Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Byte Ptr "A"

Status
Not open for further replies.

NPG

Programmer
Mar 9, 2001
9
0
0
GR
What is the difference between <byte ptr &quot;A&quot;> and
<&quot;A&quot;>?Thanks!
 
Well it depends of what is &quot;A&quot;
In any case if you marks &quot;A&quot; the value will be treated depending of the left operand. simple example

when you write following line ;

inc [eax*4+2] you want to increment the containent of memory situated at eax*4+2 but there is some piece of ambiguity : should the compiler considerate the memory as BYTE, WORD or DOUBLE WORD (8, 16 or 32 bits value) ???
to release this amiguity you should specify in which way you want to consider the memory : so if you want that memory be treated as bytes write :

inc BYTE PTR [eax*4+2]....
 
Hi,
Byte Ptr, Word Ptr -> Assembler directive, telling the
assembler about the size of operand.

For exp, when u assemble an instrn like,
mov ax, data
where &quot;data &quot; is declared in ur program, the assembler
refers its symb0l table and finds the operand size of &quot; data&quot;,and hence u need not explicitly specify whether the data fetch is byte size, word size or dword size.

Whereas for an instrn like &quot;mov ax, es:[bx]&quot; , u need to
tell the assembler exactly what type of fetch u wanna
make..Coz, assembler has no idea of what es:[bx] would
b pointing to at run time.

Hope it helps

Regards,
Sarnath.K
Do not rejoice that ur code works.
it might be a special case of an error :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top