PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.2
Code Block Pro – Beautiful Syntax Highlighting v1.27.2
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / riscv.sample

riscv.sample in Code Block Pro – Beautiful Syntax Highlighting 1.27.2, at build/shiki/samples/riscv.sample

31 lines 952 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 #
2 # Risc-V Assembler program to print "Hello World!"
3 # to stdout.
4 #
5 # a0-a2 - parameters to linux function services
6 # a7 - linux function number
7 #
8
9 .global _start # Provide program starting address to linker
10
11 # Setup the parameters to print hello world
12 # and then call Linux to do it.
13
14 _start: addi a0, x0, 1 # 1 = StdOut
15 la a1, helloworld # load address of helloworld
16 addi a2, x0, 13 # length of our string
17 addi a7, x0, 64 # linux write system call
18 ecall # Call linux to output the string
19
20 # Setup the parameters to exit the program
21 # and then call Linux to do it.
22
23 addi a0, x0, 0 # Use 0 return code
24 addi a7, x0, 93 # Service command code 93 terminates
25 ecall # Call linux to terminate the program
26
27 .data
28 helloworld: .ascii "Hello World!\n"
29
30 # From https://smist08.wordpress.com/2019/09/07/risc-v-assembly-language-hello-world/
31