Page 1 of 1

Turbo C and assembler pt. 2

Posted: Sat Jan 21, 2006 10:05 am
by zxmaster
I have begun a rewrite of my OS in mixed C and assembler. I have written a bootloader capable of loading dos EXE (I think :)
I use Turbo C for compiling, nasm for assembler and Tlink for linking.

To test the loader I am trying to write a small program that just writes a "H" to the screen using an assembler function called printch. I have previously tested this function.
The thing is when I write the following code:

extern int printch();

int main()
{
printch();
return 0;
}

Compiles and links it into an exe nothing works. It should be executable by the NT dosbox, but it complains of illegal instruction.
The only warning I get is from Tlink which says:
Warning: no stack.

I think that is weird since the compiler ought to take care of that. I would really appreciate any help on this.