Skip to content

Instantly share code, notes, and snippets.

@snapo
Created September 1, 2016 20:27
Show Gist options
  • Save snapo/91157b5c20cce96771e6483022ca4f0d to your computer and use it in GitHub Desktop.
Save snapo/91157b5c20cce96771e6483022ca4f0d to your computer and use it in GitHub Desktop.
; NASM FUN
; Example 1 - Run code in another direction
push 0
push main
jmp main
call main
call main
call main
call main
call main
call main
call main
call main
call main
db 0xC0
db 0xDE
main:
inc sp
mov a, [sp]
sub a, 4
push a
ret
; Example 2 - Stack becomes code
mov sp,0x26
push 0xde
push 3
push 6
push 0xc0
push 2
push 6
push 0xad
push 1
push 6
push 0xde
push 0
push 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment