News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Take value from keyboard console

Started by rodolfolopes, September 29, 2014, 05:53:08 AM

Previous topic - Next topic

rodolfolopes

Hi there guys!
AS you know I'm still new to MASM32 but I think its great than work with TASM that you need to control all the memory and all that
But now I'm having problems taking the input of the user of the console. For example i want that the console add 5 and print it

For example if i put 5 the result will be: 10 and if put 10 the result will be 15

How can i do this guys?


include \masm32\include\masm32rt.inc

.code
start:
      mov eax, 5
print str$(eax), 9

      mov eax, 10
      print str$(eax), 9

      mov eax,15
      print str$(eax), 9


end start



Thanks a lot

jj2007

Hi Rodolfo,
No time to code something, but check \Masm32\Help\hlhelp.chm, Console Mode Macros

dedndave

this will get you started
what you might want to do for numbers is...

write a PROC that:
1) displays a prompt by calling awStdOut
2) accepts a string from console input by calling awConIn256
3) validates the string as numeric in range
...a) displays an error message if non-numeric or out of range, then loop back to step 2
...b) returns value in EAX if valid numeric

Gunther

Hi rodolfo,

we won't do your homework. Please check rule #9.

Gunther
You have to know the facts before you can distort them.