Registers Register areas, including up to 128 general-purpose registers for data storage. In addition, the TMS7000 CPU has access to three special-purpose registers: the l6-bit Program Counter (PC), the 8-bit Status Register (ST), and the 8-bit Stack Pointer (SP).
Arithmetic Instructions TMS7000 arithmetic instructions perform basic arithmetic operations on byte values. INSTRUCTION MNEMONIC Add With Carry ADC Add ADD Decimal Add with Carry DAC Decrement DEC Decrement Double DECD Decimal Subtract with Borrow DSB Increment INC Invert (Complement ) INV Multiply MPY Subtract with Borrow SBB Subtract SUB ADC Add With Carry Instruction (ADC) SYNTAX: [<label>] ...ADC ...<s>,<d> ...[<comment>] TYPE: Dual Register EXAMPLE: LABEL ADC R66,R117 DEFINITION: Add the source operand to the destination operand with carry in and store the result at the destination address. EXECUTION RESULTS: (s) + (d) + C => (d) -- ADD Add Instruction (ADD) SYNTAX: [<label>] ...ADD ...<s>,<d> ...[<comment>] TYPE: Dual Register EXAMPLE: LABEL ADD A,B Definition: Add the source operand to the destination operand and store the result at the destination address. EXECUTION RESULTS: (s) + (d) -> (d) -- DAC Decimal Add With Carry Instruction (DAC) SYNTAX: [<label>] ...DAC ...<s>,<d> ...[<comment>] TYPE: Oual Register EXAMPLE: LABEL DAC %24,A DEFINITION: Add the source operand to the destination operand with carry in and store the result at the destination address. Each operand is a two-digit integer using BCO format. EXECUTION RESULTS: (s) + (d) + C -> (d) -- INC Increment Instruction (INC) SYNTAX: [<label>] ...INC ...<d> ...[<comment>] TYPE: Single Register EXAMPLE: LABEL INC A DEFINITION: ADD one to a register. EXECUTION RESULTS: (d) + 1 = (d) -- INV Invert Instruction (INV) SYNTAX: [<label>] ...INV ...<d> ...[<comment> ] TYPE: Single Register EXAMPLE: LABEL INV A DEFINITION: Invert or complement all bits in the operand. EXECUTION RESULTS: NOT (d) => (d)
Branch and Jump Instructions Branch and jump instructions transfer control to specified locations in program memory. INSTRUCTION MNEMONIC Branch BR Bit Test and Jump if One Peripheral BTJOP Bit Test and Jump if Zero Peripheral BTJZP Bit Test and Jump if One BTJO Bit Test and Jump if Zero BTJZ Call Subroutine CALL Decrement Register and Jump if Non Zero DJNZ Jump if Carry/Jump if Higher or Same JC/JHS Jump Unconditionally JMP Jump if Negative JN Jump if No Carry/Jump if Lower JNC/JL Jump if Not Zero/Jump if Not Equal JNZ/JNE Jump if Positive JP Jump if Positive or Zero JPZ Jump if Zero/Jump if Equal JZ /JEQ Return from Interrupt RETI Return from Subroutine RETS Trap to Subroutine TRAP CALL Call Instruction (CALL) SYNTAX: [<label>] ...CALL ...<a> ...[<comment>] TYPE: Extended Address EXAMPLE: LABEL1 CALL @LABEL4 LABEL2 CALL @LABELS(B) LABEL2 CALL *R12 DEFINITION: Push the Current PC on the stack and branch to the effective operand address. EXECUTION RESULTS: SP + 1 => SP PC MSByte -> stack SP + 1 => SP PC LSByte => stack operand address -> PC -- JMP Jump Unconditional Instruction (JMP) SYNTAX: [<label>] ...JMP ...<offset> ...[<comment>] TYPE: Simple Relative EXAMPLE: LABEL JMP THERE DEFINITION: Jump unconditionally to the address specified in the operand. The second byte of the JMP instruction is loaded with the 8-bit relative address of the operand. The operand address must therefore be within -128 to +127 bytes of the location of the instruction following the JMP instruction. --
Compare Instructions INSTRUCTION MNEMONIC Compare CMP Compare A to memory CMPA Test A register TSTA Test B register TSTB
Control Instructions INSTRUCTION MNEMONIC Clear Carry Bit CLRC Set Carry Bit SETC Disable Interrupts DINT Enable Interrupts EINT Idle until Interrupt IDLE No Operation NOP NOP No Operation Instruction (NOP) SYNTAX: [<label>] ...NOP ...[<comment>] TYPE: Implied Operand EXAMPLE: LABEL NOP DEFINITION: Perform no operation. EXECUTION RESULTS: PC + 1 => PC
Load and Move Instructions INSTRUCTION MNEMONIC Load A register LDA Load Stack Pointer LDSP Move MOV Move Double MOVD Move to/from Peripheral MOVP Pop from Stack POP Push on Stack PUSH Store A register STA Store Stack Pointer STSP Swap Nibble SWAP Exchange with B register XCHB LDA Load A Register Instruction (LDA) SYNTAX: [<label>] ...LDA ...<s> ...[<comment> ] TYPE: Extended Address EXAMPLE: LABEL1 LDA @LABEL4 DIRECT LABEL2 LDA @LABEL5(B) INDEXED LABEL3 LDA *R13 INDIRECT DEFINITION: Copy the contents of the source operand address to the A register; addressing modes include direct, indexed, and indirect. EXECUTION RESULTS: (s) -> A -- MOV MOVE Instruction (MOV) SYNTAX: [<label>] ...MOV ...<s>,<d> ...[<comment> ] TYPE: Dual Register EXAMPLE: LABEL1 MOV A,B LABEL2 MOV R32,R234 LABEL3 MOV %10,R3 DEFINITION: Copy the source operand to the destination operand address. EXECUTION RESULTS: (s) -> (d)
Logical Instructions INSTRUCTION MNEMONIC AND AND Clear CLR Invert INV OR OR Exclusive OR XOR
Other Instructions INSTRUCTION MNEMONIC End END Assembly-Time Constant Directive EQU Text TEXT -- END END terminates the assembly. -- EQU Define Assembly-Time Constant Directive (EQU): EQU assigns a value to a symbol. The label field contains the symbol to be given a value. The command field contains EQU. The operand field contains an expression. Use of the comment field is optional. SYNTAX: <label> ...EQU ...<exp> ...[<comment> ] NOTE <exp> may not contain a REF'd symbol and may not contain forward references. EXAMPLE: SUM EQU RS The directive assigns an absolute value to the symbol SUM, making SUM available to use as a register address. A second example of an EQU directive follows: TIME EQU HOURS The above example directive assigns the value of the previously defined symbo] HOURS to the symbol TIME. When HOURS appears in the label field of a machine instruction in a relocatable block of te program, the value is a relocatable value. The two symbols may be used interchangeably. Symbols in the operand field must be previously defined. -- TEXT Initialize Text Directive (TEXT): TEXT places one or more characters in successive bytes of memory. The assembler negates the last character of the string when the string is preceded by a minus (-) sign (unary minus). Use of the label field is optional. When used, a label is assigned the location at which the assembler places the first character. The command field contains TEXT. The operand field contains a character string of up to 52 characters enclosed in single quotes, which may be preceded by a unary minus sign. The comment field is optional. SYNTAX: [<label>] ...TEXT ..[-]'<string>' ...[<comment>] EXAMPLE: MSG1 TEXT '‘EXAMPLE' MESSAGE HEADING The directive places the eight-bit ASCII representations of the characters in successive bytes. When the location counter is on an even address, the result is >4558, >414D, >504C, and >45XX. XX, the contents of the rightmost byte of the fourth word, are determined by the next source statement. The label MSG1 is assigned the value of te first byte address containing >45. Another example, showing the use of a unary minus, follows: MSG2 TEXT - 'NUMBER' -- -- --