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

Assembly

Name: Anonymous 2011-04-25 15:40

Hey /prog/, I am learning Pentium Assembly on linux, using nasm assembler. I've been having trouble with the stack operations. Could somebody explain how I can simply push 4 integers(hex/dec) onto the stack, and then later pop them off? I get some really weird messages when I try to do this.

Thanks a lot.

Name: Anonymous 2011-04-25 17:44

>>8
You suck at asm and have obviously not read your SICP to be hating on Lisp.
Here's how to write it:

.code
start:
call DoYouFail
push dword ptr [eax+pFailures]
call puts ; using fast printf is left to the user (see: http://dis.4chan.org/read/prog/1279520490/3 )
ret

; valid return value: 0 or 1
DoYouFail:
xor eax,eax
inc eax
ret

.data
szFail db 'FAIL',0
szRule db 'RULE',0

pFailures dd offset szRule
          dd offset szFail

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