ASM Called By Cpp


; ** MUST SET PROJECT PROPERTY: Build Customizations
;                               to include MASM
;
;  must declare:   extern "C" void asm_main(int, int*);
;  must call:      asm_main();
; credit to kip irvine, stackoverflow, msdn and mskb

.586
.model flat, C

; PROTOTYPES
system PROTO, pcommand:PTR BYTE

; DATA ******************
.data 
str1 BYTE "cls",0


; CODE *******************
.code
asm_main PROC
   ; system call to clear screen and do a dir
   INVOKE system, ADDR str1
   INVOKE system, ADDR str2
   ret
asm_main ENDP
END