Instruction Operands
Each type of instruction requires a fixed number of operands. If an instruction has any associated operands, they must appear following the instruction name, separated by spaces. For the benefit of development productivity, the MCxxxx programming system does not require the use of redundant punctuation to separate instruction operands. Instruction operands are described with the following notation:
[1] Integer values must be in the range -999 to 999.
[2] Labels used as operands must be defined elsewhere in the program.
Basic Instructions
nop
This instruction has no effect.
mov R/I R
Copy the value of the first operand into the second operand.
jmp L
Jump to the instruction following the specified label.
slp R/I
Sleep for the number of time units specified by the operand.
slx P
Sleep until data is available to be read on the XBus pin specified by the operand.
Arithmetic Instructions
Registers can store integer values between -999 and 999, inclusive. If an arithmetic operation would produce a
result outside this range, the closest allowed value is stored instead. For example, if acc contains the value 800 and
the instruction add 400 is executed, then the value 999 will be stored in acc.
add R/I
Add the value of the first operand to the value of the acc register and store the result in the acc register.
sub R/I
Subtract the value of the first operand from the value of the acc register and store the result in the acc register.
mul R/I
Multiply the value of the first operand by the value of the acc register and store the result in the acc register.
not
If the value in acc is 0, store a value of 100 in acc. Otherwise, store a value of 0 in acc.
dgt R/I
Isolate the specified digit of the value in the acc register and store the result in the acc register.
dst R/I R/I
Set the digit of acc specified by the first operand to the value of the second operand.