News:

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

print to screen?

Started by marla, February 16, 2006, 04:19:24 PM

Previous topic - Next topic

marla

instead of using windows, i want to use a simple cmd.exe window - i want to just print to console, how can i do this?

PBrennick

marla,
When you build the project, link it in the following manner:

\masm32\bin\link /SUBSYSTEM:CONSOLE /RELEASE /VERSION:4.0 appname.obj

This will open a console window automaticaly and you can use any of the console commands, if you need an example, just ask.

Paul

The GeneSys Project is available from:
The Repository or My crappy website

marla

i need an example... thx again for the help

Tedd

code vomit..

.386
.model flat, stdcall
option casemap:none
include windows.inc
include kernel32.inc
includelib kernel32.lib

.data
greeting    db "Hello World!",0

.data?
hStdOut     HANDLE  ?
hStdErr     HANDLE  ?
chWritten   DWORD   ?

.code
start:
    invoke GetStdHandle, STD_OUTPUT_HANDLE
    mov hStdOut,eax
    invoke GetStdHandle, STD_ERROR_HANDLE
    mov hStdErr,eax

    invoke WriteFile, hStdOut,ADDR greeting,SIZEOF greeting-1,ADDR chWritten,NULL

    invoke ExitProcess, NULL

end start
No snowflake in an avalanche feels responsible.