From 536443b020d01d0d5372496529086a11b2486621 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 21 Apr 2025 22:56:50 +0200 Subject: Add stages and a rakefile --- boot/echo-boot.s | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 boot/echo-boot.s (limited to 'boot/echo-boot.s') 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 -- cgit v1.2.3