A2006 error wrt to a stuct definition

Started by mithun_vrs, January 31, 2011, 06:05:12 AM

Previous topic - Next topic

mithun_vrs

I am trying to assemble a long written code.. it is like shown below,
under test.equ file:
  .XLIST

IO_BUFR        struc                  ; i/o buffer structure
   input        dw      ?              ; input  address
   output       dw      ?              ; output address
   count        dw      ?              ; count
   bufr         dw      IO_BUFSIZE dup(?) ; data buffer
IO_BUFR        ends
.LIST

under test.asm

.DATA
               
                PUBLIC  rx2bufr, tx2bufr, tx5bufr
;
rx2bufr      IO_BUFR <0,0,0,>         
tx2bufr      IO_BUFR <0,0,0,>         
tx5bufr         IO_BUFR <0,0,0,>         

.CODE
...
                mov     [di].input,ax
                mov     [di].output,ax 
                mov     [di].count,ax   

On Assembling I get the following error,

test.asm(81): error A2006: undefined symbol : input
test.asm(82): error A2006: undefined symbol : output
test.asm(83): error A2006: undefined symbol : count


Pls guide me how to clear this error. Thanks a lot in Advance

BogdanOntanu

Is this code very old and written for TASM?

TASM does not require you to use assume or full structure name BUT it requires unique strcture member names for this to work.

Try using assume directive or a full structure name.
Something like this


assume edi ptr IO_BUFR
mov [di.input],ax


or:

mov [di + IO_BUFR.input],ax

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

MichaelW

And if you use ASSUME don't forget to cancel the assumption when you are finished with it so it will not affect later uses of DI.

assume di:nothing
eschew obfuscation

japheth

Quote from: BogdanOntanu on January 31, 2011, 07:35:00 AM
Is this code very old and written for TASM?

I guess it was written for Masm v5.1 or below.
Masm v6 and above might be able to assemble the unmodified source if the -Zm cmdline switch is used:

ml -c -Zm test.asm

MichaelW

#4
MASM 5.1 can assemble it OK, at least with the code I substituted for the missing pieces.
eschew obfuscation

dedndave

assume di ptr IO_BUFR
mov [di.input],ax
assume di:nothing