I’m studying ASM 8086 theoretically on highschool. (that means that I study ASM 8086 on a notebook, and never got to run it over a computer).
And I don’t understand – what will happen if I do this:
MOV AL, F2h
ADD AL, 20h
What will the computer do? (what will be the value of AL,AX, CF,ZF?)
and what will happen if I do this:
MOV AH,F2h
ADD AH,20h
Thank you !!
Place the value 0xF2 in the AL (accumulator) register.
Adds the value 0x20 to the value contained in the AL register.
AL will be 0xF2 + 0x20. But AL is an 8 bits register, so the value will be 0x12, and not 0x112.
Same thing for AH, as it’s also an 8 bits register.
To get the complete value, you will need to use the AX register, which is 16 bits.
AX is composed by AH (high) and AL (low), so you can access the high and low parts individually.