How do you use printf from Assembly?

Posted by bobobobo on Stack Overflow See other posts from Stack Overflow or by bobobobo
Published on 2010-12-30T15:56:33Z Indexed on 2010/12/31 5:54 UTC
Read the original article Hit count: 256

Filed under:
|
|

I have an MSVC++ project set up to compile and run assembly code.

In main.c:

#include <stdio.h>

void go() ;

int main()
{
  go() ; // call the asm routine
}

In go.asm:

.586
.model flat, c
.code

go PROC
  invoke puts,"hi"
  RET
go ENDP

end

But when I compile and run, I get an error in go.asm:

error A2006: undefined symbol : puts

How do I define the symbols in <stdio.h> for the .asm files in the project?

© Stack Overflow or respective owner

Related posts about assembly

Related posts about include