feat: almost complete clib calls

This commit is contained in:
Alex Ling
2025-02-22 21:38:12 +00:00
parent 7f2870e340
commit 24dddcadab
3 changed files with 198 additions and 55 deletions

View File

@@ -143,8 +143,17 @@ object assemblyIR {
case Text => ".text"
case RoData => ".section .rodata"
case Int(value) => s".int $value"
case Asciz(string) => s".asciz $string"
case Asciz(string) => s".asciz \"$string\""
}
}
enum PrintFormat {
case Int, Char, String
override def toString(): String = this match {
case Int => "%d"
case Char => "%c"
case String => "%s"
}
}
}