flat assembler
Message board for the users of flat assembler.
Index
> Windows > use64 in 32-bit mode |
Author |
|
LocoDelAssembly 07 Aug 2012, 19:31
You can't use 64-bit code while running in 32-bit mode. The situation is even worse than when trying to use 16-bit code, which at least is accessible by NOT using use16 so fasm insert the appropriate override prefixes for the instructions.
|
|||
07 Aug 2012, 19:31 |
|
magicSqr 07 Aug 2012, 19:59
LocoDelAssembly wrote: You can't use 64-bit code while running in 32-bit mode. So is use64 simply to revert to 64-bit after use32 in a 64-bit app? |
|||
07 Aug 2012, 19:59 |
|
LocoDelAssembly 08 Aug 2012, 03:19
Actually, use* are meant to be used when some portion of code will be run by the CPU in a mode other than the current one. For instance, if you were writing a DOS app and you switch to 32-bit protected mode, you'd need use32 for the code that will run after the mode switch, otherwise the processor won't interpret the instructions correctly because fasm (or any other assembler for that matter), assembled it assuming the CPU works in 16-bit mode all the time.
Using use32 in a 64-bit app would also be wrong, because again, if the CPU is running in 64-bit mode then instructions like "INC EAX" assembled in a use32 context will be interpreted by the CPU as a REX prefix, among many other problems caused by using incorrect instruction encodings for the mode the processor is running in. |
|||
08 Aug 2012, 03:19 |
|
magicSqr 08 Aug 2012, 12:53
Thanks for clearing that up for me loco.
|
|||
08 Aug 2012, 12:53 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.