ECE3120: Computer Systems Instructions - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

ECE3120: Computer Systems Instructions

Description:

STORE instructions save the contents of a CPU register into a memory location. ... location to store contents of the CPU register. For example, ldaa 0,X. staa ... – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 14
Provided by: xubi
Category:

less

Transcript and Presenter's Notes

Title: ECE3120: Computer Systems Instructions


1
ECE3120 Computer SystemsInstructions
  • Dr. Xubin He
  • http//iweb.tntech.edu/hexb
  • Email hexb_at_tntech.edu
  • Tel 931-3723462, Brown Hall 319

2
  • Prev
  • 68HCS12 Addressing Modes
  • Today
  • 68HCS12 instructions

3
The LOAD and STORE Instructions
  • - The LOAD instruction copies the contents of a
    memory location or places an
  • immediate value into an accumulator or a CPU
    register.
  • - STORE instructions save the contents of a CPU
    register into a memory location.
  • - N and Z flags of the CCR register are
    automatically updated and the V flag is
  • cleared.
  • - All except for the relative mode can be used to
    select the memory location or
  • value to be loaded into an accumulator or CPU
    register.
  • - All except for the relative and immediate modes
    can be used to select memory
  • location to store contents of the CPU
    register. For example,
  • ldaa 0,X
  • staa 20
  • stx 8000
  • ldd 100

4
(No Transcript)
5
Transfer and Exchange Instructions
  • - Transfer instructions copy the contents of a
    CPU register or accumulator into
  • another CPU register or accumulator.
  • - TFR is the universal transfer instruction, but
    other mnemonics are accepted for
  • compatibility with the 68HC11.
  • - The TAB and TBA instructions affect the N, Z,
    and V condition code bits.
  • - The TFR instruction does not affect any
    condition code bits. For example,
  • TFR D,X D ? X
  • TFR A,B A ? B
  • - The EXG instruction exchanges the contents of a
    pair of registers or
  • accumulators. For example,
  • exg A, B
  • exg D,X
  • - The SEX instruction sign-extend an 8-bit twos
    complement number into a 16-
  • bit number so that it can be used in 16-bit
    signed operations. For example,
  • SEX A,X

6
Move Instructions
  • - These instructions move data bytes or words
    from a source to a destination in
  • memory.
  • - Six combinations of immediate, extended, and
    index addressing modes are
  • allowed to specify the source and destination
    addresses
  • IMM ? EXT, IMM ? IDX, EXT ? EXT,
  • EXT ? IDX, IDX ? EXT, IDX ? IDX
  • - Examples
  • movb 100,800
  • movw 0,X, 0,Y

7
Add and Subtract Instructions
  • - These instructions perform fundamental
    arithmetic operations.
  • - The destinations of these instructions are
    always a CPU register or accumulator.
  • - For example,
  • adda 800 A ? A 800
  • adca 800 A ? A 800 C
  • suba 802 A ? A 802
  • sbca 800 A ? A - 800 - C

8
(No Transcript)
9
Instruction Queue
  • - The 68HCS12 executes one instruction at a time
    and many instructions take
  • several clock cycles to complete.
  • - When the CPU is performing the operation, it
    does not need to access memory.
  • - The 68HCS12 prefetches instructions when the
    CPU is not accessing memory to
  • speed up the instruction execution process.
  • - There are two 16-bit queue stages and one
    16-bit buffer. Unless buffering is
  • required, program information is first queued
    in stage 1, and then advanced to
  • stage 2 for execution.

10
Instruction Execution Cycle
Read cyclethe process of accessing a memory
location. Write cycle the process of storing a
value in a memory location. Execution cycle the
process of executing an instruction.
  • When executing an instruction, the 68HCS12
    performs
  • - One or more read cycles to fetch instruction
    opcode bytes and addressing information.
  • - One or more read cycles to fetch the memory
    operand (s) (optional).
  • - The operation specified by the opcode.
  • - One or more write cycles to write back the
    result to either a register or a memory location
    (optional).

11
Chapter Summary
  • Computer
  • hardware (CPU,Memory,I/O)
  • software
  • Microprocessor vs. microcontroller
  • Memory Addressing Modes
  • Instructions

12
What you should have learned
  • Define/explain computer,processor,nicroprocessor,
    microcontroller,embedded systems,hardware,software
    ,assembler,compiler, RAM (DRAM,SRAM),ROM(PROM,EPRO
    M,EEPROM,Flash memory), byte,word,nibble,bus,KB,MB
    ,mnemonic,opcode, operand.
  • Explain different memory addressing modes
  • Write a sequence of arithmetic and data transfer
    instructions to perform simple operations.

13
Next
  • 68HCS12 Assembly Programming
  • Reading Chapter 2.1-2.4
Write a Comment
User Comments (0)
About PowerShow.com