Ac mc add d ac ac md mul t ac ac mt store x mx ac

This preview shows page 15 - 22 out of 46 pages.

AC M[C] */ ADD D /* AC AC + M[D] */ MUL T /* AC AC * M[T] */ STORE X /* M[X] AC */
Image of page 15

Subscribe to view the full document.

Central Processing Unit 16 Zero Address Instruction Zero-Address Instructions - Can be found in a stack-organized computer - Program to evaluate X = (A + B) * (C + D) : PUSH A /* TOS A */ PUSH B /* TOS B */ ADD /* TOS (A + B) */ PUSH C /* TOS C */ PUSH D /* TOS D */ ADD /* TOS (C + D) */ MUL /* TOS (C + D) * (A + B) */ POP X /* M[X] TOS */
Image of page 16
Central Processing Unit 17 Addressing Mode Addressing Modes - Specifies a rule for interpreting or modifying the address field of the instruction (before the operand is actually referenced) Computer uses Addressing mode to accommodate one or both of the following provision : (1) To give flexibility to programmer by providing facilities such as pointer to memory, counter for loop control, indexing of data, program relocation (2) To reduce no. of bits in addressing fields of the instruction
Image of page 17

Subscribe to view the full document.

Central Processing Unit 18 Addressing Mode Two modes that need no address field at all : 1. Implied Mode - Address of the operands are specified implicitly in the definition of the instruction - No need to specify address in the instruction - EA = AC, or EA = Stack[SP] - Examples from Basic Computer - CLA, CME 2. Immediate Mode - Instead of specifying the address of the operand, operand is specified in the instruction itself. - No need to specify address in the instruction - However, operand itself needs to be specified - Sometimes, require more bits than the address - Fast to acquire an operand
Image of page 18
Central Processing Unit 19 Addressing Mode 3. Register Mode - When address field specifies a processor register, it is said to be in register mode - Designated operand need to be in a register - Shorter address than the memory address - Saving address field in the instruction - Faster to acquire an operand than the memory addressing - EA = IR(R) (IR(R): Register field of IR) 4. Register Indirect Mode - Instruction specifies a register which contains the memory address of the operand - Saving instruction bits since register address is shorter than the memory address - Slower to acquire an operand than both the register addressing or memory addressing - Adv : Fewer address bit reqd. compared to memory address - EA = [IR(R)] ([x]: Content of x) 5. Autoincrement or Autodecrement Mode - Similar to Register Indirect but When the address in the register is used to access memory, the value in the register is incremented or decremented by 1 automatically
Image of page 19

Subscribe to view the full document.

Central Processing Unit 20 Addressing Mode 6. Direct Address Mode - Instruction specifies the memory address which can be used directly to access the operand - Faster than the other memory addressing modes - Too many bits are needed to specify the address for a large physical memory space - EA = IR(addr) (IR(addr): address field of IR) 7. Indirect Addressing Mode - The address field of an instruction specifies the address of a memory location that contains the address of the operand - When the abbreviated address is used large physical memory can be addressed with a relatively small number of bits - Slow to acquire an operand because of an additional memory access - EA = M[IR(address)]
Image of page 20
Central Processing Unit 21 Addressing Mode 8. Relative Addressing Modes
Image of page 21

Subscribe to view the full document.

Image of page 22
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes