News:

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

system("pause");

Started by loki_dre, January 08, 2009, 05:11:03 AM

Previous topic - Next topic

loki_dre

Hello I have the following command in C++ and I need to bring it over to MASM:
system("pause");

My include file is:
include \masm32\include\masm32rt.inc

donkey

WaitForSingleObject can wait for the console input buffer to have unread data, you have only to pass hConsoleInput to it and wait on keyboard events.

http://msdn.microsoft.com/en-us/library/ms684199(VS.85).aspx
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

RotateRight

One way of doing it ..

;****************
;* SysPause.asm *
;****************

.386
.model flat,stdcall
option casemap:none

public start

system proto c :dword
ExitProcess proto :dword
Pause proto

includelib kernel32.lib
includelib msvcrt.lib

.data

strCommand db "Pause",13,10,0

.code

start:
        invoke  Pause
        invoke  ExitProcess,0

Pause proc 
        invoke system,addr strCommand
        ret
Pause endp
   
end start