recently i have a 8086 assembly homework to finish, i try to use the CMP instruction , but can't get it right.here is the code:
MOV AL, 88h
CMP AL, 24h
JL exit
label:
mov al,4h
exit:
RET
when i debug it , after jl it jump right to exit:
but the following code works fine
MOV AL, 88
CMP AL, 24
JL exit
label:
mov al,4h
exit:
RET
why this is happening ?
JL uses a signed condition. From a signed viewpoint, 88h is a negative number. If you want 24h to be treated as less than 88h, you have a couple of choices -- the most obvious would be to use an unsigned condition, which would mean using jb
instead of jl
.