The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: mithun_vrs on January 31, 2011, 06:05:12 AM

Title: A2006 error wrt to a stuct definition
Post by: mithun_vrs on January 31, 2011, 06:05:12 AM
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
Title: Re: A2006 error wrt to a stuct definition
Post by: BogdanOntanu on January 31, 2011, 07:35:00 AM
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

Title: Re: A2006 error wrt to a stuct definition
Post by: MichaelW on January 31, 2011, 07:51:49 AM
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
Title: Re: A2006 error wrt to a stuct definition
Post by: japheth on January 31, 2011, 08:48:14 AM
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
Title: Re: A2006 error wrt to a stuct definition
Post by: MichaelW on January 31, 2011, 09:05:00 AM
MASM 5.1 can assemble it OK, at least with the code I substituted for the missing pieces.
Title: Re: A2006 error wrt to a stuct definition
Post by: dedndave on January 31, 2011, 12:24:55 PM
assume di ptr IO_BUFR
mov [di.input],ax
assume di:nothing