diff options
author | bd <bdunahu@operationnull.com> | 2025-04-17 19:39:06 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-17 19:39:06 -0400 |
commit | 7ad6093d69afa90de243e72868f0d463dcd5eae7 (patch) | |
tree | bca1b4259ccdcfd4ac8d188383a922b88efaed1a /input | |
parent | 3b8a36443a6d83b54fc698a774ef50705f36dcb9 (diff) |
Add new push/pop test case, ensure generated files end in .rv
Diffstat (limited to 'input')
-rw-r--r-- | input/dominative-functions.asm | 5 | ||||
-rw-r--r-- | input/stacktopia.asm | 20 |
2 files changed, 22 insertions, 3 deletions
diff --git a/input/dominative-functions.asm b/input/dominative-functions.asm index d11ddcb..0931918 100644 --- a/input/dominative-functions.asm +++ b/input/dominative-functions.asm @@ -1,7 +1,6 @@ ;;;;;;;; ;;; makes use of a designated function to add two numbers together ;;; uses a stack-based paradigm with a base pointer to manage argument passing -;;; TODO this file is incomplete due to remaining ISA subroutine design issues .data answer 0 @@ -19,7 +18,7 @@ MAIN: SUB23: push $5 ; push old frame pointer addi $5 $2 0x0 - subi $2 $2 0x4 + subi $2 $2 0x1 addi $6 $0 -23 store $6 -4($5) @@ -39,7 +38,7 @@ SUB23: ADD76: push $5 addi $5 $2 0x0 - subi $2 $2 0x4 + subi $2 $2 0x1 addi $6 $0 +76 store $6 -4($5) diff --git a/input/stacktopia.asm b/input/stacktopia.asm new file mode 100644 index 0000000..5eef33b --- /dev/null +++ b/input/stacktopia.asm @@ -0,0 +1,20 @@ +;;;;;;;; +;;; demonstrates the push/pop functions by pushing and popping various values + +.data +.text +MAIN: + addi $5 $0 1 + push $5 + addi $5 $5 1 + push $5 + addi $5 $5 1 + push $5 + addi $5 $5 1 + push $5 + pop $5 + pop $6 + pop $7 + pop $8 + nop + nop |