Question

I created one variable that stores a 16 bit variable, and I'm tring to store the upper half in an 8 bit variable. How do I do this?

EDIT: its for the IA-32, and I don't think i can use registers

EDIT2: I am allowed to use registers.

Was it helpful?

Solution

You can do it like this:

mov AX, [var16]
mov [var8], AH

OTHER TIPS

Alternatively, you could use the SHR, SHL or ROR and ROL to shift of rotate the bits in your register.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top