I wrote a boot loader in NASM which is load a 64kb program data from the disk into the memory starts by address 0060:0000 [SEG:OFF]. I had tested this part of my project by Writing some code in Assembly (NASM) and put it into the disk. Works fine!
The full project it is a little bit complex for totally writing in Assembly. So I decide that I will use C with inline Assembly for further. For this I download an environment named open-watcom-c-win32-1.9. I have a simple C code for testing some WatCom compiler and linker directives to make RAW BIN file. The bin file are generated but not runs after my boot loader load it into the memory. I try a lot of wlink directives to set the segment and offset values but does not works.
void main()
{
__asm
{
mov ah, 0x0E
mov al, '!'
int 0x10
}
}
I think that the problem is that the compiler and linker uses wrong segment and offset addresses while the code generating. Because the Wlink drop the following error in any case.
Warning! W1023 no starting address found, using 0000:0000
I do not know that how I can set correctly the segment offset addresses but it would be necceserly for a working program. My questions that what kind of WatCom directives I use for generating 16 bit real mode RAW BIN file from a C source code with declared segment : offset? It is possible with WatCom or i need to use other stuff?