Beruflich Dokumente
Kultur Dokumente
ACCUMULATOR ARCHITECTURE
ISA 2 - Accumulator
Ab br eviatio ns
Accumulator Carry Flag Over-flow flag Sign Flag Zero Flag Parity Flag Instruction Pointer Acc CF OF SF ZF PF IP
2-2
ISA 2 - Accumulator
5-bit Opcode 47
19-bit operand
Operand 2 36 21 19 0
# default &
2-3
ISA 2 - Accumulator
Logical instructions............................................................................ 7
AND OR XOR SHL SHR ROL ROR NOT Bit-wise And............................................................................................ 7 Bit-wise OR ............................................................................................. 8 Bit-wise XOR .......................................................................................... 8 Shift Acc left 1-bit ................................................................................... 9 Shift Acc right 1-bit................................................................................. 9 rotate Acc left 1-bit................................................................................ 10 rotate Acc right 1-bit.............................................................................. 11 Ones compliment negation ................................................................... 11
Miscellaneous instructions.............................................................. 17
NOP No operation .......................................................................................... 17
2-4
ISA 2 - Accumulator
ADD
Opcode Format Description
Addition
10000 ADD AM operand Adds the operand specified and the Acc contents. Result modifies the Acc. The ADD instruction performs integer addition. It evaluates the results for both signed and unsigned integer operands and sets the CF and OF flags to indicate a carry in the signed or unsigned result, respectively. The SF indicates the sign of the signed result. Acc Acc + Operand Immediate, direct and indirect ZF, OF, SF and PF are set according to the result.
SUB
Opcode Format Description
Subtraction
10001 SUB AM operand Subtracts the Acc contents from the operand specified. Result modifies the Acc. The SUB instruction performs integer subtraction. It evaluates the results for both signed and unsigned integer operands and sets the CF and OF to indicate a carry in the signed or unsigned result, respectively. The SF indicates the sign of the signed result. Acc Acc Operand Immediate, direct and indirect ZF, OF, SF, CF and PF are set according to the result.
2-5
ISA 2 - Accumulator
MUL
Opcode Format Description
Signed multiplication
11011 MUL AM operand (lower 8-bit) Performs signed multiplication on lower 8-bits of accumulator and the operand. Mul instruction produces a 16-bit result in the accumulator. Acc Acc * Operand (16-bit) (8 LSBs) (8 LSBs) Immediate, direct and indirect ZF, SF and PF are set according the product. OF and CF is cleared, as no overflow occurs in this situation and no carry considered.
Operation
DIV
Opcode Format Description
Signed division
11100 DIV AM operand Divides the accumulator by the operand. Div instruction produces an integer output. Result modifies the accumulator. Acc Acc / operand Immediate, direct and indirect ZF, SF and PF are set according the product. OF and CF is cleared, as no overflow occurs in this situation and no carry considered.
2-6
ISA 2 - Accumulator
INC
Opcode Format Description
Increment Acc by 1
10101 INC Adds 1 to the Acc. Evaluates for both signed and unsigned operands. Acc Acc +1 Immediate, direct and indirect the CF is not affected. The OF, SF, ZF and PF are set according to the result.
Logical instructions
AND
Opcode Format Description
Bit-wise And
10010 AND AM operand Performs bit wise AND operation on the specified operand and the Acc. Each bit of the result is set to 1 if both corresponding bits of the operands are 1; otherwise, it is set to 0. Result replaces the Acc. Acc Acc AND specified operand Immediate, direct and indirect OF and CF are cleared; SF, ZF and PF are set according to the result.
2-7
ISA 2 - Accumulator
OR
Opcode Format Description
Bit-wise OR
10011 OR AM operand Performs bit wise OR operation on the specified operand and the Acc. Each bit of the result is set to 0 if both corresponding bits of the operands are 0; otherwise, it is set to 1. Result replaces the Acc. Acc Acc OR specified operand Immediate, direct and indirect OF and CF are cleared; SF, ZF and PF are set according to the result.
XOR
Opcode Format Description
Bit-wise XOR
10100 XOR AM operand Performs bit wise XOR operation on the specified operand and the Acc. Each bit of the result is set to 0 if both corresponding bits of the operands are 1 or if both corresponding bits of the operands are 0; otherwise, it is set to 1. result replaces the Acc. Acc Acc XOR specified operand Immediate, direct and indirect OF and CF are cleared; SF, ZF and PF are set according to the result.
2-8
ISA 2 - Accumulator
SHL
Opcode Format Description
Operation
SHR
Opcode Format Description
Operation
2-9
ISA 2 - Accumulator
ROL
Opcode Format Description
Operation
2 - 10
ISA 2 - Accumulator
ROR
Opcode Format Description
Operation
NOT
Opcode Format Description
2 - 11
ISA 2 - Accumulator
JC
Opcode Format Description
Operation AM
Flags affected
JOF
Opcode Format Description
Operation AM
Flags affected
2 - 12
ISA 2 - Accumulator
JS
Opcode Format Description
Operation AM
Flags affected
JP
Opcode Format Description
Operation AM
Flags affected
2 - 13
ISA 2 - Accumulator
JZ
Opcode Format Description
Operation AM
Flags affected
Unconditional branch
JUMP
Opcode Format
Jump
01111 JUMP {Signed offset (IP relative)}
Description
Transfers the program control to a different point of the instruction stream. The operand specified the signed offset being jumped to. This operand is an immediate signed offset
IP IP + operand IP relative addressing is applied in the address calculation. none
Operation AM
Flags affected
2 - 14
ISA 2 - Accumulator
Loop Instructions
LOOZ
Opcode Format Description
Operation
AM
Flags affected
2 - 15
ISA 2 - Accumulator
CALL
Opcode Format Description
Call procedure
01010 CALL {Immediate address} Saves IP in the implied memory location and branches to the procedure (called procedure) specified by the operand. This operand is an immediate value. When executing a CALL, the processor pushes the value of the IP register on to the implied return address (For use latter as a return-instruction pointer). The processor then branches to the address specified with instruction. implied address IP IP IP + Operand Immediate operand is used as the jumping location none
Operation
AM Flags affected
RETURN
Opcode Format Description
Operation AM
Flags affected
2 - 16
ISA 2 - Accumulator
Miscellaneous instructions
NOP
Opcode Format Description
No operation
01110 NOP Performs no operation. Takes up space in the instruction stream but does not affect the context, except IP. none
Flags affected
2 - 17
ISA 2 - Accumulator
LOADacc
Opcode Format Description
Move to Acc
11111 LOADacc AM operand Immediate Addressing Copy the 16-bit immediate source operand to the accumulator. Direct Addressing Copy the contents of the source (operand) address (of memory) to the accumulator.
Operation
Immediate Addressing
Acc 16-bit immediate Operand
Direct Addressing
Acc memory (operand)
STOREacc
Opcode Format Description
Operation
Direct Addressing
Memory (operand) Acc
Indirect Addressing
Memory {memory (operand)} Acc
2 - 18