diff options
Diffstat (limited to 'boot/echo-boot.s')
| -rw-r--r-- | boot/echo-boot.s | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/boot/echo-boot.s b/boot/echo-boot.s new file mode 100644 index 0000000..b6e65f7 --- /dev/null +++ b/boot/echo-boot.s @@ -0,0 +1,35 @@ +.global _start, source_code + +.section .rodata +.type SOURCE_BUFFER_SIZE, @object +.size SOURCE_BUFFER_SIZE, 4 +SOURCE_BUFFER_SIZE: .long 4096 + +.section .bss +.type source_code, @object +.size source_code, 4096 +source_code: .zero 4096 + +.section .text + +_compile: + ret + +_start: + # Read the source from the standard input. + la a0, source_code + la a1, SOURCE_BUFFER_SIZE # Buffer size. + lw a1, (a1) + call read_file + mv s1, a0 + + call _compile + + # Write the source to the standard output. + la a0, source_code + mv a1, s1 + call write_out + + # Call exit. + li a0, 0 # Use 0 return code. + call exit |
