INSTRUCTIONS AND INSTRUCTION SEQUENCING


A computer must have instructions capable of performing four types of operations because it has to carry out different types of tasks:  
  1. Data transfers between the memory and the processor registers
  2. Arithmetic and logic operations on data
  3. Program sequencing and control
  4. I/O transfers

BASIC INSTRUCTION TYPES

Consider the statement C = A + B in a high-level language program. The statement requires the action C  [A] + [B] to take place in the computer. When the above instruction is compiled, the three variables are assigned with three different memory locations and values of the operands will be stored in these locations. First the instruction is fetched (taken) from memory location, then the contents of memory locations where the values of A and B are stored, then the contents are sent to ALU, the operation is performed there and again the result is stored back in the memory location identified by C

Types of Instructions

  • Three address instruction
  • Two address instruction
  • One address instruction
  • Zero address instruction

  • In some processors where arithmetic operations are allowed only on operands that are in processor registers, the C = A + B task can be performed by the instruction sequence

    Move A, Ri
    Move B, Rj
    Add Ri, Rj
    Move Rj, C

    In processors where one operand may be in the memory but the other must be in a register, an instruction sequence for the required task would be

    Move A, Ri
    Add B, Ri
    Move Ri, C

Memory Operations << Previous
Next >>ADDRESSING MODES

Support us generously: contact@lessons2all.com


Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus






Footer1