OffCourse RISC-V Worked out solutions to the RISC-V VPL assignments in the PEC on https://moodle.feitsma.uk Division divide.s Download! Expand Hide .data str1: .ascii "result = \0" str2: .ascii "\n\0" .text .global main main: call read_int mv s0,a0 call read_int mv s1,a0 mv a0,s0 mv a1,s1 call divide mv s1,a0 la a0,str1 call print_string mv a0,s1 call print_int la a0,str2 call print_string call exit ret ## No Recursion Used. Demonstrates Simplification ## Recursion is might be enforced on exam. divide: mv t1, zero loop: bge a0, a1, more mv a0, t1 jr ra more: addi t1, t1, 1 sub a0, a0, a1 j loop