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 / helix / rung1 / hexB1.b0

246 lines · 7773 bytes Raw Blame History
1; hexB1.b0 -- Rung B1 of Strand B (unlabelled byte-pair stream for seedB0)
27f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 02 00 b7 00 01 00 00 00 78 00 50 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 38 00 01 00 00 00 00 00 00 00 ; ELF-64 file header (64B)
301 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 50 00 00 00 00 00 ; PT_LOAD header part 1
4b4 03 00 00 00 00 00 00 ; p_filesz (auto) = 948
500 00 40 00 00 00 00 00 00 10 00 00 00 00 00 00 ; p_memsz & p_align
6ff 83 00 d1 ; sub sp, sp, #32
7fc 03 00 91 ; mov x28, sp (name buf)
813 0c a0 d2 ; x19 = 0x600000 (in_base)
914 00 80 d2 ; x20 = 0 (in_len)
1017 0e a0 d2 ; x23 = 0x700000 (out_base)
1119 0b a0 d2 ; x25 = 0x580000 (lbl_base)
121a 00 80 d2 ; x26 = 0 (lbl_cnt)
131b 00 80 d2 ; x27 = 0 (total_len)
14; :rd_loop @ 0x98
1502 02 a0 d2 ; x2 = 0x100000 (1 MiB)
1642 00 14 cb ; x2 = avail
1742 18 00 b4 ; if avail==0 -> err 9 -> err_cap (+194)
1800 00 80 d2 ; fd 0
1961 02 14 8b ; x1 = in_base + in_len
20e8 07 80 d2 ; SYS_read
2101 00 00 d4 ; svc #0
221f 00 00 f1 ; cmp x0, #0
2380 00 00 54 ; eof -> rd_done (+4)
242b 17 00 54 ; read err -> err_rd (+185)
2594 02 00 8b ; in_len += n
26f5 ff ff 17 ; loop read -> rd_loop (-11)
27; :rd_done @ 0xc8
2815 00 80 d2 ; pass = 0
29; :pass_start @ 0xcc
3016 00 80 d2 ; cursor = 0
3118 00 80 d2 ; out_pos = 0
32; :tok_loop @ 0xd4
33df 02 14 eb ; cmp cursor, in_len
3462 0c 00 54 ; if cursor >= in_len -> pass_done (+99)
3560 6a 76 38 ; w0 = in[cursor]
36d6 06 00 91 ; cursor++
371f 80 00 71 ; cmp ' '
3860 ff ff 54 ; skip space -> tok_loop (-5)
391f 28 00 71 ; cmp LF
4020 ff ff 54 ; skip LF -> tok_loop (-7)
411f 24 00 71 ; cmp TAB
42e0 fe ff 54 ; skip TAB -> tok_loop (-9)
431f 34 00 71 ; cmp CR
44a0 fe ff 54 ; skip CR -> tok_loop (-11)
451f ec 00 71 ; cmp ';'
4601 01 00 54 ; not comment -> not_cmt (+8)
47; :cmt_loop @ 0x10c
48df 02 14 eb ; cmp cursor, in_len
49a2 0a 00 54 ; eof in cmt -> pass_done (+85)
5060 6a 76 38 ; w0 = in[cursor]
51d6 06 00 91 ; cursor++
521f 28 00 71 ; cmp LF
5361 ff ff 54 ; until LF -> cmt_loop (-5)
54ec ff ff 17 ; done cmt -> tok_loop (-20)
55; :not_cmt @ 0x128
561f e8 00 71 ; cmp ':'
5781 01 00 54 ; not : -> not_def (+12)
586d 00 00 94 ; read label name into [x28] -> rd_name (+109)
5915 fd ff b5 ; pass 1 skips def -> tok_loop (-24)
6041 eb 7b d3 ; x1 = lbl_cnt * 32
6121 03 01 8b ; x1 = entry addr
6282 03 40 f9 ; name[0..7]
6383 07 40 f9 ; name[8..15]
6422 00 00 f9 ; store name[0..7]
6523 04 00 f9 ; store name[8..15]
6638 08 00 f9 ; store offset = out_pos
675a 07 00 91 ; lbl_cnt++
68df ff ff 17 ; next -> tok_loop (-33)
69; :not_def @ 0x15c
701f f4 00 71 ; cmp '='
7101 02 00 54 ; not = -> not_word (+16)
7209 00 80 d2 ; w9 = acc
730a 01 80 d2 ; x10 = 8 digits
74; :w_loop @ 0x16c
75df 02 14 eb ; cmp cursor, in_len
76c2 10 00 54 ; truncated word -> err_hex (+134)
7760 6a 76 38 ; w0 = ch
78d6 06 00 91 ; cursor++
794c 00 00 94 ; x0 = 0..15 -> hex_val (+76)
8029 6d 1c 53 ; w9 <<= 4
8129 01 00 2a ; w9 |= w0
824a 05 00 f1 ; x10--
8301 ff ff 54 ; more digits -> w_loop (-8)
8455 00 00 b4 ; pass 0 no write -> w_skip (+2)
85e9 6a 38 b8 ; out[out_pos] = w9
86; :w_skip @ 0x198
8718 13 00 91 ; out_pos += 4
88ce ff ff 17 ; next -> tok_loop (-50)
89; :not_word @ 0x1a0
901f 00 01 71 ; cmp '@'
91e1 01 00 54 ; not @ -> not_b19 (+15)
924f 00 00 94 ; read label -> rd_name (+79)
9355 f9 ff b4 ; pass 0 skip -> tok_loop (-54)
9465 00 00 94 ; x0 = target off -> find_lbl (+101)
9501 13 00 d1 ; x1 = out_pos - 4
9600 00 01 cb ; x0 = target - pc
9700 fc 42 93 ; x0 >>= 2
98e2 ff 9f d2 ; x2 = 0xffff
99e2 00 a0 f2 ; x2 = 0x7ffff
10000 00 02 8a ; x0 &= 0x7ffff
10100 e8 7b d3 ; x0 <<= 5
102e3 6a 61 b8 ; w3 = prev word
10363 00 00 2a ; w3 |= w0
104e3 6a 21 b8 ; store patched word
105be ff ff 17 ; next -> tok_loop (-66)
106; :not_b19 @ 0x1e0
1071f 78 01 71 ; cmp '^'
108c1 01 00 54 ; not ^ -> not_b26 (+14)
1093f 00 00 94 ; read label -> rd_name (+63)
11055 f7 ff b4 ; pass 0 skip -> tok_loop (-70)
11155 00 00 94 ; x0 = target off -> find_lbl (+85)
11201 13 00 d1 ; x1 = out_pos - 4
11300 00 01 cb ; x0 = target - pc
11400 fc 42 93 ; x0 >>= 2
115e2 ff 9f d2 ; x2 = 0xffff
116e2 7f a0 f2 ; x2 = 0x3ffffff
11700 00 02 8a ; x0 &= 0x3ffffff
118e3 6a 61 b8 ; w3 = prev word
11963 00 00 2a ; w3 |= w0
120e3 6a 21 b8 ; store patched word
121af ff ff 17 ; next -> tok_loop (-81)
122; :not_b26 @ 0x21c
1231f 90 00 71 ; cmp '$'
124a1 00 00 54 ; not $ -> do_byte (+5)
12555 00 00 b4 ; pass 0 skip -> sz_skip (+2)
126fb 6a 38 f8 ; out[out_pos] = total_len
127; :sz_skip @ 0x22c
12818 23 00 91 ; out_pos += 8
129a9 ff ff 17 ; next -> tok_loop (-87)
130; :do_byte @ 0x234
1311e 00 00 94 ; first nibble -> hex_val (+30)
13209 6c 1c 53 ; w9 = hi << 4
133df 02 14 eb ; cmp cursor, in_len
13442 0a 00 54 ; odd nibble -> err_hex (+82)
13560 6a 76 38 ; w0 = second ch
136d6 06 00 91 ; cursor++
13718 00 00 94 ; second nibble -> hex_val (+24)
13829 01 00 2a ; w9 |= lo
13955 00 00 b4 ; pass 0 skip -> b_skip (+2)
140e9 6a 38 38 ; out[out_pos] = w9
141; :b_skip @ 0x25c
14218 07 00 91 ; out_pos += 1
1439d ff ff 17 ; next -> tok_loop (-99)
144; :pass_done @ 0x264
14595 00 00 b5 ; if pass==1 -> write -> write_out (+4)
146fb 03 18 aa ; total_len = out_pos
14735 00 80 d2 ; pass = 1
14897 ff ff 17 ; start pass 1 -> pass_start (-105)
149; :write_out @ 0x274
15009 00 80 d2 ; written = 0
151; :wr_loop @ 0x278
1523f 01 18 eb ; cmp written, out_pos
15342 01 00 54 ; done write -> ok_exit (+10)
15420 00 80 d2 ; fd 1
155e1 02 09 8b ; ptr = out_base + written
15602 03 09 cb ; rem = out_pos - written
15708 08 80 d2 ; SYS_write
15801 00 00 d4 ; svc #0
1591f 00 00 f1 ; cmp x0, #0
1600d 08 00 54 ; write err -> err_wr (+64)
16129 01 00 8b ; written += n
162f6 ff ff 17 ; loop write -> wr_loop (-10)
163; :ok_exit @ 0x2a4
16400 00 80 d2 ; exit 0
16541 00 00 14 ; exit -> do_exit (+65)
166; :hex_val @ 0x2ac
16701 c0 00 71 ; w1 = w0 - '0'
1683f 28 00 71 ; cmp w1, #10
16943 01 00 54 ; 0-9 -> hv_ok (+10)
17001 84 01 71 ; w1 = w0 - 'a'
1713f 18 00 71 ; cmp w1, #6
172c3 00 00 54 ; a-f -> hv_add10 (+6)
17301 04 01 71 ; w1 = w0 - 'A'
1743f 18 00 71 ; cmp w1, #6
17563 00 00 54 ; A-F -> hv_add10 (+3)
176a0 00 80 d2 ; bad hex -> exit 5
17736 00 00 14 ; exit -> do_exit (+54)
178; :hv_add10 @ 0x2d8
17921 28 00 11 ; w1 += 10
180; :hv_ok @ 0x2dc
181e0 03 01 2a ; w0 = w1
182c0 03 5f d6 ; ret
183; :rd_name @ 0x2e4
1849f 03 00 f9 ; zero name[0..7]
1859f 07 00 f9 ; zero name[8..15]
18601 00 80 d2 ; i = 0
187; :rn_loop @ 0x2f0
188df 02 14 eb ; cmp cursor, in_len
18942 02 00 54 ; eof -> rn_done (+18)
19060 6a 76 38 ; w0 = ch
1911f 80 00 71 ; cmp ' '
192e0 01 00 54 ; ws -> rn_done (+15)
1931f 28 00 71 ; cmp LF
194a0 01 00 54 ; ws -> rn_done (+13)
1951f 24 00 71 ; cmp TAB
19660 01 00 54 ; ws -> rn_done (+11)
1971f 34 00 71 ; cmp CR
19820 01 00 54 ; ws -> rn_done (+9)
1991f ec 00 71 ; cmp ';'
200e0 00 00 54 ; cmt -> rn_done (+7)
2013f 40 00 f1 ; cmp i, #16
20202 03 00 54 ; name > 16 -> err_hex (+24)
20380 6b 21 38 ; name[i] = w0
20421 04 00 91 ; i++
205d6 06 00 91 ; cursor++
206ee ff ff 17 ; loop -> rn_loop (-18)
207; :rn_done @ 0x33c
20861 02 00 b4 ; empty name -> err_hex (+19)
209c0 03 5f d6 ; ret
210; :find_lbl @ 0x344
21182 03 40 f9 ; want0
21283 07 40 f9 ; want1
21301 00 80 d2 ; i = 0
214; :fl_loop @ 0x350
2153f 00 1a eb ; cmp i, lbl_cnt
216e2 01 00 54 ; not found -> err_lbl (+15)
21724 e8 7b d3 ; x4 = i * 32
21824 03 04 8b ; x4 = entry
21985 00 40 f9 ; got0
220bf 00 02 eb ; cmp got0, want0
221c1 00 00 54 ; miss0 -> fl_next (+6)
22285 04 40 f9 ; got1
223bf 00 03 eb ; cmp got1, want1
22461 00 00 54 ; miss1 -> fl_next (+3)
22580 08 40 f9 ; x0 = offset
226c0 03 5f d6 ; ret
227; :fl_next @ 0x380
22821 04 00 91 ; i++
229f3 ff ff 17 ; loop -> fl_loop (-13)
230; :err_hex @ 0x388
231c0 00 80 d2 ; exit 6
23208 00 00 14 ; exit -> do_exit (+8)
233; :err_lbl @ 0x390
234e0 00 80 d2 ; exit 7
23506 00 00 14 ; exit -> do_exit (+6)
236; :err_wr @ 0x398
23700 01 80 d2 ; exit 8
23804 00 00 14 ; exit -> do_exit (+4)
239; :err_rd @ 0x3a0
24020 01 80 d2 ; exit 9
24102 00 00 14 ; exit -> do_exit (+2)
242; :err_cap @ 0x3a8
24340 01 80 d2 ; exit 10
244; :do_exit @ 0x3ac
245a8 0b 80 d2 ; SYS_exit
24601 00 00 d4 ; svc #0