34 lines
1.3 KiB
ArmAsm
Raw Normal View History

2019-02-11 16:56:18 +08:00
.org 0x0
.global _start
_start:
print_hello:
# t0=0x00030000user_uart
or t0, zero,zero # t0
lui t0, 0x00020 # t0 20bit=0x00020
# hello!user_uarthello!uart
ori t1, zero, 0x068 # t1='h'ASCII
sb t1, (t0) # t1t0
addi t0, t0 , 0x001 # t0+1
ori t1, zero, 0x065 # t1='e'ASCII
sb t1, (t0) # t1t0
addi t0, t0 , 0x001 # t0+1
ori t1, zero, 0x06c # t1='l'ASCII
sb t1, (t0) # t1t0
addi t0, t0 , 0x001 # t0+1
ori t1, zero, 0x06c # t1='l'ASCII
sb t1, (t0) # t1t0
addi t0, t0 , 0x001 # t0+1
ori t1, zero, 0x06f # t1='o'ASCII
sb t1, (t0) # t1t0
addi t0, t0 , 0x001 # t0+1
ori t1, zero, 0x021 # t1='!'ASCII
sb t1, (t0) # t1t0
#
lui t2, 0x00c00 # t2 = 0x00c00000
big_loop:
addi t2, t2, -1 # t2 = t2-1
bne t2, zero, big_loop # if t2!=0, jmp to big_loop
jal zero, print_hello # print_hello