3 Eight completely symmetric general-purpose registers (r0-7)
4 Special registers: pc, it (accumulator), data1 (segment), data2 (segment), code (segment)
8 0000_0000 TRAP (invalid)
11 0100 JABS jump absolute to code[it]
12 0101 CABS call absolute code[it], it <- return addr, code <- return segment
13 0110 JOFF jump pc ± it
14 0111 COFF call pc ± it, it <- return offset (-it + 1)
16 0000_1aaa SWAP a <- it, it <- a
20 0010_0000 GET1 it <- data1
23 0011 (reserved for another special register)
28 1011 (reserved for another special register)
31 0011_0ooo ALU1 it <- {zero, lsl1, lsr1, asr1, incr, decr, comp, negt} it
32 1aaa ISLT "is less than", for testing overflow / carries: it <- (it < a) ? 1 : 0
33 01oo_oaaa ALUR it <- it {addr, subr, andr, iorr, xorr, lslr, lsrr, asrr} a
35 100i_0aaa LD1U it <- data1[a], then a += i
36 0i_1aaa ST1U it <- data1[a], then a -= i
37 1i_0aaa LD2U it <- data2[a], then a += i
38 1i_1aaa ST2U it <- data2[a], then a -= i
43 1111_00oo iiiiiiii ALUI it <- it {andi, iori, xori, (see below)} i
44 0011 0iiiiiii ALUI it <- it + i (ADDI)
45 0011 10oooiii ALUI it <- it {roli, lsli, lsri, asri, clri, seti, togi, exti} i
46 0011 11iiiiii ALUI it <- it + (whole field, thus allowing many negative numbers) (ADDI)
47 0100 iiiiiiii BEZI branch ±i if it == 0
48 0101 iiiiiiii (reserved branch; SUB2, BLTI is no faster than ISLT, BEZI)
49 0110 iiiiiiii JOFI jump to ±i
50 0111 iiiiiiii COFI call ±i, it <- return offset (-it + 2)
51 1xxx iiiiiiii (reserved w/ immediate)
54 Some dubiously "nice" properties:
56 - 1111_xxxx takes immediate
57 - No reg/imm ops, so data line can be the immediate
58 - Two data segments, because I'm generous like that
59 - get/set pairs consistently differentiated by bit 5
60 - jump/call pairs differentiated by bit 0
61 - The nicest instruction is "ADDR r5"
62 - Near and far calls (okay, this is not nice)
70 # main result in it, carry in r1
71 # more work to make a full adder though
73 # Half-subtractor it - r0
78 # main result in it, carry in r0
79 # more work to make a full subtracter