Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My ASM is giving me gyp

Name: Anonymous 2012-05-26 16:58

Trying to get this to work. Just a "my first" program to help me make the transition mentally to x64, but it crashes if printf is invoked - why? Commenting out printf makes it not crash, and the stack pointer is the same at the start of the program as it is before the ret.

Yes, Windows.

include 'win64a.inc'
format PE64 Console 4.0
entry main

section '.text' code data readable executable

main:
    mov rdx, rsp
    mov rcx, text
    call [printf]
    xor rax,rax
    ret

text db "It's 5 AM. Do you know where your stack pointer is? (%016x)", 10, 0

align 16
data import
    library msvc,'msvcrt.dll'
    import msvc,printf,'printf'
end data

Name: Anonymous 2012-05-26 18:42

>>1
x64
It would help if you wrote asm for an existing processor architecture. I'm going to assume the x in x64 stands for PPC, which also explains why it won't compile since that shit ain't valid PPC64 code

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List