News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Standard Input Output

Started by MBeckford05, October 16, 2008, 03:01:41 PM

Previous topic - Next topic

MBeckford05

  .code 

SIZE_OF_BUFFER = 100

start:

.data
output1     db 'Please Enter Your Name : ',0
output2     db 13,10, 'Your name is %s',0

END start


.data?
buffer      db SIZE_OF_BUFFER dup(?)

.code

start:

    invoke printf,ADDR output1
    invoke StdIn,ADDR buffer, SIZE_OF_BUFFER
    invoke printf,ADDR output2,ADDR buffer
    invoke  EXITProcess,0

END start

I am unable to see why this code gives a compiler error.  I am tying to get the person to enter their name and return a greeting with the same name.
The program has a compiler error. Using Windows xp, and MASM32 assembler can you assist.

jj2007

Your are redefining Start, and you misspelled ExitProcess. You might have read in the documentation that crt functions are preceded by crt_

This one works.

include \masm32\include\masm32rt.inc
.code

SIZE_OF_BUFFER = 100


.data
output1     db 'Please Enter Your Name : ',0
output2     db 13,10, 'Your name is %s',0

.data?
buffer      db SIZE_OF_BUFFER dup(?)

.code
start:

    invoke crt_printf,ADDR output1
    invoke StdIn,ADDR buffer, SIZE_OF_BUFFER
    invoke crt_printf,ADDR output2,ADDR buffer
    invoke  ExitProcess,0

END start