Documente Academic
Documente Profesional
Documente Cultură
5-bit Opcode 47
19-bit operand
19-bit operand
Operand 2 36 21 19
Operand 1 1
# default &
Ab br eviatio ns
Carry Flag Over-flow flag Sign Flag Zero Flag Parity Flag Instruction Pointer Addressing Modes CF OF SF ZF PF IP AMs
Loop........................................................................................................15
LOOZ Loop until zero .....................................................................................15
ADD
Opcode Format Description
Addition
10000 ADD AM operand 1, operand 2 Adds the operand 1 and operand2. Result modifies the operand 1. 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. operand 1 operand 1 + operand 2 operand 2: immediate, direct and indirect operand 1: implied direct ZF, OF, SF and PF are set according to the result.
Operation AMs
Flags affected
SUB
Opcode Format Description
Subtraction
10001 SUB AM operand 1, operand 2 Subtracts operand 2 from operand 1. Result modifies operand 1. 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. operand 1 operand 1 operand 2 operand 2: immediate, direct and indirect operand 1: implied direct
Operation AMs
Flags affected
MUL
Opcode Format Description
Signed multiplication
11011 MUL AM operand 1 (8-bit), operand 2 (8-bit) Performs signed multiplication on lower 8-bits of operand 1 and operand 2. Mul instruction produces a 16-bit result. operand1 (16-bit) operand 1 * Operand 2 (8 LSBs) (8 LSBs)
Operation
AMs
operand 2: immediate, direct and indirect operand 1: implied direct 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.
Flags affected
DIV
Opcode Format Description
Signed division
11100 DIV AM operand 1, operand 2 Divides operand 1 by operand2. Div instruction produces an integer output. operand 1 operand 1 / operand 2 operand 2: immediate, direct and indirect operand 1: implied direct 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 AMs
Flags affected
INC
Opcode Format Description
Logical instructions
AND
Opcode Format Description
Bit-wise And
10010 ADD AM operand 1, operand 2 Performs bit wise AND operation on the specified operands. 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 operand 1. operand 1 operand 1 AND operand 2 operand 2: immediate, direct and indirect operand 1: direct OF and CF are cleared; SF, ZF and PF are set according to the result.
Operation AMs
Flags affected
OR
Opcode Format Description
Bit-wise OR
10011 OR AM operand 1, operand 2 Performs bit wise OR operation on the specified operands. 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 operand 1. operand 1 operand 1 OR operand 2 operand 2: immediate, direct and indirect operand 1: direct OF and CF are cleared; SF, ZF and PF are set according to the result.
Operation AMs
Flags affected
XOR
Opcode Format Description
Bit-wise XOR
10100 XOR AM operand 1, operand 2 Performs bit wise XOR operation on the specified operands. 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 operand 1. operand 1 operand 1 XOR operand 2 operand 2: immediate, direct and indirect operand 1: direct OF and CF are cleared; SF, ZF and PF are set according to the result.
Operation AMs
Flags affected
SHL
Opcode Format Description
SHR
Opcode Format Description
ROL
Opcode Format Description
Operation
10
ROR
Opcode Format Description
Operation
NOT
Opcode Format Description
11
JC
Opcode Format Description
Operation AM
Flags affected
12
JOF
Opcode Format Description
Operation AM
Flags affected
JS
Opcode Format Description
Operation AM
Flags affected
13
JP
Opcode Format Description
Operation AM
Flags affected
JZ
Opcode Format Description
Operation AM
Flags affected
14
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
Loop
LOOZ
Opcode Format Description
Operation
AM
Flags affected
15
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 return address IP IP Immediate address Immediate operand is used as the jumping location none
Operation
AM Flags affected
RETURN
Opcode Format Description
Operation AM
Flags affected
16
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
17
LOAD
Opcode Format Description
Operation
Immediate Addressing Memory (Operand 1) operand 2, 16-bit immediate value Direct Addressing Memory (Operand 1) Memory (Operand 2)
AM
Flags affected
none
18