The + operator is used to add a number to the value stored in a register, or to add the value of two registers together.
When used with 4-bit registers, Mi can be M0 - M15 and can store numbers from 0 to 15.
There are sixteen 4-bit registers.
|
Code Example |
Meaning |
|
M2=M2+3 |
Add the integer number 2 to the value stored in 4-bit register M2. |
|
M2=M3+2 |
Add the integer number 2 to the value stored in M3 and store the result in 4-bit register M2. |
|
M2=M3+M4 |
Add the value stored in M4 to the value stored in M3 and store the result in 4-bit register M2.. |
When used with 8-bit registers, Xi can be X0 - X7 and can store numbers from 0 to 255.
There is a maximum of eight 8-bit registers.
|
Code Example |
Meaning |
|
X4=X4+127 |
Add the integer number 127 to the value stored in 8-bit register X4. |
|
X4=X5+127 |
Add the integer number 127 to the value stored in X5 and store the result in 8-bit register X4. |
|
X4=X5+X6 |
Add the value stored in X6 to the value stored in X5 and store the result in 8-bit register X4. |
Numbers can also be represented in binary or hex format.
|
Code Example |
Meaning |
|
X4=X4+01111111b |
Add the binary number 01111111 to the value stored in 8-bit register X4. |
|
M0=M0+0Ah |
Add the hex number A to the value stored in M0. |