Hi;
Could anyone write an win32 console application skeleton plz
thx
Posted on 2002-02-19 23:21:43 by k0d
This recent post by malone is a nice example of using MASM32 for console:
http://www.asmcommunity.net/board/index.php?topic=3669.msg24937

It has intput/output and clear screen. What more do you need? :)
Posted on 2002-02-19 23:49:38 by bitRAKE
The well known hello world.



; # to compile use >buildc test.asm

.386
.model flat, stdcall
option casemap :none ; case sensitive

; #########################################################################

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib


; #########################################################################



; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
; P R O T O T Y P E S
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

PrintText PROTO :DWORD


.data

hInstance dd 0
commandline dd 0

HelloWorld db 'Hello World!',13,10,0

.code






start:

invoke GetModuleHandle, NULL
mov hInstance, eax

invoke GetCommandLine
mov commandline, eax

invoke PrintText, ADDR HelloWorld

invoke ExitProcess, 0



; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
; Function: PrintText
;


PrintText proc spText:DWORD

LOCAL hOutPut :DWORD
LOCAL bWritten :DWORD

invoke GetStdHandle, STD_OUTPUT_HANDLE
mov hOutPut, eax
cld

xor ebx, ebx
mov esi, spText
lodsb

pt0:
cmp al, 0
je pt1
inc ebx
lodsb
jmp pt0

pt1:
invoke WriteFile, hOutPut, spText, ebx, ADDR bWritten, NULL
mov eax, bWritten
ret

PrintText endp



end start

Posted on 2002-02-20 02:41:21 by marsface
A quick FAsm example:
Posted on 2002-02-20 23:56:48 by eet_1024
Robert,

I'm getting INVALID_HANDLE_VALUE after


invoke GetStdHandle, STD_OUTPUT_HANDLE


GetLastError returns 0 (no error) so I'm not sure why it's not working. I'm running this on win98.
Posted on 2002-02-21 10:50:04 by grv575
I had that happen once. But it was some little stupid and I can't remember what it was.

Run a debugger and look at what really is put onto the stack.
Posted on 2002-02-22 00:21:34 by eet_1024