1 | 2 | 3 | 4 | 5 | 6 | page 7 | 8

A Set GPRM command or instruction performs an arithmetic or bitwise calculation based on a source operand and a destination operand. The result is stored in the destination operand which is a GPRM register. The source operand can be a GPRM, a SPRM, or a specified constant value.

The following table shows all commands which can be used with the GPRMs.

Function Description
Assign to a GPRM the value defined in a GPRM, an SPRM, or a constant value (immediate 16-bit number).

Example:
1) Mov GPRM0,GPRM1
(Copy the contents of GPRM1 to GPRM0)

2) Mov GPRM2,SPRM9
(Copy the contents of SPRM9 to GPRM2)

3) Mov GPRM0,1024
(Initialize GPRM0 to 1024)
Swap the contents of two GPRMs.

Example:
Swp GPRM0,GPRM9
(If GPRM0 has a value of 10 and GPRM9 has a value of 19, after this command executes, GPRM0 has a value of 19 and GPRM9 has a value of 10)
Add a GPRM to another GPRM or a constant value (immediate 16-bit number).
SPRM is not allowed as operands in this command.

Example:
1) Add GPRM0,GPRM1
(Add the contents of GPRM1 and GPRM0 and save the result in GPRM0. The previous value of GPRM0 is lost after the command executes.)

2) Add GPRM0,1024
(Add the contents of GPRM0 with 1024. If GPRM0 is 1, after the command executes, GPRM0 becomes 1025)
Subtract a GPRM or a constant value (immediate 16-bit number) from another GPRM.
SPRM is not allowed as operands in this command.

Example:
1) Sub GPRM0,GPRM1
(Subtract the contents of GPRM1 from GPRM0 and save the result in GPRM0. The previous value of GPRM0 is lost after the command executes.)

2) Sub GPRM0,1024
(Subtract the contents of GPRM0 with 1024. If GPRM0 is 1025, after the command executes, GPRM0 becomes 1)
Compute the product (multiplication) of a GPRM or a constant value (immediate 16-bit number) with another GPRM.
SPRM is not allowed as operands in this command.

Example:
1) Mul GPRM0,GPRM1
(Multiply the contents of GPRM1 and GPRM0 and save the result in GPRM0. The previous value of GPRM0 is lost after the command executes.)

2) Mul GPRM0,2
(Multiply the contents of GPRM0 with 2. If GPRM0 is 1024, after the command executes, GPRM0 becomes 2048)
Compute the quotient (division) by dividing a GPRM to another GPRM or a constant value (immediate 16-bit number).
SPRM is not allowed as operands in this command.

Example:
1) Div GPRM0,GPRM1
(Divide the contents of GPRM0 and GPRM1 and save the result in GPRM0. GPRM0 is the divider and GPRM1 is the divisor. The previous value of GPRM0 is lost after the command executes.)

2) Div GPRM0,2
(Divide the contents of GPRM0 with 2. If GPRM0 is 1024, after the command executes, GPRM0 becomes 512)
Compute the remainder (modulo) by dividing a GPRM to another GPRM or a constant value (immediate 16-bit number).
SPRM is not allowed as operands in this command.

Example:
1) Mod GPRM0,GPRM1
(Modulo the contents of GPRM0 and GPRM1 and save the result in GPRM0. GPRM0 is the divider and GPRM1 is the divisor. The previous value of GPRM0 is lost after the command executes.)

2) Mod GPRM0,2
(Compute the remainder by dividing the contents of GPRM0 by 2. If GPRM0 is an even number such as 8, after the command executes, GPRM0 becomes 0. If GPRM0 is an odd number such as 3, after the command executes, GPRM0 becomes 1)
Compute a new random value using the contents of a GPRM or a constant value (immediate 16-bit number) as the seed value. The seed value cannot be 0.
SPRM is not allowed as operands in this command.

Example:
1) Rnd GPRM0,GPRM1
(Store a new random value in GPRM0 using the contents of GPRM1 as the seed value. The previous value of GPRM0 is lost after the command executes.)

2) Rnd GPRM0,2
(Store a new random value in GPRM0 using 2 as the seed value)
Compute the logical AND of a GPRM with another GPRM or a constant value (immediate 16-bit number).
A logical AND of two bits yields a value of 0 if either bit is 0 and yields a value of 1 if both bits are 1.
SPRM is not allowed as operands in this command.

Example:
1) And GPRM0,GPRM1
(Perform a logical AND of the contents of GPRM0 and GPRM1 and save the result in GPRM0.
The previous value of GPRM0 is lost after the command executes.)

2) And GPRM0,255
(Perform a logical AND of the contents of GPRM0 and 255 and save the result in GPRM0. This command effectively keeps the least significant 8 bits of GPRM0. The upper 8 bits of GPRM0 are cleared to 0)
Compute the logical OR of a GPRM with another GPRM or a constant value (immediate 16-bit number).
A logical OR of two bits yields a value of 1 if either bit is 1 and yields a value of 0 if both bits are 0.
SPRM is not allowed as operands in this command.

Example:
1) Or GPRM0,GPRM1
(Perform a logical OR of the contents of GPRM0 and GPRM1 and save the result in GPRM0.
The previous value of GPRM0 is lost after the command executes.)

2) Or GPRM0,255
(Perform a logical OR of the contents of GPRM0 and 255 and save the result in GPRM0. This command effectively sets the least significant 8 bits of GPRM0 to all 1s and leaves the upper 8 bits of GPRM0 unchanged)
Compute the logical XOR of a GPRM with another GPRM or a constant value (immediate 16-bit number).
A logical XOR of two bits yields a value of 0 if both bits are same and yields a value of 1 otherwise.
SPRM is not allowed as operands in this command.

Example:
1) Xor GPRM0,GPRM1
(Perform a logical XOR of the contents of GPRM0 and GPRM1 and save the result in GPRM0.
The previous value of GPRM0 is lost after the command executes.)

2) Xor GPRM0,255
(Perform a logical XOR of the contents of GPRM0 and 255 and save the result in GPRM0. This command effectively inverts the least significant 8 bits of GPRM0 and leaves the upper 8 bits of GPRM0 unchanged)

1 | 2 | 3 | 4 | 5 | 6 | page 7 | 8