scu1casper
Programmer
Hi, I am taking my first course in Assembly Language, and unfortunately I have run in to some issues that my textbook has not done the best job of explaining.
I have this information:
; MOVZX
mov bx,85C2h
movzx eax,bx ;EAX = 000085C2h
movzx edx,b1 ;EDX = 000000C2h
movzx cx,b1 ;CX = 00C2h
; MOVSX
mov bx,85C2h
movsx eax,bx ;EAX = FFFF85C2h
movsx edx,b1 ;EDX = FFFFFFC2h
mov b1,7B
movsx cx,b1 ;CX = 007B
I have been asked to interpret the info as following:
For MOVZX, record values of EBX, EAX, EDX, and CX making sure to record the exact number of HEX digits as required
32-bit register requires 8 HEX digits
16-bit register requires 4 HEX digits
8-bit register requires 2 HEX digits
For MOVSX, record the values of EAX, EDX, and CX making sure to record the exact number of HEX digits as required (same as above).
Also, add two statements to your report to show your understand why the data was negative that start like this:
bx contained 85C2 and this represents a negative number because....
bl contained
** I have recorded what I believe to be stored in the registers in the data i provided for you above. I believe those are correct, the only one i may be a bit confused about is the movsx cx,b1
For the two statements, I am not quite sure what to put other than...our professor has told us flat out "The data copied and extended into the eax and edx registers was the two's complement code for a negative integer." So, all I can think is, since i know it is in two's complement form, I can convert to binary, and the leading int is a 1, which means it is negative. The second statement, I am completely lost on.
Any help explaining some of this would be greatly appreciated!
I have this information:
; MOVZX
mov bx,85C2h
movzx eax,bx ;EAX = 000085C2h
movzx edx,b1 ;EDX = 000000C2h
movzx cx,b1 ;CX = 00C2h
; MOVSX
mov bx,85C2h
movsx eax,bx ;EAX = FFFF85C2h
movsx edx,b1 ;EDX = FFFFFFC2h
mov b1,7B
movsx cx,b1 ;CX = 007B
I have been asked to interpret the info as following:
For MOVZX, record values of EBX, EAX, EDX, and CX making sure to record the exact number of HEX digits as required
32-bit register requires 8 HEX digits
16-bit register requires 4 HEX digits
8-bit register requires 2 HEX digits
For MOVSX, record the values of EAX, EDX, and CX making sure to record the exact number of HEX digits as required (same as above).
Also, add two statements to your report to show your understand why the data was negative that start like this:
bx contained 85C2 and this represents a negative number because....
bl contained
** I have recorded what I believe to be stored in the registers in the data i provided for you above. I believe those are correct, the only one i may be a bit confused about is the movsx cx,b1
For the two statements, I am not quite sure what to put other than...our professor has told us flat out "The data copied and extended into the eax and edx registers was the two's complement code for a negative integer." So, all I can think is, since i know it is in two's complement form, I can convert to binary, and the leading int is a 1, which means it is negative. The second statement, I am completely lost on.
Any help explaining some of this would be greatly appreciated!