Instruction |
Synopsis |
Description |
Numeric calculation instructions |
move |
move source,dest |
Moves the integer source to dest |
add |
add source,dest |
Adds source to dest, storing the result
in dest. |
sub |
sub source,dest |
Subtracts source from dest, storing the result
in dest. |
mul |
mul source,dest |
Multiplies source by dest, storing the result
in dest. |
div |
div source,dest |
Divides dest by source, storing the result
in dest. |
neg |
neg dest |
Negates dest. |
mod |
mod source,dest |
Calculates source modulo dest, storing
the result in dest. |
lsl |
lsl count,dest |
Shift the bits in dest left by count
bits. |
lsr |
lsr count,dest |
Shift the bits in dest right by count
bits. |
Logical instructions |
not |
not dest |
Performs a logical not operation on dest. If
dest is 0 the result is 1. If dest is not
0, the reult is 0. |
tsteq |
tsteq source,dest |
If source and dest are equal, store 1
in dest, otherwise store 0. |
tstne |
tstne source,dest |
If source and dest are not equal, store 1
in dest, otherwise store 0. |
tstlt |
tstlt source,dest |
If source is less than dest, store 1
in dest, otherwise store 0. |
tstgt |
tstgt source,dest |
If source is greater than dest, store 1
in dest, otherwise store 0. |
tstle |
tstle source,dest |
If source is equal to or less than
dest, store 1 in dest, otherwise store 0. |
tstge |
tstge source,dest |
If source is equal to or greater than
dest, store 1 in dest, otherwise store 0. |
tstand |
tstand source,dest |
If both source and dest are true (not equal
to 0) store 1 in dest, otherwise store 0. |
tstor |
tstor source,dest |
If either source or dest is true (not equal
to 0) store 1 in dest, otherwise store 0. |
Program flow instructions |
jmp |
jmp location |
Jump to the location indicated by location. |
jpl |
jpl value,location |
If value is greater than 0, Jump to the location
indicated by location. |
jmi |
jmi value,location |
If value is less than 0, Jump to the location
indicated by location. |
jeq |
jeq value,location |
If value is 0, Jump to the location indicated by
location. |
jne |
jne value,location |
If value is not equal to 0, Jump to the location
indicated by location. |
jsr |
jsr location |
Push the current PC on to the system stack and jump to
the location specified by location. |
rts |
rts |
Pop the top value off the system stack and jump to that
location. |
Stack manipulation instructions |
push |
push value |
Push value on to the user stack. |
pop |
pop dest |
Pop the top value off the user stack and store it in
dest. |
Callback functions |
callback |
callback id,location |
Installs a callback handler for callback
id. Whenever an event occurs that triggers this
callback, the routine at location is
called. Specifying -1 as the location removes the callback
handler. |
getcallback |
getcallback id,dest |
Stores the callback installed for callback id in
dest. If no callback is installed then -1 is
stored. |
rtc |
rtc |
Returns from a callback handler. This instruction does
the same thing as rts except that it also
unblocks all callbacks.
|
getcb |
getcb arg,dest |
Stores the callback data specified by arg in
dest. |
Miscellaneous instructions |
random |
random dest |
Stores a random number in dest. |