EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong
EE 345 Class Notes 2 Outline 6811 Architecture Review of Addressing modes Review of Instructions Problem solving from Hw3 Exercise: write a program
EE 345 Class Notes 3 A Simple Architecture What is register? What is the structure of memory system?
EE 345 Class Notes 4 M68HC11 Architecture (1) CPU registers
EE 345 Class Notes 5 Memory map in M68HC11 M68HC11 has 16 bit address bus And 8-bit data bus has memory locations Each location hold 8-bit word Not all locations can be used Most useful regions in EE byte RAM staring from $0000 Used for store variables, etc. 8K ROM starting from $e000 Used for store program xx ROM Single Chip mode $FFFF $E000 $B000 $1000 $103F $0000 $00FF RAM Interrupt vectors
EE 345 Class Notes 6 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 LDAA4, X;load from memory address X+4
EE 345 Class Notes 7 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;
EE 345 Class Notes 8 Instruction review Your good friend: Instruction set table
EE 345 Class Notes 9 Example CLRA LDAA #10 LDAB $01 ABA STAA $02 COM $03 LDX #0 STD 2, X