Instruction Types and Timing Diagrams
1. What is an instruction?
Ans. An instruction is a command given to the microcomputer to perform a specific task or function on a given data.
2. What is meant by instruction set?
Ans. An instruction set is a collection of instructions that the microprocessor is designed to perform.
3. In how many categories the instructions of 8085 be classified? Ans. Functionally, the instructions can be classified into five groups:
*data transfer (copy) group
*arithmetic group
*logical group
* branch group
*stack, I/O and machine control group.
4. What are the different types of data transfer operations possible? Ans. The different types of data transfer operations possible are cited below:
* Between two registers.
* Between a register and a memory location.
*A data byte can be transferred between a register and a memory location.
* Between an I/O device and the accumulator.
*Between a register pair and the stack.
The term ‘data transfer’ is a misnomer—actually data is not transferred, but copied from source to destination.
5. Mention the different types of operations possible with arithmetic, logical, branch and machine control operations.
Ans. The arithmetic operations possible are addition, subtraction, increment and decrement.
The logical operations include AND, OR, EXOR, compare, complement, while branch
operations are Jump, Call, Return and Restart instructions.
The machine control operations are Halt, Interrupt and NOP (no operation).
6. What are the different instruction word sizes in 8085? Ans. The instruction word sizes are of the following types:
Instruction Types and Timing Diagrams 33
z 1-byte instruction z 2-byte instruction z 3-byte instruction.
7. What an instruction essentially consists of?
Ans. An instruction comprises of an operation code (called ‘opcode’) and the address of the data (called ‘operand’), on which the opcode operates. This is the structure on which an instruction is based. The opcode specifies the nature of the task to be performed by an instruction. Symbolically, an instruction looks like
8. Give one example each of 1-byte, 2-byte and 3-byte instructions.
Ans. The examples are given below:
* 1-byte instruction : ADD B
* 2-byte instruction : MVIC, 07
* 3-byte instruction : LDA 4400
9. What is meant by ‘addressing mode’? Mention the different addressing modes.
Ans. Each instruction indicates an operation to be performed on certain data. There are various methods to specify the data for the instructions, known as ‘addressing modes’.
For 8085 microprocessor, there are five addressing modes. These are:
*Direct addressing
* Register addressing
* Register indirect addressing
* Immediate addressing
*Implicit addressing.
10. Give one example each of the five types of addressing modes. Ans. The examples for each type of addressing mode are given below:
(a) Direct Addressing: In this mode, the operand is specified within the instruction itself.
LDA 4000H, STA 5513H, etc.
IN/OUT instructions (like IN PORT C, OUT PORT B, etc.) also falls under this category.
(b) Register Addressing: In this mode of addressing, the operand are in the general purpose registers.
Examples are: MOV A, B ; ADD D, etc.
(c) Register Indirect Addressing: MOV A, M; ADD M are examples of this mode of addressing. These instructions utilise 1-byte. In this mode, instead of specifying a register, a register pair is specified to accommodate the 16-bit address of the operand.
(d) Immediate Addressing: MVI A, 07; ADI 0F are examples of Immediate Addressing mode.
The operand is specified in the instruction in this mode. Here, the operand address is not specified.
(e) Implicit Addressing: In this mode of addressing, the operand is fully absent. Examples are RAR, RAL, CMA, etc.
11. Let at the program memory location 4080, the instruction MOV B, A (opcode 47H) is stored while the accumulator content is FFH. Illustrate the execution of this instruction by timing diagram.
Ans. Since the program counter sequences the execution of instructions, it is assumed that
the PC holds the address 4080H. While the system one after another.
1. The CPU places the address 4080H (residing in PC) on the address bus—40H on the high
CLK A 1 T2 T3 T4 order bus A15 – A8 and 80H on the low order bus AD7 – AD0.
2. The CPU raises the ALE signal to go high—the H to L transition of ALE at the end of the
first T state demultiplexes the low order bus.
3. The CPU identifies the nature of the machine cycle by means of the three status IO/M
signals IO/ M , S0 and S1.
IO/ = 0, S1 = 1, S0 = 1
4. In T2, memory is enabled by the signal.
The content of PC i.e., 47H is placed on the data bus. PC is incremented to 4081H.
5. In T3, CPU reads 47H and places it in the instruction register.
6. In T4, CPU decodes the instruction, places FFH (accumulator content) in the temporary register and then transfers it to register B. Figure 3.1 shows the execution of the above. It consists of 4T states.