Assembly Language Programming: Code Analysis and Solutions
Assembly Language Code Analysis and Solutions
Section 1: Instruction Correctness Check
.data
calculate WORD 100
wVal DWORD 2Instructions:
mov bl, calculatemov ax, wVal
Question 1: Are the above two instructions correct? If not, justify your claim. [2 marks]
Answer:
Both instructions are incorrect.
- For the
movoperation, the operands must generally be of the same size. - In instruction 1,
blis 8 bits (1 byte), butcalculateis defined as aWORD(16 bits or 2 bytes). The operand sizes do not match. - In instruction 2,
axis 16 bits (2 bytes), butwValis defined as aDWORD(32 bits or 4 bytes). The operand sizes do not match.
English with a size of 4.63 KB