diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-01-01 19:31:12 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-01-01 19:31:12 +0100 |
commit | 69fe7b182a1eedfb75c611f7dd35fa60200426f4 (patch) | |
tree | 329a0c6cc9b06c23d8782ece09f0f7dfa9b16b13 /miniasm/test8.asm | |
download | compilertests-69fe7b182a1eedfb75c611f7dd35fa60200426f4.tar.gz compilertests-69fe7b182a1eedfb75c611f7dd35fa60200426f4.tar.bz2 |
initial checkin
Diffstat (limited to 'miniasm/test8.asm')
-rw-r--r-- | miniasm/test8.asm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/miniasm/test8.asm b/miniasm/test8.asm new file mode 100644 index 0000000..f261f08 --- /dev/null +++ b/miniasm/test8.asm @@ -0,0 +1,25 @@ +; test8 - subroutines, saving registers to the stack + +begin: + mov ax, 1 + mov bx, 2 + mov cx, 3 + mov dx, 4 + jsr func +end: + hlt + +func: + push ax + push bx + push cx + push dx + mov ax, 10 + mov bx, 11 + mov cx, 12 + mov dx, 13 + pop dx + pop cx + pop bx + pop ax + ret |