From bcf37be308e8ef0017515e7484877b8ed74d98fd Mon Sep 17 00:00:00 2001 From: Sanjar Ahmadov Date: Sun, 2 May 2021 09:40:03 -0400 Subject: [PATCH] added makeint --- src/main/asm/chocopy/common/makeint.s | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/asm/chocopy/common/makeint.s diff --git a/src/main/asm/chocopy/common/makeint.s b/src/main/asm/chocopy/common/makeint.s new file mode 100644 index 0000000..9fbf065 --- /dev/null +++ b/src/main/asm/chocopy/common/makeint.s @@ -0,0 +1,11 @@ +# Box integer + addi sp, sp, -8 + sw ra, 4(sp) + sw a0, 0(sp) + la a0, $int$prototype + jal ra, alloc + lw t0, 0(sp) + sw t0, @.__int__(a0) + lw ra, 4(sp) + addi sp, sp, 8 + jr ra \ No newline at end of file