Message board for the users of flat assembler.
> Main > Issue with fasmg 32-bit compilation: why '66' inx prefixes ?
fabbel 13 Mar 2023, 13:13
Maybe someone can help with below very basic issue :
am just starting with switching from FASM to FASMG..
and getting puzzled by result of compilation - pbly some newbie err...
trying some very basic test code as follows
(raw binary output format) :
use32 include 'cpu\80486.inc' push ebp mov ebp, esp mov esp, ebp pop ebp ret
i get following binary from FASMG compilation :
66 55 66 89 E5 66 89 EC 66 5D C3
Why am I getting those "66" prefixes in 32-bit mode ?
What am I doing wrong ?
(... exact same code - w/o the include - compiled with FASM does not yield the same...)
Tx 4 help
|13 Mar 2023, 13:13||
Tomasz Grysztar 13 Mar 2023, 13:38
The CPU headers set up the default "use16" mode when you include them. You need to switch to "use32" after the CPU headers are set up, not before.
This is similar to how FORMAT directive in fasm 1 sets up default mode for the selected format (and the same happens if you use FORMAT emulation in fasmg) - if you need to switch to a different instruction encoding mode, you should do it after setting up the target architecture, not before.
You could also assemble the same source as with fasm 1 by adding the [include 'cpu/80486.inc'] statement from the command line with the -i switch. The architecture would be set up before proceeding to the actual source (and the "use32" line), and so the result should be the same as with fasm 1.
|13 Mar 2023, 13:38||
fabbel 13 Mar 2023, 14:04
OK working now
tx 4 quick reply !
|13 Mar 2023, 14:04||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.