diff options
Diffstat (limited to 'src/main.s')
-rw-r--r-- | src/main.s | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/main.s b/src/main.s new file mode 100644 index 0000000..52c4f03 --- /dev/null +++ b/src/main.s @@ -0,0 +1,49 @@ +;; .globl _start + +_start: + la a0, start_str + call puts + + addi sp, sp, -8 + la t0, helloworld + sw t0, 4(sp) + + li t0, 69 + sw t0, 0(sp) + + la a0, fmtstr2 + call printf + + addi sp, sp, -4 + sw a0, 0(sp) + la a0, fmtstr2 + call printf + + la a0, fmtstr3 + call printf + + la a0, end_str + call puts +loop: + j loop + +.section .data +fmtstr3: + .ascii "%s\0" +fmtstr2: + .ascii "%d\n" + .byte 0x0 +fmtstr: + .ascii "hello %d %d%d %s thing test%%\n\n\\\n%%\n" + .byte 0x0 + +helloworld: + .ascii "Hello World!" + .byte 0xA, 0x0 +.equ helloworld_sz, . - helloworld + +start_str: + .ascii "\n| START |\n\n\0" +end_str: + .ascii "\n| END |\n\0" + |