A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | PARALLAX PROPELLER P2 ASSEMBLER INSTRUCTION SUMMARY | ||||||||||||||||
2 | iiiiii | zcr | i | cccc | ddddddddd | sssssssss | Instruction | Operand(s) | Description | Z Result | C Result | R Result | Clocks | Dlyd | |||
3 | %000000 | %000 | p | cccc | ddddddddd | sssssssss | WRBYTE | D, S | Write from cog D[7..0] to hub byte S[16..0] | --- | --- | Not Written | 1..8 | ||||
4 | %000000 | %001 | p | cccc | ddddddddd | sssssssss | RDBYTE | D, S | Read into cog D(0-extended) from hub byte S[16..0] | Result = 0 | --- | Written | 3..10 | ||||
5 | %000000 | %011 | p | cccc | ddddddddd | sssssssss | RDBYTEC | D, S | Read into cog D(0-extended) from hub byte S[16..0] using QuadCache | Result = 0 | --- | Written | 1, 3..10 | ||||
6 | %000001 | %000 | p | cccc | ddddddddd | sssssssss | WRWORD | D, S | Write from cog D[15..0] to hub word S[16..1] | --- | --- | Not Written | 1..8 | ||||
7 | %000001 | 1 | p | cccc | ddddddddd | sssssssss | RDWORD | D, S | Read into cog D(0-extended) from hub word S[16..1] | Result = 0 | --- | Written | 3..10 | ||||
8 | %000001 | 11 | p | cccc | ddddddddd | sssssssss | RDWORDC | D, S | Read into cog D(0-extended) from hub word S[16..1] using QuadCache | Result = 0 | --- | Written | 1, 3..10 | ||||
9 | %000010 | 0 | p | cccc | ddddddddd | sssssssss | WRLONG | D, S | Write from cog D[31..0] to hub long S[16..2] | --- | --- | Not Written | 1..8 | ||||
10 | %000010 | 1 | p | cccc | ddddddddd | sssssssss | RDLONG | D, S | Read into cog D[31..0] from hub long S[16..2] | Result = 0 | --- | Written | 3..10 | ||||
11 | %000010 | 11 | p | cccc | ddddddddd | sssssssss | RDLONGC | D, S | Read into cog D[31..0] from hub long S[16..2] using QuadCache | Result = 0 | --- | Written | 1, 3..10 | ||||
12 | %000011 | 0 | 1 | cccc | ddddddddd | %000000000 | CLKSET | D | Set CLK to D | --- | --- | Not Written | 1..8 | ||||
13 | %000011 | 1 | 1 | cccc | ddddddddd | %000000001 | COGID | D | Get this COG number (0..7) into D | --- | --- | Written | 2..9 | ||||
14 | %000011 | 0 | 1 | cccc | ddddddddd | %000000011 | COGSTOP | D | Stop COG number (0..7) in D[2..0] | --- | --- | Not Written | 1..8 | ||||
15 | %000011 | zc1 | 1 | cccc | ddddddddd | %000000100 | LOCKNEW | D | Checkout a new LOCK number (0..7) into D | No LOCK free | 2..9 | ||||||
16 | %000011 | 0 | 1 | cccc | ddddddddd | %000000101 | LOCKRET | D | Return LOCK number D[2..0] | 1..8 | |||||||
17 | %000011 | 10 | 1 | cccc | ddddddddd | %000000110 | LOCKSET | D | Set LOCK number D[2..0] | Prev LOCK state | 2..9 | ||||||
18 | %000011 | 10 | 1 | cccc | ddddddddd | %000000111 | LOCKCLR | D | Clear LOCK number D[2..0] | Prev LOCK state | 2..9 | ||||||
19 | %000011 | 0 | 1 | cccc | 0 | %000001000 | CASHEX | Invalidate QuadCache | --- | --- | Not Written | 1 | |||||
20 | %000011 | zcr | 1 | cccc | 1 | %000001000 | CLRACCA | Zero Multiply Accumulator A (ACCA). | |||||||||
21 | %000011 | zcr | 1 | cccc | 10 | %000001000 | CLRACCB | Zero Multiply Accumulator B (ACCB). | |||||||||
22 | %000011 | zcr | 1 | cccc | 11 | %000001000 | CLRACCS | Zero both multiply accumulators (accumulator A and B). | |||||||||
23 | %000011 | zcr | 1 | cccc | 101 | %000001000 | FITACCA | Shifts accumulator A’s high long right into the low long so that the high long is MSB justified (discarding the low bits). Accumulator A’s high long is then replaced with the number of bit places required to MSB justify Accumulator A’s original value. | |||||||||
24 | %000011 | zcr | 1 | cccc | 110 | %000001000 | FITACCB | Shifts accumulator B’s high long right into the low long so that the high long is MSB justified (discarding the low bits). Accumulator B’s high long is then replaced with the number of bit places required to MSB justify Accumulator B’s original value. | |||||||||
25 | %000011 | zcr | 1 | cccc | 111 | %000001000 | FITACCS | Similar operation to FITACCA/FITACCB. Examines both accumulator A and B and right shifts both accumulators so that the greater value of the two accumulators is MSB justified. The number of bits shifted is written to both accumulator’s high long. This has the effect of scaling both accumulators equally. | |||||||||
26 | %000011 | zc0 | 1 | cccc | ddddddddd | %000001001 | SNDSER | D | Sends a long (D) out of the special chip-to-chip serial port. Blocks until the long is sent. Use C flag to avoid blocking. | ||||||||
27 | %000011 | zc1 | 1 | cccc | ddddddddd | %000001001 | RCVSER | D | Receives a long (D) in from the special chip-to-chip serial port. Blocks until the long is received. Use C flag to avoid blocking. | ||||||||
28 | %000011 | zcr | 1 | cccc | ddddddddd | %000001010 | PUSHZC | D | Push the Z and C flags into D[1:0] and pop D[31:30] into Z and C through WZ and WC. | ||||||||
29 | %000011 | zcr | 1 | cccc | ddddddddd | %000001011 | POPZC | D | Pop D[1:0] into the Z and C flags and push D[31:30] into Z and C through WZ and WC. | ||||||||
30 | %000011 | zcr | 1 | cccc | ddddddddd | %000001100 | SUBCNT | D | Subtracts the system count value when the GETCNT instruction was last executed from the current system count value. Results are stored in the register referenced by “D (0-511)”. If a roll over occurs between accesses TOP-1 is stored. | ||||||||
31 | %000011 | zcr | 1 | cccc | ddddddddd | %000001101 | GETCNT | D | Get D= CNT[31..0]; if repeated immediately gets D= CNT[63..31] | ||||||||
32 | %000011 | zcr | 1 | cccc | ddddddddd | %000001110 | GETACCA | D | Get D=ACCA[31..0]; if repeated immediately gets D=ACCA[63..31] | ||||||||
33 | %000011 | zcr | 1 | cccc | ddddddddd | %000001111 | GETACCB | D | Get D=ACCB[31..0]; if repeated immediately gets D=ACCB[63..31] | ||||||||
34 | %000011 | zcr | 1 | cccc | ddddddddd | %000010000 | GETLFSR | D | Get D=LFSR | ||||||||
35 | %000011 | z01 | 1 | cccc | ddddddddd | %000010001 | GETTOPS | D | Get top bytes of QUADs into D | Result = 0 | --- | Written | 1 | ||||
36 | %000011 | zcr | 1 | cccc | ddddddddd | %000010010 | GETPTRA | D | Get PTRA into D, C = PTRA[16] | PTRA[16] | 1 | ||||||
37 | %000011 | zcr | 1 | cccc | ddddddddd | %000010011 | GETPTRB | D | Get PTRB into D, C = PTRB[16] | PTRB[16] | 1 | ||||||
38 | %000011 | zcr | 1 | cccc | ddddddddd | %000010100 | GETPIX | D | Get Texture Pointer address into D | ||||||||
39 | %000011 | zc0 | 1 | cccc | 0 | %000010101 | CHKSPD | Compare SPA==SPB (CLUT/FIFO stack pointers) | SPA==SPB | SPA<SPB | 1 | ||||||
40 | %000011 | zc1 | 1 | cccc | ddddddddd | %000010101 | GETSPD | D | Get ((SPA-SPB) & 0x7F) into D (CLUT/FIFO stack pointers) | SPA==SPB | SPA<SPB | 1 | |||||
41 | %000011 | zc0 | 1 | cccc | 0 | %000010110 | CHKSPA | Compare SPA==0 (CLUT/FIFO stack pointers) | SPA==0 | SPA[7] | 1 | ||||||
42 | %000011 | zc1 | 1 | cccc | ddddddddd | %000010110 | GETSPA | D | Get SPA into D (CLUT/FIFO stack pointers) | SPA==0 | SPA[7] | 1 | |||||
43 | %000011 | zc0 | 1 | cccc | 0 | %000010111 | CHKSPB | Compare SPB==0 (CLUT/FIFO stack pointers) | SPB==0 | SPB[7] | 1 | ||||||
44 | %000011 | zc1 | 1 | cccc | ddddddddd | %000010111 | GETSPB | D | Get SPB into D (CLUT/FIFO stack pointers) | SPB==0 | SPB[7] | 1 | |||||
45 | %000011 | zc1 | 1 | cccc | ddddddddd | %000011000 | POPAR | D | Read CLUT[SPA++] into D (CLUT/FIFO) | D[31] | 1 | ||||||
46 | %000011 | zc1 | 1 | cccc | ddddddddd | %000011001 | POPBR | D | Read CLUT[SPB++] into D (CLUT/FIFO) | D[31] | 1 | ||||||
47 | %000011 | zc1 | 1 | cccc | ddddddddd | %000011010 | POPA | D | Read CLUT[--SPA] into D (CLUT/FIFO) | D[31] | 1 | ||||||
48 | %000011 | zc1 | 1 | cccc | ddddddddd | %000011011 | POPB | D | Read CLUT[--SPB] into D (CLUT/FIFO) | D[31] | 1 | ||||||
49 | %000011 | zc0 | 1 | cccc | 0 | %000011100 | RETA | Jump: Set PC=CLUT[--SPA] Flush pipeline(2) (CLUT/FIFO) | 2+2? | ||||||||
50 | %000011 | zc0 | 1 | cccc | 0 | %000011101 | RETB | Jump: Set PC=CLUT[--SPB] Flush pipeline(2) (CLUT/FIFO) | 2+2? | ||||||||
51 | %000011 | zc0 | 1 | cccc | 0 | %000011110 | RETAD | Delayed(2) Jump: Set PC=CLUT[--SPA] (CLUT/FIFO) | 1? | 2 | |||||||
52 | %000011 | zc0 | 1 | cccc | 0 | %000011111 | RETBD | Delayed(2) Jump: Set PC=CLUT[--SPB] (CLUT/FIFO) | 1? | 2 | |||||||
53 | %000011 | zcr | 1 | cccc | ddddddddd | %000100000 | DECOD5 | D | Overwrite D = decoded D[4:0] repeated x1 | ||||||||
54 | %000011 | zcr | 1 | cccc | ddddddddd | 100001 | DECOD4 | D | Overwrite D = decoded D[3:0] repeated x2 | ||||||||
55 | %000011 | zcr | 1 | cccc | ddddddddd | 100010 | DECOD3 | D | Overwrite D = decoded D[2:0] repeated x4 | ||||||||
56 | %000011 | zcr | 1 | cccc | ddddddddd | 100011 | DECOD2 | D | Overwrite D = decoded D[1:0] repeated x8 | ||||||||
57 | %000011 | zcr | 1 | cccc | ddddddddd | 100100 | BLMASK | D | Overwrite D = bit length mask specified by D[5:0] | ||||||||
58 | %000011 | zcr | 1 | cccc | ddddddddd | 100101 | NOT | D | Overwrite D = bitwise inverted D[31..0] | ||||||||
59 | %000011 | zcr | 1 | cccc | ddddddddd | 100110 | ONECNT | D | Overwrite D = count of 1's in D[31..0] | ||||||||
60 | %000011 | zcr | 1 | cccc | ddddddddd | 100111 | ZERCNT | D | Overwrite D = count of 0's in D[31..0] | ||||||||
61 | %000011 | zcr | 1 | cccc | ddddddddd | 101000 | INCPAT | D | Overwrite D = next bit pattern with same number of 1's and 0's in D[31..0] | ||||||||
62 | %000011 | zcr | 1 | cccc | ddddddddd | 101001 | DECPAT | D | Overwrite D = previous bit pattern with same number of 1's and 0's in D[31..0] | ||||||||
63 | %000011 | zcr | 1 | cccc | ddddddddd | 101010 | BINGRY | D | Overwrite D = Gray Code of the binary in D[31..0] | ||||||||
64 | %000011 | zcr | 1 | cccc | ddddddddd | 101011 | GRYBIN | D | Overwrite D = binary of the Gray Code in D[31..0] | ||||||||
65 | %000011 | zcr | 1 | cccc | ddddddddd | 101100 | MERGEW | D | Overwrite D = Merge (interleave) high and low words in D[31..0] (low word -> bits 0,2,4+ high word -> bits 1, 3, 5+) | ||||||||
66 | %000011 | zcr | 1 | cccc | ddddddddd | 101101 | SPLITW | D | Overwrite D = Split (de-interleave) high and low words in D[31..0] (low word <- bits 0,2,4+ high word <- bits 1, 3, 5+) | ||||||||
67 | %000011 | zcr | 1 | cccc | ddddddddd | 101110 | SEUSSF | D | Overwrite D = a pseudo random bit pattern seeded from D[31..0] (after 32 forward iterations, original bit pattern is returned) | ||||||||
68 | %000011 | zcr | 1 | cccc | ddddddddd | 101111 | SEUSSR | D | Overwrite D = a pseudo random bit pattern seeded from D[31..0] (after 32 reversed iterations, original bit pattern is returned) | ||||||||
69 | %000011 | zcr | 1 | cccc | ddddddddd | 110000 | GETMULL | D | Get MUL[31..0] into D (lower long of 32x32 multiply; waits if not ready) | ||||||||
70 | %000011 | zcr | 1 | cccc | ddddddddd | 110001 | GETMULH | D | Get MUL[63..32] into D (higher long of 32x32 multiply; waits if not ready) | ||||||||
71 | %000011 | zcr | 1 | cccc | ddddddddd | 110010 | GETDIVQ | D | Get QUOTIENT[31..0] into D (quotient of divide; waits if not ready) | ||||||||
72 | %000011 | zcr | 1 | cccc | ddddddddd | 110011 | GETDIVR | D | Get REMAINDER[31..0] into D (remainder of divide; waits if not ready) | ||||||||
73 | %000011 | zcr | 1 | cccc | ddddddddd | 110100 | GETSQRT | D | Get SQRT[31..0] into D (square root value; waits if not ready) | ||||||||
74 | %000011 | zcr | 1 | cccc | ddddddddd | 110101 | GETQX | D | Get CORDIC X into D (waits if not ready) | ||||||||
75 | %000011 | zcr | 1 | cccc | ddddddddd | 110110 | GETQY | D | Get CORDIC Y into D (waits if not ready) | ||||||||
76 | %000011 | zcr | 1 | cccc | ddddddddd | 110111 | GETQZ | D | Get CORDIC Z into D (waits if not ready) | ||||||||
77 | %000011 | zcr | 1 | cccc | ddddddddd | 111000 | GETPHSA | D | Get PHSA into D | ||||||||
78 | %000011 | zcr | 1 | cccc | ddddddddd | 111001 | GETPHZA | D | Get PHSA into D and clear PHSA=0 | ||||||||
79 | %000011 | zcr | 1 | cccc | ddddddddd | 111010 | GETCOSA | D | Get COSA into D | ||||||||
80 | %000011 | zcr | 1 | cccc | ddddddddd | 111011 | GETSINA | D | Get SINA into D | ||||||||
81 | %000011 | zcr | 1 | cccc | ddddddddd | 111100 | GETPHSB | D | Get PHSB into D | ||||||||
82 | %000011 | zcr | 1 | cccc | ddddddddd | 111101 | GETPHZB | D | Get PHSB into D and clear PHSB=0 | ||||||||
83 | %000011 | zcr | 1 | cccc | ddddddddd | 111110 | GETCOSB | D | Get COSB into D | ||||||||
84 | %000011 | zcr | 1 | cccc | ddddddddd | 111111 | GETSINB | D | Get SINB into D | ||||||||
85 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 01001mmmm | JMPTASK | D/#n,#mask | Set PC's in mask to 0..511 (r=1 for #n) | 1 | |||||||
86 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 0100iiiii | REPD | D/#n | Repeat D/#n loops of following #i[4..0] instructions Delayed(3) | 3 | |||||||
87 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 10100000 | NOPX | D/#n | Repeat NOP D/#n times | ||||||||
88 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 10100001 | SETZC | D/#n,#i | Set Z and C flags = D[1:0] using WZ and WC | ||||||||
89 | %000011 | zcn | 1 | cccc | dnnnnnnnn | 10100010 | SETSPA | D/#n | Set SPA = D/#n[7..0] (r=1 for #n) | 1 | |||||||
90 | %000011 | zcn | 1 | cccc | dnnnnnnnn | 10100011 | SETSPB | D/#n | Set SPB = D/#n[7..0] (r=1 for #n) | 1 | |||||||
91 | %000011 | zcn | 1 | cccc | dnnnnnnnn | 10100100 | ADDSPA | D/#n | Add SPA += D/#n[7..0] (r=1 for #n) | 1 | |||||||
92 | %000011 | zcn | 1 | cccc | dnnnnnnnn | 10100101 | ADDSPB | D/#n | Add SPB += D/#n[7..0] (r=1 for #n) | 1 | |||||||
93 | %000011 | zcn | 1 | cccc | dnnnnnnnn | 10100110 | SUBSPA | D/#n | Subtract SPA -= D/#n[7..0] (r=1 for #n) | 1 | |||||||
94 | %000011 | zcn | 1 | cccc | dnnnnnnnn | 10100111 | SUBSPB | D/#n | Subtract SPB -= D/#n[7..0] (r=1 for #n) | 1 | |||||||
95 | %000011 | 0 | 1 | cccc | ddddddddd | 10101000 | PUSHAR | D/#n | Push CLUT[--SPA] = D/#n (r=1 for #n) | 1 ** +1 | |||||||
96 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 10101001 | PUSHBR | D/#n | Push CLUT[--SPB] = D/#n (r=1 for #n) | 1..2 | |||||||
97 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 10101010 | PUSHA | D/#n | Push CLUT[SPA++] = D/#n (r=1 for #n) | 1..2 | |||||||
98 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 10101011 | PUSHB | D/#n | Push CLUT[SPB++] = D/#n (r=1 for #n) | 1..2 | |||||||
99 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 10101100 | CALLA | D/#n | Call: CLUT[SPA++] = PC, PC = D/#n, flush pipeline(2) (r=1 for #n) | 4..5? | |||||||
100 | %000011 | zcn | 1 | cccc | nnnnnnnnn | 10101101 | CALLB | D/#n | Call: CLUT[SPB++] = PC, PC = D/#n, flush pipeline(2) (r=1 for #n) | 4..5? |