42 lines
582 B
ArmAsm
42 lines
582 B
ArmAsm
.section .text
|
|
.global start
|
|
.global main
|
|
|
|
start:
|
|
/* print "START\n" */
|
|
lui a0,0x10000000>>12
|
|
addi a1,zero,'S'
|
|
addi a2,zero,'T'
|
|
addi a3,zero,'A'
|
|
addi a4,zero,'R'
|
|
addi a5,zero,'\n'
|
|
sw a1,0(a0)
|
|
sw a2,0(a0)
|
|
sw a3,0(a0)
|
|
sw a4,0(a0)
|
|
sw a2,0(a0)
|
|
sw a5,0(a0)
|
|
|
|
/* set stack pointer */
|
|
lui sp,(64*1024)>>12
|
|
|
|
/* jump to main C code */
|
|
jal ra,main
|
|
|
|
/* print "DONE\n" */
|
|
lui a0,0x10000000>>12
|
|
addi a1,zero,'D'
|
|
addi a2,zero,'O'
|
|
addi a3,zero,'N'
|
|
addi a4,zero,'E'
|
|
addi a5,zero,'\n'
|
|
sw a1,0(a0)
|
|
sw a2,0(a0)
|
|
sw a3,0(a0)
|
|
sw a4,0(a0)
|
|
sw a5,0(a0)
|
|
|
|
/* break */
|
|
sbreak
|
|
|