Click here to Skip to main content
15,885,366 members
Articles / Programming Languages / ASM

Integrating a compiler/assembler in VS ; Using NASM with Visual Studio 2010

Rate me:
Please Sign up or sign in to vote.
5.00/5 (11 votes)
9 Jul 2012CPOL10 min read 94K   2.9K   29  
A simple technique to integrate a custom build tool in VS 2010.
extern	_printf
SECTION .data		; Data section, initialized variables


	newmsg:  db "We are now from data section into an external function ;) ",10,0 

 global _extfun		; the standard gcc entry point
_extfun:				; the program label for the entry point
    push    ebp		; set up stack frame
    mov     ebp,esp
	push    dword newmsg	; address of ctrl string
	call    _printf		; Call C function
	add     esp, 4		; pop stack 3 push times 4 bytes
	mov     esp, ebp	; takedown stack frame
	pop     ebp		; same as "leave" op	
	xor	eax,eax		;  normal, no error, return value
	ret		

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems Engineer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions