60 likes | 556 Views
Ptr Operator. Ptr Operator - For some instructions, the size of the operand is not clear (INC [20H]). INC Byte Ptr [0020]. INC Word Ptr [0020]. PTR Operator. Ptr Operator allows the override of the default size of an operand.
E N D
Ptr Operator Ptr Operator - For some instructions, the size of the operand is not clear (INC [20H]). INC Byte Ptr [0020] INC Word Ptr [0020]
PTR Operator • Ptr Operator allows the override of the default size of an operand. • Because operand sizes must match, PTR allows the movement of different size operands (of course, only the same size is actually moved).
Ptr Operator Example .data MyDouble DWORD 12345678h .code Mov ax, myDouble ;error
Ptr Operator Example .data MyDouble DWORD 12345678h .code Mov ax, Word PTR myDouble ;ax = ? ;ax = 5678h Mov ax, Word PTR [myDouble + 2] ;ax = ? ;ax = 1234h Mov ax, BYTE PTR myDouble ;ax = ? ;assembly error