New to Assembly.. How do i display values of 16-bit registers...

Started by i3fan8760, September 17, 2009, 08:06:16 PM

Previous topic - Next topic

i3fan8760

Im new to assembly and having lots of issues:

i have to make a program that subtracts 3 integers using only 16-bit registers and display it using a function or procedure (idk the difference in assembly) that only displays 32-bit registers and the flags.....

Thanks to whoever helps me out


Slugsnack

let's say you have result in ax. just zero extend to eax with 'movzx eax, ax' then you can display eax. zero extend puts the value of smaller source operand into larger destination one. the new bytes are zeroed

dedndave


        print right$(uhex$(eax),2)

will display AL

        print left$(right$(uhex$(eax),4),2)

will display AH

        print right$(uhex$(eax),4)

will display AX

i3fan8760

I tried to use the movzx eax,ax but it gives me an error: instruction operands must be the same size