Add call pseudo instruction
This commit is contained in:
29
tools/builtin.s
Normal file
29
tools/builtin.s
Normal file
@ -0,0 +1,29 @@
|
||||
.global printi
|
||||
.type printi, @function
|
||||
|
||||
.text
|
||||
printi:
|
||||
addi sp, sp, -8
|
||||
sw s0, 0(sp)
|
||||
sw ra, 4(sp)
|
||||
addi s0, sp, 8
|
||||
|
||||
addi t0, a0, 0
|
||||
addi a0, a0, '0'
|
||||
sw a0, 0(s0)
|
||||
addi a0, x0, 1
|
||||
addi a1, s0, 0
|
||||
addi a2, x0, 1
|
||||
addi a7, x0, 64
|
||||
ecall
|
||||
|
||||
addi t1, x0, '\n'
|
||||
sw t1, 0(s0)
|
||||
ecall
|
||||
|
||||
addi a0, t0, 0
|
||||
|
||||
lw s0, 0(sp)
|
||||
lw ra, 4(sp)
|
||||
addi sp, sp, 8
|
||||
ret
|
@ -118,7 +118,6 @@ enum status run_test(const char *file_entry_name)
|
||||
close(pipe_ends[0]);
|
||||
|
||||
int wait_status = 0;
|
||||
wait(&wait_status);
|
||||
|
||||
make_path(filename, "./expectations/", file_entry_name, ".txt");
|
||||
|
||||
|
Reference in New Issue
Block a user