When a source operand is ambiguous such as a value defined a

When a source operand is ambiguous, such as a value defined as CR EQU 0DH which can be either a 16 bit value or an 8 bit value, how can the ambiguity be removed This is typical of an error staring \"ls it byte or word?\" EX: MOV LSI], CR;assembler doesn\'t know if you mean move a byte or move a word

Solution

Normally, the mov instruction moves 4 bytes of data .In general,the intended size of the of the data item at a given memory address can be inferred from assembly code instruction in which it is referenced.But, in the cases like the given case, there is always an ambiquity that whether to take 16 bit value or 8 bit value or 32 bit value.So,in order to remove that ambiguity , we need to explicitly tell the processor to perform transfer indicating the transfer sizes as 1,2 or 4 bytes respectively using the size directives :

MOV BYTE PTR - moves 1 byte of data

MOV WORD PTR - moves 2 bytes of data

MOV DWORD PTR - moves 4 bytes of data

 When a source operand is ambiguous, such as a value defined as CR EQU 0DH which can be either a 16 bit value or an 8 bit value, how can the ambiguity be remove

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site