From 000b28c88bbfd1fde94b5e01ce2766230077e013 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 12 Jan 2025 15:10:23 -0700 Subject: Expansion of complex expressions into set of instructions --- src/modules/ast/assembly-tree.scm | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/modules/ast/assembly-tree.scm') diff --git a/src/modules/ast/assembly-tree.scm b/src/modules/ast/assembly-tree.scm index ee3e116..3f0f1b1 100644 --- a/src/modules/ast/assembly-tree.scm +++ b/src/modules/ast/assembly-tree.scm @@ -4,22 +4,37 @@ subroutine? subroutine-label subroutine-instructions + subroutine-frame-size make-instruction instruction? + instruction-destination + set-instruction-destination instruction-operator - instruction-operand-1 - instruction-operand-2)) + instruction-src-1 + instruction-src-2 + + make-register + register? + register-name + )) (define-record-type - (make-subroutine label instrs) + (make-subroutine label instrs f-size) subroutine? (label subroutine-label) - (instrs subroutine-instructions)) + (instrs subroutine-instructions) + (f-size subroutine-frame-size)) (define-record-type - (make-instruction op oper1 oper2) + (make-instruction dest op src1 src2) instruction? + (dest instruction-destination set-instruction-destination) (op instruction-operator) - (oper1 instruction-operand-1) - (oper2 instruction-operand-2)) + (src1 instruction-src-1) + (src2 instruction-src-2)) + +(define-record-type + (make-register name) + register? + (name register-name)) -- cgit v1.2.3