Commit 28490c5f authored by Matthieu Moy's avatar Matthieu Moy
Browse files

A few bugfixes in lab1

parent 96e59223
from typing import Union
from typing import List
from typing import (Union, List)
# Union[int, float] means ``either an int or a float''.
NUMBER = Union[int, float]
......
......@@ -6,9 +6,8 @@ int_variable = 4.2 # Static typing error, but no runtime error
float_variable = 42.0 # OK
float_variable = int_variable # OK
# Typing annotations for functions (-> means "returns")
# Typing annotations for functions (-> means "returns")
def int_to_string(i: int) -> str:
return str(i)
......
......@@ -8,7 +8,6 @@ main:
## END TODO /end of user assembly code
ld ra,8(sp)
addi sp,sp,16
jr ra
ret
# Data comes here
......
......@@ -7,7 +7,6 @@ main:
## END TODO - end of user assembly code
ld ra,8(sp)
addi sp,sp,16
jr ra
ret
# Data comes here
......
......@@ -4,8 +4,7 @@ main:
addi sp,sp,-16
sd ra,8(sp)
## Your assembly code there
lui a5,%hi(.LC1)
addi a0,a5,%lo(.LC1)
la a0, .LC1
call println_string
li a0,42
call print_int
......@@ -18,7 +17,6 @@ main:
## /end of user assembly code
ld ra,8(sp)
addi sp,sp,16
jr ra
ret
# Data comes here
......
......@@ -7,7 +7,6 @@ main:
## END TODO /end of user assembly code
ld ra,8(sp)
addi sp,sp,16
jr ra
ret
# Data comes here
.section .data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment