mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 17:55:20 +08:00
20 lines
272 B
ArmAsm
20 lines
272 B
ArmAsm
|
.macro syscall msg ptr
|
||
|
li a0, \msg
|
||
|
li a1, \ptr
|
||
|
ecall
|
||
|
.endm
|
||
|
|
||
|
.text
|
||
|
.global _start
|
||
|
_start:
|
||
|
la t0, msg
|
||
|
.loop:
|
||
|
lb a2, 0(t0)
|
||
|
beqz a2, _start # print forever
|
||
|
syscall (1<<12 | 1), 1 # see uapi/syscall.rs
|
||
|
addi t0, t0, 1
|
||
|
j .loop
|
||
|
|
||
|
.data
|
||
|
msg : .string "Hello, world!\n\0"
|