I am writing a C program in real time. The program will be downloaded to the address 0x2000:0x0000and run. The register DSis equal CS, which is equal 0x2000. I am also debugging with bochs.
My goal is to print text on the screen. So I need a built-in assembly (for BIOS INT 10h).
Here is my test file:
asm("jmp _main");
void putchar(c) char c;
{
asm("mov ah, 0x0e");
asm("mov al, c");
asm("xor bx, bx");
asm("int 0x10");
}
void main ()
{
asm("push cs");
asm("pop ds");
putchar('A');
for(;;);
}
When I compiled it with this command ...
bcc -W -0 -c test.c -o test.obj
... it works. But when I try to associate it with ...
ld86 -d isimsiz.obj -o kernel.bin
... he gave me this error:
undefined symbol: c
Why is this happening? How can I use C variables under BCC In-Line Assembly?
If you know a good tutorial about BCC, leave a link. I could not find it on the Internet :(
Thanks in advance.
PS: BCC linker LD86.