hello.asm and build instructions.

by (Login MCalkins)
ASM Forum

Build it with:

nasm.exe -f win32 hello.asm
ld.exe -l kernel32 -L %windir%\system32 -o hello.exe -s -Map hello.map -nostdlib --no-leading-underscore hello.obj

You can get nasm from:
I used Nasm version 2.09.10

ld.exe is in the
subfolder of your QB64 folder. I used the ld that came with QB64 0.942.

---------------- hello.asm

;public domain
cpu 586

extern GetStdHandle
extern WriteConsoleW
extern ExitProcess

section .text

push dword 0xfffffff5
call GetStdHandle
mov [_stdout],eax

push dword 0x0
push dword _trash
push dword (_msgend-_msg)/2
push dword _msg
push dword [_stdout]
call WriteConsoleW

push dword 0x0
call ExitProcess

section .rdata

dw __utf16__("Hello, world!"),0xd,0xa

section .bss

_stdout: resd 0x1
_trash: resd 0x1

This message has been edited by MCalkins on Feb 19, 2012 6:54 PM

Posted on Feb 19, 2012, 6:03 PM

Respond to this message   

Return to Index

Response TitleAuthor and Date
a little explanation of the source on Feb 19, 8:38 PM

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement