The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Magnum on December 29, 2010, 10:51:16 PM

Title: Handle to console output
Post by: Magnum on December 29, 2010, 10:51:16 PM
How do I get a handle to console output in order to send this to the screen?



ASSUME FS:NOTHING

.data?

dwBytes DWORD ?

.DATA

message   db 'Loose Cannon ',

'noun ', 

'Definition: ',

'1. indiscreet and unpredictable person: an unpredictable or indiscreet person, often causing
    trouble for colleagues or associates ( slang ) ','                                                               '

'2. (nautical) a cannon that breaks loose during battle a storm and causes serious damage to the ship
    and its crew ',

.CODE

start:

invoke WriteFile, ?, ADDR message, SIZEOF message, addr dwBytes, 0

invoke ExitProcess,0

end start

Title: Re: Handle to console output
Post by: jj2007 on December 29, 2010, 10:55:09 PM
Check \masm32\m32lib\stdout.asm.
Title: Re: Handle to console output
Post by: dedndave on December 29, 2010, 11:43:13 PM
even better - the console reference....
http://msdn.microsoft.com/en-us/library/ms682010%28v=VS.85%29.aspx
lots of good stuff there, Andy  :U

eventually, you will get to GetStdHandle
Title: Re: Handle to console output
Post by: Magnum on December 30, 2010, 12:14:16 AM
Thanks jj2007.