Motorola 6809 Assembler Overview
Motorola 6809 Assembler Overview
Assembler
Module: Computer Architecture
Course 1erayear S1
2019 - 2020
PLAN
2
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
PLAN
3
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
MOTOROLA 6809
4
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
MOTOROLA 6809
The Motorola 6809 contains:
° An 8-bit Data bus
° A 16-bit address bus allowing for memory addressing of
64 Kilobits.
° Two 8-bit accumulators 'A' and 'B' convertible into 1
16-bit accumulator 'D'
° Two 16-bit index registers 'X' and 'Y'
° Two stack pointer registers "U" and "S"
° A 8-bit page pointer 'DP' used for direct addressing of the
memory
° A status register "CC" on 8 bits
° The 16-bit program counter "PC" (CO) always pointing
on the address that the microprocessor must execute.
5
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
6
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
MOTOROLA 6809: THE PINOUT
7
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
8
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
MOTOROLA 6809: THE PINOUT - Command example
The read/write signal R/W (read/write) determines the
meaning of data transfer.
° When R/W = 1, the 6809 performs a read.
° When R/W = 0, the 6809 performs a write on the bus.
of data.
The status lines of bus BA (Bus Available) and BS (Bus)
State) informs the peripherals of the 6809 about the
availability of data and address buses.
° BA = BS = 0: the data and address buses are
available
° BA = 0, BS = 1 : the 6809 has just received a
interruption.
° BA = 1, BS = 0: the 6809 just encountered in the
program the SYNC instruction.
° BA = BS = 1: Interruption by the HALT signal on 6809
9
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6computers - Assembler 2016 - 2017
10
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
MOTOROLA 6809 : THE REGISTERS
11
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
° The 6809 has several registers used for manipulation and the
data processing:
° 2 8-bit accumulators A and B transformable into 1 accumulator of
16 bits, D.
° They are used for arithmetic, logical, and instructions
loading 8-bit (or 16-bit) data into memory. They are for
they are completely identical.
° The accumulator D is actually the concatenation of A and B, register A
representing the high weights (bits 8 to 15) and B the low weights (bits 0 to)
7).
12
Arch.EitLeHcAtRuIr2e01d5e-s20o1r6computers - Assembler 2016 - 2017
MOTOROLA 6809 : THE INDEX REGISTERS
13
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
° The stack pointer points to the last effective entry of the stack.
14
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6computers - Assembler 2016 - 2017
MOTOROLA 6809 : THE PAGE REGISTER
15
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6computers - Assembler 2016 - 2017
THE CO REGISTER
16
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
MOTOROLA 6809: THE CC REGISTERS
17
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
18
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
MOTOROLA 6809: INTERFACES
19
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
20
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
Assembler: Motorola 6809
° Introduction
° Structure of an assembly instruction
° The main instructions
° The addressing modes in assembly language
° Loops in assembly
° A first example
21
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6computers - Assembler 2016 - 2017
22
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
Motorola 6809 Assembler: INTRODUCTION
23
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
24
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
Motorola 6809 Assembler: STRUCTURE OF AN INSTRUCTION
° An operator (mandatory);
° One or more operands (optional).
Operator Operands
25
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
27
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
LDX, LDY => load the X or Y registers with the contents of the address
mentioned memory
28
ArchEitLeHcAtRuIr2e01d5e-s20o1r6computers - Assembler 2016 - 2017
Motorola 6809 Assembler: ADDRESSING MODES
corresponds to 12 in hexadecimal.
--ADDB#%10001001 Addition of the binary value 10001001 to B
29
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
Ex: With DP = 00
LDA < $00=> load A with the content of address $0000
CMPX < $35 => compare X with the content of addresses $0035 and
$0036
With DP = 24
LDA < $00=> load A with the contents of address $2400
CMPX < $35 => compare X with the content of addresses $2435 and
$2436
30
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
Motorola 6809 Assembler: ADDRESSING MODES
– LDA $0035 => The accumulator A receives the content of the address
35.
31
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
33
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017
Return:
DECB
BNE Return
In this example, the first line loads B with the content of
the address $AA, then we decrement the content of B to the third
line and the fourth line means that if this content does not become
equal to zero, then the μP must return to the line indicated by the label
Return
Note: A label can be any string of
character starting with an alphabet letter
35
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6computers - Assembler 2016 - 2017
36
ArcKh.EitLeHcAtRuIr2e01d5e-s20o1r6dinateurs - Assembler 2016 - 2017