Let's suppose we have 0000FFFF in EAX. If I use INC AX, EAX becomes 00000000. How can I make it becomes 00010000, accessing AX?

Thanks
Posted on 2005-05-24 15:10:52 by Marginais
The answer isl... you can't. :sad: The high word of 32 bit registers is not accessible with 16 bit instructions. In plain words, the only way to use the high part of 32 bit registers is to use the whole register - you need to use EAX, you can't with just AX.
Posted on 2005-05-24 16:00:20 by QvasiModo
and don't forget that increasing AX, while it's FFFF, changes it to 0, and sets ZERO flag, as well as Overflow (which means, that the result of the operation did not fit in register's size) ;)

EDIT: lol, i just noticed that the overflow flag is being REset :shock:? ZERO is set as expected, carry is unaltered ( :| ). it's strange for me...
Posted on 2005-05-24 18:00:45 by ti_mo_n
And the carry flag. :)

EDIT: Actually the overflow flag is not set... just noticed that, sorry.
Posted on 2005-05-24 18:07:19 by QvasiModo
The carry flag is not set, as you use the inc instruction. If you used add ax, 1 then carry would be set.

Mirno
Posted on 2005-05-25 06:41:48 by Mirno
:shock: And I call myself an assembly programmer! :lol:
Posted on 2005-05-25 15:33:38 by QvasiModo
:shock: And I call myself an assembly programmer! :lol:

Yeah - I think ASM is too difficult for us, if we get caught on simple INC :lol:
Posted on 2005-05-25 17:30:35 by ti_mo_n
Stumbling in solving a useless/senseless problem is never shameful. Why would anyone prefer several "emulation" instructions instead of "inc eax" anyway? :) .
He's obviously not coding in 16-bit, since he can see the EAX value.
Posted on 2005-05-26 11:29:42 by Ultrano

Stumbling in solving a useless/senseless problem is never shameful. Why would anyone prefer several "emulation" instructions instead of "inc eax" anyway? :) .
He's obviously not coding in 16-bit, since he can see the EAX value.

Hehe, now it caught you too... :lol: You can still use the 32 bit registers in 16 bit mode! There are a couple prefixes for that. :)
Posted on 2005-05-26 17:32:50 by QvasiModo
I think 16-bit asm is evil :)
Oh, my lucky post - #777 :)
Posted on 2005-05-26 19:53:42 by Ultrano

I think 16-bit asm is evil :)
Oh, my lucky post - #777 :)


Now be nice. Be open minded. He's being flexible. :-)

Posted on 2005-05-29 00:00:12 by skywalker