I have this mov cx,12345d
Now i want to check if the last 3 digits of this number are for example 111 in binary
Thanks
"AND" the value with "111" (binary) to clear all other bits and then compare the result with "111" (binary).
It's been more than a decade since I did some x86 assembly, but it should look something like this:
AND CX, 111b
CMP CX, 111b
JE found
; whatever happens when it is not found
JMP end
found:
; whatever happens when it is found
end:
; the end
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.