Jump to content
Tuts 4 You

how does 16 bit register works ?


Recommended Posts

what is moving something to cl or ax or dl ? 

what does it mean ? i know it's 16 bit register. Can anyone give me an example so i understand better ? 


Link to comment
EAX is a 32bit register, but you can still access the last 16 bits (compatibility etc)

EAX is the full 32-bit value
AX is the lower 16-bits
AL is the lower 8 bits
AH is the bits 8 through 15 (zero-based)



AX               0DE5

AH               0D

AL                   E5

Link to comment

PS as loki stated above just a addition if its RAX its 64bit :)

AX - x means extended

H means higher and L means lower

Edited by Jasi2169
Link to comment

Watch out with RAX, it doesn't work in the same way as subregisters for EAX. If you do "mov eax,12345678" in x64, you will get "RAX = 12345678 & 0xFFFFFFFF", effectively clearing the upper part of RAX.

Link to comment

CodeCracker never said that! :D:P

SHR r/m8 = Unsigned divide r/m8 by 2, 1 time.
If EAX = BADC0DE5 and you want BADC
you divide EAX to 2^16 = 65536 ( SHR is divide by power of two).

Edited by CodeCracker
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...