I am writing real mode function, which should be normal function with stackframes and so, but it should use %sp instead of %esp. Is there some way to do it?
GCC does not produce 8086 code. The GNU AS directive .code16gcc
can be used to assemble the output of GCC to run in a 16-bit mode, put asm(".code16gcc")
at the start of your C source, your program will be limited to 64Kibytes.
On modern GCC versions you can pass the -m16
argument to gcc
which will produce code to run in a 16-bit mode. It still requires a 386 or later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With