Docsity

Basic Instruction Set - Microprocessor Based Systems - Lecture Slides, Slides of Microprocessor and Interfacing

Partial preview of the text

Download Basic Instruction Set - Microprocessor Based Systems - Lecture Slides and more Slides Microprocessor and Interfacing in PDF only on Docsity!

Basic Instruction Set

Lecture Overview

  • The M68HC11 Basic Instruction Set
    • How to partition the instruction set to learn it
    • What are those partitions
    • The 68HC11 data movement instructions
  • Material from Chapter 2 and 3 plus a 68HC reference manual. Instruction set details are in Appendix A of the text.

Basic guide (cont.)

  • Instruction classes continued
    • Condition Code Register
    • Branch โ€“ what conditional branches are supported
    • Jump โ€“ direct? How different from Branch?
    • Subroutine Calls and Return โ€“ calls that save register and data and calls that donโ€™t.
    • Stack Pointer
    • Index Register and Indexed access to data
    • Interrupts and Interrupt Handling
    • Any miscellaneous instructions

Data Movement

  • These instructions allow for the transfer of data from one location to another.
  • In a RISC (Reduced Instruction Set Computer) these transfers are the only data movement instructions. Operational instructions are typically register to register with both operands being in register to start.
  • In a CISC (Complex Instruction Set Computer) there are complex instruction that not only perform the operation on data but also result in complex data movement and/or storage.

CLR

  • Operation: ACCX ๏ƒŸ 0 or M ๏ƒŸ 0
  • Description: The contents of the accumulator or the memory location are set to 0s.
  • CC effects: N, V, C are cleared, Z is set
  • Forms: CLRA CLRB CLR

Load data

  • Operation: place the operand data into accumulator A, B, or D.
  • Description: Load the accumulator
  • CC effects: V cleared, N and Z set or cleared depending on value of data.
  • Forms: LDAA LDAB LDD

Store data

  • Operation: Store the accumulator at the effective address.
  • Forms: STAA
  • STAB
  • STD

The Stack

  • The stack is an area of RAM used for temporary storage, typically for subroutine calls and then the subsequent return. It is also used when servicing and interrupt.
  • One of the Programmers Model registers is the stack pointer register. This is a 16-bit register that points to the next free location on the stack. The stack grows down in memory.

Push and Pop

  • Two common operations on stacks are to add data, a Push, and the retrieval of data, a Pop.
  • For the 68HC
    • A PUSH โ€“ Simply store the data at the address pointed to by the stack pointer. After storing the data, decrement the stack pointer.
    • A POP โ€“ Increment the stack pointer. Use the data that the stack pointer now points to. Location is now considered free.

Push and Pull

  • Operation: A/B ๏ƒŸ Mem(SP) Pull
  • Mem(SP) ๏ƒŸ A/B Push
  • Description: Transfers the contents of the Accumulator to or from the top of the stack.
  • CC effects: none
  • Forms: this is an inherent instruction
    • PSHA PSHB PULA PULB

Transfer register

  • Operation: Transfers allowed are
  • from A to B or CCR
  • from B to A
  • from CCR to A
  • Description: Transfers the contents of one register to another.
  • CC effects: A to B and B to A ๏ƒ  N V Z
  • Forms: only inherent

Exchange registers

  • Operation: D ๏ƒŸ X concurrent with X ๏ƒŸ D
  • D ๏ƒŸ Y concurrent with Y๏ƒŸ D
  • Description: Exchange the contents of the D accumulator with the X or Y index register
  • CC effects: None
  • Forms: Inherent form instruction

Assignment

  • Read Chapter 3 through section 3.
  • Problems