Created
September 1, 2016 20:27
-
-
Save snapo/91157b5c20cce96771e6483022ca4f0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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