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 / rung1 / hex1.hex

215 lines · 13771 bytes Raw Blame History
1# hex1.hex -- rung 1 of the Omega seed chain, written in seed-0's language (8 hex digits = one word,
2# '#' comment to end of line) and built by seed-0: seed0.bin < hex1.hex > hex1.bin.
3# hex1 reads seed-0's language plus two marks:
4# :c names the place of the next word "c" (c = any one printable character)
5# @c right after a word: adds the distance in words from that word to label c into bits 5..23 of it
6# (the imm19 field of B.cond, CBZ, CBNZ, LDR literal; and ADR's immhi when the target is a
7# whole word away). This is the one relative branch form.
8# It reads all its input first, counts words and labels (pass 1), then writes (pass 2), so a label may
9# be used before it is named. Exit codes: 0 ok, 1 word cut short, 2 read failed, 3 write failed,
10# 4 bad character, 5 label used but never named, 6 label named twice, 7 input over 4 MiB,
11# 8 ':' or '@' without a printable label character, 9 mark in the middle of a word, 10 '@' before any word.
12# Instruction bits: Arm DDI 0487 M.d, section on each line. Memory: one mapping at 0x400000;
13# labels table 0x410000 (256 x 8 bytes), input 0x420000..0x820000, output from 0x820000 (4 MiB).
14# Unconditional jumps are B.cond with condition AL (1110, "Always", Table C1-1), so that every branch
15# in hex1 uses the imm19 form that hex1 itself understands.
16#
17# ---- ELF-64 file header, 16 words ----
18464c457f # e_ident[0..3] = 7f 'E' 'L' 'F'
1900010102 # e_ident[4..7] = ELFCLASS64, ELFDATA2LSB, EV_CURRENT, ELFOSABI_NONE
2000000000 # e_ident[8..11] = ABI version 0, padding
2100000000 # e_ident[12..15] = padding
2200b70002 # e_type = 2 ET_EXEC, e_machine = 183 EM_AARCH64
2300000001 # e_version = 1
2400400078 # e_entry low = 0x400078 (file offset 120)
2500000000 # e_entry high
2600000040 # e_phoff low = 64
2700000000 # e_phoff high
2800000000 # e_shoff low = 0 (no sections)
2900000000 # e_shoff high
3000000000 # e_flags = 0
3100380040 # e_ehsize = 64, e_phentsize = 56
3200000001 # e_phnum = 1, e_shentsize = 0
3300000000 # e_shnum = 0, e_shstrndx = 0
34# ---- program header, 14 words ----
3500000001 # p_type = PT_LOAD
3600000007 # p_flags = read, write, execute
3700000000 # p_offset low = 0
3800000000 # p_offset high
3900400000 # p_vaddr low = 0x400000
4000000000 # p_vaddr high
4100400000 # p_paddr low = 0x400000
4200000000 # p_paddr high
4300000308 # p_filesz low = 776 bytes (120 header + 164 instructions * 4)
4400000000 # p_filesz high
4500820000 # p_memsz low = 0x820000 (tables and buffers up to 0xc20000, zero-filled)
4600000000 # p_memsz high
4700001000 # p_align low = 4096
4800000000 # p_align high
49# ---- code, 164 words from address 0x400078 ----
50# x9=10 x25=1 x26=labels x23=input x24=output (and input limit) x10=0x7ffff x22=pointer x11=input end
51# x27=pass (0 count, 1 write) x19=word being built x20=its digits x21=words so far
52d2800149 # [0] movz x9, #10 C6.2.285 MOVZ
53d2800039 # [1] movz x25, #1 C6.2.285 MOVZ
54d2a0083a # [2] movz x26, #0x41, lsl #16 C6.2.285 MOVZ
55d2a00857 # [3] movz x23, #0x42, lsl #16 C6.2.285 MOVZ
56d2a01058 # [4] movz x24, #0x82, lsl #16 C6.2.285 MOVZ
57d29fffea # [5] movz x10, #0xffff C6.2.285 MOVZ
58f2a000ea # [6] movk x10, #7, lsl #16 C6.2.283 MOVK
59aa1703f6 # [7] orr x22, xzr, x23 C6.2.302 ORR (shifted register)
60d2800000 # [8] movz x0, #0 C6.2.285 MOVZ
61aa1603e1 # [9] orr x1, xzr, x22 C6.2.302 ORR (shifted register)
62cb160302 # [10] sub x2, x24, x22 C6.2.458 SUB (shifted register)
63b4001202 # [11] cbz x2, +144 -> [155] fail7 C6.2.78 CBZ
64d28007e8 # [12] movz x8, #63 C6.2.285 MOVZ
65d4000001 # [13] svc #0 C6.2.466 SVC
66f100001f # [14] subs xzr, x0, #0 C6.2.464 SUBS (immediate), alias CMP C6.2.96
6754000080 # [15] b.eq +4 -> [19] readdone C6.2.34 B.cond (cond 0, Table C1-1)
685400102b # [16] b.lt +129 -> [145] fail2 C6.2.34 B.cond (cond 11, Table C1-1)
698b0002d6 # [17] add x22, x22, x0 C6.2.6 ADD (shifted register)
7054fffece # [18] b.al -10 -> [8] readloop C6.2.34 B.cond (cond 14, Table C1-1)
71aa1603eb # [19] orr x11, xzr, x22 C6.2.302 ORR (shifted register)
72d280001b # [20] movz x27, #0 C6.2.285 MOVZ
73aa1703f6 # [21] orr x22, xzr, x23 C6.2.302 ORR (shifted register)
74d2800013 # [22] movz x19, #0 C6.2.285 MOVZ
75d2800014 # [23] movz x20, #0 C6.2.285 MOVZ
76d2800015 # [24] movz x21, #0 C6.2.285 MOVZ
77eb0b02df # [25] subs xzr, x22, x11 C6.2.465 SUBS (shifted register), alias CMP C6.2.97
7854000c40 # [26] b.eq +98 -> [124] passend C6.2.34 B.cond (cond 0, Table C1-1)
79394002c0 # [27] ldrb w0, [x22] C6.2.220 LDRB (immediate), unsigned offset 0
808b1902d6 # [28] add x22, x22, x25 C6.2.6 ADD (shifted register)
8171008c1f # [29] subs wzr, w0, #35 C6.2.464 SUBS (immediate), alias CMP C6.2.96
82540002a0 # [30] b.eq +21 -> [51] comment C6.2.34 B.cond (cond 0, Table C1-1)
837100e81f # [31] subs wzr, w0, #58 C6.2.464 SUBS (immediate), alias CMP C6.2.96
8454000340 # [32] b.eq +26 -> [58] deflabel C6.2.34 B.cond (cond 0, Table C1-1)
857101001f # [33] subs wzr, w0, #64 C6.2.464 SUBS (immediate), alias CMP C6.2.96
8654000520 # [34] b.eq +41 -> [75] reflabel C6.2.34 B.cond (cond 0, Table C1-1)
877100c001 # [35] subs w1, w0, #48 C6.2.464 SUBS (immediate)
887100283f # [36] subs wzr, w1, #10 C6.2.464 SUBS (immediate), alias CMP C6.2.96
89540008c3 # [37] b.lo +70 -> [107] nibble C6.2.34 B.cond (cond 3, Table C1-1)
9071018401 # [38] subs w1, w0, #97 C6.2.464 SUBS (immediate)
917100183f # [39] subs wzr, w1, #6 C6.2.464 SUBS (immediate), alias CMP C6.2.96
9254000843 # [40] b.lo +66 -> [106] letter C6.2.34 B.cond (cond 3, Table C1-1)
9371010401 # [41] subs w1, w0, #65 C6.2.464 SUBS (immediate)
947100183f # [42] subs wzr, w1, #6 C6.2.464 SUBS (immediate), alias CMP C6.2.96
95540007e3 # [43] b.lo +63 -> [106] letter C6.2.34 B.cond (cond 3, Table C1-1)
967100801f # [44] subs wzr, w0, #32 C6.2.464 SUBS (immediate), alias CMP C6.2.96
9754fffd80 # [45] b.eq -20 -> [25] scan C6.2.34 B.cond (cond 0, Table C1-1)
987100281f # [46] subs wzr, w0, #10 C6.2.464 SUBS (immediate), alias CMP C6.2.96
9954fffd40 # [47] b.eq -22 -> [25] scan C6.2.34 B.cond (cond 0, Table C1-1)
1007100241f # [48] subs wzr, w0, #9 C6.2.464 SUBS (immediate), alias CMP C6.2.96
10154fffd00 # [49] b.eq -24 -> [25] scan C6.2.34 B.cond (cond 0, Table C1-1)
10254000c6e # [50] b.al +99 -> [149] fail4 C6.2.34 B.cond (cond 14, Table C1-1)
103eb0b02df # [51] subs xzr, x22, x11 C6.2.465 SUBS (shifted register), alias CMP C6.2.97
10454000900 # [52] b.eq +72 -> [124] passend C6.2.34 B.cond (cond 0, Table C1-1)
105394002c0 # [53] ldrb w0, [x22] C6.2.220 LDRB (immediate), unsigned offset 0
1068b1902d6 # [54] add x22, x22, x25 C6.2.6 ADD (shifted register)
1077100281f # [55] subs wzr, w0, #10 C6.2.464 SUBS (immediate), alias CMP C6.2.96
10854ffff61 # [56] b.ne -5 -> [51] comment C6.2.34 B.cond (cond 1, Table C1-1)
10954fffc0e # [57] b.al -32 -> [25] scan C6.2.34 B.cond (cond 14, Table C1-1)
110eb0b02df # [58] subs xzr, x22, x11 C6.2.465 SUBS (shifted register), alias CMP C6.2.97
11154000c40 # [59] b.eq +98 -> [157] fail8 C6.2.34 B.cond (cond 0, Table C1-1)
112394002c3 # [60] ldrb w3, [x22] C6.2.220 LDRB (immediate), unsigned offset 0
1138b1902d6 # [61] add x22, x22, x25 C6.2.6 ADD (shifted register)
1147100847f # [62] subs wzr, w3, #33 C6.2.464 SUBS (immediate), alias CMP C6.2.96
11554000bc3 # [63] b.lo +94 -> [157] fail8 C6.2.34 B.cond (cond 3, Table C1-1)
116b5000bf4 # [64] cbnz x20, +95 -> [159] fail9 C6.2.77 CBNZ
117b5fffb1b # [65] cbnz x27, -40 -> [25] scan C6.2.77 CBNZ
1188b030063 # [66] add x3, x3, x3 C6.2.6 ADD (shifted register)
1198b030063 # [67] add x3, x3, x3 C6.2.6 ADD (shifted register)
1208b030063 # [68] add x3, x3, x3 C6.2.6 ADD (shifted register)
1218b1a0063 # [69] add x3, x3, x26 C6.2.6 ADD (shifted register)
122f9400064 # [70] ldr x4, [x3] C6.2.216 LDR (immediate) 64-bit, unsigned offset 0
123b5000a44 # [71] cbnz x4, +82 -> [153] fail6 C6.2.77 CBNZ
1248b1902a4 # [72] add x4, x21, x25 C6.2.6 ADD (shifted register)
125f9000064 # [73] str x4, [x3] C6.2.415 STR (immediate) 64-bit, unsigned offset 0
12654fff9ee # [74] b.al -49 -> [25] scan C6.2.34 B.cond (cond 14, Table C1-1)
127eb0b02df # [75] subs xzr, x22, x11 C6.2.465 SUBS (shifted register), alias CMP C6.2.97
12854000a20 # [76] b.eq +81 -> [157] fail8 C6.2.34 B.cond (cond 0, Table C1-1)
129394002c3 # [77] ldrb w3, [x22] C6.2.220 LDRB (immediate), unsigned offset 0
1308b1902d6 # [78] add x22, x22, x25 C6.2.6 ADD (shifted register)
1317100847f # [79] subs wzr, w3, #33 C6.2.464 SUBS (immediate), alias CMP C6.2.96
132540009a3 # [80] b.lo +77 -> [157] fail8 C6.2.34 B.cond (cond 3, Table C1-1)
133b50009d4 # [81] cbnz x20, +78 -> [159] fail9 C6.2.77 CBNZ
134b4fff8fb # [82] cbz x27, -57 -> [25] scan C6.2.78 CBZ
135b40009d5 # [83] cbz x21, +78 -> [161] fail10 C6.2.78 CBZ
1368b030063 # [84] add x3, x3, x3 C6.2.6 ADD (shifted register)
1378b030063 # [85] add x3, x3, x3 C6.2.6 ADD (shifted register)
1388b030063 # [86] add x3, x3, x3 C6.2.6 ADD (shifted register)
1398b1a0063 # [87] add x3, x3, x26 C6.2.6 ADD (shifted register)
140f9400064 # [88] ldr x4, [x3] C6.2.216 LDR (immediate) 64-bit, unsigned offset 0
141b40007c4 # [89] cbz x4, +62 -> [151] fail5 C6.2.78 CBZ
142cb190084 # [90] sub x4, x4, x25 C6.2.458 SUB (shifted register)
143cb1902a5 # [91] sub x5, x21, x25 C6.2.458 SUB (shifted register)
144cb050084 # [92] sub x4, x4, x5 C6.2.458 SUB (shifted register)
1458a0a0084 # [93] and x4, x4, x10 C6.2.15 AND (shifted register)
1468b040084 # [94] add x4, x4, x4 C6.2.6 ADD (shifted register)
1478b040084 # [95] add x4, x4, x4 C6.2.6 ADD (shifted register)
1488b040084 # [96] add x4, x4, x4 C6.2.6 ADD (shifted register)
1498b040084 # [97] add x4, x4, x4 C6.2.6 ADD (shifted register)
1508b040084 # [98] add x4, x4, x4 C6.2.6 ADD (shifted register)
1518b0500a5 # [99] add x5, x5, x5 C6.2.6 ADD (shifted register)
1528b0500a5 # [100] add x5, x5, x5 C6.2.6 ADD (shifted register)
1538b1800a5 # [101] add x5, x5, x24 C6.2.6 ADD (shifted register)
154b94000a6 # [102] ldr w6, [x5] C6.2.216 LDR (immediate) 32-bit, unsigned offset 0
155aa0400c6 # [103] orr x6, x6, x4 C6.2.302 ORR (shifted register)
156b90000a6 # [104] str w6, [x5] C6.2.415 STR (immediate) 32-bit, unsigned offset 0
15754fff60e # [105] b.al -80 -> [25] scan C6.2.34 B.cond (cond 14, Table C1-1)
1580b090021 # [106] add w1, w1, w9 C6.2.6 ADD (shifted register) 32-bit
1598b130273 # [107] add x19, x19, x19 C6.2.6 ADD (shifted register)
1608b130273 # [108] add x19, x19, x19 C6.2.6 ADD (shifted register)
1618b130273 # [109] add x19, x19, x19 C6.2.6 ADD (shifted register)
1628b130273 # [110] add x19, x19, x19 C6.2.6 ADD (shifted register)
163aa010273 # [111] orr x19, x19, x1 C6.2.302 ORR (shifted register)
1648b190294 # [112] add x20, x20, x25 C6.2.6 ADD (shifted register)
165f100229f # [113] subs xzr, x20, #8 C6.2.464 SUBS (immediate), alias CMP C6.2.96
16654fff4e1 # [114] b.ne -89 -> [25] scan C6.2.34 B.cond (cond 1, Table C1-1)
167b40000bb # [115] cbz x27, +5 -> [120] countonly C6.2.78 CBZ
1688b1502a5 # [116] add x5, x21, x21 C6.2.6 ADD (shifted register)
1698b0500a5 # [117] add x5, x5, x5 C6.2.6 ADD (shifted register)
1708b1800a5 # [118] add x5, x5, x24 C6.2.6 ADD (shifted register)
171b90000b3 # [119] str w19, [x5] C6.2.415 STR (immediate) 32-bit, unsigned offset 0
1728b1902b5 # [120] add x21, x21, x25 C6.2.6 ADD (shifted register)
173d2800013 # [121] movz x19, #0 C6.2.285 MOVZ
174d2800014 # [122] movz x20, #0 C6.2.285 MOVZ
17554fff3ce # [123] b.al -98 -> [25] scan C6.2.34 B.cond (cond 14, Table C1-1)
176b5000274 # [124] cbnz x20, +19 -> [143] fail1 C6.2.77 CBNZ
177b500007b # [125] cbnz x27, +3 -> [128] output C6.2.77 CBNZ
178d280003b # [126] movz x27, #1 C6.2.285 MOVZ
17954fff2ce # [127] b.al -106 -> [21] pass C6.2.34 B.cond (cond 14, Table C1-1)
1808b1502a2 # [128] add x2, x21, x21 C6.2.6 ADD (shifted register)
1818b020042 # [129] add x2, x2, x2 C6.2.6 ADD (shifted register)
182aa1803f6 # [130] orr x22, xzr, x24 C6.2.302 ORR (shifted register)
183b4000142 # [131] cbz x2, +10 -> [141] exit0 C6.2.78 CBZ
184d2800020 # [132] movz x0, #1 C6.2.285 MOVZ
185aa1603e1 # [133] orr x1, xzr, x22 C6.2.302 ORR (shifted register)
186d2800808 # [134] movz x8, #64 C6.2.285 MOVZ
187d4000001 # [135] svc #0 C6.2.466 SVC
188f100001f # [136] subs xzr, x0, #0 C6.2.464 SUBS (immediate), alias CMP C6.2.96
1895400014d # [137] b.le +10 -> [147] fail3 C6.2.34 B.cond (cond 13, Table C1-1)
1908b0002d6 # [138] add x22, x22, x0 C6.2.6 ADD (shifted register)
191cb000042 # [139] sub x2, x2, x0 C6.2.458 SUB (shifted register)
19254fffeee # [140] b.al -9 -> [131] wloop C6.2.34 B.cond (cond 14, Table C1-1)
193d2800000 # [141] movz x0, #0 C6.2.285 MOVZ
1945400028e # [142] b.al +20 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
195d2800020 # [143] movz x0, #1 C6.2.285 MOVZ
1965400024e # [144] b.al +18 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
197d2800040 # [145] movz x0, #2 C6.2.285 MOVZ
1985400020e # [146] b.al +16 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
199d2800060 # [147] movz x0, #3 C6.2.285 MOVZ
200540001ce # [148] b.al +14 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
201d2800080 # [149] movz x0, #4 C6.2.285 MOVZ
2025400018e # [150] b.al +12 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
203d28000a0 # [151] movz x0, #5 C6.2.285 MOVZ
2045400014e # [152] b.al +10 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
205d28000c0 # [153] movz x0, #6 C6.2.285 MOVZ
2065400010e # [154] b.al +8 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
207d28000e0 # [155] movz x0, #7 C6.2.285 MOVZ
208540000ce # [156] b.al +6 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
209d2800100 # [157] movz x0, #8 C6.2.285 MOVZ
2105400008e # [158] b.al +4 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
211d2800120 # [159] movz x0, #9 C6.2.285 MOVZ
2125400004e # [160] b.al +2 -> [162] exit C6.2.34 B.cond (cond 14, Table C1-1)
213d2800140 # [161] movz x0, #10 C6.2.285 MOVZ
214d2800ba8 # [162] movz x8, #93 C6.2.285 MOVZ
215d4000001 # [163] svc #0 C6.2.466 SVC