I am trying to compile a simple function, that calls the BIOS to make some output on the screen. The code runs in real mode and the function looks like this:
Code: Select all
void mprint(const char* text) {
while(*text){
asm volatile("int 0x10" : : "a" ( (0x0E << 8) | *text ) : "ebx", "ecx", "edx" );
text++;
}
}
-m32 -march=i386 -O0 -Wall -include 16bit.h -masm=intel -nostdlib -c
where 16bit.h adds the .code16gcc section.
When I make a call to this function in my main, no call is actually produced in the assembled machine code (which of course results in no text output). However, when I remove the -march=i386 option, the calls are correctly produced. This is somehow strange, because I have several other functions as well and the calls to them compile correctly in both cases.
Any ideas what I am missing?
PS. The function itself is compiled and assembled correctly, but no call to it at all.