diff options
author | bd <bdunahu@operationnull.com> | 2024-12-28 12:44:07 -0700 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-12-28 12:47:56 -0700 |
commit | babe9f9d0e84daec1015d7593a9d6c6d480662b8 (patch) | |
tree | 1314d8803b4fa564e06c58444e3524e688c4f204 /src/modules/ast/assembly-tree.scm | |
parent | 11ecac1d0686d5ed75b73eee0c860d7d67f6d6f0 (diff) |
Assembly generation for trivial programs
Diffstat (limited to 'src/modules/ast/assembly-tree.scm')
-rw-r--r-- | src/modules/ast/assembly-tree.scm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/modules/ast/assembly-tree.scm b/src/modules/ast/assembly-tree.scm new file mode 100644 index 0000000..ee3e116 --- /dev/null +++ b/src/modules/ast/assembly-tree.scm @@ -0,0 +1,25 @@ +(define-module (modules ast assembly-tree) + #:use-module (srfi srfi-9) + #:export (make-subroutine + subroutine? + subroutine-label + subroutine-instructions + + make-instruction + instruction? + instruction-operator + instruction-operand-1 + instruction-operand-2)) + +(define-record-type <subroutine> + (make-subroutine label instrs) + subroutine? + (label subroutine-label) + (instrs subroutine-instructions)) + +(define-record-type <instruction> + (make-instruction op oper1 oper2) + instruction? + (op instruction-operator) + (oper1 instruction-operand-1) + (oper2 instruction-operand-2)) |