The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: MBeckford05 on October 16, 2008, 03:01:41 PM

Title: Standard Input Output
Post by: MBeckford05 on October 16, 2008, 03:01:41 PM
  .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.
Title: Re: Standard Input Output
Post by: jj2007 on October 16, 2008, 03:47:36 PM
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