Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help understanding registers

Status
Not open for further replies.

scu1casper

Programmer
Sep 11, 2012
1
0
0
US
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!
 
Any help explaining some of this would be greatly appreciated!"

You would do well to explain what part of it you don't understand. I'm not really sure I'm seeing a question here relating to a specific statement. Also, are you sure it's not BL instead of B1? Also, "mov b1,7B" won't assemble properly (syntax error).

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top