I am unsure of what the cbw command actually does. I have a snippet of code:
mov ax,0FF0h
cbw
idiv ah
How does the value of ax change after cbw?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
cbwinstruction sign-extends a byte into a word. In this case, it’ll take the sign bit ofAL(which happens to be 1) and copy it into every bit ofAH.This means that the two’s-complement value of
AXwill be the same, but the binary representation will be different.The value of
AXafter thecbwinstruction will beFFF0h(a 16-bit -16 value, just likeALwas originally an 8-bit -16)