[comp.os.msdos.programmer] C and ASM mixed source

jdb@reef.cis.ufl.edu (Brian K. W. Hook) (01/31/91)

To everyone who replied, thank you.  Next question:

Since most of the replies stated that inline asm was the fastest, but that
compiled .OBJ files was the most reusable, couldn't the two be mixed without
any real speed reductions?  For example, instead of setCursorSize written
in ASM couldn't I do it like this without a significant amount of speed
or code enlargement?

SETCURSOR.C

void setCursorSize ( unsigned char start, unsigned char end )
{
asm {
	mov  ah,1;      /* Subfunction 0x01 -- set size */
        mov  ch,start;
        mov  cl,end;
        int  10;
}
}

I'm not sure if the syntax is exact (do I use semi-colons at the end of
inline asm statements?)....but you get the gist.  Wouldn't the C compiler
automatically do all the stack clean up for me, adjust for variable
offsets for each memory model, etc. etc. but I still retain most of
the advantages of assembly?

Brian