Mixed Code


 
 ; ** 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
 
 
; DATA ******************
.data
str1 BYTE "hello",0
list db 66 dup(0)
 
 
; CODE *******************
.code
myAsmProc PROC
   ; x db 1
   ; use esp to get
   mov ebx, [esp+4] ; count
   mov edx, [esp+8] ; pointer to array

   mov eax, [edx]



   ;add dword ptr[edx], 1

   ; use eax to return
   ;mov eax, 100
   ret
myAsmProc ENDP
END