| Mnemonic |
Byte |
Command or |
Num of |
Comment |
|
(Decimal) |
Reporter |
Args |
|
| code-end |
0 |
c |
0 |
terminates code. |
| byte |
1 |
r |
1 immediate byte |
pushes 16-bit number on stack. takes one immediate byte as
number in code stream (resulting number is 16-bit representation of 0
- 255). |
| number |
2 |
r |
2 immediate bytes |
pushes 16-bit number on stack. takes two immediate bytes as
number in code stream. |
| list |
3 |
c |
0 |
"start of list"; opens a code block |
| eol |
4 |
c |
0 |
"end of list"; closes a code block |
| eolr |
5 |
r |
0 |
"end of list reporter"; closes a code block that will return a
value (e.g, for when, waituntil) |
| lthing |
6 |
r |
1 |
"local thing"; uses stack frame to retrieve proc args |
| stop | 7 | c | 0 |
stops currently running procedure, returning control to caller |
| output | 8 | c | 1 |
stops currently running procedure, returning value to caller |
| repeat | 9 | c | 2 |
repeats block for specific number of times |
| if | 10 | c | 2 |
if input expression is true, executes block |
| ifelse | 11 | c | 3 |
if input expression is true, executes block1, else executes block2 |
| beep | 12 | c | 0 | causes
Cricket to beep |
| note | 13 | c | 2 |
makes Cricket play note of specified pitch and duration |
| waituntil | 14 | c | 1 |
repeatedly executes block until it evaluates to true |
| loop | 15 | c | 1 | indefinitely
executes block |
| wait | 16 | c | 1 |
waits for specified time period |
| timer | 17 | r | 0 |
returns value of free-running timer |
| resett | 18 | c | 0 |
resets free-running timer to zero |
| send | 19 | c | 1 |
sends specified value out IR port, with 0.1 sec trailing delay |
| ir | 20 | r | 0 |
reports value of most recently received IR byte |
| newir? | 21 | r | 0 |
reports whether IR value has been received since last call to "ir" |
| random | 22 | r | 0 | reports
pseudorandom 16 bit value |
| + | 23 | r | 2 | reports sum of
two inputs |
| - | 24 | r | 2 | reports
difference of two imputs |
| * | 25 | r | 2 | reports product
of two inputs |
| / | 26 | r | 2 | reports division
of two inputs |
| % | 27 | r | 2 | reports remainder
of division of two inputs |
| = | 28 | r | 2 | reports boolean
equality of two inputs |
| > | 29 | r | 2 | reports boolean
"greater than" of two inputs |
| < | 30 | r | 2 | reports boolean
"less than" of two inputs |
| and | 31 | r | 2 |
reports bitwise AND of two inputs |
| or | 32 | r | 2 |
reports bitwise OR of two inputs |
| xor | 33 | r | 2 |
reports bitwise XOR of two inputs |
| not | 34 | r | 1 |
reports (0x0001 and (input XOR 0x0001)). In other words, does a
NOT on the low bit and reports just that low bit.
If you need bitwise not, XOR with 0xffff. |
| setglobal | 35 | c | 2 |
sets numbered global to value |
| global | 36 | r | 1 | reports
value of numbered global |
| aset | 37 | c | 3 |
sets numbered array with numbered element to value |
| aget | 38 | r | 2 |
reports value of numbered element of numbered array |
| record | 39 | c | 1 |
records 8-bit value into data buffer |
| recall | 40 | r | 0 |
reports 8-bit value stored in data buffer |
| resetdp | 41 | c | 0 |
resets data buffer pointer to zero |
| setdp | 42 | c | 1 | sets data
buffer pointer to specified value |
| erase | 43 | c | 1 |
erases data point |
| when | 44 | c | 2 |
sets up daemon with condition block and action block |
| whenoff | 45 | c | 0 | terminates
"when" daemon |
| a, | 46 | c | 0 |
selects motor A for control |
| b, | 47 | c | 0 |
selects motor B for control |
| ab, | 48 | c | 0 |
selects motors A and B |
| on | 49 | c | 0 |
turns on selected motor(s) |
| onfor | 50 | c | 1 |
turns on selected motor(s) for specified period of time |
| off | 51 | c | 0 |
turns off selectec motor(s) |
| thisway | 52 | c | 0 | sets
selected motor(s) direction to green LED |
| thatway | 53 | c | 0 |
sets selected motor(s) direction to red LED |
| rd | 54 | c | 0 | reverses
direction of selected motor(s) |
| sensora | 55 | r | 0 |
reports value of sensor A |
| sensorb | 56 | r | 0 |
reports value of sensor B |
| switcha | 57 | r | 0 |
reports boolean value of sensor A |
| switchb | 58 | r | 0 | reports
boolean value of sensor B |
| setpower | 59 | c | 1 |
sets power level of selected motor(s) |
| brake | 60 | c | 0 |
sets selected motor(s) for active braking |
| bsend | 61 | c | 1 |
sends value out Bus Port |
| bsr | 62 | r | 1 | sends value
out Bus Port and reports reply |
| c, | 63 | c | 0 |
selects bus motor C for control |
| d, | 64 | c | 0 |
selects bus motor D for control |
| cd, | 65 | c | 0 |
selects bus motors C and D for control |
| abcd, | 66 | c | 0 | selects all
motors for control |
| fastsend | 67 | c | 1 |
sends specified value out IR port without trailing delay |
| stop! | 68 | c | 0 |
terminates execution completely |
| eb | 69 | r | 1 |
"examine byte"; reports value of Cricket memory at specified address |
| db | 70 | c | 2 | "deposit byte";
pokes byte into Cricket memory |
| low-byte | 71 | r | 1 | reports low
byte of input |
| high-byte | 72 | r | 1 | reports high
byte of input |