interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / tensix / boot-qemu.s2

20 lines · 1008 bytes Raw Blame History
1; boot-qemu.s2 -- start-up words for the second oracle, qemu-riscv32 in Linux user mode. Same job as
2; boot-tt.s2, different world: the image is loaded at 0x10000 (code at 0x10100), the argument block is at
3; 0x11000 (+0 a, +4 b, +8 out, +12 n words), and the result leaves through Linux system calls:
4; write(1, out, 4n) (a7 = 64) then exit(0) (a7 = 93), RISC-V Linux syscall numbers.
5; 15 instructions (60 bytes); vecadd follows at byte 60.
6 lui 28 0x11 ; t3 = 0x11000, the argument block
7 lw 10 28 0 ; a0 = a
8 lw 11 28 4 ; a1 = b
9 lw 12 28 8 ; a2 = out
10 lw 13 28 12 ; a3 = n
11 jal 1 0 20 0 0 ; ra = next, call vecadd: +40 bytes (imm[10:1] = 20), 10 instructions ahead
12 addi 10 0 1 ; a0 = 1 (stdout)
13 lw 11 28 8 ; a1 = out
14 lw 12 28 12 ; a2 = n
15 slli 12 12 2 ; a2 = 4n bytes
16 addi 17 0 64 ; a7 = write
17 ecall
18 addi 10 0 0 ; a0 = 0
19 addi 17 0 93 ; a7 = exit
20 ecall