10.95
SUB
Binary Subtraction
Format
SUB Rm,Rn
Description
This instruction subtracts the contents of general register Rm from the contents of general register
Rn and stores the result in Rn. For immediate data subtraction, ADD #imm,Rn should be used.
Operation
SUB(long m, long n) /* SUB Rm,Rn */
{
R[n]-=R[m];
PC+=2;
}
Example
SUB
R0,R1
SUBtract binary
Summary of Operation
Rn-Rm → Rn
;Before execution R0 = H'00000001, R1 = H'80000000
;After execution
Arithmetic Instruction
Instruction Code
0011nnnnmmmm1000 1
R1 = H'7FFFFFFF
Rev. 2.0, 03/99, page 377 of 396
Execution
States
T Bit
—