INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Help understanding registers

Help understanding registers

(OP)
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!

RE: Help understanding registers

"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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close