The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Pokanoket on April 12, 2005, 07:44:04 PM

Title: How do I get the screen to remain when running code.
Post by: Pokanoket on April 12, 2005, 07:44:04 PM
I am starting out with MASM32 again and forgot how to make the code output stay on the screen.  It comes and goes quickly without notice.

Thanks.
Title: Re: How do I get the screen to remain when running code.
Post by: pbrennick on April 12, 2005, 07:59:13 PM
Hi Pokanoket,
It sounds like you are either running a console app or a 16bit DOS executable.  In either case start the command shell using command or cmd depending on your OS.  You can use either one with XP but you should use cmd if it is a console app.  If your application is sending DOS commands to the console, you, also, have the option to send a pause command to hold the window open, that is what we will usually do with the batch file used to assemble an executable.  I hope this answers your question.

Paul
Title: Re: How do I get the screen to remain when running code.
Post by: dsouza123 on April 13, 2005, 02:29:11 AM
If you are using the MASM32 Editor ( QEDITOR.EXE ) that comes with MASM32 and
you wrote a 32 bit console program but assembled it by 
Project -> Assemble & Link
it wont show up
OR
if the console program is very short and assembled correctly
Project -> Console Assemble & Link
it will show up very briefly.

If using StdIn and StdOut from the masm32.lib
then
   .data
   szInputMsg    db "Enter your favorite name : ", 0
   szInputBuffer db 161 dup (0)

   .code
    invoke StdOut,ADDR szInputMsg
    invoke StdIn,ADDR szInputBuffer,160     ; will wait until input or at least  Enter
Title: Re: How do I get the screen to remain when running code.
Post by: MichaelW on April 13, 2005, 02:51:26 AM
If you include macros.asm (include \masm32\macros\macros.asm), you can use:

mov   eax,input(13,10,"Press enter to exit...")
exit

to pause before terminating.
Title: Re: How do I get the screen to remain when running code.
Post by: pro3carp3 on April 13, 2005, 01:14:05 PM
I usually use a message box that pops up at the end so I can view the console window, then click ok when done to close the app.