Re: Problem Linking (win32)
- From: nbaker2328 <spamtrap@xxxxxxxxxx>
- Date: Wed, 23 Jul 2008 22:54:11 -0700 (PDT)
But if your aim is to explore the Win API, then keep 'golink' but
steer clear of any C library.
----8<----
; nasm -f win32 -o go.obj go.asm
; golink /console go.obj kernel32.dll
section .bss
wrtn: resd 1
section .text
global start
extern ExitProcess
extern GetStdHandle
extern WriteFile
start:
push ebp
mov ebp, esp
sub esp, 4
mov al, 13
mov [ebp-4], al
mov al, 0x048
mov [ebp-3], al
mov al, 0x049
mov [ebp-2], al
mov al, 13
mov [ebp-1], al
push -11
call GetStdHandle
mov ebx, esp
push dword 0
push wrtn
push dword 4
push ebx
push eax
call WriteFile
push eax
call ExitProcess
---->8----
That will print "HI" to the console.
Nathan.
.
- References:
- Problem Linking (win32)
- From: bwaichu@xxxxxxxxx
- Re: Problem Linking (win32)
- From: nbaker2328
- Problem Linking (win32)
- Prev by Date: Re: Problem Linking (win32)
- Next by Date: Re: Problem Linking (win32)
- Previous by thread: Re: Problem Linking (win32)
- Next by thread: Re: Problem Linking (win32)
- Index(es):
Relevant Pages
|