Assembly ir #23

Merged
gc1523 merged 9 commits from assembly-ir into master 2025-02-20 19:02:47 +00:00
11 changed files with 422 additions and 548 deletions
Showing only changes of commit 7525e523bb - Show all commits

View File

@@ -20,7 +20,7 @@ object assemblyIR {
}
}
//arguments
// arguments
enum CLibFunc extends Operand {
case Scanf,
Puts,
@@ -62,7 +62,7 @@ object assemblyIR {
override def toString = name
}
//TODO Check if dest and src are not both memory locations
// TODO Check if dest and src are not both memory locations
abstract class Operation(ins: String, op1: Operand = NoOperand, op2: Operand = NoOperand) {
override def toString: String = if (op2 == NoOperand) {
s"$ins ${op1.toString}"
@@ -79,7 +79,7 @@ object assemblyIR {
case class Or(op1: Dest, op2: Src) extends Operation("or", op1, op2)
case class Compare(op1: Dest, op2: Src) extends Operation("cmp", op1, op2)
//stack operations
// stack operations
case class Push(op1: Src) extends Operation("push", op1)
case class Pop(op1: Src) extends Operation("pop", op1)
case class Call(op1: CLibFunc) extends Operation("call", op1)
@@ -94,4 +94,3 @@ object assemblyIR {
}
}