Can anyone clear up the proper syntax for calling assembler code from within a c or c++ program? I am using masm 6.00 and VC ver 1 (both 16 bit and both using the medium memory model) I want to expand on this basic example, but I can't seem to get it to work. Both the c program and the assembler program compile to obj files without errors. Link builds the exe from both obj files without any reported errors; however, when run, the program goes into lala land. TIA
masm
.MODEL MEDIUM, C
.STACK
.CODE
.STARTUP
PUBLIC set_mode
set_mode PROC FAR C vmode:WORD
mov ah,0
mov al, BYTE PTR vmode
int 10h
ret
set_mode ENDP
END
c source
#include <stdio.h>
#define MODE13 0x13
extern set_mode(int);
void main()
{
blah blah
set_mode(MODE13);
blah blah
}