sovereign-intelligence
Front door to Drake Stapleton's sovereign stack.
Brought by drakestapleton
sovereign-intelligence / seed / rung2 / table.s2
| 1 | ; table.s2 -- the instruction table of asm2 (rung 2), readable text. Every line: |
| 2 | ; = name 0xBASE field... |
| 3 | ; BASE is the word with every operand field zero, read from the encoding diagram of the Arm ARM |
| 4 | ; DDI 0487 M.d section named in the comment. Fields, in operand order: rP register at bit P (5 bits), |
| 5 | ; iP.W unsigned, sP.W signed, lP.W label distance in words, a ADR label distance in bytes. |
| 6 | ; Units: load/store offsets are in units of the access size (the manual's imm12), as the bits hold them. |
| 7 | ; Suffix .x = 64-bit (sf=1), .w = 32-bit (sf=0). |
| 8 | ; |
| 9 | ; ---- arithmetic and logic, shifted register with shift 0 (operands: Rd, Rn, Rm) ---- |
| 10 | = add.x 0x8b000000 r0 r5 r16 ; C6.2.6 ADD (shifted register) |
| 11 | = add.w 0x0b000000 r0 r5 r16 ; C6.2.6 |
| 12 | = sub.x 0xcb000000 r0 r5 r16 ; C6.2.458 SUB (shifted register) |
| 13 | = sub.w 0x4b000000 r0 r5 r16 ; C6.2.458 |
| 14 | = subs.x 0xeb000000 r0 r5 r16 ; C6.2.465 SUBS (shifted register) |
| 15 | = subs.w 0x6b000000 r0 r5 r16 ; C6.2.465 |
| 16 | = cmp.x 0xeb00001f r5 r16 ; C6.2.97 CMP (shifted register) = SUBS with Rd 31 |
| 17 | = cmp.w 0x6b00001f r5 r16 ; C6.2.97 |
| 18 | = and.x 0x8a000000 r0 r5 r16 ; C6.2.15 AND (shifted register) |
| 19 | = and.w 0x0a000000 r0 r5 r16 ; C6.2.15 |
| 20 | = orr.x 0xaa000000 r0 r5 r16 ; C6.2.302 ORR (shifted register) |
| 21 | = orr.w 0x2a000000 r0 r5 r16 ; C6.2.302 |
| 22 | = eor.x 0xca000000 r0 r5 r16 ; C6.2.156 EOR (shifted register) |
| 23 | = eor.w 0x4a000000 r0 r5 r16 ; C6.2.156 |
| 24 | = mov.x 0xaa0003e0 r0 r16 ; C6.2.282 MOV (register) = ORR Rd, ZR, Rm |
| 25 | = mov.w 0x2a0003e0 r0 r16 ; C6.2.282 |
| 26 | ; ---- multiply, divide, variable shifts ---- |
| 27 | = mul.x 0x9b007c00 r0 r5 r16 ; C6.2.293 MUL = MADD with Ra 31 (C6.2.275) |
| 28 | = mul.w 0x1b007c00 r0 r5 r16 ; C6.2.293 |
| 29 | = madd.x 0x9b000000 r0 r5 r16 r10 ; C6.2.275 MADD (Rd, Rn, Rm, Ra) |
| 30 | = msub.x 0x9b008000 r0 r5 r16 r10 ; C6.2.291 MSUB (Rd, Rn, Rm, Ra) |
| 31 | = udiv.x 0x9ac00800 r0 r5 r16 ; C6.2.490 UDIV |
| 32 | = lslv.x 0x9ac02000 r0 r5 r16 ; C6.2.271 LSLV |
| 33 | = lsrv.x 0x9ac02400 r0 r5 r16 ; C6.2.274 LSRV |
| 34 | = asrv.x 0x9ac02800 r0 r5 r16 ; C6.2.21 ASRV |
| 35 | ; ---- immediates ---- |
| 36 | = add.x.i 0x91000000 r0 r5 i10.12 ; C6.2.5 ADD (immediate), sh 0 |
| 37 | = sub.x.i 0xd1000000 r0 r5 i10.12 ; C6.2.457 SUB (immediate), sh 0 |
| 38 | = subs.x.i 0xf1000000 r0 r5 i10.12 ; C6.2.464 SUBS (immediate), sh 0 |
| 39 | = subs.w.i 0x71000000 r0 r5 i10.12 ; C6.2.464 |
| 40 | = cmp.x.i 0xf100001f r5 i10.12 ; C6.2.96 CMP (immediate) = SUBS with Rd 31 |
| 41 | = cmp.w.i 0x7100001f r5 i10.12 ; C6.2.96 |
| 42 | = movz.x 0xd2800000 r0 i5.16 i21.2 ; C6.2.285 MOVZ (Rd, imm16, hw = shift/16) |
| 43 | = movz.w 0x52800000 r0 i5.16 i21.1 ; C6.2.285 (32-bit: hw 0 or 1) |
| 44 | = movk.x 0xf2800000 r0 i5.16 i21.2 ; C6.2.283 MOVK |
| 45 | = movk.w 0x72800000 r0 i5.16 i21.1 ; C6.2.283 |
| 46 | ; ---- loads and stores (Rt, Rn, offset in access-size units / signed bytes for post-index) ---- |
| 47 | = ldr.x 0xf9400000 r0 r5 i10.12 ; C6.2.216 LDR (immediate), unsigned offset, size 11 |
| 48 | = ldr.w 0xb9400000 r0 r5 i10.12 ; C6.2.216 size 10 |
| 49 | = str.x 0xf9000000 r0 r5 i10.12 ; C6.2.415 STR (immediate), unsigned offset |
| 50 | = str.w 0xb9000000 r0 r5 i10.12 ; C6.2.415 |
| 51 | = ldrb 0x39400000 r0 r5 i10.12 ; C6.2.220 LDRB (immediate), unsigned offset |
| 52 | = strb 0x39000000 r0 r5 i10.12 ; C6.2.417 STRB (immediate), unsigned offset |
| 53 | = ldr.w.post 0xb8400400 r0 r5 s12.9 ; C6.2.216 LDR (immediate), post-index, 32-bit |
| 54 | = ldr.x.post 0xf8400400 r0 r5 s12.9 ; C6.2.216 post-index, 64-bit |
| 55 | = str.w.post 0xb8000400 r0 r5 s12.9 ; C6.2.415 STR (immediate), post-index, 32-bit |
| 56 | = str.x.post 0xf8000400 r0 r5 s12.9 ; C6.2.415 post-index, 64-bit |
| 57 | ; ---- branches (label operands) ---- |
| 58 | = b 0x14000000 l0.26 ; C6.2.35 B |
| 59 | = bl 0x94000000 l0.26 ; C6.2.43 BL |
| 60 | = b.eq 0x54000000 l5.19 ; C6.2.34 B.cond, cond from Table C1-1 |
| 61 | = b.ne 0x54000001 l5.19 |
| 62 | = b.hs 0x54000002 l5.19 |
| 63 | = b.lo 0x54000003 l5.19 |
| 64 | = b.mi 0x54000004 l5.19 |
| 65 | = b.pl 0x54000005 l5.19 |
| 66 | = b.vs 0x54000006 l5.19 |
| 67 | = b.vc 0x54000007 l5.19 |
| 68 | = b.hi 0x54000008 l5.19 |
| 69 | = b.ls 0x54000009 l5.19 |
| 70 | = b.ge 0x5400000a l5.19 |
| 71 | = b.lt 0x5400000b l5.19 |
| 72 | = b.gt 0x5400000c l5.19 |
| 73 | = b.le 0x5400000d l5.19 |
| 74 | = b.al 0x5400000e l5.19 |
| 75 | = b.nv 0x5400000f l5.19 |
| 76 | = cbz.x 0xb4000000 r0 l5.19 ; C6.2.78 CBZ |
| 77 | = cbz.w 0x34000000 r0 l5.19 |
| 78 | = cbnz.x 0xb5000000 r0 l5.19 ; C6.2.77 CBNZ |
| 79 | = cbnz.w 0x35000000 r0 l5.19 |
| 80 | = adr 0x10000000 r0 a ; C6.2.12 ADR (byte distance, immlo at 29, immhi at 5) |
| 81 | = ret 0xd65f03c0 ; C6.2.338 RET (x30) |
| 82 | = ret.r 0xd65f0000 r5 ; C6.2.338 RET Rn |
| 83 | = br 0xd61f0000 r5 ; C6.2.46 BR |
| 84 | = blr 0xd63f0000 r5 ; C6.2.44 BLR |
| 85 | = svc 0xd4000001 i5.16 ; C6.2.466 SVC |
| 86 | ; ---- the same branches with the distance written as a number (words), for checks at the edges ---- |
| 87 | = b.raw 0x14000000 s0.26 ; C6.2.35 |
| 88 | = b.c.raw 0x54000000 i0.4 s5.19 ; C6.2.34 (cond, distance) |
| 89 | = cbz.x.raw 0xb4000000 r0 s5.19 ; C6.2.78 |
| 90 | = cbz.w.raw 0x34000000 r0 s5.19 |
| 91 | = cbnz.x.raw 0xb5000000 r0 s5.19 ; C6.2.77 |
| 92 | = cbnz.w.raw 0x35000000 r0 s5.19 |