You are on page 1of 3

MICROPROCESSOR INSTRUCTION

INSTRUCTION - a binary pattern designed inside a microprocessor to perform a specific function. In another word it
can be defined as command in binary (i.e., machine language) that is recognized and executed by a computer to
accomplish a task. Computer instructions are normally stored in central memory locations and are executed
sequentially one at a time.
CLOCK SPEED - the rate at which a processor can complete a processing cycle. It is typically measured in
megahertz or gigahertz. One megahertz is equal to one million cycles per second, while one gigahertz equals one
billion cycles per second.
CYCLE - is technically a pulse synchronized by an internal oscillator, but for our purposes, they’re a basic unit that
helps understand a CPU’s speed.
FREQUENCY - the rate at which current changes direction per second. It is measured in hertz (Hz), an international
unit of measure where 1 hertz is equal to 1 cycle per second.
PERFORMANCE EQUATION
The performance equation analyzes execution time as a product of three factors that are relatively independent of each
other.
INSTRUCTION COUNT

 Computer architects can reduce the instruction count by adding more powerful instructions to the instruction
set. However, this can increase either CPI or clock time, or both.
CLOCKS PER INSTRUCTIONS (CPI)

 Is an effective average. It is averaged over all the instruction executions in a program.


 CPI is affected by instruction-level parallelism and by instruction complexity. Without instruction-level
parallelism, simple instructions usually take 4 or more cycles to execute.
 For computing clocks per instruction as an effective average, the cases are categories of instructions, such as
branches, loads, and stores. Frequencies for the categories can be extracted from execution traces. Knowledge
of how the architecture handles each category yields the clocks per instruction for that category.
CLOCK TIME

 is the period of the clock that synchronizes the circuits in a processor. It is the reciprocal of the clock
frequency. For example, a 1 GHz processor has a cycle time of 1.0 ns and a 4 GHz processor has a cycle time
of 0.25 ns.
 Clock time is affected by circuit technology and the complexity of the work done in a single clock.
 Logic gates do not operate instantly. A gate has a propagation delay that depends on the number of inputs to
the gate (fan in) and the number of other inputs connected to the gate's output (fan out). Increasing either the
fan in or the fan out slows down the propagation time.
FETCH CYCLE - the central processing unit obtains the instruction code from the memory for its execution. Once
the instruction code is fetched from memory, it is then executed.
MACHINE CYCLE - defined as the time required for completing one operation of accessing memory, I\O or
acknowledging an external request. This cycle may consist of three to six T-states. It consists of four operations: Op-
code Fetch, Memory Read, Memory Write, I/O Read and I/O Write.
T – STATES - is defined as the subdivision of the operation performed in one clock period. During T-second
microprocessor (a sequential machine) stays in a particular state called T-state
Each microprocessor can handle predefined number of instructions. For example, an 8085A can handle at the
maximum of 256 instructions (2word length). The sheet which contains all these instructions with their hex code,
mnemonics, descriptions, and functions is called an instruction sheet.
1 Byte Instruction

 One byte will be Op-code and Operand will be default for that instruction. A one-byte instruction includes the
Op-code and Operand in the same byte. These instructions are stored in 8-bit binary format in memory; each
requires one memory location.
2 Byte Instruction

 In two-byte instruction, the first byte specifies the operation code and the second byte specifies the operand.
These instructions would require two memory locations each to store the binary codes.
3 Byte Instruction

 In three-byte instruction, the first byte specifies the operation code and the following two bytes specify the 16-
bit address where the second byte is the low order address and the third byte is the high order address.
DIGITAL SYSTEM - is an interconnection of digital hardware modules that accomplish a specific information
processing task. Digital modules are best defined by the register they contain and the operations that are performed on
the data stored in them.
RESGITER TRANSFER LANGUAGE - a language that uses the symbolic notation to literally define, express and
describe the transfer of data among the register.
The term “REGISTER TRANSFER” implies the availability of hardware logic circuits that can perform a stated
microoperation and transfer the result of the operation to the same or another register. The word “LANGUAGE” is
borrowed from programmers, who apply this term to programming language.
Function of Control Unit of Microprocessor
The control unit of microprocessor performs the following two tasks:

1. Causes the microprocessor to execute the micro-operation in a proper sequence determined by the program
being executed.
2. Generate the control signal that causes each micro-operation to be executed. The control signal generated by
the control unit causes the opening and closing of logic gates, thus resulting in the transfer of data to and from
register and the operation of ALU.

8085 ADDRESSING MODES


1. Direct Addressing (Absolute Addressing) 4. Implied Addressing (Inherent Addressing)
2. Register Indirect Addressing 5. Immediate Addressing
3. Register Direct Addressing

1. DIRECT OR ABSOLUTE ADDRESSING

 In this mode 8 or 16-bit address of an operand will be given just after the Op-code. It means address is written
directly in instruction. These instructions are of 2 or 3 bytes with first byte as the Op-code followed by 1 or 2
bytes of address of data.
EXAMPLES:
i. LDA 2035H
- This instruction loads the accumulator with the contents of the memory location having 16bit
address of 2035H.
ii. IN FCH
- This is an example which has only one byte address. This will read the data at port FCH and store
the data at the accumulator.
iii. OUT FFH
- This instruction will display/write the data stored in accumulator at port address FFH.
2. REGISTER INDIRECT ADDRESSING
 In this mode, the address part of instruction specifies the memory location whose content is the address of the
operand. So, this type of addressing mode contains a register pair which stores the address of actual data.
EXAMPLES:
i. MOV A, M
- This instruction moves the contents of the memory location whose address is specified by the
contents of the register H & L to the accumulator. If register H & L contains 20H and 50H
respectively then the contents of memory location 2050H will be transferred to the accumulator.
ii. ADD M
- This instruction adds the contents of the memory location whose address is specified by the
content of the register H & L to the content of the accumulator.
iii. MVI M, 8bit data
- This instruction moves the immediate 8-bit data to the memory location whose address is
specified by the contents of the register H & L.
3. REGISTER DIRECT ADDRESSING
 This mode of addressing specifies the register or register pair that contains the actual data to be manipulated
or operated on by the microprocessor. The instruction specifies the direct address of the operand. The memory
address is specified where the actual operand is.
EXAMPLES:
i. MOV A, B
- This instruction moves the contents of the register B directly to register A (Accumulator).
ii. ADD B
- This instruction adds the contents of the register B with the contents of accumulator directly and
stores the result in accumulator.
iii. ORA B
- This instruction stores the result in accumulator after bitwise OR-operation between the contents
of register B and Accumulator.
4. IMPLIED OR INHERENT ADDRESSING
 It is called inherent addressing mode The operand is implied by the instruction The operand is hidden/fixed
inside the instruction.
EXAMPLES:
i. HLT: Halt the operation.
ii. EI: Enable interrupt S
iii. TC: Set the carry flat.
iv. CMA: Complement the Accumulator
v. CMC: Complement Carry Flag
5. IMMEDIATE ADDRESSING
 In this mode the data is specified immediately after Op-code in the instruction. For an 8bit data, this mode
uses 2-bytes instruction, with first byte as the Op-code followed by 1 or 2 byte of data whereas for 16-bit data,
this mode uses 3-bytes instruction with first byte as the Op-code followed by 2 bytes of data. In both cases,
the actual data is part of the instruction, and hence called immediate addressing.
 The operand is specified with in the instruction.
 operand itself is provided in the instruction rather than its address.
EXAMPLES:
i. MVI A, 05H (8-bit Data)
- This instruction moves the immediate data 05H to the accumulator.
ii. LXI H, 7A21J (16-bit Data)
- This instruction loads register H with 7AH and register L with 21H.

PURPOSE OF ADDRESSING MODE


 To give programming versatility to the user by providing such facilities as pointers to memory, counters for
loop control, indexing of data and program relocation.
 To reduce the number of bits in the addressing field of the instruction
 To provide flexibility for writing programs that are more efficient with respect to the number of instructions
and execution time.

You might also like