Hi everyone
I wish a happy new year for all.

This is the code that i wrote so far.

TITLE MASM Template                     (main.asm)

; Description:
; 
; Revision date:

INCLUDE Irvine32.inc
INCLUDE macros.inc
Employee STRUCT
    idnum BYTE "0000",0
    lastname BYTE 30 DUP(0)
    years WORD 0
Employee ENDS

.data
workers Employee 3 DUP(<>)
count DWORD ?
.code
main PROC

    mov ecx,LENGTHOF workers
    mov esi,TYPE Employee

l1:
    mov count,ecx
    mWrite "Enter employee id:> "

    mov edx,OFFSET workers[esi].idnum  ; Problem is here
    mov ecx,LENGTHOF workers.idnum
    call ReadString
    call crlf
    mov ecx,count
    add esi,TYPE employee
    loop l1


    exit
main ENDP

END main

I want to add ID for every worker in the structere.The problem is that i cant reach the workers' idnum variable.

Here's the errors:

Error 2 error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\main.obj" /I "c:\Irvine" /W3 /errorReport:prompt /Tamain.asm" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\masm.targets 49 6 Project

Error 1 error A2098: invalid operand for OFFSET C:\Irvine\Examples\structure3\main.asm 28 1 Project

I need your hepls.

        ASSUME  esi : ptr workers

        mov     ebx, [esi:idnum]

          - or -

        mov     ebx, [esi: Employee:idnumb]

        ASSSUME esi : nothing

Been quite sometime since I've used MASM, so the move may not be exactly right, but should get you started in the right direction.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.