C compiler

Is there any C compiler that can make a .com file from a source file?I have borland C 2.0 which can make .exe files for TINY model but it uses MS-DOS int 21h even vor a simple program like this:
void main()
{
}

I think it dose this to initialize an application.I need something like this ...

void main()
{
int a;
a=21;
}

will become

START:jmp begin
a word (?)

begin:mov ax,cs
mov ds,ax
mov ss,ax
mov sp,0 ;or another value
mov a,word ptr 21

Without any MS-DOS stuff.Is there something that dose that ?

10x

Comments

  • : Is there any C compiler that can make a .com file from a source file?I have borland C 2.0 which can make .exe files for TINY model but it uses MS-DOS int 21h even vor a simple program like this:
    : void main()
    : {
    : }
    :
    : I think it dose this to initialize an application.I need something like this ...
    :
    : void main()
    : {
    : int a;
    : a=21;
    : }
    :
    : will become
    :
    : START:jmp begin
    : a word (?)
    :
    : begin:mov ax,cs
    : mov ds,ax
    : mov ss,ax
    : mov sp,0 ;or another value
    : mov a,word ptr 21
    :
    : Without any MS-DOS stuff.Is there something that dose that ?
    :
    : 10x
    :

    The thing is, that when the program runs, it has to shut down. Else it will crash.

    If you don't want that, then just try:
    [code]
    void idk()
    {
    int a;
    a=21;
    }
    [/code]

    And compile (not link).

    I'm not sure, but I think the .o will hold the data you want, if not, then I don't know how you should link it, but look at the manual for your linker or something
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion