Code: Select all
load.o: load.c
$(CC) $(REALMODE_CFLAGS) load.c -c -o $(OBJDIR)/load.o
Code: Select all
void test_load() {
puts16("hi\r\n");
}
Problem is that while code generated by gcc is using 0x66 prefix any push/ret/call push 4B instead of 2. Segments are all 0.
Code: Select all
$ objdump -d obj/load.o -mi8086
obj/load.o: file format elf32-i386
00000000 <test_load>:
0: 66 68 00 00 00 00 pushd 0x0
6: 66 e8 fc ff ff ff calld 8 <test_load+0x8>
c: 66 58 pop eax
e: 66 c3 retd
Edit: thanks.