Instruction Reference

c0 Instruction Formats

  • OOOO OOOO (All instructions)

    • 0SSO OOOO / 10SS OOOO (Normal instructions)
      • All normal instructions affect the entire stack according to the S bits
        • Instructions 1011 0000 - 1011 0111 have an SS of 00.
          • These are used for preserving DCs between calls.
        • Instructions 1011 1000 - 1011 1111 have an SS of 10.
      • 0010 LLLL (Conveyor instruction)
        • Reads and synchronizes with conveyor index location
      • 0011 10LL (Loop index)
        • Places the index from the loop of depth location on the dstack
      • 0SSO OOLL (DC instructions)
        • Operates using specifically the DC of index location
    • 11OL LLLL (Random access instructions)
      • 110L LLLL (Rotate)
        • dstack item of depth location rotated to top of dstack
        • Only elements above the rotate are pushed down
      • 111L LLLL (Copy)
        • dstack item of depth location copied to top of dstack
        • Entire stack is pushed down
  • O - Opcode bit

  • S - Stack bit

  • L - Location bit

Stack bits

  • 00 - The dstack is not popped or pushed.
  • 01 - The dstack is pushed once.
  • 10 - The dstack is popped once.
  • 11 - The dstack is popped twice.

Key

  • WORD - Data word width in use
  • c - Carry bit
  • cv - Conveyor Belt
  • dc[0-3] - Data Counters
  • pc - Program Counter
  • iflag - Interrupt Flag
  • i[0-3] - Loop Indices
  • cv[0-F] - Conveyor Belt Values
  • ls - lstack
    • Format is (beginning, end, iterations, iterator)
  • if - ifile
  • n.. - n anonymous words on the stack
  • imm - Immediate value

Instruction Listing By Opcode

OpInstructionOctetsdstackSide Effects
00 - 03move#2--dc# += imm
04 - 07raread#1a -- mem[dc# + a]
08 - 0Brereadi#2--cv <- mem[mem[dc#] + imm]
0Cinc1a -- (a + 1)c, o
0Ddec1a -- (a - 1)c, o
0Ecarry1v -- (v + c)c, o
0Fborrow1v -- (v + c - 1)c, o
10inv1v -- ~v
11break1--Pops the lstack and goes to end of loop
12return1--pop cstack
13continue1--Goes to the next loop iteration
14inten1--Enables only selected interrupts
15intrecv1--Interrupt sync; cv <- bus, v
16iloop3--ls <- pc + 1, pc + imm, ∞, 0
17kill1--Kill all selected cores
18intwait1--Waits for an interrupt before continuing
19getbp1b -- permGets the permission on bus b
1Agetba1b -- addrGets the address on bus b
1Bcalli1 + WORD--pc = imm; push cstack
1Cjmpi1 + WORD--pc = imm
1Dbra3--pc += imm
1Ediscard1--Discard the top loop without going to the end
1Fcallri3--pc += imm; push cstack
20 - 2Fcv#1-- cv#cv# synchronizes
30 - 33read#2-- mem[dc#]dc# += imm
34 - 37rareadi#2-- mem[dc# + imm]
38 - 3Bget#1-- dc#
3C - 3Fi#1-- i#
40 - 43writepre#2v --dc# += imm; mem[dc#] = v
44 - 47writepst#2v --mem[dc#] = v; dc# += imm
48 - 4Bset#1a --dc# = a
4C - 4Frawritei#2v --mem[dc# + imm] = v
50 - 53rewritei#2v --mem[mem[dc#] + imm] = v
54 - 57reread#1a --cv <- mem[mem[dc#] + a]
58add1a b -- (a + b)c, o
59sub1a b -- (a - b)c, o
5Alsl1a b -- (a << b)
5Blsr1a b -- (a >> b)
5Ccsl1a b -- ((a << b) or (a >> (b - WORD)))
5Dcsr1a b -- ((a >> b) or (a << (b - WORD)))
5Easr1a b -- (a >>> b)
5Fand1a b -- (a & b)
60 - 63rewrite#1v a --mem[mem[dc#] + a] = v
64 - 67rawrite#1v a --mem[dc# + a] = v
68write1v a --mem[a] = v
69writep1v a --progmem[a] = v
6Awritepo1o a --progmem[a] = o
6Bwriteps1s a --progmem[a] = s
6Cbeq3a b --if a == b then pc += imm
6Dbne3a b --if a != b then pc += imm
6Ebles3a b --if a < b then pc += imm
6Fbleq3a b --if a <= b then pc += imm
70blesu3a b --if a < b then pc += imm
71blequ3a b --if a <= b then pc += imm
72recv1n a --Stream in to a; cv <- bus
73send1n a --Stream n words to buses from mem[a]
74incept1n a --Incept target cores from main mem; see send
75set1m s --Clear ifile and set register s to m
76sel1m s --Ors m with register s of ifile
77setpa1perm addr --Sets UARC permission and address delegation
78expect1v b --Send v to bus b; cv <- response
79sef1a f --Sets fault f handler to a
7Areset1_ _ --Resets the core
7Bddrop1_ _ --Drops two elements from the stack
7Csendp1n a --Stream n words to buses from progmem[a]
7Dinceptp1n a --Incept target cores from program mem; see send
7ERESERVED1_ _ --
7FRESERVED1_ _ --
80addi1 + WORDa -- (a + imm)c, o
81addi82a -- (a + imm)c, o
82addi163a -- (a + imm)c, o
83subi1 + WORDa -- (imm - a)c, o
84lsli2a -- (a << imm)
85csli2a -- ((a << imm) or (a >> (imm - WORD)))
86asri2a -- (a >>> imm)
87andi1 + WORDa -- (a & b)
88ori1 + WORDa -- (a or b)
89xori1 + WORDa -- (a ^ b)
8Abc3--if c then pc += imm
8Bbnc3--if ~c then pc += imm
8Cbo3--if o then pc += imm
8Dbno3--if ~o then pc += imm
8Ebi3--if i then pc += imm; i = 0
8Fbni3--if ~i then pc += imm; i = 0
90 - 93index#2-- (dc# + imm)
94imm82-- imm
95imm163-- imm
96imm325-- imm
97imm649-- immOnly supported on u0-64
98getp1-- permGet UARC permission
99geta1-- addrGet UARC address
9ARESERVED1-- _
9BRESERVED1-- _
9CRESERVED1-- _
9DRESERVED1-- _
9ERESERVED1-- _
9FRESERVED1-- _
A0or1a b -- (a or b)
A1xor1a b -- (a ^ b)
A2read1a --cv <- mem[a]
A3call1a --pc = a; push cstack
A4jmp1a --pc = a
A5intset1p --Set selected interrupt addresses to p
A6seb1b --Set a single bus
A7slb1b --Select an additional UARC bus
A8usb1b --Unselect a UARC bus
A9intsend1v --Send value to selected buses
AAloop3n --ls <- pc + 1, pc + imm, n, 0
ABbz3n --if n == 0 then pc += imm
ACbnz3n --if n != 0 then pc += imm
ADwritepi1 + WORDv --Writes v to instruction memory at imm
AEwritepri3v --progmem[pc + imm] = v
AFdrop1_ --Drops one element from the stack
B0 - B3push#1--Pushes dc# onto the astack
B4 - B7pop#1--Pops dc# from the astack
B8ba3b --Branch if an interrupt is available on bus b
B9bna3b --Branch if an interrupt is not available on bus b
BAwritepori3o --progmem[pc + imm] = o
BBwritepsri3s --progmem[pc + imm] = s
BCRESERVED1_ --
BDRESERVED1_ --
BERESERVED1_ --
BFRESERVED1_ --
C0 - DFrot#v #.. -- #.. v
E0 - FFcopy#v #.. -- v #.. v