|
|
|
GoGo board Cricket
Logo Implementation |
|
|
|
|
|
|
BETA
Version 0.91 |
|
|
|
|
|
Last Update: Mar 23, 2004 |
|
|
|
|
|
|
|
|
|
|
This Cricket Logo interpreter
has been re-written in PIC-C (from CCS). The VM size including the original GoGo teathered-mode features
is 5.3k. It has been tested with Logo Blocks and Jackal. The following list
shows the byte codes that have been ported and their status. |
|
|
|
|
|
|
|
|
|
Stuatus |
Code |
Description |
Note |
|
|
Ok |
code-end |
terminates code. |
|
|
|
Ok |
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). |
|
|
|
Ok |
number |
pushes 16-bit number
on stack. takes two immediate bytes as number in code stream. |
|
|
|
Ok |
list |
"start of
list"; opens a code block |
|
|
|
Ok |
eol |
"end of
list"; closes a code block |
|
|
|
Ok |
eolr |
"end of list
reporter"; closes a code block that will return a value (e.g, for when,
waituntil) |
|
|
|
Ok |
lthing |
"local
thing"; uses stack frame to retrieve proc args |
|
|
|
Ok |
stop |
stops currently
running procedure, returning control to caller |
|
|
|
Ok |
output |
stops currently
running procedure, returning value to caller |
|
|
|
Ok |
repeat |
repeats block for
specific number of times |
|
|
|
Ok |
if |
if input expression
is true, executes block |
|
|
|
Ok |
ifelse |
if input expression
is true, executes block1, else executes block2 |
|
|
|
Ok |
beep |
causes Cricket to
beep |
|
|
|
Not yet |
note |
makes Cricket play
note of specified pitch and duration |
|
|
|
Ok |
waituntil |
repeatedly executes
block until it evaluates to true |
|
|
|
Ok |
loop |
indefinitely executes
block |
|
|
|
Ok |
wait |
waits for specified
time period |
|
|
|
Ok |
timer |
returns value of
free-running timer |
|
|
|
Ok |
resett |
resets free-running
timer to zero |
|
|
|
Ok |
send |
sends specified value
out IR port, with 0.1 sec trailing delay |
GoGo will send a 16
bit value through the serial port. |
|
|
Ok |
ir |
reports value of most
recently received IR byte |
Replaces IR with
serial |
|
|
Ok |
newir? |
reports whether IR
value has been received since last call to "ir" |
Same as ir. |
|
|
Ok |
random |
reports pseudorandom
16 bit value |
|
|
|
Ok |
+ |
reports sum of two
inputs |
|
|
|
Ok |
- |
reports difference of
two imputs |
|
|
|
Ok |
* |
reports product of
two inputs |
|
|
|
Ok |
/ |
reports division of
two inputs |
|
|
|
Ok |
% |
reports remainder of
division of two inputs |
|
|
|
Ok |
= |
reports boolean
equality of two inputs |
|
|
|
Ok |
> |
reports boolean
"greater than" of two inputs |
|
|
|
Ok |
< |
reports boolean
"less than" of two inputs |
|
|
|
Ok |
and |
reports
bitwise/logical AND of two inputs |
|
|
|
Ok |
or |
reports
bitwise/logical OR of two inputs |
|
|
|
Ok |
xor |
reports bitwise XOR
of two inputs |
|
|
|
Ok |
not |
reports
bitwise/logical NOT of two inputs |
|
|
|
Ok |
setglobal |
sets numbered global
to value |
|
|
|
Ok |
global |
reports value of
numbered global |
Crickets allow 16
global variables. Same for GoGo. |
|
|
Ok |
aset |
sets numbered array
with numbered element to value |
GoGo
uses memory where Crickets store data recordings allowing larger array sizes.
They can contain up to 1250 16 bit items. |
|
|
Ok |
aget |
reports value of
numbered element of numbered array |
|
|
|
Ok |
record |
records 16-bit value into data
buffer |
*Since GoGo has 32K
of EEPROM (Cricket has 4K), we have 26K for Data recording. |
|
|
Ok |
recall |
reports 16-bit value
stored in data buffer |
*the Cricket records
and stores 8 bit values (not 16). |
|
|
Ok |
resetdp |
resets data buffer
pointer to zero |
|
|
Ok |
setdp |
sets data buffer
pointer to specified value (in 16 bit units) |
|
|
|
Ok |
erase |
erases data point |
|
|
|
X |
when |
sets up daemon with
condition block and action block |
|
|
|
X |
whenoff |
terminates
"when" daemon |
|
|
|
Ok |
a, |
selects motor A for
control |
|
|
|
Ok |
b, |
selects motor B for
control |
|
|
|
Ok |
ab, |
selects motors A and
B |
|
|
|
Ok |
on |
turns on selected
motor(s) |
|
|
|
Ok |
onfor |
turns on selected
motor(s) for specified period of time |
|
|
|
Ok |
off |
turns off selectec
motor(s) |
|
|
|
Ok |
thisway |
sets selected
motor(s) direction to green LED |
|
|
|
Ok |
thatway |
sets selected
motor(s) direction to red LED |
|
|
|
Ok |
rd |
reverses direction of
selected motor(s) |
|
|
|
Ok |
sensora |
reports value of
sensor A |
|
|
|
Ok |
sensorb |
reports value of
sensor B |
|
|
|
Ok |
switcha |
reports boolean value
of sensor A |
|
|
|
Ok |
switchb |
reports boolean value
of sensor B |
|
|
|
Ok |
setpower |
sets power level of
selected motor(s) |
|
|
|
Ok |
brake |
sets selected
motor(s) for active braking |
|
|
|
X |
bsend |
sends value out Bus
Port |
Will implement a
version for I2C bus instead. |
|
|
X |
bsr |
sends value out Bus
Port and reports reply |
Same as bsend. |
|
|
Ok |
c, |
selects bus motor C
for control |
|
|
|
Ok |
d, |
selects bus motor D
for control |
|
|
|
Ok |
cd, |
selects bus motors C
and D for control |
|
|
|
Ok |
abcd, |
selects all motors
for control |
|
|
|
X |
fastsend |
sends specified value
out IR port without trailing delay |
|
|
|
Ok |
stop! |
terminates execution
completely |
Untested |
|
|
Ok |
eb |
"examine
byte"; reports value of Cricket memory at specified address |
Untested |
|
|
Ok |
db |
"deposit
byte"; pokes byte into Cricket memory |
Untested |
|
|
Ok |
low-byte |
reports low byte of
input |
|
|
|
Ok |
high-byte |
reports high byte of
input |
|
|
|
|
|
|
|
|
X = No plan for implementation |
|
|
|
|
|
|
|
|
|
|