Top Banner
mith College Computer Science Dominique Thiébaut [email protected] CSC270 Spring 2016 Circuits and Systems Lecture Notes — Week 8
45

CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

May 30, 2018

Download

Documents

vanphuc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

mith College

Computer Science

Dominique Thiébaut [email protected]

CSC270 Spring 2016Circuits and Systems

Lecture Notes — Week 8

Page 2: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Goal

Page 3: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Goal

Page 4: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Goal

Page 5: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Goal

Page 6: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

The Motorola 6811 Processor

• M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM • 256 Bytes of On-Chip RAM • 8-Channel, 8-Bit Analog-to-Digital (A/D) Converter • 38 General-Purpose Input/Output (I/O) Pins

Page 7: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

The Motorola 6811 Processor

• M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM • 256 Bytes of On-Chip RAM • 8-Channel, 8-Bit Analog-to-Digital (A/D) Converter • 38 General-Purpose Input/Output (I/O) PinsSystem On a Chip

(SOC)

Page 8: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

The Programmer's View of the 6811

Page 9: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Simplified Architecture

Page 10: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Programmer's View

Page 11: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Complete Architecture

Page 12: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

A Sample of 6800 Instructions

http://www.science.smith.edu/dftwiki/images/9/9e/CSC270_Assembly_Instructions.pdf

Page 13: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

LDAALDAA 0A ; AccA <— Mem[A] (direct)LDAA 0100 ; AccA <— Mem[100](extended)LDAA #3 ; AccA <— 3 (immediate)LDAA X,4 ; AccA <— Mem[X+4](indexed)

LDABLDAB F0 ; AccB <— Mem[F0] (direct)LDAB 0200 ; AccB <— Mem[200](extended)LDAB #3 ; AccB <— 3 (immediate)LDAB X,4 ; AccB <— Mem[X+4](indexed)

LDXLDX #0010 ; X <- 0010 (immediate)

Page 14: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

STAA

STAA 00 ; Mem[0] <— AccA (direct)STAA 0000 ; Mem[0] <— AccA(extended)

STAB

STAB 00 ; Mem[0] <— AccB (direct)STAB 0000 ; Mem[0] <— AccB(extended)

Page 15: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

ADDA

ADDA 00 ; AccA <— AccA + Mem[0](direct)ADDA 0000 ; AccA <— AccA + Mem[0](extended)ADDA #3 ; AccA <— AccA + 3 (immediate)

ADDB

ADDB 00 ; AccB <— AccB + Mem[0](direct)ADDB 0000 ; AccB <— AccB + Mem[0](extended)ADDB #3 ; AccB <— AccB + 3 (immediate)

ABA

ABA ; AccA <— AccA + AccB (inherent)

Page 16: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

INCAINCA ; AccA <— AccA + 1 (inherent)

INCINC 0003 ; Mem[03] <— Mem[03]+1 (extended)

INCBINCB ; AccB <— AccB + 1 (inherent)

Page 17: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

JMP

JMP label ; PC <— label (extended)

Page 18: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

First 6800-Assembly Program

Page 19: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

void main() { char a=2, b=3, result=0; result = a + b; }

ORG 0000a DB 3b DB 4result DB ? ORG 0010start: LDAA a ADDA b STAA result JMP start

Page 20: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Assembling By Hand

http://www.ele.uri.edu/Courses/ele205/6811-Instructions/index.html

ORG 0000a DB 3b DB 4result DB ?

ORG 0010start: LDAA a

ADDA b STAA result JMP start

Page 21: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Assembling By Hand

http://www.ele.uri.edu/Courses/ele205/6811-Instructions/index.html

ORG 0000a DB 3b DB 4result DB ?

ORG 0010start: LDAA a

ADDA b STAA result JMP start

What can you say about the different

bytes?

Page 22: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

We stopped

here last

time…

Page 23: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Side Notes• Motorola 6811 instruction set different from the

Pentium instruction set. Different register sets.

• Different architecture but same groups of instructions (data move, arithmetic and logic, control), and similar addressing modes.

• A note about C, C++, Java and Python programs running on different processors.

• Speed of execution C++, vs Java, vs Assembly http://www.science.smith.edu/dftwiki/index.php/Speed_of_Instructions:_Nasm,_Java,_C%2B%2B_and_Python_comparison

Page 24: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Assembling By Hand

http://www.ele.uri.edu/Courses/ele205/6811-Instructions/index.html

ORG 0000a DB 3b DB 4result DB ?

ORG 0010start: LDAA a

ADDA b STAA result JMP start

Page 25: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Assembling By Hand

http://www.ele.uri.edu/Courses/ele205/6811-Instructions/index.html

ORG 0000a DB 3b DB 4result DB ?

ORG 0010start: LDAA a

ADDA b STAA result JMP start

Page 26: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Assembling By Hand

http://www.ele.uri.edu/Courses/ele205/6811-Instructions/index.html

ORG 0000a DB 3b DB 4result DB ?

ORG 0010start: LDAA a

ADDA b STAA result JMP start

Page 27: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Assembling with an Assembler

Visit this page before continuing…

Page 28: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Assembling with an Assembler

http://www.science.smith.edu/dftwiki/index.php/CSC270_Assembling_6800_Assembly_Programs_on_OSX/Windows

Page 29: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

www.science.smith.edu/dftwiki/index.php/CSC270_Assembling_6800_Assembly_Programs_on_OSX/Windows

Page 30: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

www.science.smith.edu/dftwiki/index.php/CSC270_Assembling_6800_Assembly_Programs_on_OSX/Windows

Page 31: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

www.science.smith.edu/dftwiki/index.php/CSC270_Assembling_6800_Assembly_Programs_on_OSX/Windows

0000 03 0001 04 0002 00 … 0010 96 0011 00 0012 9B 0013 01 0014 97 0015 02 0016 7E 0017 00 0018 10

Page 32: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

ExerciseWrite and assemble a 6800 assembly program that computesy = 2*x + 3, where x and y are byte variables…

Page 33: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Instructions Cycles

http://www.science.smith.edu/dftwiki/images/7/71/6811CycleByCycle.pdfSection 10, Pages 10-6 and 10-13:

Page 34: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

LDAA 03 ; Acca <— Mem[03] (direct)

Page 35: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

LDAA 03 ; Acca <— Mem[03] (direct)

Page 36: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

LDAA 03 ; Acca <— Mem[03] (direct)

Page 37: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

LDAA 03 ; Acca <— Mem[03] (direct)

Page 38: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

LDAA 03 ; Acca <— Mem[03] (direct)

Page 39: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Example Program ORG 0000

a DB 0

ORG 0010start: INC a JMP start

Page 40: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Page 41: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Page 42: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Page 43: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Timing DiagramE

R/W'

Address

Data

Page 44: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

Observing the Execution with a Scope

Page 45: CSC270 Spring 2016 - Clark Science Center. Thiebaut, Computer Science, Smith College The Motorola 6811 Processor • M68HC11 CPU • 8 Kbytes ROM • 512 Bytes of On-Chip EEPROM •

D. Thiebaut, Computer Science, Smith College

You are ready forLab 7!