Re: Problem Linking (win32)



You might have better results if you start with a simple solution and
then add complexity in incremental steps. For instance:

,--
| hey.asm
,--

; nasm -f win32 -o hey.obj hey.asm
; gcc -o hey.exe hey.obj

section .data

format db 10, 'Result = %d', 10, 0

section .text

global _main
extern _printf

_main:
push 0x05
push 0x08
call AddFunc
push eax
push format
call _printf
add esp, 8

xor eax, eax
ret

AddFunc:
mov eax, [esp+4]
add eax, [esp+8]
ret 8
`--

Nathan.

.



Relevant Pages

  • Re: Macro2D
    ... mov, eax ... cmp eax, -1 ... push STD_INPUT_HANDLE ...
    (alt.lang.asm)
  • Re: Insert a byte
    ... push ebx ... mov ebx, dword ... cmp dword, 0 ... ..e0: xor eax, eax ...
    (alt.lang.asm)
  • ascii to st0
    ... push IDC_ARROW ... cmp eax, 0 ... mov ebp, esp ... cmp dword @Message, WM_CLOSE ...
    (alt.lang.asm)
  • Re: Interesting Web Site on Open Source Development
    ... mov D§esp 0DEADBEEF call Code04013A0 ... call Code0401100 push eax lea eax D§esp+014 push Data0402124 ... push eax call 'USER32.wsprintfA' add esp 0C push 030 lea ecx D§esp+014 push ecx ...
    (alt.lang.asm)
  • Re: Newbie question...
    ... something like push allign - pop allign ... @1: dec esp ... push eax ...
    (alt.lang.asm)