9
EE 345 Class Notes EE 345 Class Notes EE345 Midterm Review EE345 Midterm Review Dr. Jane Dong

EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

Embed Size (px)

Citation preview

Page 1: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

EE 345 Class NotesEE 345 Class Notes

EE345 Midterm ReviewEE345 Midterm Review

Dr. Jane Dong

Page 2: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

2EE 345 Class NotesEE 345 Class Notes

OutlineOutline

6811 Architecture

Review of Addressing modes

Review of Instructions

Problem solving from Hw3

Exercise: write a program

Page 3: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

3EE 345 Class NotesEE 345 Class Notes

A Simple Architecture A Simple Architecture

What is register?

What is the structure of memory system?

Page 4: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

4EE 345 Class NotesEE 345 Class Notes

M68HC11 Architecture (1)M68HC11 Architecture (1)CPU registers

Page 5: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

5EE 345 Class NotesEE 345 Class Notes

Memory map in M68HC11Memory map in M68HC11

M68HC11 has 16 bit address bus

And 8-bit data bushas memory locations

Each location hold 8-bit word

Not all locations can be used

Most useful regions in EE345256 byte RAM staring from $0000

Used for store variables, etc.

8K ROM starting from $e000Used for store program

162

xx

ROM

Single Chip mode$FFFF

$E000

$B000

$1000

$103F

$0000

$00FFRAM

Interrupt vectors

Page 6: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

6EE 345 Class NotesEE 345 Class Notes

Addressing mode (1)Addressing mode (1)What is addressing mode?

The method to reference data in memory or in instruction

The same instruction may have different addressing mode

How M68HC11 distinguish among the addressing modes?Different addressing modes different Opcode in machine code

Example:LDAA #64; load an immediate value

LDAA $0001; load from memory address $0001

LDAA 4, X; load from memory address X+4

Page 7: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

7EE 345 Class NotesEE 345 Class Notes

Addressing mode (2) Addressing mode (2)

Immediate Addressing

Direct Addressing

Extended Addressing

Inherent Addressing

Index addressing

Relative addressing

Example: What addressing modes are used?

ADDA #100;

ADDA $0001;

SUBB 2, X;

Example: What addressing modes are used?

ADDA #100;

ADDA $0001;

SUBB 2, X;

Page 8: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

8EE 345 Class NotesEE 345 Class Notes

Instruction reviewInstruction review

Your good friend: Instruction set table

Page 9: EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong

9EE 345 Class NotesEE 345 Class Notes

ExampleExample

CLRA

LDAA #10

LDAB $01

ABA

STAA $02

COM $03

LDX #0

STD 2, X