The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: anuradha on May 20, 2007, 12:58:16 PM

Title: please help me
Post by: anuradha on May 20, 2007, 12:58:16 PM
hi guys

i found a source code that demonstrate the MOV instruction.here is the part of it

   mov   ax,@data      
   mov   ds,ax         

can any one tell me what is this @data means????
thanks :bg :bg
Title: Re: please help me
Post by: evlncrn8 on May 20, 2007, 01:12:09 PM
the data segment...
Title: Re: please help me
Post by: ic2 on May 20, 2007, 01:19:30 PM
I haven't seen code of this type but it seems to me to mean offset because you're moving initialized data into an registers.

mov ax, offset MyWordValue

2 byte only
Title: Re: please help me
Post by: MichaelW on May 21, 2007, 02:20:52 AM
@data is one of the MASM predefined symbols. For all models except FLAT it expands to DGROUP, the name of the segment group for near data. DGROUP is defined automatically when you use the .MODEL directive, and it includes the near data segment and the stack segment.

.model small
% echo @code
% echo @data
% echo @stack
end


Assembling: presym.asm
_TEXT
DGROUP
DGROUP

For all models except TINY, and unless you use the .STARTUP directive, before your program can access data it must set DS to the data segment.