Spin bytecodes -------------- 00 ldfrmr - Load call frame with return value required 01 ldfrm - Load call frame 02 ldfrmar - Load call frame with abort trap and return value required 03 ldfrma - Load call frame with abort trap 04 jmp offset - Jump to signed object offset 05 call methnum - Call method 06 callobj methnum, objnum - Call method in object 07 callobjx methnum, objnum - Call method in object with index 08 tjz offset - Test and jump if zero 09 djnz offset - Decrement and jump if not zero 0a jz offset - Jump if zero 0b jnz offset - Jump if not zero 0c casedone - Case done without a match 0d casevalue - Execute if value matches case value 0e caserange - Execute if case value within range 0f lookdone - Look up/down done without a match 10 lookupval - 11 lookdnval 12 lookuprng 13 lookdnrng 14 pop - Discard N bytes from the stack 15 run - Prepare new spin cog stack for execution 16 strsize - Determine the size of a string 17 strcomp - Compare two strings 18 bytefill - Fill memory with a constant byte value 19 wordfill - Fill memory with a constant word value 1a longfill - Fill memory with a constant long value 1b waitpeq - Wait till pins are equal to a specified value 1c bytemove - Copy bytes to a new location 1d wordmove - Copy words to a new location 1e longmove - Copy longs to a new location 1f waitpne - Wait till pins are not equal to a specified value 20 clkset - Change the clock frequency and mode 21 cogstop - Stop the specified cog 22 lockret - Return a lock 23 waitcnt - Wait for cnt to equal a specified value 24 ldlsx 25 stlsx 26 exlsx 27 waitvid - Wait on video 28 coginitret - Start a cog and return the cog number on the stack 29 locknewret - Allocate a lock and return the lock number on the stack 2a locksetret - Set a lock and return the previous value on the stack 2b lockclrret - Clear a lock and return the previous value on the stack 2c coginit - Start a cog 2d locknew - Allocate a lock without returning the lock number 2e lockset - Set a lock without returning its previous value 2f lockclr - Clear a lock without returning its previous value 30 abort - Perform an abort by returning until an abort trap is found 31 abortval - Perform an abort and load a return value on the stack 32 ret - Return without loading a return value 33 retval - Return and load a return value on the stack 34 ldlim1 - Load a minus 1 35 ldli0 - Load zero 36 ldli1 - Load 1 37 ldlip - Load a packed byte 38 ldbi - Load a byte 39 ldwi - Load two bytes 3a ldmi - Load three bytes 3b ldli - Load four bytes 3c lmm - Execute LMM PASM code under SpinLMM (Previously undefined) 3d ldregbit - Load a bit from a register 3d stregbit - Store a bit to a register 3e ldregbits - Load bits from a register 3e stregbits - Store bit to a register 3f ldreg - Load a register 3f streg - Store a register 40 ldlvc - Load long variable compact 41 stlvc - Store long variable compact 42 exlvc - Execute on a long variable compact 43 lalvc - Load address of a long variable compact 60 ldllc - Load long local compact 61 stllc - Store long local compact 62 exllc - Execute on a long local compact 63 lallc - Load address of a long local compact 80 ldba - Load byte absolute 81 stba - Store byte absolute 82 exba - Execute on a byte absolute 83 laba - Load address of a byte absolute 84 ldbo - Load byte object offset 85 stbo 86 exbo 87 labo 88 ldbv - Load byte variable offset 89 stbv 8a exbv 8b labv 8c ldbl - Load byte local offset 8d stbl 8e exbl 8f labl 90 ldbax - Load byte absolute with index 91 stbax 92 exbax 93 labax 94 ldbox 95 stbox 96 exbox 97 labox 98 ldbvx 99 stbvx 9a exbvx 9b labvx 9c ldblx 9d stblx 9e exblx 9f lablx a0 ldwa a1 stwa a2 exwa a3 lawa a4 ldwo a5 stwo a6 exwo a7 lawo a8 ldwv a9 stwv aa exwv ab lawv ac ldwl ad stwl ae exwl af lawl b0 ldwax b1 stwax b2 exwax b3 lawax b4 ldwox b5 stwox b6 exwox b7 lawox b8 ldwvx b9 stwvx ba exwvx bb lawvx bc ldwlx bd stwlx be exwlx bf lawlx c0 ldla c1 stla c2 exla c3 lala c4 ldlo c5 stlo c6 exlo c7 lalo c8 ldlv c9 stlv ca exlv cb lalv cc ldll cd stll ce exll cf lall d0 ldlax d1 stlax d2 exlax d3 lalax d4 ldlox d5 stlox d6 exlox d7 lalox d8 ldlvx d9 stlvx da exlvx db lalvx dc ldllx dd stllx de exllx df lallx e0 ror - Rotate right e1 rol - Rotate left e2 shr - Shift right e3 shl - Shift left e4 min - Maximum e5 max - Minimum e6 neg - Negate e7 com - Compliment e8 and - Bitwise and e9 abs - Absolute value ea or - Bitwise or eb xor - Bitwise exclusive or ec add - Add ed sub - Subtract ee sar - Shift arithmetic right ef rev - Bit reverse f0 andl - Logical and f1 encode - Shift "1" left f2 orl - Logical or f3 decode - Find left-most "1" bit f4 mul - Multiply f5 mulh - Multiply high f6 div - Divide f7 mod - Modulus f8 sqrt - Square root f9 cmplt - Less than fa cmpgt - Greater than fb cmpne - Not equal fc cmpeq - Equal fd cmple - Less than or equal fe cmpge - Greater than or equal ff notl - Logical not Extended opcodes ---------------- 00 store - Store the value 02 repeat - Repeat index from first to last 06 repeats - Repeat index from first to last with step 08 randf - Forward random number 0c randr - Reverse random number 10 sexb - Sign extend byte 14 sexw - Sign extend word 18 postclr - Post clear to zero 1c postset - Post set to all ones 26 preinc - Pre-increment 2e postinc - Post-increment 36 predec - Pre-decrement 3e postdec - Post-decrement