USTC-RVSoC/ASM/uart_print.S
2019-02-05 16:19:46 +08:00

31 lines
1.3 KiB
ArmAsm
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.org 0x0
.global _start
_start:
# t0=0x00030000user_uart
or t0, zero,zero # t0
lui t0, 0x00030 # t0 20bit=0x00020
# hello!user_uarthello!uart
print_hello:
ori t1, zero, 0x068 # t1='h'ASCII
sb t1, (t0) # t1t0
ori t1, zero, 0x065 # t1='e'ASCII
sb t1, (t0) # t1t0
ori t1, zero, 0x06c # t1='l'ASCII
sb t1, (t0) # t1t0
ori t1, zero, 0x06c # t1='l'ASCII
sb t1, (t0) # t1t0
ori t1, zero, 0x06f # t1='o'ASCII
sb t1, (t0) # t1t0
ori t1, zero, 0x021 # t1='!'ASCII
sb t1, (t0) # t1t0
ori t1, zero, 0x00a # t1='\n'ASCII
sb t1, (t0) # t1t0
#
lui t2, 0x00200 # t2 = 0x00800000
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