News:

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

Writing a program to input and Output a Name

Started by MBeckford05, April 02, 2008, 11:53:13 AM

Previous topic - Next topic

MBeckford05

Hi everyone,

Newbie.  Please how would I go about writing a program to input output a persons name.

I am new to Masm32.

Running Windows XP,Pentium 4, 2megabyte of RAM.


Thank you.


Tedd

1. Write a program that does nothing.
2. Modify it so it prints a message.
3. Add in code to allow someone to type in some letters.
4. Print the letters that were typed instead of the inane message.

So first you need to learn how to write a program :wink
No snowflake in an avalanche feels responsible.

Vortex

Hi MBeckford05,

Welcome to the forum. You should make an effort to study the documentation supplied with Masm32.

Here is an example :

include     InputOutputName.inc

SIZE_OF_BUFFER = 100

.data
output1     db 'Please type 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

[attachment deleted by admin]

MBeckford05

Thank you. I will look at the documentation that goes with masm32.

MBeckford05.