Is there a way to convert C++ code to Intel 8086 Assembly and get .asm file? I'm trying to figure out how to do it, GCC wouldn't work. Can anyone suggest anything?
Asked
Active
Viewed 781 times
0
-
1gcc -S
– Sean F Dec 08 '20 at 06:15 -
1@SeanF: Not for an 8086, though. – Nate Eldredge Dec 08 '20 at 06:41
-
@SeanF Technically even with [`-m16`](https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html) the `gcc` assembler code is not guaranteed to run on pre-80386 processors, such as the 8086, see some discussion [here](https://stackoverflow.com/questions/19055647/how-to-tell-gcc-to-generate-16-bit-code-for-real-mode) for example. – dxiv Dec 08 '20 at 06:41
-
You need an 8086 C++ compiler. There are some C compilers discussed at https://stackoverflow.com/questions/4493035/is-there-a-c-compiler-that-targets-the-8086 and some of them had C++ compilers also. Note that since they target an obsolete machine, it is also likely that they only run on similarly obsolete machines, and that they only support obsolete versions of the C++ standard. – Nate Eldredge Dec 08 '20 at 06:42
-
@NateEldredge `ia16-gcc`? Or some other compiler, like Open Watcom? – fuz Dec 08 '20 at 09:13
-
Unfortunately, most MS-DOS compilers (including Watcom version 10.6) directly compile to object code and do not output assembly code. – Martin Rosenau Dec 08 '20 at 09:41