Computer Organization &
Architecture
PREPARED BY
Ruchi Maurya
Harsh Nankani
Dhaval Solanki
by Ruchi Maurya
What you will see??
• Stack Organizations
• Instruction Formats
• Addressing modes
by Ruchi Maurya
Stack Organization
• A stack is a storage device
• Stores information in such a way that the item stored last would be the
first to be retrieved
• Follows principle of LIFO(Last In First Out)
• A group of memory locations with a register that holds address of Top
• Register that holds the address is called Stack Pointer(SP)
by Ruchi Maurya
Stack Operations
• Two operations of stack are insertion & deletion
• The operation of insertion is called PUSH into stack because it can
be thought of as pushing a new item
• The operation of deletion is called POP from stack because it can
be thought of as removing one item
by Ruchi Maurya
Stack Implementation
• Stack can be implemented in two ways:
1. Register Stack
2. Memory Stack
by Ruchi Maurya
Instruction Format
“The assembler processes an instruction, and it converts the
instruction from its mnemonic form to a standard machine-language
(binary) format called an “instruction format”
by Ruchi Maurya
Components of Instruction format
• Operation code
• Specifies operations to be performed.
• Address field
• Designates a memory address or a processor register.
• Mode
• The way the operand or the effective address is determined.
by Ruchi Maurya
Instruction format
In an instruction format:
• First 12 bits(0-11) specify an address
• Next 3 bits specify operation code(opcode)
• Left most bit specify the addressing mode I
I=0 for direct address
I=1 for indirect address
AddressOpcodeI
011121415
Types of Instruction Format
• Three address instruction
• ADD R1, A, B //R1<-M[A]+M[B]
• Two address instruction
• MOV R1, A //R1<-M[A]
• One address instruction
• LOAD A //AC<-M[A]
• Zero address instruction
• PUSH A //TOS<-A
by Ruchi Maurya
Addressing Modes
• The way the operands are chosen during program execution is
dependent on the addressing mode of the instruction.
• The addressing mode specify a rule for interpreting or the
modifying the address field of the instruction before the operand
is actually referenced.
Opcode Mode Address
Figure Instruction format with mode field
Types of Addressing modes
• Implied Mode
• Immediate Mode
• Register Mode
• Register Indirect Mode
• Autoincrement or Autodecrement Mode
• Direct Address Mode
• Indirect Address Mode
• Relative Address Mode
• Indexed Addressing Mode
• Base Register Addressing Mode
by Ruchi Maurya
Implied Mode
• The operand is hidden/fixed inside the instruction.
• Zero Address instructions in a stack organized computer are
implied mode instructions.
Complement Accumulator CMA
(Here accumulator A is implied by the instruction)
Complement Carry Flag CMC
(Here Flags register is implied by the instruction)
Set Carry Flag STC
(Here Flags register is implied by the instruction)
by Ruchi Maurya
Immediate Mode
• In this mode the operand is specified in instruction itself.
• Operand itself is provided in the instruction rather than its
address.
Move Immediate
MVI A , 15h A ← 15h Here 15h is the immediate operand
Add Immediate
ADI 3Eh A ← A + 3Eh Here 3Eh is the immediate operand
by Ruchi Maurya
Register Mode
• The operand is specified with in one of the processor register.
• Instruction specifies the register in which the operand is stored.
Move
MOV C , A C ← A Here A is the operand specified in register
Add
ADD B A ← A + B Here B is the operand specified in register
by Ruchi Maurya
Register Indirect Mode
• The instruction specifies the register in which the memory address
of operand is placed.
• It do not specify the operand itself but its location with in the
memory where operand is placed.
Move
MOV A , M A ← [[H][L]]
It moves the data from memory location specified by HL register
pair to A.
by Ruchi Maurya
Direct Addressing Mode
• The instruction specifies the direct address of the operand.
• The memory address is specified where the actual operand is.
Load Accumulator
LDA 2805h A ← [2805]
It loads the data from memory location 2805 to A.
Store Accumulator
STA2803h [2803] ← A
It stores the data from A to memory location 2803.
by Ruchi Maurya
Thanks A Lot….!!
by Ruchi Maurya

Types of Addressing modes- COA

  • 1.
    Computer Organization & Architecture PREPAREDBY Ruchi Maurya Harsh Nankani Dhaval Solanki by Ruchi Maurya
  • 2.
    What you willsee?? • Stack Organizations • Instruction Formats • Addressing modes by Ruchi Maurya
  • 3.
    Stack Organization • Astack is a storage device • Stores information in such a way that the item stored last would be the first to be retrieved • Follows principle of LIFO(Last In First Out) • A group of memory locations with a register that holds address of Top • Register that holds the address is called Stack Pointer(SP) by Ruchi Maurya
  • 4.
    Stack Operations • Twooperations of stack are insertion & deletion • The operation of insertion is called PUSH into stack because it can be thought of as pushing a new item • The operation of deletion is called POP from stack because it can be thought of as removing one item by Ruchi Maurya
  • 5.
    Stack Implementation • Stackcan be implemented in two ways: 1. Register Stack 2. Memory Stack by Ruchi Maurya
  • 6.
    Instruction Format “The assemblerprocesses an instruction, and it converts the instruction from its mnemonic form to a standard machine-language (binary) format called an “instruction format” by Ruchi Maurya
  • 7.
    Components of Instructionformat • Operation code • Specifies operations to be performed. • Address field • Designates a memory address or a processor register. • Mode • The way the operand or the effective address is determined. by Ruchi Maurya
  • 8.
    Instruction format In aninstruction format: • First 12 bits(0-11) specify an address • Next 3 bits specify operation code(opcode) • Left most bit specify the addressing mode I I=0 for direct address I=1 for indirect address AddressOpcodeI 011121415
  • 9.
    Types of InstructionFormat • Three address instruction • ADD R1, A, B //R1<-M[A]+M[B] • Two address instruction • MOV R1, A //R1<-M[A] • One address instruction • LOAD A //AC<-M[A] • Zero address instruction • PUSH A //TOS<-A by Ruchi Maurya
  • 10.
    Addressing Modes • Theway the operands are chosen during program execution is dependent on the addressing mode of the instruction. • The addressing mode specify a rule for interpreting or the modifying the address field of the instruction before the operand is actually referenced. Opcode Mode Address Figure Instruction format with mode field
  • 11.
    Types of Addressingmodes • Implied Mode • Immediate Mode • Register Mode • Register Indirect Mode • Autoincrement or Autodecrement Mode • Direct Address Mode • Indirect Address Mode • Relative Address Mode • Indexed Addressing Mode • Base Register Addressing Mode by Ruchi Maurya
  • 12.
    Implied Mode • Theoperand is hidden/fixed inside the instruction. • Zero Address instructions in a stack organized computer are implied mode instructions. Complement Accumulator CMA (Here accumulator A is implied by the instruction) Complement Carry Flag CMC (Here Flags register is implied by the instruction) Set Carry Flag STC (Here Flags register is implied by the instruction) by Ruchi Maurya
  • 13.
    Immediate Mode • Inthis mode the operand is specified in instruction itself. • Operand itself is provided in the instruction rather than its address. Move Immediate MVI A , 15h A ← 15h Here 15h is the immediate operand Add Immediate ADI 3Eh A ← A + 3Eh Here 3Eh is the immediate operand by Ruchi Maurya
  • 14.
    Register Mode • Theoperand is specified with in one of the processor register. • Instruction specifies the register in which the operand is stored. Move MOV C , A C ← A Here A is the operand specified in register Add ADD B A ← A + B Here B is the operand specified in register by Ruchi Maurya
  • 15.
    Register Indirect Mode •The instruction specifies the register in which the memory address of operand is placed. • It do not specify the operand itself but its location with in the memory where operand is placed. Move MOV A , M A ← [[H][L]] It moves the data from memory location specified by HL register pair to A. by Ruchi Maurya
  • 16.
    Direct Addressing Mode •The instruction specifies the direct address of the operand. • The memory address is specified where the actual operand is. Load Accumulator LDA 2805h A ← [2805] It loads the data from memory location 2805 to A. Store Accumulator STA2803h [2803] ← A It stores the data from A to memory location 2803. by Ruchi Maurya
  • 17.