flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
chaoscode 04 Mar 2009, 02:00
in long mode just 32 bit immediates are allowed.
|
|||
![]() |
|
msschlt 04 Mar 2009, 02:02
Ah ok. Thanks.
|
|||
![]() |
|
revolution 05 Mar 2009, 01:21
For a long time now we have been "spoiled" by the x86 architecture. It has traditionally allowed all possible constants to be encoded within the instruction stream. Other ISAs have not always been so forthcoming when it comes to encoding constants and people have been forced to find ingenious ways to code around it. But now, with the 64bit coming into the picture, we have entered an era in the x86 world of suddenly not having our precious constants available to us within the instruction stream where they are most convenient.
Case and point above, msschlt expected that the use of xor reg,constant would naturally allow all constant values, just like it did with the 32bit code. This is not the fault of msschlt, but more the fault of the previous x86 ISAs being so forgiving to the assembly programmer. So now in the new era we will have to rethink how we deal with large constants. We will have to consider a good plan ahead of time. We will have to think harder before starting to simply code up a routine. If any of you have programmed for another CPU you may have already been aware of this problem and found solutions. Now you can use that knowledge in the x86. But we have one saving grace here in the x86 architecture. The infamous mov has been 'promoted' to allow a full 64bit constant. But still, even with that, the 64bit instruction set makes coding just a little bit more tricky, and a little bit more interesting. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.