flat assembler
Message board for the users of flat assembler.
Index
> Windows > Hello world console program |
| Author |
|
|
revolution 08 Dec 2012, 11:51
Lucy: Answers are given in the other thread.
Look in the "examples" folder in the fasm download. |
|||
|
|
typedef 09 Dec 2012, 17:12
A lady ?
Anyways, @Rev be kind. And IIRC there are no console examples in the download folder. @Lucy Here's how. Code: format pe console include 'win32ax.inc' entry main section '.data!!!' data readable writeable strHello db 'Hello World !',13,10,0 strPause db 'pause',0 section '.txt' code executable readable main: ; you can use crt functions or windows API. cinvoke printf,strHello cinvoke system,strPause; or import getc() ; or ; invoke printf,srtHello ; add esp, 4 ; or use WriteFile and GetStdHandle APIs push 0 call [ExitProcess] section '.blah' import data readable library kernel32,'kernel32.dll',\ msvcrt,'msvcrt.dll' ;; C-Run time from MS. This is always on every windows machine import kernel32,\ ExitProcess,'ExitProcess' import msvcrt,\ printf,'printf',\ system,'system' |
|||
|
|
baldr 12 Dec 2012, 08:16
Lucy Berie,
printf() is prototyped in stdio.h, iostream gives you (object-oriented-&-overloaded) operator << for cout. Heh, you can even use puts() for a free CR/LF. |
|||
|
|
bzdashek 14 Dec 2012, 15:05
The flower of blooming prairies,
Lucy "asm" Berie. sorry, couldn't constrain myself. |
|||
|
|
mindcooler 14 Dec 2012, 15:36
Code: format PE console include 'win32ax.inc' .code start: invoke WriteConsole,<invoke GetStdHandle,STD_OUTPUT_HANDLE>,"Hello World !",13,0 invoke Sleep,-1 .end start _________________ This is a block of text that can be added to posts you make. |
|||
|
|
chastitywhiterose 28 Oct 2025, 01:09
typedef wrote: A lady ? This is correct. I could not find any Hello World examples in the downloads for FASM except GUI messagebox examples. I will try the examples from this thread and hopefully be able to translate my Assembly programs from Linux to Windows because all they ever do is output text to a console. |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.