MC6809-MC6809E 8-Bit Microprocessor Programming Manual (Motorola Inc.) 1981
MC6809-MC6809E 8-Bit Microprocessor Programming Manual (Motorola Inc.) 1981
MC6809·MC6809E
8·BIT MICROPROCESSOR
PROGRAMMING MANUAL
SECTION 1
GENERAL DESCRIPTION
iii
TABLE OF CONTENTS
(CONTINUED)
SECTION 2
ADDRESSING MODES
2.1 Introduction . .
.............. .... .
............. ......... . . . . .
.................................. 2·1 .. .... ....... ...... ........
2.2.3 Extended . . .
.................................................. . . .... .... . . . .. 2·2
.......... ...... .. ................... .. .. .
2.2.5 Indexed . ..
....... .. . . . . .. . .
................ ............ . .. ... . . . ..
... . ..... ........... .. 2·2
.. .. ..... . ................... ..
SECTION 3
INTERRUPT CAPABILITIES
iv
TABLE OF CONTENTS
(CONCLUDED)
SECTION 4
PROGRAMMING
APPENDIX A
INSTRUCTION SET DETAILS
APPENDIX B
ASSIST09 MONITOR PROGRAM
v
TABLE OF CONTENTS
(CONTINUED)
vi
TABLE OF CONTENTS
(CONTINUED)
.CODTA .
.......................................... . . ........ 8-28
....................................... ...... ............
APPENDIX C
MACHINE CODE TO INSTRUCTION CROSS REFERENCE
APPENDIX D
PROGRAMMING AID
APPENDIX E
ASCII CHARACTER SET
vii
TABLE OF CONTENTS
(CONTINUED)
APPENDIX F
OPCODE MAP
APPENDIX G
PIN ASSIGNMENTS
G.1 Introduction ............................................................................................................ G-1
APPENDIX H
CONVERSION TABLES
H.1 Introduction ............................................................................................................ H-1
H.2 Powers of 2; Powers of 16 ..................................................................................... H-1
H.3 Hexadecimal and Decimal Conversion............................................................... H-2
H.3.1 Converting Hexadecimal to Decimal .............................................................. H-2 .
H.3.2 Converting Decimal to Hexadecimal .............................................................. H-2
LIST OF ILLUSTRATIONS
viii
LIST OF TABLES
4-3 16-Bit Accumulator and Memory Instructions ..... . ........ . ................................... 4-12
4-4 Index/Stack Pointer Instructions ......... . ............ . ...... . ...... . ....... . ..... . .............. . ...... 4-1 2
4-5 Branch Instructions .......................................... . ... . ..................... . .... . ................... 4-1 3
4-6 Miscellaneous Instructions .... ....... . ................... . ........................................ . ....... 4-1 3
ix/x
SECTION 1
GENERAL DESCRIPTION
1.1 INTRODUCTION
This section contains a general description of the Motorola MC6809 and MC6809E
Microprocessor Units (MPU). Pin assignments and a brief description of each input/out
put signal are also given. The term MPU, processor, or M6809 will be used throughout this
manual to refer to both the MC6809 and MC6809E processors. When a topic relates to
only one of the processors, that specific designator (MC6809 or MC6809E) will be used.
.
1.2 FEATURES
The MC6809 and MC6809E microprocessors are greatly enhanced, upward compatible,
computationally faster extensions of the MC6800 microprocessor.
Both address and data are available from the processor earlier in an instruction cycle
than from the MC6800 which simplifies hardware design. Two clock signals, E (the
MC6800 <1>2) and a new quadrature clock Q (which leads E by one-quarter cycle) also
simplify hardware design.
A memory ready (MRDY) input is provided on the MC6809 for working with slow
memories. This input stretches both the processor internal cycle and direct memory ac
cess bus cycle times but allows internal operations to continue at full speed. A direct
memory access request (DMAIBREQ) input is provided for immediate memory access or
dynamic memory refresh operations; this input halts the internal MC6809 clocks.
Because the processor's registers are dynamic, an internal counter periodically recovers
the bus from direct memory access operations and performs a true processor refresh
cycle to allow unlimited length direct memory access operation. An interrupt
acknowledge signal is available to allow development of vectoring by interrupt device
hardware or detection of operating system calls.
1-1
Three prioritized, vectored, hardware interrupt levels are available: non-maskable, fast,
and normal. The highest and lowest priority interrupts, non-maskable and interrupt re
quest respectively, are the normal interrupts used in the M6800 family. A new interrupt on
this processor is the fast interrupt request which provides faster service to its interrupt
input by only stacking the program counter and condition code register and then servic
ing the interrupt.
A Memory Management Unit (MMU), the MC6829, allows a M6809 based system to ad
dress a two megabyte memory space. Note: An arbitrary number of tasks may be sup
ported - slower - with software.
This advanced family of processors is compatible with all M6800 peripheral parts.
Some of the software features of these processors are itemized in the following
paragraphs. Programs developed for the MC6800 can be easily converted for use with the
MC6809 or MC6809E by running the source code through a M6809 Macro Assembler or
any one of the many cross assemblers that are available.
The addressing modes of any microprocessor provide it with the capability to efficiently
address memory to obtain data and instructions. The MC6809 and MC6809E have a ver
satile set of addressing modes which allow them to function using modern programming
techniques.
The addressing modes and instructions of the MC6809 and MC6809E are upward com
patible with the MC6800. The old addressing modes have been retained and many new
ones have been added.
A direct page register has been added which allows a 256 byte "direct" page anywhere in
the 64K logical address space. The direct page register is used to hold the most
significant byte of the address used in direct addreSSing and decrease the time required
for address calculation.
Program counter relative addreSSing is also available for data access as well as branch
instructions.
1-2
In addition, most indexed addressing modes may have an additional level of indirection
added.
Any or all registers may be pushed on to or pulled from either stack with a single instruc
tion.
The programming model (Figure 1-1) for these processors contains five 16-bit and four
8-bit registers that are available to the programmer.
}
15 o
x - I ndex Register
Y - I ndex Register
Po;",,, Rog;"""
U - User Stack Pointer
A
I B Accumu lators
,
D
7 0
7 0
The index registers are used during the indexed addressing modes. The address informa
tion in an index register is used in the calculation of an effective address. This address
may be used to point directly to data or may be modified by an optional constant or
register offset to produce the effective address.
Two stack pOinter registers are available in these processors. They are: a user stack
pOinter register (U) controlled exclusively by the programmer, and a hardware stack
pOinter register (5) which is used automatically by the processor during subroutine calls
1-3
and interrupts, but may also be used by the programmer. Both stack pOinters always
point to the top of the stack.
These registers have the same indexed addressing mode capabilities as the index
registers, and also support push and pull instructions. All four indexable registers (X, Y,
U, S) are referred to as pOinter registers.
The program counter register is used by these processors to store the address of the
next instruction to be executed. It may also be used as an index register in certain ad·
dressing modes.
The accumulator registers (A, B) are general·purpose 8·bit registers used for arithmetic
calculations and data manipulation.
Certain instructions concatenate these registers into one 16·bit accumulator with
register A positioned as the most·significant byte. When concatenated, this register is
referred to as accumulator D.
This 8-bit register contains the most·significant byte of the address to be used in the
direct addressing mode. The contents of this register are concatenated with the byte
following the direct addressing mode operation code to form the 16·bit effective address.
The direct page register contents appear as bits A15 through A8 of the address. This
register is automatically cleared by a hardware reset to ensure M6800 compatiblity.
The condition code register contains the condition codes and the interrupt masks as
shown in Figure 1·2.
Carry
....-Overflow
..
----Zero
----- Negative
.......
--- - I RQ Mask
....-----
. H alf Carry
'------ FIRQ Mask
----- Entire Flag
1·4
1.10.1 CONDITION CODE BITS. Five bits in the condition code register are used to in
dicate the results of instructions that manipulate data. They are: half carry (H), negative
(N), zero (Z), overflow (V), and carry (C). The effect each instruction has on these bits is
given in the detail information for each instruction (see Appendix A).
1.10.1.1 Half Carry (H), Bit 5. This bit is used to indicate that a carry was generated from
bit three in the arithmetic logiC unit as a result of an a-bit addition. This bit is undefined in
all subtract-like instructions. The decimal addition adjust (OAA) instruction uses the
state of this bit to perform the adjust operation.
1.10.1.3 Zero (Z), Bit 2. This bit is used to indicate that the result of the previous opera
tion was zero.
1.10.1.5 Carry(C), Bit O. This bit is used to indicate that a carry or a borrow was generated
from bit seven in the arithmetic logic unit as a result of an a-bit mathematical operation.
1.10.2 INTERRUPT MASK BITS AND STACKING INDICATOR. Two bits (I and F) are used
as mask bits for the interrupt request and the fast interrupt request inputs. When either
or both of these bits are set, their associated input will not be recognized.
One bit (E) is used to indicate how many registers (all, or only the program counter and
condition code) were stacked during the last interrupt.
1.10.2.1 Fast Interrupt Mask (F), Bit 6. This bit is used to mask (disable) any fast
Request
Q
interrupt request line (FIR ). This bit is set automatically by a hardware reset or after
recognition of another interrupt. Execution of certain instructions such as SWI will also
inhibit recognition of a FIRQ input.
1·5
1.10.2.3 Ent i re Flag (E), Bit 7. This bit is used to indicate how many registers were stack
ed. When set, all the registers were stacked during the last interrupt stacking operation.
When clear, only the program counter and condition code registers were stacked during
the last interrupt.
The state of the E bit in the stacked condition code register is used by the return from in
terrupt (RTI) instruction to determine the number of registers to be unstacked.
Figure 1-3 shows the pin assignments for the processors. The following paragraphs pro
vide a short description of each of the input and output signals.
MC6809 MC6809E
BS 5 MR O Y BS 36 AVMA
BA 6 Q. 35 Q
VCC 7 E VCC 34 E
AO 8 OMA/BREQ AO 33 BUSY
Al 9 R/ W 32 R/W
A2 10 DO 31 DO
A3 11 01 30 01
02 29 02
03 28 03
A6 04 27 04
A7 05 26 05
A8 16 06 25 06
A9 07 A9 24 07
1.11.1 MC6809 CLOCKS. The MC6809 has four pins committed to developing the clock
signals needed for internal and system operation. They are: the oscillator pins EXTAL
and XTAL; the standard M6800 enable (E) clock; and a new, quadrature (Q) clock.
1.11.1.1 Oscillator (EXTAL, XTAL). These pins are used to connect the processor's inter
nal oscillator to an external, parallel-resonant crystal. These pins can also be used for in
put of an external TTL timing signal by grounding the XTAL pin and applying the input to
the EXTAL pin. The crystal or the external timing source is four times the resulting bus
frequency.
1-6
1.11.1.2 Enable (E). The E clock is similar to the phase 2 (<p2) MC6800 bus timing clock.
The leading edge indicates to memory and peripherals that the data is stable and to
begin write operations. Data movement occurs after the Q clock is high and is latched on
the trailing edge of E. Data is valid from the processor (during a write operation) by the
rising edge of E.
1.11.1.3 Quadrature (Q). The Q clock leads the E clock by approximately one half of the E
clock time. Address information from the processor is valid with the leading edge of the
Q clock. The Q clock is a new signal in these processors and does not have an equivalent
clock within the MC6800 bus timing.
1.11.2 MC6809E CLOCKS (E and Q). The MC6809E has two pins provided for the TIL
clock signal inputs required for internal operation. They are the standard M6800 enable
(E) clock and the quadrature (Q) clock. The Q input must lead the E input.
Addresses will be valid from the processor (on address delay time after the falling edge
of E) and data will be latched from the bus by the falling edge of E. The Q input is fully TIL
compatible. The E input is used to drive the internal MOS circuitry directly and therefore
requires input levels above the normal TIL levels.
1.11.3 THREE STATE CONTROLS (TSC) (MC6809E). This input is used to place the ad
dress and data lines and the RIW line in the high-impedance state and allows the address
bus to be shared with other bus masters.
1.11.4 LAST INSTRUCTION CYCLE (LIC)(MC6809E). This output goes high during the last
cycle of every instruction and its high-to-Iow transition indicates that the first byte of an
opcode will be latched at the end of the present bus cycl�.
1.11.5 ADDRESS BUS(AO·A15). This 16-bit, unidirectional, three-state bus is used by the
processor to provide address information to the address bus. Address information is
valid on the rising edge of the Q clock. All 16 outputs are in the high-impedance state
when the bus available (BA) signal is high, and for one bus cycle thereafter.
When the processor does not require the address bus for a data transfer, it outputs ad
dress FFFF16, and read/write (RIW) high. This is a "dummy access" of the least
significant byte of the reset vector which replaces the valid memory address (VMA) func
tions of the MC6800. For the MC6809, the memory read signal internal circuitry inhibits
stretching of the clocks during non-access cycles.
1.11.6 DATA BUS (00·07). This 8-bit, bidirectional, three-state bus is the general purpose
data path. All eight outputs are in the high-impedance state when the bus available (BA)
output is high.
1-7
1 .11.7 READIWRITE (RIW). This output indicates the d i rection of data transfer on the data
bus. A low indicates that the processor is writi n g onto the data bus; a high indicates that
the processor is read i n g data from the data bus. The signal at the R/W output is val i d at
the lead i n g edge of the Q clock. The R/W output is in the h igh-i m pedance state when the
bus ava i l able (BA) output is high.
1 .1 1.8 PROCESSOR STATE INDICATORS (BA, BS). The processor uses these two output
l i nes to indicate the p resent processor state. These pins are val id with the leadi n g edge
of the Q c lock.
The bus available (BA) output is used to i ndicate that the buses (address and data) and
the read/write output are in the h i g h-Im pedance state. Thi s signal can be used to i n d i cate
to bus-sharing or d irect memory access systems that the buses are available. When BA
goes low, an additional dead cycle will elapse before the processor regains control of the
buses.
The bus status (BS) output is used in conjunction With the BA output to I ndicate the pre
sent state of the processor. Table 1 -1 is a listing of the BA and BS outputs and the pro
cessor states that they Indicate. The fol lowing paragraphs briefly explain each processor
state.
M U Pl'OC8IIOr State
0 0 Normal (Running)
0 1 Interrupt or Reset Acknowledge
1 0 Sync Acknowledge
1 1 Haiti Bus Grant Acknowledged
1 .1 1 .8.2 Interrupt or Reset Acknowledge. This processor state is i nd icated d u ring both
cycles of a hardware vector fetch which occurs when any of the fol l ow i n g i nterrupts have
occurred: RESET, N MI, FIRQ, IRQ, SWI, SWI2, and SWI3.
This output, p l us decod ing of address li nes A3 through A1 provides the user with an
i ndication of which interrupt is bei ng serviced.
1 .11.8.3 Sync Acknowledge. The processor is waiting for an external synchron ization in
put on an i nterrupt l i ne. See SYN C inst ruction i n Appendix A.
1 .11.8.4 Halt/Bus Grant. The processor is halted or bus control has been g ranted to some
other device.
1-8
1.11 .9 RESET (RESET). This input is used to reset the processor. A low input lasting
longer than one bus cycle will reset the processor.
The reset vector is fetched from locations $FFFE and $FFFF when the processor enters
the reset acknolwedge state as indicated by the BA output being low and the BS output
being high.
During initial power-on, the reset input should be held low until the clock oscillator is ful
ly operational.
1.1 1 .1 0.1 Non-Maskable Interrupt (NMI). A negative edge on this input requests that a
non-maskable interrupt sequence be generated. This input, as the name indicates, can
not be masked by software and has the highest priority of the three interrupt inputs. After
a reset has occurred, a NMI input will not be recognized by the processor until the first
program load of the hardware stack pointer. The entire machine state is saved on the
hardware stack during the processing of a non-maskable interrupt. This interrupt is inter
nally blocked after a hardware reset until the stack pOinter is initialized.
1 .1 1 .1 0.2 Fast Interrupt Request (FIRQ). This input is used to initiate a fast interrupt re
quest sequence. Initiation depends on the F (fast interrupt request mask) bit in the condi
tion code register being clear. This bit is set during reset. During the interrupt, only the
contents of the condition code register and the program counter are stacked resulting in
a short amount of time required to service this Interrupt. This interrupt has a higher priori
ty than the normal interrupt request (IRQ).
1.1 1 .1 0.3 Interrupt Request (IRQ). This input is used to initiate what might be considered
the "normal" interrupt request sequence. Initiation depends on the I (interrupt mask) bit
in the condition code register being clear. This bit is set during reset. The entire machine
state is saved on the hardware stack during processing of an IRQ input. This input has
the lowest priority of the three hardware interrupts.
1 .1 1 .11 MEMORY READ (MRDy) (MC6809). This input allows extension of the E and Q
clocks to allow a longer data access time. A low on this input allows extension of the E
and Q clocks (E high and Q low) in integral multiples of quarter bus cycles (up to 1 0
cycles) to allow interface with slow memory devices.
1-9
M emory ready does not extend the E and Q clocks d u ring non-va l id memory access
cycles and therefore the processor does not slow down for "don't care" bus accesses.
M emory ready may also be used to extend the E and Q clocks when an external device is
using the halt and d i rect memory access/bus request i n p uts.
1.11 .1 3 HALT. This i n put is used to halt the processor. A low i n put halts the processor at
the end of the present instruction execution cycle and the processor remains halted in
defin itely without loss of data.
When the processor is halted, the BA output is high to indicate that the buses are in the
h i g h-im pedance state and the BS output is also high to indicate that the processor is i n
t h e halt/bus g rant state.
During the halt/bus grant state, the processor will not respond to external real-time re
q uests such as FIRQ or IRQ. However, a d irect memory accesslbus request input wi l l be
accepted . A non-maskable Interrupt or a reset i n put wi l l be l atched for processing l ater.
The E and Q clocks conti n ue to run during the halt/bus grant state.
A low level on this i nput occurring d uring the Q clock high time suspends instruct ion ex
ecution at the end of the current cycle. The processor ac �nowledges acceptance of this
i n put by setti ng the BA and BS outputs high to sign ify the bus grant state. The requesting
device now has up to 15 bus cycles before the processor retrieves the bus for self-refresh.
!n!!...c � di rect memory access controller w i l l req uest to use the bus by setting the
DMAIBREQ I nput low when E goes high. When the processor acknowledges this i n p ut by
setti ng the BA and BS outputs high, that cycle will be a dead cycle used to transfer bus
mastership to the direct memory access controller. False memory access d u ri ng any
dead cycle should be prevented by externally developing a system DMAVMA signa·1
which Is low in any cycle when the BA output changes.
When the BA output goes low, either as a result of a d irect memory access/bus request or
a processor self-refresh, the d irect memory access device should be removed from the
bus. Another dead cycle w i l l elapse before the processor accesses memory, to al low
transfer of bus mastership without contention.
1.1 1 .1 5 BUSY (MC8809E). This output ind icates that bus re-arbitration should be deferred
and provides the i ndlvisable memory operation required for a "test-and-set" pri m itive.
1-10
This output wi l l be high for the fi rst two cycles of any Read-Modify-Wrlte i n struction, h i g h
d u ring t h e fi rst byte o f a double-byte access, a n d h i g h d u r i n g t h e fi rst byte of any indirect
access or vector-fetch o peration.
1 .1 1 .16 POWER. Two i n puts are used to su pply power to the p rocessor: Vee i s + 5.0
± 5%, wh i le VSS is g round or 0 volts.
1-1111-12
SECTION 2
ADDRESSIN G MODES
2.1 INTRODUCTION
This section contains a description of each of the addressing modes available on these
processors.
The addressing modes available on the MC6809 and MC6809E are: Inherent, Immediate,
Extended, Direct, Indexed (with various offsets and autoincrementing/decrementing),
and Branch Relative. Some of these addressing modes require an additional byte after
the opcode to provide additional addressing interpretation. This byte is called a postbyte.
2.2.2 IMMEDIATE. The operand is contained in one or two bytes immediately following
the opcode. This addressing mode is used to provide constant data values that do not
change during program execution. Both 8- bit and 16-bit operands are used depending on
the size of the argument specified in the opcode.
Example: LOA #CR
LOB #7
LOA #$FO
LOB #%1110000
LOX #$8004
2-1
b7 b6 b5 b4 b3 b2 bl bO
I SOURCE ( R l 1 DESTINAT I O N ( R21 I
Code- Register Code- Register
0000 D (A:BI 0101 Program Counter
000 1 X Index 1 000 A Accumulator
00 1 0 Y Index 1001 B Accumulator
001 1 U Stack Pointer 1010 Condition Code
0 1 00 S Stack Pointer 101 1 Direct Page
b7 b6 b5 b4 b3 b2 bl bO
I PC l s/ u I y I X I DP I B I A I cc I
PC = Program Counter
StU = Hardware/ User Stack Pointer
y = Y Index Register
X = U Index Register
DP = Direct Page Register
B = B Accumulator
A = A Accumulator
CC = Condition Code Register
2.2.3 EXTENDED. The effective address of the argument is contained in the two bytes
fol lowing the opcode. I n structions using the extended addressing mode can reference
arg uments anywhere in the 64K add ressi ng space. Extended addressi ng is generally not
u sed i n position i ndependent programs because it suppl ies an absol ute add ress.
Example: LOA > CAT
2.2.4 DIRECT. The effective address is developed by concaten ation of the contents of the
d i rect page reg ister with the byte immediately fol lowi n g the opcode. The d i rect page
reg ister contents are the most·significant byte of the address. This allows accessi n g 256
l ocations withi n any one of 256 pages. Therefore, the enti re add ressing range i s avai l able
for access using a single two·byte instruct ion.
Example: LOA > CAT
2.2.S INDEXED. I n these addressing modes, one of the pOi nter reg i sters (X, V, U, or S), and
someti mes the program counter (PC) is u sed in the calculation of the effective add ress of
the i n struct ion operand. The basic types (and their variations) of i ndexed add ressing
avai lable are shown i n Table 2-1 along with the post byte conf i g u ration used .
2.2.S.1 Constant Offset from Register. The contents of the reg i ster deSignated i n the
post byte are added to a twos com plement offset val ue to form the effective add ress of
2-2
the instruction operand. The contents of the designated register are not affected by this
addition. The offset sizes available are:
No
offset designated register contains the effective
address
5-bit 16 to + 15
8·bit 128 to + 127
16-bit 32768 to + 32767
The 5·bit offset value is contained in the postbyte. The 8· and 16·bit offset values are con·
tained in the byte or bytes immediately following the postbyte. If the Motorola assembler
is used, it will automatically determine the most efficient offset; thus, the programmer
need not be concerned about the offset size.
Examples: LOA ,X LOY - 64000, U
LOB O,Y LOA 17, PC
LOX 64,000,5 LOA There, PCR
2.2.5.2 Accumulator Offset from Register. The contents of the index or pOinter register
designed in the postbyte are temporarily added to the twos complement offset value con·
tained in an accumulator (A, B, or D) also designated in the postbyte. N either the
designated register nor the accumulator contents are affected by this addition.
Example: L OA A,X LOA O,U
LOA B,Y
2-3
I n the autoincrement mode, the contents of the effective address contai ned i n the
pOi nter reg ister, designated in the postbyte, and then the pOinter regi ster is automatical
ly incremented ; thus, the pOi nter reg ister is post incremented.
In the autodecrement mode, the poi nter reg ister, designated in the postbyte, is
automatical ly decremented fi rst and then the contents of the new address are used;
thus, the poi nter reg i ster is predecremented.
Exam ples: Autolncrement Autodecrement
LOA ,X + LOY ,X + + LOA ,-X LOY ,- -X
LOA ,Y + LOX ,Y + + LOA ,-V LOX ,- -Y
LOA ,5 + LOX ,U + + LOA ,-5 LOX ,- -U
LOA ,U + LOX ,5 + + LOA ,-U LOX ,- -5
2.2.5.4 Indirection. When using indirect ion, the effect ive address of the base i ndexed ad
dressing mode is used to fetch two bytes which contai n the final effective address of the
operand. It can be used with al l the i ndexed addressing modes and the program cou nter
rel ative addressing mode.
2.2.5.5 Extended Indirect. The effective address of the arg ument is located at the ad
dress specified by the two bytes fol low i n g the post byte. The postbyte is used to indicate
i n d i rection .
Example: LOA [$FOOO]
2.2.5.8 Program Counter Relative. The p rogram counter can also be used as a pOi nter
with either an 8- or 1 6-bit signed constant offset. The offset val ue is added to the program
cou nter to develop an effective address. Part of the post byte is used to indicate whether
the offset is 8 or 16 bits.
2.2.8 BRANCH RELATIVE. This addressing mode is used when branches from the c u rrent
i n struction location to some other locat ion relative to the current program counter are
des i red. If the test condition of the branch instruction is true, then the effective address
is calculated (program counter plus twos complement offset) and the branch is taken. If
the test condition i s false, the processor proceeds to the next in-l i ne instruction. Note
that the prog ram counter is always poi nting to the next instruction when the offset is ad
ded . Branch relative addressing is always used i n position independent programs for all
contro l transfers.
For short branches, the byte fol lowi n g the branch instruction opcode is treated as an
8-bit signed offset to be used to cal c u l ate the effective add ress of the next i n struction if
the branch i s taken . Th is is cal led a short relative branch and the range is l i m i ted to p l us
1 27 or m i n u s 1 28 bytes from the fol low i n g opcode.
For long branches, the two bytes after the opcode are used to calculate the effective ad
d ress. Th i s is cal led a long relative branch and the range is p l u s 32,767 or m i n us 32,768
2-4
bytes from the fol lowing opcode or the f u l l 64K address space of memory that the pro
cessor can add ress at one t i me.
Examples: Short Branch Long Branch
BRA PO LE LBRA CAT
2-5/2-6
SECTION 3
I NTERRUPT CAPABI LITI ES
3.1 INTRODUCTION
The M C6809 and MC6809E microprocessors have six vectored i nterrupts (th ree hardware
and three software). The hardware interrupts are the non-maskable interrupt (N M I), the
fast maskable interru pt req uest (FI RQ), and the normal maskable interru pt req uest (I RQ).
The software I nterrupts consist of SWI , SWI2, and SWI3. When an i nterrupt request is
acknowledged, all the processor registers are pushed onto the hardware stack, except i n
t h e case o f F I RQ where o n l y t h e program counter and t h e condition code register is sav
ed , and control is transferred to tl!!.! d dress1!!.1he interrupt vector. The p ri o rity of these
i nterrupts is, h i ghest to lowest, N M I , SWI , FI RQ, I RQ, SWI2, and SWI3. Figure 3-1 is a
detai l ed flowchart of i nterru pt processi n g i n these processors. The i nterrupt vector loca
tions are g iven in Table 3-1 . The vector locations contai n the address for the i nterru pt
routi ne.
Add itional information on the SWI , SWI2, and SWI3 interrupts is g iven in Appendix A. The
hardware i nterrupts, N M I , FI RQ, and I RQ are l i sted al phabetical ly at the end of Appendix
A.
The non-maskable i nterrupt is edge-sensitive i n the sense that if it is sam p led low one cy
cle after it has been sampled high, a non-maskable interrupt wi l l be triggered. Because
the non-maskable i nterrupt cannot be masked by execution of the non-maskable i nter
rupt handler routine, it is possible to accept another non-maskable interru pt before ex
ecut i ng the first instruct ion of the interru pt routine. A fatal error w i l l exist if a non
maskable i nterrupt is repeatedly al lowed to occur before completing the retu rn from i n
terru pt (RTI) instruction of the previous non-maskable interru pt req uest, si nce the stack
3-1
w i l l eventual ly overflow. Th is i nterrupt is especial ly appl icable to gai n i n g i m med iate p ro
cessor response for powerfa i l , software dynamic memory refresh , or other non-delayable
events.
A low level on the F I RQ i nput with the F (fast i nterrupt req uest mask) bit i n the condit ion
code reg i ster clear triggers this i nterru pt seq uence. The fast i nterru pt req uest provides
fast i nterru pt response by stacking only the prog ram counter and condit ion code
reg i ster. Th i s al lows fast context switching with m i n imal overhead . If any reg i sters are
u sed by the i nterrupt routine then they can be saved by a single push i nstruct ion.
After accepti n g a fast interru pt req uest, the processor clears the E flag, saves the pro
g ram c2!:!IDer and cond ition code reg ister, and then sets both the I and F bits to mask any
f u rther I RQ and F I RQ i nterrupts. After servicing the ori g i nal interru pt, the user may selec
t ively clear the I and F bits to al low multi ple-level i nterrupts if so desired .
A low level on the I RQ input with the I (i nterru pt req uest mask) bit i n the cond ition code
reg i ster clear triggers this i nterru pt seq uence. The normal m askabl e i nterru pt req uest
p rovides a slower hardware response to i nterru pts because it causes the ent i re m ach i ne
state to be stacked . However, this means that i nterrupting software routi nes can use all
p rocessor resou rces without fear of damag ing the i nterrupted routine. A normal i nterru pt
request, havi n g lower priority than the fast i nterrupt request, i s prevented from i nterru p
t i n g the fast i nterru pt hand ler by the automatic sett i ng of the I bit by the fast i nterrupt re
q uest handler.
After accepti n g a normal i nterrupt req uest, the p rocessor sets the E flag, saves the ent i re
m achine state, and then sets the I bit to mask any further interrupt req uest i n puts. After
servicing the ori g i nal i nterrupt, the user may clear the I bit to al low m u lt i ple-level normal
i nterrupts.
All interrupt hand l i ng routi nes shou ld retu rn to the formerly executing tasks u s i n g a
ret u rn from i nterrupt (RiT) instruction. Th is i n st ruction recovers the saved mach ine state
f rom the hardware stack and control is retu rned to the i nterru pted program . If t he
recovered E bit is clear, it indicates that a fast i nterrupt req uest occurred and only the
program cou nter address and condition code reg ister are to be recovered.
The software i nterru pts cause the processor to go through the normal i nterru pt request
sequence of stacking the complete mac h i ne state even though the i nterru pt i n g sou rce i s
the processor itself. These i nterru pts are com monly used for prog ram debugg i n g a n d for
cal l s to an operating system.
3-2
Normal p rocessing of the SWI i n put sets the I and F bits to p revent either of these i nter
ru pt req uests from affecting the com pletion of a software i nterrupt req uest. The remain
ing software interru pt request inp uts (SWI2 and SWI3) do not have the priority of the SWI
i n put and therefore do not mask the two hardware i nterru pt req uest i n puts (FI RQ and
I RQ).
3-3
r- - - - - - ~C6!!
~ --,
O-DPR
I-F,I
l-R/W
Clrimi
LogiC
DlsarmNm
----r---
L ___________ _
CWAI
Bus SIal8 BA I BS
Run",n o I 0
Interrupt or Reset Acknowledge o I 1
ync Acknowledge o
Halt Acknowledge
NOTES: 1. Asserting RESET will result in entering the reset sequence from any point in Ihe flowchart.
2. BUSY is high during first vector fetch cycle (MC6809EI.
4.1 I NTRODUCTION
These processors are designed to be sou rce-code com patible with the M 6800 to m ake
use of the su bstantial existi n g base of M6BOO software and traini n g . However, this asset
sho u l d not overshadow the capab i l ities bu i lt i nto these processors that allow more
modern prog ram m i ng tec h n i q ues such as position-i ndependence, mod u lar programm
i n g , and reentrancy/recu rsion to be u sed on a m icroprocessor-based system. A brief
review of these methods is given in the fol l owing paragraphs.
4.1 .2 MO DULAR P ROG RAMM I N G . M od u lar prog ramm i ng is another indication of q ual ity
code. A mod u l e is a prog ram element which can be easily discon nected from the rest of
the prog ram either for re-use in a new environment or for replacement. A module is usual
ly a su broutine (although a subroutine i s not necessari ly a mod u le); freq uently, the p ro
g rammer isol ates reg ister changes i nternal to the module by pushing these reg isters
onto the stack u pon entry, and p u l l i ng them off the stack before the return. I so l at i n g
register changes i n t h e cal led mod u l e , to that mod u l e alone, allows t h e code i n the cal l
i n g program to be more eas i ly analyzed since it can be assumed that al l registers (except
those spec ifical l y used for parameter transfer are u nchanged by each cal led mod u le.
Th i s l eaves the processor's registers free at each level for loop counts, add ress com
parisons, etc.
4.1 .2.1 Local Storage. A clean m ethod for al locat i n g "local " storage is req u i red both by
position-i ndependent prog rams as wel l as mod u l ar prog rams. Local or temporary storage
is used to hold va l ues on ly d u ri n g execution of a mod ule (or cal l ed modu les) and is releas
ed u pon ret u rn . One way to al locate local storage is to decrement the hardware stack
4-1
pOinter(s) by the nu mber of bytes needed. I n terru pts w i ll then leave th i s area intact and i t
c a n b e de-allocated o n exit ing the module. A mod u l e wi ll almost always need more tem
porary storage than just the M PU regi sters.
4.1.2.2 Global Storage. Even in a modu lar envi ron ment there may be a n eed for "global"
val ues which are accessi ble by many modu l es wit h i n a gi ven system. These provide a
conven ient means for storing val u es from one i nvocat ion to another i nvocat ion of the
same routi n e. Global storage may be created as local storage at some level, and a
pOinter reg ister (usually U) used to pOi nt at this area. Th is register is passed u nchanged
i n al l subrouti n es, and may be used to i ndex i nto the global area.
The same tec h n i que wh ich was implemented to allow reentrancy also allows recursion .
A recursive routine i s defined as a routine that cal l s itself. A recu rsive routine might be
written to simplify the solution of certai n types of problems, especially those wh ich have
a data structure whose elements may themselves be a structure. For exam ple, a paren
thet ical equat ion represents a case where the expression i n parenthesis may be con
sidered to be a val ue wh ich is operated on by the rest of the equation. A programmer
m ight choose to write an expression evaluator passing the parenthetical expression
(which m i g ht also contain parenthetical expressions) i n the call, and receive back the
retu rned value of th e expression wit h i n th e parenthesis.
The followi ng paragraphs briefly explain how the MC6809 is used with the programmi ng
tech n i ques mentioned earl ier.
4-2
4.2.1.1 Parameters. Parameters may be passed to or from modu l es eith er i n reg i sters, if
they will provi de sufficient storage for parameter passage, or on the stack. If parameters
are passed on the stack, they are placed there before call ing the lower level modu l e. The
called modu l e is then written to use local storage i n s i de the -stack as n eeded (e.g., ADDA
offset,S). Notice that the requ i red offset consists of the n u mber of bytes pushed (upon
entry), plus two from the stacked return address, plus the data offset at the t i me of the
call. Th is value may be calculated, by hand, by drawing a "stack pictu re" d i ag ram
representi n g module entry, and assi g n i n g conven i ent mnemonics to these offsets with
the assembler. Returned parameters replace those sent to the routi ne. If more
parameters are to be returned on the stack than would normal ly be sent, space for the i r
return is allocated by t h e call ing rout i n e before t h e act ual call (i f four additional bytes are
to be returned, the caller wou l d execute LEAS -4,S to acqu i re the additional storage).
4.2.1.2 Local Storage. Local storage space is acqu i red from the stack wh i le the present
rout i n e is executing and then returned to the stack prior to exit. The act of push i ng
reg isters which w i l l be used in later calcu l ations essentially saves those regi sters i n tem
porary local storage. Add itional local storage can easi ly be acqu i red from the stack e.g.,
executing LEAS -2048,S acqu i res a buffer area ru n n i ng from the O,S to 2047,S i nclusive.
Any byte in this area may be accessed d i rectly by any instruction which h as an i ndexed
addresing mode. At the en d of the routi ne, the area acqu ired for local storage is released
(e.g., LEAS 2048,S) prior to the fi nal pull . For c l eaner prog rams, local storage should be
allocated at entry to the module and released at the exit of the module.
4.2.1.3 Global Storage. The area requ i red for global storage is also most effecti vely ac
qu i red from the stack, probably by the h ighest level routi ne in the standard package.
Although this is local storage to the highest level routine, it becomes "global" by posi
tion i ng a reg ister to poi nt at this storage, (someti mes referred to as a stack mark) then
establishing the convention that all modu les pass that same pOi nter val u e when cal l i ng
lower level modu les. I n practice, it i s conve n ient to leave this stack mark reg i ster u n
changed i n all modules, especially if g lobal accesses are common. The highest level
routi n e in the standard package would execute the fol lowing sequence u pon ent ry (to i n
itialize t h e g lobal area):
4-3
4.2.2 POSITION·INDEPENDENT CODE. Position-independent code means that the same
machine lang uage code can be placed anywhere in memory and sti l l function correctly.
The M6809 has a long relative (16-bit offset) branch mode along with the com mon
MC6800 branches, p l u s program-counter rel at ive addressi ng. Program-counter rel ative
addressing u ses the program counter l i ke an i ndexable reg ister, which allows all instruc
tions that reference memory to also reference data rel ative to the program counter. The
M6809 also h as load effect ive add ress (LEA) i n st ructions which al low the user to pOi nt to
data in a ROM in a position-independent man ner.
An i mportant rule for generat i n g position-independent code is: NEVER USE ABSOLUTE
ADDRESSI NG.
Program-cou nter relative addressing on the M6809 is a form of i ndexed addressing that
uses the prog ram cou nter as the base reg ister for a constant-offset i ndexi ng operation.
However, the M6809 assembler treats the PCR address field differently from that used in
other i ndexed instructions. I n PCR addressing, the assembly t i me location val ue i s sub
tracted from the (con stant) value of the PCR offset. The resulting distance to the desi red
symbol is the val ue placed i nto the machine language object code. During execution, the
processor adds the value of the run time PC to the d i stance to get a posit ion-independent
absol ute add ress.
The PCR indexed add ressing form can be used to poi nt at any locat ion relati ve to the pro
g ram regard l ess of position in memory. The peR form of i ndexed addressing al lows ac
cess to tables with i n the program .s pace in a position-independent manner via use of the
load effective address instruction.
I n a program which is completely position-i nd$pendent, some absol ute locations are
usual ly requi red, particularly for I /O. If the locations of I /O devices are placed on the
stack (as g lobals) by a small set u p rout ine before the standard package Is invoked, all in
ternal mod ules can do their I /O through that pOi nter (e.g., STA [ACIAD, UD, al lowing the
hardware to be eas i ly changed, i f desi red . Only the Single, smal l , and obvious set u p
rout ine need b e rewritten for each different hardware confi g u rat ion.
The LEA instructions al low access to tables, data, or i mmediate val ues i n the text of the
program in a position-i ndependent manner as shown i n the fol lowing example:
4-4
Here we wish to pOint at a message to be pri nted from the body of the program. By
writing "MSG1 , peR" we s i gnal the assembler to compute the distance between the pre
sent address (the address of the LBSR) and MSG1 . Th is resu lt is inserted as a constant
i nto the LEA instruction which wi l l be indexed from the program counter value at the t i me
of execution. Now, no matter where the code i s located, when i t is executed the com
p uter offset from the program cou nter wi ll poi nt at MSG1 . Th is code is position
i n dependent.
It is common to use space in the hardware stack for temporary storage. Space is made
for temporary variables from O,S through TEMP-1 , S by decrement i n g the stack pOi nter
equal to the len gth of requ i red storage. We could u se:
LEAS -TEMP,S.
Not only does this facil itate position-i ndependent code but i t is structured and helps
reentrancy and recursion.
Stacks are simple and convenient mechanisms for generati n g reentrant programs.
Subrouti nes wh ich use stacks for pass i n g parameters and results can be easily made to
be reentrant. Stack accesses use the i ndexed addressing mode for fast, efficient execu
tion. Stack addressi n g is qu ick.
Pure code, or code that is not self-modifying, is mandatory to produce reentrant code. No
i nternal i nformation within the code Is subject to modification . Reentrant code never has
i nternal tem porary storage, is sim pler to debug, can be placed i n ROM, and must be i nter
ruptable.
4.2.4 RECURSIVE PROGRAMS. A recu rsive program is one that can call itself. They are
quite conven ient for parsing mechanisms and certain arithmetic functions such as com
puting factorials. As with reentrant programmi ng, stacks are very usef u l for this techni
que.
4.2.5 LOOPS. The usual structured loops (i.e., REPEAT ... UNTIL, WHI LE ... DO, FOR ... , etc.)
are avai lable In assembly language i n exactly the same way a h i gh-level language com
piler cou ld translate the construct for execution on the target machine. Using a
FOR...NEXT loop as an example, it is possi ble to p ush the loop count, i ncrement value,
and termi nation val ue on the stack as variables local to that loop. On each pass through
the loop, the worki ng register is saved, the loop count picked up, the increment added i n ,
a n d t h e resu lt compared to t h e termi nation value. Based o n t h i s comparison, t h e loop
counter might be u pdated, the worki n g register recovered and the loop resumed, or the
workin g register recovered and the loo p variables de-allocated. Reasonable macros
4-5
cou ld m ake the sou rce form for loop trivial , even i n assembly l an guage. Such m acros
might red uce errors resu lt i n g from the u se of m u lt i ple i n structions sim ply to i m pl ement a
standard control structure.
It i s i m portant to al low the main program as well as su brouti nes access to this block of
data, especially if arg uments are to be passed from the mai n program to the subrouti nes
and vice versa.
4.2.6.1 M6809 Stacking Operations. Stack pOi nters are markers which poi nt to the stack
and its i nternal contents. Although a l l fou r i ndex reg i sters may be used as stack
regi sters, the S (hardware stack pointer) and the U (user stack pOi nter) are generally
preferred because the push and pull instructions apply to these regi sters. Both are 16-bit
i ndexable registers. The processor uses the S reg i ster automatically d u ring i nterrupts
and subroutine cal ls. The U register is free for any purpose needed. It i s not affected by
i nterrupts or subroutine cal ls i mplemented by the hardware.
Either stack poi nter can be specified as the base address in i ndexed addreSSi ng. One u se
of the i n d i rect addressing mode uses stack poi nters to al low addresses of d ata to be
passed to a subrouti n e on a stack as argu ments to a subrouti n e. The subroutine can now
reference the data with one instruction. Hi gh-level language cal l s that pass argu ments
by reference are now more efficiently coded. Also, each stack push or pull operation in a
program u ses a post byte wh ich specifies any register or set of regi sters to be pushed or
p u lled from either stack. With this option, the overhead associated with subroutine call s
i n both assembl y a n d high-level language program s i s greatly decreased. I n fact, with the
large n u m ber of i n st ructions that use autoincrement and autodecrement, the M6809 can
em u l ate a true stack computer architectu re.
Using the S or U stack poi nter, the order i n which the reg isters are pushed or pu l led i s
shown i n Figure 4-1. Not ice that w e push "onto" the stack towards decreas i n g memory
locations. The program cou nter is pushed fi rst. Then the stack poi nter is decremented
and the "other" stack pOi nter is pushed onto the stack. Decrement i ng and stori ng con
t i n ues u nt i l all the reg isters requested by the postbyte are pushed onto the stack. The
stack pOi nter pOi nts to the top of the stack after the push ope ration.
The stacki n g order i s specified by the processor. The stacki ng order is identical to the
order used for all hardware and software i nterrupts. The same order is used even if a
subset of the reg i sters i s p ushed.
4-6
Good prog rammi ng pract ice dictates the use of the hardware stack for temporary
storage. To reserve space, decrement the stack poi nter by the amount of storage re
qu i red with the i n struction LEAS -TEMPS, S. Th i s instruction makes space for tem
porary variables from 0,5 through TEMPS -1,5.
Memory
=R ·
...
Stack Pointer
After Stacking
- CC } Condition Code Register Contents
-
X.H
X.L
-
} X Contents
-
.Y .H
Y. L
- } Y Contents
U . H or S .H
-
�
U . L or S . L .
} Other Stack Pointer Contents
-
PC.H
PC. L
- } P rogram Counter Contents
Stack Pointer
..
Before Stacking
·
. · .
4.2.6.2 Subroutine Linkage. In the h ighest level routi ne, global variables are someti mes
considered to be local. Therefore, global storage is al located at this poi nt, but access to
these same variables requ ires different offset val ues dependi ng on s u brouti n e dept h .
Because subroutine depth chan ges dynamically, the length may not b e known
beforehan d . Th is problem is solved by ass i g n i ng one pOi nter (U will be u sed i n the fol low
ing descri ption, but X or Y could also be used) to "mark" a location on the hardware stack
by using the instruct ion TFR S,U. If the prog rammer does this i mmediately prior to
allocating g lobal storage, then all variables will then be available at a constant n egat i ve
offset location from this stack mark. I f the stack i s marked after the g lo bal variables are
4-7
al located, then the g lobal variables are avai lable at a constant positive offset from U .
Reg ister U is then cal led the stack mark pOi nter. Recall that the hardware stack poi nter
m ay be modi fied by hardware i nterrupts. For this reason, i t i s fatal to use data referred to
by a negative offset with respect to the hardware stack pOi nter, S.
4.2.6.3 Software Stacks.If more than two stacks are needed, autoincrement and
autodecrement mode of addressi n g can be used to gen erate addi ti onal software stack
pOi n ters.
The X, Y, and U i n dex regi sters are qu i te useful i n loops for i ncrementi ng and decremen
t i ng pu rposes. Th e pOi nter is used for searching tables and also to move data from one
area of memory to another (block moves). Th is auto i ncrement and autodecremen t
feature i s available i n the i ndexed addressi ng mode of the M6809 to fac i l itate such opera
t ions.
In autoi ncrem ent, the value contained i n the i ndex reg i st er (X or Y, U or S) is used as the
effective address and then the reg ister i s i nc remen ted (post i ncremen ted). I n autodecre
ment, the i n dex reg i ster is f i rst decremented and then used to obtai n the effecti ve ad
d ress (predecremented). Postincremen t or predecrement is always performed in this ad
d ressing mode. Th i s is equ i valent in operation to the push and p u l l from a stack. Th i s
equ i valence allows the X and Y i n d ex reg i sters to be used a s software stack pOi n ters. The
i ndexed addressi ng mode can a l so i mplement an extra level of post i n di rection. Thi s
feature supports parameter and pOi nter operations.
4.2.7 REAL TIME PROGRAMMING. Real t i me programmi ng requ ires special care.
Someti mes a peri pheral or task demands an i mmediate response from the processor,
other t i mes it can wait. Most real t i me app l i cat ions are demanding in t erms of processor
response.
A common solution is to use the i n terru pt capab i l i ty of the processor in solvi ng real ti me
p roblems. I nterru pts mean just that; they request a break i n the cu rrent sequence of
events to solve an asynch ronous service request. The system designer must consider all
vari at ions of the conditions to be encountered by the system i n c l u ding software i nterac
t ion w i th i n terrupts. As a resu lt, probl ems d u e to software design are more common in i n
terrupt i mplementation code for real t i me programmi ng than most other situations. Soft
ware timeou ts, h ardware i nterrupts, and program control i n terru pts are typically used i n
solving real t i m e prog ramming problems.
Common sense dictates that a wel l docu mented prog ram is mandatory. Comments are
needed to explai n each g roup of i nstructions si nce thei r use i s not always obvious from
l ooking at the code. Program bou n daries and branch i n structions n eed full clarificatio n .
Consider the fol lowing pOi nts when writi n g comments: u p-to-date, acc uracy, com
pl eteness, conciseness, and u n derstandab i l ity.
4-8
Accu rate docu mentation enables you and others to maintai n and adapt programs for u p
dat i n g and/or addi tional use with other programs.
The complete i n struction set for the M6809 is gi ven in Table 4-1.
Instruction Description
ABX Add Accumulator B into Index Register X
ADC Add with Carry into Register
ADD Add Memory into R egister
AND logical A N D Memory into Register
ASl Arithmetic Shift left
ASR Arithmetic Shift R ight
BCC Branch on Carry Clear
BCS Branch on Carry S et
BEQ Branch on Equal
BGE Branch on Greater Than or Equal to Zero
BGT Branch on Greater
BH I Branch if H igher
BH S Branch if H igher or S ame
BIT Bit Test
BlE Branch if less than or Equal to Zero
4-9
Table 4·1. Instruction Set (Continued)
Instruction Description
B LO Branch on Lower
B LS Branch on Lower or Same
B LT Branch on Less than Zero
BMI Branch on Minus
BNE Branch N ot Equal
BPL Branch on Plus
BRA Branch Always
BRN Branch Never
BSR Branch t o Subroutine
BVC Branch on Overflow Clear
BVS B ranch on Overflow Set
CLR Clear
CMP Compare Memory from a Register
COM Complement
CWAI Clear CC bit's and Wait for Interrupt
DAA Decimal Addition Adjust
D EC Decrement
EOR Exclusive OR
EXG Exchange Registers
INC I ncrement
J MP J ump
JSR J ump to Subroutine
LD Load Register from Memory
LEA Load Effective Address
LSL Logical Shift Left
LS R Logical S hift Right
MU L Multiply
N EG Negate
NOP No Operation
OR Inclusive OR Memory into Register
PSH Push Registers
PUL Pull Registers
ROL Rotate Left
ROR Rotate Right
RTI Return from Interrupt
RTS Return from Subroutine
SBC S ubtract with Borrow
S EX Sign Extend
ST Store Register into Memory
SUB Subtract Memory from Register
SWI Software I nterrupt
SYNC Synchronize t o External Event
TFR Transfer Register to Register
TST Test
4-10
The instruction set can be functional ly divi ded i n to five categories. They are:
8-Bit Accumulator and Memory Instructions
16-Bit Accumulator and Memory I nstructions
I ndex Reg ister/Stack Pointer I nstructions
Branch Instructions
Miscellaneous I nstructions
Tables 4-2 th rough 4-6 are l isti n gs of the M6809 instructions and th eir variations grouped
i nto the five categories l isted.
Instruction Description
ADCA, ADCB Add memory to accumulator with carry
ADDA, A D D B Add memory t o accumulator
AN DA, A N D B And memory with accumulator
ASL, A S LA , A S L B Arithmetic shift of accumulator or memory left
A S R , A S R A , AS R B Arithmetic shift o f accumulator o r memory right
BITA, BITB Bit test memory with accumulator
CLR, CLRA, C L R B Clear accumulator or memory location
CMPA, CMPB Compare memory from accumulator
COM, COMA, COMB Complement accumulator or memory location
DAA Decimal adjust A accumulator
DEC, D ECA, DECB Decrement accumulator or memory location
EO R A , EO R B Exclusive o r memory with accumulator
EXG R l , R 2 Exchange R l with R 2 ( R l , R2", A, B, CC, DP)
I N C, I N CA, INCB I ncrement accumulator or memory location
LOA, LOB Load accumulator from memory
LSL, LSLA, LSLB Logical shltt lett accumulator or memory location
LS R , L S R A , L S R B Logical shift right accumulator o r memory location
MUL U nsigned multiply ( Ax B-D)
N E G , N EG A , N EG B Negate accumulator o r memory
ORA, O R B O r memory with accumulator
ROL, R O LA, R O L B Rotate accumulator or memory left
ROR, RORA, RORB Rotate accumulator o r memory right
S BCA, S BCB Subtract memory from accumulator with borrow
STA, S T B Store accumulator to memroy
S U BA, S U B B S ubtract memory from accumulator
TST, TSTA, TSTB Test accumulator or memory location
TFR R l , R2 Transfer Rl to R2 ( R l , R2",A, B, CC, D P )
4·11
Table 4·3. 16·Bit Accumulator and Memory Instructions
Instruction Description
ADDD Add memory t o D accumulator
CMPD Compare memory from D accumulator
EXG D, R Exchange D with X, y, S, U, or PC
LDD Load D accumulator from memory
S EX Sign Extend B accum ulator into A accumulator
STD Store D accum ulator to memory
SUBD Subtract memory from D accumulator ...
TFR D, R Transfer D to X, Y, S, U, or P C
TFR R , D Transfer X, Y, S , U, or PC to D
NOTE: D may be pushed (pulled) to either stack with PSHS, PSHU ( P U LS, P U L U )
instructions.
Instruction Description
CMPS, CMPU Compare memory from stack pointer
C M PX, C M P Y Compare memory from index register
EXG R 1 , R2 Exchange D, x, Y, �, U or PC Wltn D, x, Y, 5, U or PC
LEA S , LEAU Load effective address into staCk·pointer
LEAX, LEAY Load effective address into index register
LDS, LDU Load stack pointer from memory
LDX, LDY Load index register from memory
PSHS Push A, B, CC, DP, D, X, Y, U, or P C onto hardware stack
P SH U Push A, B, CC, D P , D , X, Y , X , or PC onto user stack
P U LS Pull A, B, CC, DP, D, X, Y, U, or PC from hardware stack
P U LU Pull A, B, CC, DP, D, X, Y, S, or PC; from hardware stack
STS, STU Store stack pointer to memory
STX, STY Store index register to memory
TFR R 1 , R2 Transfer D, X, Y, S, U, or PC to D, X, Y, S, U, or PC
ABX Add B accumulator to X ( unsigned)
4·1 2
Table 4·5. Branch Instructions
Instruction I Description
SIMPLE BRANCHES
B EQ, lBEQ B ranch if equal
B N E, l B N E B ranch i f not equal
B M I, l B M I B ranch i f minus
B Pl,lBPl B ranch if plus
BCS, lBCS B ranch if carry set
BCC, lBCC Branch if carry clear
BVS, lBVS Branch if overflow set
BVC, lBVC Branch if overflow clear
SIGNED BRANCHES
BGT, lBGT B ranch if greater (signed)
BVS, lBVS B ranch if invalid twos complement result
B G E, l B G E B ranch i f greater t h a n or equal (signed)
BEQ, l B EQ B ranch if equal
B N E, l B N E B ranch i f n o t equal
B lE, lBlE B ranch if less than or equal (Signed)
BVC, lBVC B ranch if valid twos complement result
B lT,l B lT B ranch if less than (Signed)
UNSIGNED BRANCHES
B H I ,l B H I B ranch i f higher ( unsigned)
B CC, lBCC B ranch if higher or same ( unsigned)
B H S,lB H S B ranch i f higher or same ( unsigned)
B EQ, lBEQ B ranch if equal
B N E, l B N E B ranch i f n o t equal
B lS, lBlS B ranch if lower or same ( unsigned)
BCS, lBCS B ranch if lower ( unsigned)
B lO, lBlO Branch if lower (unsigned)
OTHER B RANCHES
B S R, lBSR B ranch to subroutine
BRA,lBRA B ranch always
BRN, lBRN B ranch never
Instruction Description
ANDCC A N D condition code register
CWAI AND condition code register,then wait for interrupt
NOP N o operation
ORCC OR condition code register
JMP Jump
JSR Jump to subroutine
RTI Retum from interrupt
RTS Retum from subroutine
SWI, SWI2, SWI3 Software interrupt (absolute indirect)
SYNC Synchron ize with interrupt line
4-13/4-14
APPENDIX A
INSTRUCTION SET DETAILS
A.1 INTRODUCTION
This appendix contains detailed information about each instruction in the MC6809 in
struction set. They are arranged i n an alphabetical order with the mnemonic head ing set
in larger type for easy reference.
A.2 NOTATION
I n the operation description for each instruction, symbols are used to indicate the opera
tio n . Table A-1 l ists these symbols and their meanings. Abbreviations for the various
registers, bits, and bytes are also used . Table A-2 l ists these abbreviations and their
meani ngs.
� Meaning
Is transferred to
A Boolean A N D
V Boolean O R
• Boolean exclusive O R
(Overlinel Boolean NOT
Concatenation
+ Arithmetic plus
Arithmetic minus
X Arithmetic multiply
A-1
Table A·2. Register Notation
Abbreviation Meaning
ACCA or A Accumulator A
ACCB or B Accumulator B
ACCA:ACCB or 0 Double accumulator 0
ACCX Either accumulator A or B
CCR or CC Condition code register
D P R or DP Direct page register
EA Effective add ress
I FF If and only if
IX or X I ndex register X
I Y or Y I ndex register Y
LSN Least significant nibble
M Memory location
MI Memory immediate
MSN M ost significant nibble
PC Program counter
R A register before the operation
R' A register after the operation
TEMP Temporary storage location
xxH Most signifcant byte of any 16-bit register
xxL Least significant byte of any 1 6-bit register
Sp or S Hardware Stack pointer
Us or U User Stack pointer
P A memory argument with Immediate, Di
rect,Extended, and Indexed addressing
modes
Q A read-modify-write argument with Direct,
I ndexed, and Extended addressing modes
( ) The data pointed to by the enclosed
( 1 6-bit address)
dd �bit branch offset
DODD 16-bit branch offset
I Immediate value follows
$ Hexadecimal value follows
[ 1 I ndirection
I ndicates indexed addressing
A-2
ABX Add Accumulator B into Index Register X ABX
Source Form: ABX
Description: Add the a·bit unsigned val ue in acc u m u l ator B i nto i ndex reg ister X.
A·3
ADC Add with Carry into Register A DC
Source Forms: ADCA P; ADCB P
Operation: R' - R + M + C
Description: Adds the contents of the C (carry) bit and the memory byte i nto an
8-bit acc u m u l ator.
A-4
A D D (8- Bit) Add Memory into Register AD D (8- Bit)
Source Forms: ADDA P; ADDB P
Operation: R' - R + M
A-5
A D D (16-Bit) Add Memory into Register AD D (16-Bit)
Source Forms: ADDD P
Operation: R' - R + M : M + 1
Description: Adds the 1 6·bit memory val ue into the 1 6·bit acc u m u l ator
A·6
AN D Logical AN D Memory into Regi ster AN D
Source Form s: A N DA P; AN DB P
A·7
AN D Logical AND Immediate Memory Into Condition Code Register AN D
Source Form: A N DCC #xx
Operation: A' - AA MI
Description: Performs a logical AN D between the cond ition code reg ister and the
i m med i ate byte specified in the i n struction and places the result in
the condition code reg ister.
A-a
ASL Arithmetic Shift Left AS L
Source Forms: AS L Q; AS LA; AS LB
Operation: c+-I I I I I I I I 1- 0
..
b7 bO
Condition Codes: H - Undef ined
N - Set if the result is neg at ive; cleared ot herwise.
Z - Set if the result is zero; c l eared otherw i se.
V - Loaded with the res u lt of the exc l usive OR of bits s i x and
seven of the ori g i nal o perand .
C - Loaded with bit seven of the ori g inal operan d .
Description: Sh i fts a l l bits of the operand one place to the l eft. Bit zero is loaded
with a zero. Bit seven is sh i fted into the C (carry) bit.
A-9
AS R Arithmetic Shift Right AS R
Source Forms: ASR Q; ASRA; ASRB
Operation:
�""""rl----
b7
-r �
-r- -'Ir---T'I---r-I--'1 -. c
bO
Description: Shifts al l bits of the operand one pl ace to the right. Bit seven i s held
constant. Bit zero i s shifted i nto the C (carry) bit.
A·1 0
Bee Branch o n Carry Clear Bee
Source Forms: BCC dd; LBCC DODD
Operation: TEM P - M I
I F F C = 0 then PC' - PC + TEM P
Description: Tests the state of the C (carry) bit and causes a branch if it is c l ear.
A-11
B CS Branch on Carry Set BCS
Source Forms: BCS dd; LBCS DODD
Operation: TEM P - M I
I F F C=1 then PC' - PC + TEM P
Description: Tests the state of the C (carry) bit and causes a branch if it is set.
A-12
B EQ Branch on Equal B EQ
Source Forms: B EQ dd; LBEQ DODD
Operation: T EM P - M I
I F F Z = 1 then PC' - PC + TEM P
Description: Tests the state of the Z (zero) bit and causes a branch if it is set .
When used after a su btract or compare operation, this i n struction
will branch if the com pared val ues, sig ned or unsig ned, were exact ly
the same.
A·1 3
BG E Branch on G reater than or Equal to Zero BG E
Source Forms: BG E dd; LBG E DODD
Operation: TEM P - M I
I FF [NeV1 = O then PC' - PC + TEM P
Description: Causes a branch if the N (negat ive) bit and the V (overflow) bit are
either both set or both clear. That is, branch if the sign of a val id
twos com plement resu lt is, or woul d be, positive. When u sed after a
subtract or compare operation on twos com plement val ues, t h i s in
struction will branch if the reg i ster was g reater than or eq ual to the
memory operand.
A-1 4
BGT Branch on Greater BGT
Source Forms: BGT dd; LBGT DODD
Operation: TEM P - M I
I FF Z A [N eV] = O then PC' - PC + TEM P
Description: Causes a branch if the N (negative) bit and V (ove rflow) bit are either
both set or both clear and the Z (zero) bit is c lear. I n other words,
branch if t he s i g n of a val id twos com p lement result is, or wou l d be,
posit ive and not zero. When used after a subt ract or com pare opera
tion on twos complement val ues, t h i s i nstruction wi l l branch if the
reg i ster was g reater than the memory operand.
A-15
BHI Branch if Higher BHI
Source Forms: B H I dd; LBH I DODD
Operation: TEM P - M I
I FF [C v Z] = 0 then PC' - PC + TEMP
Description: Causes a branch if the previous operation caused neither a carry nor
a zero result. When used after a subtract or compare operat ion on
unsigned binary val ues, t h i s instruct ion w i l l branch if the reg ister
was h i gher than the memory operand.
A-1 6
BHS Branch if Higher or Same BHS
Source Forms: BHS dd ; LBHS DDDD
Operation: TEM P - M I
I F F C = O then PC' - PC+M I
Description: Tests the state of the C (carry) bit and causes a branch if it is c l ear.
When used after a subt ract or com pare on unsigned binary val ues,
t h i s i n struct ion w i l l branch if the reg i ster was h i gher than or the
same as the memory operand.
A-1 7
B IT Bit Test BIT
Source Form: Bit P
Description: Performs the log ical AN D of the contents of accu m u l ator A or B and
the contents of memory location M and mod ifies the cond ition
codes accord i n g ly. The contents of accu m u l ator A or B and memory
locat ion M are not affected .
A·1 8
BlE Branch on Less than or Equal to Zero BlE
Source Forms: BlE dd; lBlE DO D D
A-19
BlO Branch on Lower BlO
Source Forms: BLO dd; LBLO DODD
Operation: TEMP - MI
I FF C=1 then PC'-PC+TEMP
Description: Tests the state of the C (carry) bit and causes a branch if it is set.
When used after a su btract or compare on unsigned bin ary val ues,
this instruction wil l branch if the register was lower than the
memory operand.
A-20
BLS Branch on Lower or Same BLS
Source Forms: BLS dd; LBLS DOD D
Operation: TEM P - M I
I FF (C v Z) = 1 then PC' - PC + TEM P
Description: Causes a branch if the previous operat ion caused either a carry or a
zero result. When used after a subtract or compare operat ion on u n
s i gned binary val ues, t h is i n struction w i l l branch if the reg ister was
lower than or the same as the memory operand.
A-21
Bll Branch on Less than Zero Bll
Source Forms: BLT dd; LBLT DODD
Operation: TEMP-MI
IFF [NeV]=1 then PC'-PC+TEMP
A-22
BMI Branch on Minus BMI
Source Forms: BM I dd; LBM I DODD
Operation: TEM P - M I
I FF N =1 then PC' - PC + TEM P
Description: Tests the state of the N (negative) bit and causes a branch if set.
That is, branch if the sign of the tw os com plem ent result is negative.
Comments: When u sed after an operation on signed binary values, this i n struc
tion w i l l branch if the resu lt is m i n us. It is general ly preferred to use
the LBLT i nstruction after sig ned operations.
A-23
BN E Branch Not Equal BNE
Source Forms: B N E dd; LBN E DODD
Operation: TEM P - M I
I FF Z = O then PC' - PC + TEM P
Description: Tests the state of the Z (zero) bit and causes a branch if it is c lear.
When used after a subtract or com pare operation on any binary
val ues, this instruction w i l l branch i f the reg ister is, or would be, not
equal to the memory operand.
A-24
BPL Branch o n Plus BP L
Source Forms: BPL dd; LBPL DODD
Operation: TEM P - M I
I FF N = 0 then PC' - PC + TEM P
Description: Tests the state of the N (negative) bit and causes a branch if it is
clear. That is, branch if the sign of the twos com p lement result i s
posit ive.
Comments: When used after an operation on sig ned binary val ues, this i nstruc
tion wi l l branch if the resu lt (possibly i nval id) is positive. It is general
ly preferred to use the BGE i n struction after sig ned operations.
A-25
BRA Branch Always B RA
Source Forms: BRA dd; LBRA DODD
Operation: TEM P - M I
PC' - PC + TEM P
A·26
B RN Branch Never BRN
Source Forms: BRN dd; LBRN DODD
Operation: TEM P - M I
Descript ion: Does not cause a branch. Th is i n struction is essent ially a no opera
tion, but has a bit pattern logically rel ated to branch always.
A-27
BSR Branch to Subroutine BSR
Source Forms: BSR dd; LBSR DODD
Operation: TEM P - M I
S P' - SP - 1 , (SP) - PCL
S P' - S P - 1 , (S P) - PC H
PC' - PC + TEM P
Description: The program counter is pushed onto the stack. The prog ram counter
i s then loaded with the sum of the prog ram counter and the offset .
Comments: A ret urn from subroutine (RTS) i n st ruction i s used to reverse this pro
cess and m u st be the l ast i n st ruction executed in a subrouti ne.
A-28
Bve Branch on Overflow Clear Bve
Source Forms: BVC dd; LBVC DODD
Operation: TEM P - M I
I FF V=O then PC' - PC + TEM P
Description: Tests the state of the V (overflow) bit and causes a branch if it is
clear. That is, branch if the twos complement result was val id. When
used after an operation on twos complement b i nary val ues, t h i s i n
struct ion wi l l branch if there was no overflow.
A-29
BVS Branch on Overflow Set BVS
Source Forms: BVS dd; LBVS DODD
Operation: TEM P - M I
I FF V = 1 then PC' - PC + TEM P
Description: Tests the state of the V (overflow) bit and causes a branch if it i s set .
That is, branch if the twos complement result was i nval id. When us
ed after an operation on twos .complement binary val ues, this i n
struction w i l l branch if there was an overflow.
A-30
CLR Clear CLR
Source Form: CLR a
Operation: TEM P - M
M - 00 1 6
A-31
CMP (8-Bit) Compare Memory from Register CMP (8-Bit)
Source Forms: C M PA P; CM PB P
Operation: TEM P - R - �
Description: Com pares the contents of memory locat ion to the contents of the
specified reg i ster and sets the appropriate condition codes. N either
memory location M nor the specified reg ister is modified . The carry
flag represents a borrow and is set to the i nverse of the resulting
bi nary carry.
A-32
CMP (1 6- Bit) Compare Memory from Register CMP (1 6- Bit)
Source Forms: C M PD P; CM PX P; CM PY P; CM PU P; CM PS P
A-33
CO M Complement CO M
Source Forms: COM Q; COMA; COM B
V - Atways cleared .
C - Always set .
A·34
CWAI Clear CC bits and Wait for Interrupt CWAI
Source Form: CWAI #$XX IEl F I H I I I NI I VI C I
z
Comments: The fol lowi n g i m med iate values w i l l have the fol low i ng results:
F F = enable neither
E F = enable 'iRa
B F = enable FI RQ
AF = enable both
A-35
DAA Decimal Addition Adjust DAA
Source Form: DAA
A-36
D EC Decrement DEC
Source Forms: DEC Q; DECA; DECB
Operation: M' - M - 1
Description: Subtract one from the operand. The carry bit is not affected, thus
allowing t h i s instruct ion to be used as a loop counter i n m u lt i ple
prec ision com putations. When operat i n g on unsig ned val ues, on ly
BEQ and B N E branches can be expected to behave consistently.
When operat i ng on twos com plement val ues, al l sig ned branches
are available.
A-37
EO R Excl usive O R EO R
Source Forms: EO RA P; EO RB P
Operation: R' - R ED M
Description: The contents of memory l oc ation M is exc l usive O Red i nto an 8-bit
reg i ster.
A-38
EXG Exchange Registers EXG
Source Form: EXG R1 , R2
Operation: R1 - R2
Condition Codes: N ot affected (u n l ess one of the reg i sters is the condition code
reg i ster).
Description: Exchanges data between two designated reg i sters. Bits 3-0 of the
post byte defi ne one reg ister, wh i l e bits 7-4 d efine the other, as
fo l lows:
OOOO = A:B 1 000 = A
0001 = X 1 001 = B
001 0 = Y 1 0 1 0 = CCR
001 1 = US 1 01 1 = DPR
01 00 = S P 1 1 00 = U ndefi ned
01 01 = PC 1 1 01 = Undefi ned
01 1 0 = Undefi ned 1 1 1 0 = Undefi ned
01 1 1 = Undefi ned 1 1 1 1 = Undefi ned
Only l i ke size reg i sters may be exchanged. (8-bit with 8-bit or 1 6-bit
with 1 6-bit .)
A-39
INC Increment I NC
Source Forms: I N C Q; I N CA; I N CB
Operation: M'- M + 1
Description: Adds to the operand. The carry bit is not affected , thus al low i n g t h i s
i n struction to b e used a s a loop counter in m u lt i ple-precision com
putat ions. When operating on unsigned val ues, only the BEQ and
BN E branches can be expected to behave consistently. When
operat i ng on twos com plement val ues, al l sig ned branches are cor
rectly avai lable.
A-40
JMP J ump JMP
Source Form: J M P EA
Operation: PC' - EA
A-41
JSR J ump to Subro utine JSR
Source Form: JSR EA
Operation: SP' - SP - 1 , (S P) - PC L
SP' - SP - 1 , (S P) - PC H
PC' - EA
Description: Prog ram control is transferred to the effective add ress after stori ng
the retu rn address on the hardware stack. A RTS i n st ruction sho u l d
b e t h e last executed inst ruct ion o f t h e su brout ine.
A·42
L D (8- Bit) Load Register from M emory L D (8- Bit)
Source Forms: LOA P; LOB P
Operation: R' - M
V Always cl eared .
-
C N ot affected .
-
Description: Loads the contents of memory location M i nto the desig nated
reg i ster.
A-43
L D (1 6- Bit) Load Register from Memory L D (1 6-Bit)
Source Forms: LOO P; LOX P: LOY P; LOS P; LOU P
Operation: R' - M : M + 1
V - Always cleared .
C - N ot affected .
Description: Load the contents of the memory locat ion M : M + 1 i nto the
desi gnated 1 6-bit reg i ster.
A-44
LEA Load Effective Address L EA
Source Forms: LEAX, LEAY, LEAS, LEAU
Operation: R' - EA
Description: Cal c u l ates the effect ive add ress f rom the i ndexed addressi ng mode
and pl aces the add ress in an i ndexable reg ister.
LEAX and LEAY affect the Z (zero) bit to al low u se of these reg isters
as counters and for M C6800 I N XIDEX compat i b i l ity.
LEAU and LEAS do not affect the Z bit to al low clean i ng up the stack
w h i l e ret u rn i n g the Z bit as a parameter to a cal l i ng routi ne, and also
for M C6800 I N SID ES com pat i b i l ity.
Comments: Due to the order i n which effective add resses are calcu lated i nter
nal ly, the LEAX, X + + and LEAX, X + do not add 2 and 1 (respective
ly) to the X reg ister; but i n stead leave the X reg ister unchanged . Th is
also appl ies to the Y, U , and S reg isters. For the expected resu lts,
use the faster i nst ruction LEAX 2, X and LEAX 1 , X.
Some exam ples of LEA i nstruction uses are g iven in the fol lowi ng
table.
Instruct ion Operation Comment
LEAX 1 0, X X + 10 - X Adds 5-bit constant 1 0 to X
LEAX 500, X X + 500 - X Adds 1 6-bit constant 500 to X
LEAY A, Y Y+A-Y Add s 8-bit acc u m u l ator to Y
LEAY 0, Y Y+D-Y Adds 1 6-bit 0 accumulator to Y
LEAU - 1 0, U U - 10 - U Subt racts 1 0 from U
LEAS - 1 0, S - S - 10 - S Used to reserve area on stack
LEAS 1 0, S S + 10 - S Used to 'clean up' stack
LEAX 5, S S+5-X Transfers as wel l as adds
A-45
LSL Logical Shift Left LSL
Source Forms: LSL Q; LSLA; LS LB
Operation:
c- I I I I I I I I 1- 0
b7 bO
Condition Codes: H - U ndefi ned .
N - Set if the res u lt is negative; cleared otherwise.
Z - Set if the res u lt is zero; cl eared otherwise.
V - Loaded with the resu lt of the exc l usive O R of bits six and
seven of the original operand.
C - Loaded with bit seven of the origi nal operand .
Description: Sh ifts al l bits of accu m u l ator A or B or memory locat ion M one place
to the left . Bit zero is loaded with a zero. Bit seven of acc u m u l ator A
or B or memory locat ion M is shifted i nto the C (carry) bit.
A-46
LS R Logical Shift Right LS R
Source Forms: LS R Q; LS RA; LSRB
Operation:
0-+1 I I I I I I I 1- c
b7 bO
Condition Codes: H - N ot affected .
N - Always cleared .
Z - Set if the result is zero; c leared ot herw i se.
V - N ot affected.
C - Loaded with bit zero of the orig i nal operand .
Description: Performs a logical shift right on the operand . Sh ifts a zero i nto bit
seven and bit zero i nto the C (carry) bit.
A·47
MUL M ultiply MUL
Source Form: MUL
Comments: The C (carry) bit allows rou nding the most-sig nif icant byte t h rough
the seq uence: M U L, ADCA #0.
A-48
N EG Negate N EG
Source Forms: N EG Q; N EGA; N EG B
Operation: M'-0 - M
Description: Rep laces the operand with its twos com plement. The C (carry) bit
represents a borrow and is set to the i nverse of the resulting bin ary
carry. N ote that 80 1 6 i s replaced by itself and only i n this case i s the
V (overflow) bit set . The val ue 00 1 6 is also rep laced by itself, and only
i n t h i s case is the C (carry) bit cleared .
A-49
NOP No Operation NOP
Source Form: NOP
Operation: N ot affected .
Condition Codes: This i nstruct ion causes only the prog ram cou nter to be incremented .
No ot her reg i sters or memory locations are affected .
A-50
OR Inclusive O R Memory into Register OR
Source Forms: O RA P; ORB P
Operation: R' - Rv M
C - N ot affected .
A-51
OR I nclusive OR Memory Immediate i nto Condition Code Register OR
Source Form: ORee #XX
Operation: R' - R v M I
A-52
PS·H S Push Registers on the Hardware Stack PSH S
Source Form: PSH S reg ister l i st
PSH S # LABEL
Post byte:
b7 b6 b5 b4 b3 b2 b1 bO
Ipc IU I Y I X l op I B I A I cc i
push order- - - - .
Description: Al l , some, or none of the p rocessor reg isters are pushed onto the
hardware stack (with the exception of the hardware stack pOi nter
itself).
Comments: A single reg i ster may be pl aced on the stack with the cond ition
codes set by doing an autodecrement store onto the stack (example:
STX , - - S).
A·53
PSH U Push Registers on the User Stack PS H U
Source Form: PSH U reg i ster l i st
PSH U # LABEL
Postbyte:
b7 b6 b5 b4 b3 b2 b1 bO
I PC I U I Y I X I D P I B I A I cc I
push order- - - - -�
Description: Al l , some, or none of the p rocessor reg isters are pushed onto the
user stack (with the except ion of the user stack poi nter itself).
Comments: A s i n gl e reg ister may be p laced on the stack with the condition
codes set by doing an autodecrement store onto the stack (exam ple:
STX , - - U).
A·54
P U LS Pull Registers from the H a rdware Stack P U LS
Source Form : PU lS reg ister l i st
P U lS #lABEl
Postbyte:
b7 be b5 b4 b3 b2 b1 bO
I pc I U I Y I x l op I B I A I cci
... - - - - - - pu l l order
Description: Al l , some, or none of the processor registers are p ulled from the
h ardware stack (w ith the exception of the h ardware stack poi nter
itself).
Comments: A single reg i ster may be p u l l ed from the stack with cond ition codes
set by doing an auto i ncrement load from the stack (exa m ple:
lOX ,S + + ).
A-55
PU LU Pull Registers from the User Stack P U LU
Source Form: PU lU reg ister l i st
PU lU #lASEl
Post byte:
b7 b6 b5 b4 b3 b2 b1 bO
I PC I U I Y I X I OP I S I A I cci
. - - - - - - pu l l order
Condition Codes: May be pul led from stack; not affected otherwise.
Description: Al l , some, or none of the processor reg i sters are p u l l ed from the u ser
stack (with the exception of the user stack pOi nter itself).
Comments: A single reg i ster may be p u l l ed from the stack with condition codes
set by doing an auto i n c rement load from the stack (exam ple:
lOX ,U + + ).
A-56
RO L Rotate Left RO L
Source Forms: RO L Q; ROLA; RO LB
�� """--"' �....,..--
j=r""I ,.
Operation:
b7 'II(�-----
.... bO
Description: Rotates a l l bits of the operand one place l eft through the C (carry)
bit. Th is is a 9-bit rotation.
A-57
RO R Rotate Right RO R
Source Forms: ROR Q; RO RA; RORB
Y"--'---I�_c_ I �
I --
Operation:
- I --
b7 -----�. bO
Description: Rotates al l bits of the operand one place right through the C (carry)
bit. Th i s is a 9·bit rotation.
A·58
RTI Return from Interrupt RTI
Source Form: RTI
Description: The saved mach ine state is recovered from the hardware stack and
contro l i s returned to the i nterru pted prog ram . I f the recovered E (en
t i re) bit is clear, it i n d icates that only a subset of the machine state
was saved (retu rn address and cond ition co des) and only that subset
is recovered .
A-59
RTS Return from Subroutine RTS
Source Form: RTS
Description: Program control is retu rned from the subrout i ne to the cal l i ng pro
g ram. The return address is pul l ed from the stack.
A-60
SBe Subtract with Borrow SBe
Source Forms: SBCA P; SBCB P
Operation: R' - R - M - C
Description: Subtracts the contents of memory locat ion M and the borrow (in the
C (carry) bit) from the contents of the designated a·bit register, and
places the res u lt i n that reg i ster. The C bit represents a borrow and
i s set to the i nverse of the resulting bin ary carry.
A·61
S EX Sign Extended SEX
Sou rce Form: S EX
A -62
ST (8-Bit) Store Register· into Memory ST (8-Bit)
Source Forms: STA P; STe P
Operation: M' - R
Description: Writes the contents of an 8·bit reg ister i nto a memory location .
A-63
8T (1 6-Bit) Store Register Into Memory 8T (1 6-Bi·t )
Source Forms: STD P; STX P; STY P; STS P; STU P
Description: Writes the contents of a 1 6·bit reg ister i nto two consecutive memory
locations.
A-64
SU B (8- Bit) Su btract Memory from Register SU B (8- Bit)
Source Forms: S U BA P; SUBB P
Operation: R' - R - M
A-65
S U B (1 6- Bit) Subtract Memory from Register S U B (1 6- Bit)
Source Forms: SUBD P
A-66
SWI Software Interrupt SWI
Source Form: SWI
Description: Al l of the processor reg i sters are pushed onto the hardware stack
(with the exception of the h ardware stack poi nter itsel f), and control
is transferred through the software i nterrupt vector. Both the normal
and fast i nterrupts are masked (di sabled).
A-67
SWI2 Software Interrupt 2 SWI2
Source Form: SWI 2
Description: A l l of the processor reg i sters are pushed onto the hardware stack
(with the except ion of the hardware stack pOi n t er itself), and control
i s transferred through the software i nterrupt 2 vector. Th i s i nterrupt
i s avai l able to the end user and must not be u sed i n packaged soft
ware. Th is interru pt does not mask (d isable) the normal and fast in
terrupts.
A-6 8
SWI 3 Software Interrupt 3 SWI 3
Source Form: SW I 3
Description: Al l of the processor reg i sters are pushed onto the hardware stack
(with the except ion of the hardware stack poi nter itself), and control
i s transferred t h rough the software i nterru pt 3 vector. This i nterru pt
does not mask (d i sable) the normal and fast i nterru pts.
A-69
SYN C Synchronize to External Event SYN C
Source Form: SYNC
Descri ption: When a SYNC i nstruct ion is excuted , the processor enters a syn
chron izi ng state, stops processing instructions, and waits for an in
terrupt . When an interrupt occ u rs, the synchron izi ng state i s c leared
and processing cont i n ues. If the i nterrupt is enabled , and it l asts
t h ree cyc les or more, the processor w i l l perform the i nterru pt
routine. i f the i nterrupt is masked or i s shorter t h an three cycles, the
processor s i mply cont i n ues to the next i nstruct ion. Wh i l e in the syn
chronizing state, the add ress and data buses are in the hig h
i m pedance state.
The synchron izing state is cleared by any i nterrupt . Of cou rse, enabl
ed interrupts at this pOint may destroy the d ata transfer and, as
such, shou ld represent only emergency condit ions.
The same con nect ion used for i nterrupt-driven I/O service m ay also
be used for high-speed data transfers by sett i n g the i nterrupt mask
a n d u s i n g the SY N C i n st ruct i o n as t h e above e xa m p l e
demonstrates.
A-70
TFR Transfer Register to Register TFR
Source Form: TFR R1 , R2
Operation: R1 - R2
Condition Code: N ot affected unless R2 is the cond ition code reg i ster.
Descri ption: Transfers data between two designated registers. Bits 7-4 of the
postbyte define the sou rce reg i ster, wh i l e bits 3-0 define the dest i na
tion reg i ster, as fol lows:
OOOO = A:B 1 000 = A
0001 = X 1 00 1 = B
001 0 = Y 1 01 0 = CCR
001 1 = US 1 01 1 = CPR
01 00 = S P 1 1 00 = U ndefined
01 01 = PC 1 1 01 = U ndefined
01 1 0 = U ndefi n ed 1 1 1 0 = U n defined
01 1 1 = U ndefined 1 1 1 1 = U n defined
O n ly l i ke size reg isters may be t ransferred . (8-bit to 8-bit, or 1 6-bit to
1 6-bit.)
A-71
TST Test TST
Source Forms: TST Q; TSTA; TSTB
Operation: TEM P - M - 0
Description: Set the N (negat ive) and Z (zero) bits accordi ng to the contents of
memory location M , and c lear the V (overflow) bit. The TST i n st ruc
t ion provides only m i n i m u m i n formation when testing u n s i g ned
val ues; si nce no unsigned val ue is less than zero, BlO and B lS have
no uti l ity. Wh ile B H I cou l d be used after TST, it provides exactly the
same control as BN E, wh i c h i s preferred. The signed branches are
avai lable.
A-72
FI RQ Fast Interrupt Request (Hardware Interrupt) FI RQ
Operation: I F F F bit clear, then: S P' - S P - 1 , (S P) - PCL
S P' - S P - 1 , (S P) - PCH
Clear E (subset state is saved)
S P' - S P - 1 , (S P) - CCR
Set F, I (mask f u rther i nterru pts)
PC' - (FFF6):(FF F7)
Description: A F I RQ (fast i nterru pt req uest) with t h e F (fast i nterru pt req uest
mask) bit clear causes t h i s i nterru pt sequence to occur at the end of
the c u rrent i nstruction. The prog ram cou nter and condit ion code
reg i ster are pushed onto the hardware stack. Program control is
transferred through the fast i nterrupt req uest vector. An RTI (retu rn
from i nterrupt) i n st ruction ret u rns the p rocessor to the ori g i nal task.
It is poss i bl e to enter the fast i nterru pt req uest rout ine with the en
t i re mach ine state saved if the fast i nterru pt req uest occurs after a
c l ear and wait for i nterru pt i nstruction. A normal i nterru pt req uest
has lower priority than the fast i nterrupt req uest and is prevented
from i nterrupt i ng the fast i nterrupt req uest routi n e by automat ic set
t i n g of the I (interrupt req uest mask) bit. Th i s m ask bit could then be
reset d u ri n g the i nterrupt rout i ne if priority was not desired. The fast
i nterrupt request al lows o perations on m emory, TST, I N C, DEC, etc.
i n st ruct ions without the overhead of sav i n g the e nt i re mach ine state
on the stack.
A-73
I RQ Interrupt Request (Hardware Interrupt) I RQ
Operation: I FF I bit clear, then: SP' - S P - 1 , (S P) - PCL
SP' - S P - 1 , (S P) - PCH
SP' - SP - 1 , (S P) - USL
SP' - S P - 1 , (S P) - USH
SP' - SP - 1 , (S P) - IYL
SP' - S P - 1 , (S P) - IYH
SP' - SP - 1 , (S P) - IXL
SP' - S P - 1 , (S P) - IXH
SP' - SP - 1 , (S P) - DPR
SP' - S P - 1 , (S P) - ACCB
SP' - SP - 1 , (SP) - ACCA
Set E (ent ire state saved)
SP' - SP - 1 , (SP) - CCR
Set I (mask further I RQ i nterru pts)
PC' - (FFF8):(F FF9)
Description: If the I (i nterrupt req uest m ask) bit is clear, a low level on the I RQ i n
pu t causes this i nterru pt seq uence to occur at the end of the c urrent
i n struction. Control is ret u rned to the i nterru pted prog ram using a
RTI (ret urn from i nterrupt) i n st ruction . A FI RQ (fast i nterrupt req uest)
may i nterru pt a normal I RQ (interrupt req uest) routi n e and be
recogn ized anyt i me after the interru pt vector is take n.
A-74
NMI Non·M askable Interrupt (Hardware Interrupt) NMI
Ope ration: SP' - SP - 1 , (S P) - PCl
S P' - S P - 1 , (S P) - PCH
S P' - S P - 1 , (SP) - USl
S P' - S P - 1 , (S P) - USH
SP' - SP - 1 , (SP) - IYl
S P' - S P - 1 , (S P) - IYH
S P' - SP - 1 , (SP) - IXl
S P' - S P - 1 , (S P) - IXH
S P' - S P - 1 , (S P) - OPR
S P' - S P - 1 , (SP) - ACCB
S P' - SP - 1 , (SP) - ACCA
Set E (enti re state save)
S P' - SP - 1 , (SP) - CCR
Set I, F (mask i nterrupts)
PC' - (FF FC):(FFFO)
Description: A negat ive edge on the N M I (non-maskable i nterru pt) i n put causes
al l of the processor's reg isters (except the hardware stack poi nter)
to be pushed onto the hardware stack, start i n g at the end of the cur
rent i n struction. Program control is transferred t h rough the N M I vec
tor. Successive negat ive edges on the N M I i n put wi l l cause s u c
cessive N M I operations. Non-maskable i nterru pt operat ion can be
i nternal ly blocked by a RESET operation and any non-maskabl e i n
terrupt that occ urs wi l l b e latched . If t h i s happens, the non
maskable i nterru pt operat ion w i l l occu r after the f i rst load i nto the
stack poi nter (lOS; TFR r,s; EXG r,s; etc.) after R ESET.
A- 75
R ESTART Restart (H ardware Interrupt) R ESTART
Operation: CCR' - X1 X1 XXXX
D PR' - 00 1 6
PC' - ( F F F E):(F F F F)
Description: The processor is i n itial ized (req u i red after power-on) to start pro
g ram exec ution. The start i ng add ress is fetched from the restart vec
tor.
A-76
APPEN DIX B
ASSIST09 MON ITOR P ROG RAM
The ASSIST09 monitor is easi ly adapted to run u nder control of a real-time operat ing
system . A s pecial f unction i s avai lable which a l l ows vol untary t i me-slicing, as wel l a s
forced time-sl icing u pon t h e use of several service rout ines b y a user program .
Since ASSIST09 was coded i n an add ress-i ndependent manner, it wi l l properly execute
anywhere in the 64K add ress space of the M 6809. However, an assu m ption must be m ade
reg ard i n g the location of a work area needed to hold miscel l aneous variables and the
default stack location. Th i s work area is cal l ed the page work area and it is addressed
wit h i n ASSIST09 by use of the di rect page reg ister. It is located rel at ive to the start of the
B-1
ASSI ST09 ROM by an offset of - 1 900 hexadec i m a l . Assuming ASSI ST09 resides at the
top of the memory address space for d i rect contro l of the hardware i nterru pt vectors, the
memory map wo u l d appear as shown i n Fig u re B-1 .
FOOO Un used 2K
( U n used)
If F800 i s not the start of the mon itor RO M the add resses wou l d change, but the rel ative
locations would remain the same except for the prog rammable t i mer mod u l e (PTM) and
asynchronous com m u n i cat ions i nterface adapter (ACI A) default addresses which are fix
ed .
The defau lt con sole i n put/output hand lers access an ACIA located at EOO8. For t race
commands, a PTM with default add ress EOOO is used to force an N M I so that s i n g l e in
structions may be executed . These default add resses may eas i ly be changed using one
of several methods. The conso l e I/O handlers m ay also be rep laced by user rout i nes. The
PTM is i n it ial ized d uring the M O N ITR service cal l (see Paragraph B.9 SERVICES) to f i reup
the monitor un less its default address has been changed to zero, i n which case no PTM
references w i l l occu r.
U pon reset , a vector table i s created which contai ns, among other things, default i nter
rupt vector handler appendage add resses. These routi nes may easily be rep l aced by user
appendages with the vector swap service descri bed later. The defau lt act ions taken by
the appendages are as fol lows:
RESET - B u i l d the ASSI ST09 vector tabl e and set up mon itor defaults, then i nvoke
the mon itor start u p rout ine.
SWI - Req uest a service from ASS IST09.
FI RQ - An i mmed i ate RTI is done.
SWI2, SWI3, I RQ, Reserved , N M I - Force a breakpo i nt and enter the command
processor.
B-2
The use of I RQ is recom mended as an abort fu nct ion d u ring prog ram debug g i ng ses
sions, as breakpoi nts and ot her ASSI ST09 defaults are rei n itial ized u pon RESET. On ly the
primary software i nterru pt i n struct ion (SWI) is used , not the SWI2 or SWI3. Th i s avoids
page fau l t problems which wou l d otherw i se occur with a memory management u n it as
the SWI2 and SWI3 i n st ruct ions do not d i sable i nterru pts.
Cou nter n u m ber one of the PTM is used to cause an N M I i nterru pt for the trace and break
pOint com m ands. At R ES ET the control reg i ster for t i mer one is i n itial ized for trac i n g pur
poses. If no trac i n g or breakpointing i s done then the ent i re PTM is available to the user.
Otherwise, only counters two and th ree are avai lable. Although control reg ister two m ust
be used to i n itial ize control reg ister one, ASS I ST09 ret urns contro l reg ister two to the
same val ue i t has after a R ES ET occurs. Therefore, the on ly condition i m posed on a u ser
program is that if the "operate/preset " b it in contro l reg i ster one m ust be tu rned on , $A7
sho u l d be stored, $A6 shou l d be stored if it m ust be t u rned off.
B.4 I NITIALIZAT I O N
During ASSI ST09 exec ution , a vector tabl e i s used to add ress certain service routi nes
and default val ues. Th is table is generated to provide easily changed control information
for user mod ifications. The f i rst byte of t he ASSI ST09 ROM contai ns the start of a
subrout i n e which i n it i al izes the vector table along with sett i ng u p certai n default val u es
before ret u rn i n g to the cal ler.
If the ASSI ST09 RESET vector receives contro l , it does three t h i ngs:
1 . Ass i g n s a default stack i n the work space,
2. Cal ls the aforement ioned su brout ine to i n itial ize the vector table, and
3. Fires up the ASSI ST09 mon itor proper w ith a M O N ITR SWI service req uest .
However, a u ser rout i n e can perform the same fu nctions with a bon us. After cal l i n g the
vector i nt i t i al izat ion subroutine, it may exa m i n e or alter any of the vector table val ues
before start i n g normal ASSIST09 processi ng . Th us, a user routi n e may "bootstrap"
ASSIST09 and alter the defau lt standard val ues.
Another method of i n sert i n g user mod ifications i s to have a user routine reside at an ex
tension RO M l ocation 2K bel ow the start of the ASSI ST09 ROM . The vector table i n
itial izat ion routine ment ioned above, looks for a " B RA * " f l ag ($20F E) at this add ress, and
if found cal ls the location fol lowing the flag as a subrout i n e with the U reg i ster poi nting
to the vector table. S i n ce this is done after vector table i n itial ization , any or al l defau lts
may be altered at t h i s t i me. A big advantage to u s i n g t h i s method i s that the mod ifica
t ions are "automat i c" i n that upon a RESET con�ition t h e changes are made without
overt act ion req u i red such as the execution of a memory change command.
N o special stack is u sed during ASSI ST09 processi n g . Th i s means that the stack pOi nter
m u st be val id at al l i nterru ptable t i mes and sho u l d contai n enough room for the stacki ng
of at least 21 bytes of i nformat ion . The stack i n use d u ring the i n itial M O N ITR service cal l
to start u p ASS I ST09 processing becomes the "official " stack. If any l ater stack val idity
checks occu r, t h i s same stack w i l l be re-based before enteri ng the command han d l er.
B-3
ASS IST09 u ses a work area which is addressed at an offset from the start of the
ASSI ST09 ROM . The offset val ue is - 1 900 hexadecimal . Th is poi nts to the base page us·
ed d u ri n g mon itor execution and contains the vector table as wel l as the start of the
default stack. If the default stack is used and it excee d s 81 bytes i n size, then cont ig uous
RAM m u st exist below this base work page for proper extension of the stack.
Each "expression" above consists of one or more val ues separated by an operator.
Val ues can be hex stri ngs, the l etters " P" , " M " , and "W", or the result of a function. Each
hexadeci m a l st ring is converted i nternally to a 1 6·bit binary n u m ber. The l etter " P"
stands for the current prog ram counter, " M " for the last memory examine/change ad·
d ress, and "W" for the w i ndow value. The w i ndow val ue is set by using the W I N DOW
command.
One function exists and it i s the I N DI RECT fu nction. The character " @ " fol lowi n g a val ue
rep laces that val ue with the 1 6·bit n u m be r o btai ned by using that val ue as an address.
Two operators are al l owed, " + " and " - " which cause add ition and subtract ion. Val ues
are operated on in a left·to·rig ht order.
Exam ples:
480 - h exadecimal 480
W + 3 - val ue of wi ndow p l u s three
P·200 - cu rrent program cou nter m i n u s 200 hexadec i mal
M - W - cu rrent memory pointer m i n u s w i ndow val ue
1 00 @ - value of word addressed by the two bytes at 1 00 hexadeci m al
P + 1 @ - val ue add ressed by the word located one byte u p from the cu rrent prog ram
counter
8·4
B.7 COMMAND LIST
Table B·1 l i sts the commands avai l able i n the ASSI ST09 mon itor.
B.8 CO M M ANDS
Each of the com mands are explai ned on the fo l lowi ng pages. They are arrang ed i n
al phabetical order b y t h e command name used i n t h e command l ist . The command name
appears at each marg i n and i n S l i g htly larger type for easy reference.
B·5
•
B REAKPO I NT B R EAKPO I NT
Format: Breakpoi nt
Breakpoint -
Breakpoint < Add ress >
Breakpoint - < Address >
Operation: Set or change the breakpoint table. The f i rst format d i s p l ays a l l breakpoi nts.
The second c lears the breakpoi nt table. The t h i rd enters an address i nto the
table. The fou rth deletes an address from the table. At reset, all breakpo i nts
are deleted. Only i n structions in RAM m ay be breakpoi nted .
CALL CALL
Format: Cal l
Cal l < Address >
Operation: Cal l and execute a user routine as a subrout i ne. The c urrent p rogram cou nter
w i l l be used u n l ess the add ress is specified. The user routi n e shou l d eventual
ly term inate with a " RTS" i nstruct ion. When this occurs, a breakpoi nt w i l l en
sue and the prog ram counter wi l l point i nto the mon itor.
B-6
DISP LAY D I S P LAY
Format: Display < From >
Display < From > < Length >
Display < From > < To >
Operation: Display contents of memory i n hexadeci mal and ASC I I characters. The se
cond arg ument, when entered, is taken to be a length if it is less than the f i rst,
otherwise it is the ending address. A default length of 1 6 decimal is assu med
for the fi rst format. The add resses are adj usted to i n c l ude all bytes with i n the
s u rround i n g mod u lo 16 address byte bou ndary. The CANCEL (CO NTROL-X)
key may be entered to abort the d isplay. Care m ust be exercised when the l ast
1 5 bytes of memory are to be d isplayed . The < Length > o pt ion shou ld always
be used in t h i s case to assure proper term i nat ion: D FFEO 40
Exam ples:
D M 10 - Display 1 6 bytes s urrou nding the l ast memory
location exam i ned.
D EOOO FOOO - Display memory from EOOO to FOOO hex.
EN CO D E E N CO D E
Format: Encode < I ndexed operand >
Operation: The encode command w i l l return the i ndex i n g i nstruct ion mode postbyte
val ue from the entered assembler-l i ke syntax operand. This is useful when
hand cod i n g i n struct ions. The letter " H " i s used.to i n d icate the n u m ber of hex
d i g its n eeded i n the expression as shown i n the fol lowi n g exam ples:
E ,V - Ret urn zero offset to V reg i ster postbyte.
E [H H H H , PCR] - Ret urn two byte peR offset using i n d i rection.
E [,S + + 1 - Ret urn autoi ncrement S by two i n d i rect.
E H ,X - Return 5-bit offset from X.
Note that one " H " specifies a 5-bit offset , and that the result g iven w i l l h ave
zeros in the offset val ue position. Th is comand does not detect all i ncorrect ly
s pec ified syntax or i l l egal i ndex i n g modes.
8-7
GO GO
Format: Go
Go < Add ress >
Operation: Execute start i n g from the add ress g iven . The fi rst format w i l l cont i n ue from
the current program cou nter sett i n g . If it is a breakpo i nt no break w i l l be
taken . This al l ows cont i n u ation from a breakpoint. The secon d format wi l l
breakpoint i f the add ress specified i s i n the breakpoi nt l i st.
LOAD LOAD
Format: Load
Load < Offset >
Operation: Load a tape f i l e created using the 51 -59 format. The offset option, i f u sed , i s
added to t h e address on t h e tape t o specify t h e act ual load address. Al l off
sets are positive , but wrap around memory mod u lo 64K. Depend ing on the
eq u i p m ent i nvolved , after the l oad i s complete a few spurious c haracters m ay
sti l l be sent by the i n put device and i nterpreted as com mand characters. If
t h i s happens, a CANCEL (CONTRO L-X) shoul d be entered to cause such
characters to be ig nored . If the load was not successfu l a " 7 " is d isplayed .
8-8
M EM O RY M EM O RY
Format: M EM O RY < Add ress > /
< Ad d ress > /
I
Operation: I n it i ate the memory exami ne/change fu nct ion. The second format w i l l not ac
cept an expression for the add ress, only a hex stri ng. The t h i rd format
defau lts to the address d isplayed during the l ast memory change/exam i ne
fu nction. (The same val u e is obtai ned i n expressions by use of the letter " M ".)
After act ivation, the fol lowing actions may be taken unt i l a carriage ret u rn is
entered:
< Exp r > Replaces the byte w i t h t h e specified val ue . The value m ay
be an expression.
S PACE Go to next address and print the byte val ue.
(Comma) Go to next add ress without printing the byte
val ue.
LF (Li ne feed) Go to next address and print it along with the
byte value on the next l i ne.
(Circumflex or Up arrow) Go the previous address and pri nt
it along with the byte val ue on the next l i ne.
/ Print the current add ress with the byte val u e on the next
l i ne.
CR (Carriage retu rn) Term inate the com mand.
' < Text > ' Replace succeed i n g bytes with ASCI I characters u nt i l the
second apostrophe i s entered.
I f a change attem pt fai l s (i .e., the locat ion is not vali d RAM) then a q uestion
mark wi l l appear and the next location d i splayed .
8-9
N U LL N U LL
Format: N u l l < Specification >
Operation: Set the new l i ne and character pad d i ng count val ues. The expression value i s
treated a s two val ues. The u p per two hex represent t h e character pad count,
and the lower two the new l i ne pad count (triggered by a carriage retu rn). An
expression of less than three hex d i g its wi l l set the character pad count to
zero. The val ues m ust range from zero to 7F hexadec i mal (1 27 deci m al).
Exam ple:
N 3 - Set the character cou nt to zero and new l i ne count
to t h ree.
N 207 - Set character padding cou nt to two and new l i ne
cou nt to seven.
Sett ings for TI Silent 700 term i na l s are:
Baud Setting
1 00 0
300 4
1 200 31 7
2400 72F
O F FS ET O F FS ET
Format: Offset < Offset add r > < To i n st ruct ion >
Operation: Print the one and two byte offsets needed to perform a branch from the f i rst
expression to the i n struction. Th us, offsets for branches as wel l as i ndexed
mode i n struct ions wh ich use offsets may be obtained. If only a fou r byte
val ue is pri nted , then a short branch count can not be done between th.e two
add resses.
Example:
o P + 2 AOOO - Com pute offsets needed from the c u rrent pro-
g ram cou nter plus two to AOOO.
8-1 0
PUNCH PUNCH
Format: Punch < From > < To >
Operation: Punch or record formatted binary object tape i n 51 -59 (M I KBUG ) form at.
Operation: Print the reg ister set and prom pt for a change. At each prom pt the fol lowi ng
m ay be entered .
SPACE Ski p to the next reg ister pro mpt
< Expr > S PACE Repl ace with the specified val ue and pro m pt for the next
reg i ster.
< Expr > CR (carriage retu rn) Replace with the specified val ue and ter
m i n ate the command.
CR Term i n ate the com mand.
B-1 1
ST LEVEL STL EVEL
Format: St l evel
St l evel < Ad dress >
Operation: Set the stack trace l evel for i n h i biting tracing information . As long as the
stack is at or above the stack level address, the trace display wi l l cont i n ue.
H owever, when lower than the address it is i n h i bited . This a l l ows trac i n g of a
routi ne without including al l subrout i ne and lower level cal l s i n the trace i n
formation. N ote that tracing t h rough a ASSIST09 "SW I " service req uest m ay
also temporarily supress t race output as explai ned i n the descri pt ion of the
t race com mand. The fi rst form at sets the stack trace level to the cu rrent p ro
g ram stack value.
T RAC E T RAC E
Format: Trace < Cou nt >
. (period)
Operation: Trace the specified n u m ber of i nstruct ions. At each trace, the opcode j u st ex
ecuted w i l l be shown along with the reg ister set. The program counter i n the
reg i ster d i s p l ay pOi nts to the N EXT i n struct ion to be executed. A CAN C E L
(CONTRO L-X) w i l l premat u re l y h a l t t racing. The second format (period) w i l l
cause a s i n g l e trace t o occu r. Breakpoi nts have n o effect d u ring t h e trace.
Selected port ions of a trace m ay be d i sabled using the STLEVEL command.
I nstructions i n ROM and RAM may be traced, whereas breakpoints m ay be
done only in RAM . When tracing t h rough a ASSI ST09 service request, the
t race d isplay wi l l be supressed start i n g two i n structions i nto the mon itor u nt i l
shortly before contro l is retu rned to t h e user program. This is done t o avo id a n
i nord i nate amount o f d isplay i ng because ASSIST09, at t i m es, performs a
sizeable amount of processi n g to provide the req uested services.
B-1 2
V E RI FY VERI FY
Format: Verify
Verify < Offset >
Operation: Verify or com pare the contents of memory to the tape f i le. Th is com mand h as
the same format and operation as a LOAD command except the f i l e i s com
pared to memory. If the verify fai ls for any reason a "?" is d isplayed .
WI N DOW WI N DOW
Format: Wi ndow < Value >
Operation: Set t h e w i ndow t o a val ue. Thi s val ue may b e referred to when entering ex
pressions by use of the l etter "W". The wi ndow may be set to any 1 6-bit val ue.
8-1 3
B.9 SERVICES
The fol lowi ng descri bes services provided by the ASSIST09 mon itor. These servi ces are
i n vo ked by u s i n g the "SWI" instruction fol lowed by a one byte fu nct ion code. Al l services
are designed to al low complete address i ndependence both in i nvocation and operation.
U n l ess spec ified otherwise, a l l reg isters are transparent over the "SW I " cal l . I n the
fol lowing descriptions, the terms " i n put hand ler" and "output hand ler" are used to refer
to appendage rout i nes which may be repl aced by the user. The default rout i nes perform
standard 1/0 through an ACIA for console operations to a term inal . The ASC I I CAN C E L
c o d e can b e entered on most term i nals b y depressing t h e CONTROL and X keys
s i m u ltaneously. A l ist of services is g iven in Table 8-2.
8-1 4
B R KPT User Breakpoint B R KPT
Code: 10
Arguments: N one
Result: A d i sabled breakpoint is taken. The reg isters are d i s p l ayed and the com
m and handler of ASSI ST09 is entered .
Description: Establ i shes u ser breakpoints. Both SWI2 and SWI3 default appendages
cause a breakpoint as wel l , but do not set the I and F m ask bits. However,
s i nce they may both be repl aced by user routi nes the breakpoi nt service
always ensures breakpoint avai labi l ity. These user breakpoi nts h ave
noth ing to do with system breakpoi nts which are hand led differently by the
ASSIST09 mon itor.
Arguments: None
Result: Reg ister A contains a character obtai ned from the i n put handler.
Description: Control is not ret urned unt i l a val i d i n put character is received f ro m the in
p ut hand ler. The i n put character wil l have its parity bit (bit 7) stri pped and
forced to a zero. Al l N U LL ($00) and RU BOUT ($ 7 F) characters are i g nored
and not returned to the cal ler. The ECH O flag, which m ay be changed by
the vector SWAP service, determ i nes whether or not the i n put character is
echoed to the output hand ler (f u l l d uplex operation). The defau lt at reset is
to echo i n put. When a carriage retu rn ($00) i s received , l i ne feed ($AO) is
automat i cally sent back to the output hand ler.
B-1 5
MO N IT R Startup ASSISl09 M O N IT R
Code: 8
Result: ASSIST09 is entered and the com and handler g iven control
Description: The pu rpose for this function is to e nter ASSI ST09, either after a system
reset, or when a user program des i res to term inate. Contro l is not ret urned
u n l ess a "GO" or "CALL" com m and is done without altering the p rogram
counter. ASSI ST09 runs on the passed stack, and if a stack error i s
detected during user program exec ution this is t h e stack that is rebased .
The di rect page reg i ster val ue i n use remains the d efault for user program
execution.
The ASSIST09 restart vector routine uses this funct ion to start u p mon itor
processing after cal l i ng the vector build su brout ine as explai n ed in I N·
ITI ALIZATIO N .
I f i n dicated by the A reg ister, the i n put and output i n itial ization handlers
are cal l ed fol lowed by the send i n g of the string "ASSIST09" to the output
handler. The programm able t i mer (PTM) is i n itial ized, if its address i s not
zero, such that reg i ster 1 can be used for causing an N M I d uring t race com·
mands. The command handler is then entered to perform the com m and re·
qu est prompt.
B-1 6
O UTC H Output a Character O UTC H
Code: 1
Description: If a FREEZE Occu rs (any i n put character is received) then control i s not
retu rned to the user routi n e u nt i l the condition is released. The F REEZE
cond ition i s checked for only when a l i n efeed is being sent. Padd i n g n u l l
characters (SOO) may be sent fol lowi n g the outputted character depend i ng
on the cu rrent sett ing of the N U LLS command. For DLE (Data Link Escape),
character n u l l s are never sent. Otherwise, carriage retu rns (SOO) receive the
n ew l i ne cou nt of n u l ls, all other characters the character count of n u l ls.
Result: The byte is converted to two hex d i g its and sent to the output handler
fol lowed by a blank.
B-1 7
O UT4H S Convert Word to Hex O UT4H S
Code: 5
Arguments: Reg ister X pOi nts to a word (two bytes) to d i splay i n hex.
Result: The word i s converted to four hex d i g its and sent to the output handler
fol lowed by a blan k.
Arguments: None
Description: The PAUSE service should b e used whenever a s i g n ificant amount o f pro
cessing i s done by a program without any external i nteraction (such as con
sole 110). Another use of the PAUS E service is for the monitori ng of FREEZE
or CAN C E L requests from the i nput hand ler. Th i s al lows m ult i-taski n g
operat i n g systems t o receive control and possi bly re-d i spatch ot her pro
g rams in a ti mesl i ce-l i ke fash ion. Testing for FREEZE and CAN CEL condi
tions is performed before return. Return may be after other tasks h ave h ad
a chance to execute, or after a F R E EZE condition is l i fted . I n a one task
system , ret u rn is always i mmed i ate u n l ess a FREEZE occu rs.
B·1 8
PC R L F Output t o N ext Line PC R L F
Code: 6
Arguments: None
Result: A carriage retu rn and l i ne feed are sent to the output hand ler.
C = 1 if normal output occurred.
C = 1 i f CONTROL-X was entered d u ring output.
Description: If a FR E EZE occurs (any i nput character is received), then control is not
ret u rned to the user routi ne u nt i l the cond ition is released . The string is
com pletely sent regard less o f any FREEZE or CAN CEL events occ u rri n g .
Pad d i n g characters may b e sent a s descri bed under t h e OUTCH service.
Arguments: Reg i ster X poi nts to an output stri ng term i n ated with an ASC I I EOT ($04).
Result: The string is sent to the output handler fol lowi ng a carriage retu rn and l i ne
feed .
CC = 0 if normal output occu rred.
CC = 1 if CONTRO L-X was entered d u ring output.
Description: The output string may contai n em bedded carriage ret urns and l i ne feeds
thus al low i n g several l i nes of d ata to be sent with one function cal l . If a
FR E EZE occurs (any i n put character is received), then control is not ret u rn
ed to the user routine until the cond ition is released . The stri ng is com p l ete
ly sent regard less of any FREEZE or CAN CEL events occurri ng. Pad d i n g
ch aracters may b e sent a s descri bed b y the OUTCH fu nction.
B-1 9
Send New Line and String
P DATA (Contin ued) P DATA
Example: PDATA EQU 3 I N PUT CODE FO R PDATA
Arguments: Reg i ster X poi nts to an output string term i n ated with an ASC I I EOT ($04).
Description: The output st ring m ay contai n e m bedded carriage returns and l i ne feeds
thus al lowi ng several l i nes of data to be sent with one function cal l . If a
FREEZE occu rs (any i n put character i s received), then control is not retu rn
ed to the user routi n e unt i l the condition is released . The stri ng i s com p l ete
ly sent regard less of any FREEZE or CAN CEL events occurri n g . Pad d i n g
characters may b e sent as described b y t h e OUTCH function.
B-20
SPAC E Single Space O utp ut SPAC E
Code: 7
Arguments: N one
Descript ion: Padd ing characters may be sent as descri bed under the OUTCH service.
Result: Reg ister X contai ns the previous val ue for the vector.
Description: The vector swap service exam i nes/alters a word entry in the ASSI ST09 vec
tor table. Th is tabl e contai n s pOi nters and default val ues used d u ri n g
mon itor processing. The entry is repl aced w i t h the value contained i n the X
reg i ster un less it i s zero. The codes ava i l able are l i sted i n Tab l e B·3.
B·21
B.1 0 V ECTO R SWAP SERV I C E
The vector swap service al lows u ser modifications of the vector table to be easily i nstal l
ed. Each vector hand ler, i n c l u d i n g the one for SWI , perform s a val i d ity check on the stack
before any other processi n g . If the stack is not pOinting to val i d RAM , it is reset to the in
itial val ue passed to the M O N ITR request which f i red-up ASSIST09 after RESET. Al so, the
cu rrent reg i ster set i s pri nted fol low ing a "?" (q uestion m ark) and then the command
hand l er is entered . A l i st of each entry i n the vector tabl e i s g iven in Table 8-3.
The follow i n g pages describe the p urpose of each entry and the req u i rements which
m u st be met for a user replaceable val ue or routi n e to be successf u l ly substituted .
8-22
.ACIA ACIA Address .ACIA
Code: 46
Description: This entry contains the add ress of the ACIA used by the defau lt console in
put and output device handlers. Standard ASSI ST09 i n itial ization sets this
val ue to hexadec imal E008. If this m ust be altered , then it m ust be done
before the M O N ITR start u p service i s i nvoked , si nce that service cal l s the
.COO N and .CO I N i nput and output device i n itial ization routi nes which i n
itial ize the ACIA pOi nted to by this vector slot.
Description: The add ress of the vector table is ret u rned with this code. Th is al lows m ass
changes to the table without i n d ividual cal l s to the vector swap service.
The code val ues are i dentical to the offsets i n the vector table. Th is entry
shou l d n ever be changed , only exam i ned.
8-23
. BS OTA P unch/Load H andler Routine . BS OTA
Code: 36
A ret u rn code m ust be given which reflects the f inal processing d i s position :
Z= 1 Successfu l com plet ion
or
Z=0 Unsuccessful com plet ion .
Description: This entry points to a su broutine which i s des i g n ated to term i n ate d evice
processing for the punch, load , and verify handler . BS OTA. The stack con
tains a parameter l i st as documented for the . BSO N entry. The d efault
ASSIST09 routine issues OC4 ($1 4 or stop) and OC3 ($1 3 or x-off) fol lowed
by a one second delay to g ive the reader/punch t i m e to stop. Also, an i nter
nally used fl ag by the I N CH P service rout ine is c leared to reverse the ef
fect caused by its sett ing in the . BSON handler. See that descri ption for an
exp l anation of the proper use of this f l ag .
B-24
. BSO N Punch/Load Initialization Routine . BSO N
Code: 34
Description: T h i s entry poi nts to a su brout ine with the assig ned task of turning on the
device used for punch, load, and verify processi n g . The stack contai ns a
parameter l i st descri bing which funct ion is req uested. The defau lt rout i ne
sends an ASC I I "reader on" or "punch on" code of DC1 ($1 1 ) or DC2 ($1 2)
respectively to the output handler ( .CODTA) . A flag is a lso set which
d i sables test for FREEZE conditions d uri ng I N CH N P processi n g . Th is is
done so characters are not lost by be i n g i nterpreted as FREEZE mode in
d i c ators. If a user replacement rout i n e a lso uses the I N CH N P service, then
it a l so should set this same byte non-zero and clear it i n the . BSO F F
routi ne. The ASSIST09 source l i sting should b e consu lted for t h e location
of this byte.
.CI OTA Input Data Byte from Console Routine .CI OTA
Code: 22
Description: This entry determ i nes the console i n put handler appendage. The respon
s i b i l ity of this routine i s to furnish the req uested next i n put character in the
A reg ister, if avai lable, and ret urn with a cond ition code. The I N CH P ser
vice routine cal l s this appendage to supply the next ch aracter. Also, a
" F R E EZE" mode routine cal ls at various ti mes to test for a FREEZE condi
tion or determ ine if the CAN CEL key has been entered . Processi n g for t h i s
appendage m ust abide by t h e follow i n g conventions:
Input: PC - ASSIST09 work page
S- Return add ress
Output: C = 0, A = i n put character
C = 1 if no i n put character is yet avai l able
Vol atile Registers: U , B
The hand ler shou ld always pass contro l back i m med i ately even if no
character i s yet available. Th is enables other tasks to do product ive work
w h i l e i n put is unavai lable. The defau lt rout ine reads an ACI A as explai ned
in Parag raph B.2 Implementation Req u i rements.
B-25
.CI O F F Input Console Shutdown Routine .CIO FF
Code: 24
Description: Th is entry points to a rout i n e which is cal led to term i nate i n put processing.
It is not cal l ed by ASS IST09 at any time, but is incl uded for consistency.
The defau lt routine merely does an " RTS". The environment is as fol l ows:
Input: None
Output: I n put device term i nated
Volatile Registers: None
Description: Th i s entry i s cal led to i n itiate the in put device. It is cal led once d u ring the
M O N ITR service which i n itial izes the monitor so the . command processor
m ay obtain commands to p rocess. The defau lt hand ler resets the ACIA
used for standard i nput and output and sets up the fol lowing default condi·
tions: 8-bit word length, no parity checki ng, 2 stop bits, divide·by·1 6 counter
ratio. The effect of an 8·bit word with no parity checking is to accept 7·bit
ASCI I and i g nore the parity bit.
Input: .ACIA Memory address of the ACIA
Output: The output device is i n itial ized
Volatile Registers: A, X
8·26
.CM D L 1 Primary Comm a nd List .C M D L 1
Code: 2
Description: User suppl ied com mand tables m ay either subst itute or re place the
ASSI ST09 standard tables. The co mmand hand ler scans two l i sts, the
primary table f i rst fo l lowed by the secondary table. The primary table is
poi nted to by this entry and contains, as a defau lt, the ASSIST09 com m and
table. The secondary table defaults to a n u l l l i st . A user may insert their own
table i nto either position. If a user l i st is i nstal led i n the secondary table
position, then the ASSI ST09 l i st wi l l be searched f i rst . The default
ASS I ST09 l i st contains all one character com m and names. Th us, a user
com mand " PRI NT" would be matched if the l etters " PR" are typed , but not
j ust a " P" si nce the system command l ist wou l d match first . A user m ay
rep l ace the primary system l i st if des i red . A command is chosen on a f i rst
match basis com pari ng only the character(s) entered . Th is means that two
or more commands may have the same i n itial characters and that if only
that much i s entered then the fi rst one i n the l i st(s) i s chosen.
Each entry i n the users com mand l i st m ust have the fo l l owing form at :
+0 FCB L Where " L" is the s ize of the entry i n
c l ud i n g t h i s byte
+1 FCC ' < stri ng > ' Where " < stri ng > " is the com m and
name
+N FOB EP - * Where " EP" represents the sym bo l de
f i n i ng the start of the command rou
t i ne
The f i rst byte is an entry length byte and is always three more than the
lengt h of the command stri ng (one for the length itself plus two for the
routi ne offset). The command st ri ng m ust contai n only ASC I I al phan u meric
characters, no spec ial characters. An offset to the start of the com mand
routine i s used i n stead of an absol ute add ress so that position
i ndependent prog rams may contain command tables. The end of the com
mand table is a one byte flag . A - 1 ($F F) spec ifies that the secondary table
i s to be searched , or a -2 ($FE) that command l i st search ing is to be ter
m i n ated. The table represented as the secondary command l i st m u st end
with - 2. The f i rst l i st m ust end with a - 1 if both l i sts are to be searched , or
a - 2 i f o n ly one l i st i s to be used .
A com mand rout ine i s entered with t h e fol l ow i n g reg isters set:
DPR- ASS IST09 page work area.
S- A ret urn address to t h e command processor.
Z= 1 A carriage return term i nated the command name.
Z=0 A space del i m iter fol lowed the com m and name.
B-27
.CM D L 1 Primary Command List
(Continued) .CM D L 1
A com m and ro utine is entered after the del i m iter fol low ing the command
name is typed i n . Th is means that a carriage ret u rn m ay be the d e l i m iter
entered with the i n put device rest i n g on the next l i ne. For this reason the Z
bit i n the condition code is set so the command routi n e m ay determ i ne the
c u rrent position of the i n put device. The com mand routine sho uld ensure
that the console device is left on a new l i ne before returning to the com
m and h andler.
Description: T h i s entry poi nts to the second l i st table. The defau lt is a n u l l l i st fol lowed
by a byte of 2. A com plete expl an ation of the use for t h i s entry is provided
-
Description: The responsib i l ity of this handler i s to send the character i n the A reg i ster
to the output device. The default rout ine al so fol lows with paddi ng
characters as explai ned i n the description of the O UTCH service. If the out
put device is not ready to accept a character, then the " pause" subroutine
should be cal led repeated ly wh i l e this cond ition l asts. The address of the
pause routine i s obtained from the . PAUSE entry i n the vector table. The
character counts for padding are o btai ned from the . PAD entry i n the table.
Al l ASSI ST09 output is done with a cal l to this appendage. Th is incl udes
punch p rocessi n g as wel l . The default routine sends the character to an
ACI A as explai ned i n Paragraph 8.2 I m plementation Req u i rements. The
operat i n g environment i s as fol lows:
Input: A = Character to send
DP = ASSI ST09 work page
. PAD = Character and new l i n e padd ing cou nts
(i n vector table)
. PAUSE = Pause routine (i n vector table)
O ut put: Character sent to the output d evice
Volatile Registers: None. Al l work reg isters m ust be restored
8-28
.COO F F Output Console Sh utdown Routine . COO F F
Code: 30
Descript ion: This entry addresses the rout ine to term i n ate output device processi n g .
ASSIST09 does not cal l t h i s rout ine. It is incl u ded for com pleteness. The
defau lt routine is an " RTS".
Input: D P - ASSI ST09 work page
Output: The output device is term i n ated
Vol at i l e Registers: None
Description: This entry points to a routine to i n itial ize the standard output device. The
defau lt ro ut i ne i n it i a l izes an ACIA and is the very same one descri bed
u nder the .CI O N vector swap def i n ition.
Input: .ACIA vector entry for the ACIA add ress
O utput: The output device is i n it i al ized
Vol atile Registers: A, X
8·29
. EC H O Echo Flag . EC H O
Code: 50
Description: The fi rst byte of this word is used as a flag for the I N CH P service rout ine
to determ i ne the requ i rement of echoing i n p ut received from the i n put
hand ler. A non-zero value means to echo the i n p ut; zero not to echo. The
ec hoing w i l l take place even if user handlers are substituted for the defau lt
.CI DTA handler as the I N C H P service routine performs the echo .
Description: The fast i nterru pt request rout i n e is located via this poi nter. The M C6809
add resses hexadecimal FFF6 to l ocate the hand le r when p rocessi ng a
F I RQ. The stack and mach ine status is as defi ned for the F I RQ i nterrupt
u pon entry to this appendage. It should be noted that t h i s rout i ne is
"j u m ped " to with an i n d i rect jump i n struction which adds eleven cycles to
the i nterru pt time before the handler actual ly receives contro l . The default
handler does an i m med i ate " RT I " which, i n essence, i g nores the i nterrupt.
8-30
. H S DTA High Speed Display Handler Routine . H S DTA
Code: 32
Description: This entry is i nvoked as a su broutine by the D ISPLAY command and passed
a parameter l i st contai n i ng the "TO" and " FROM " add resses. The from
val u e is rou nded down to a 1 6 byte add ress boundary. The defau lt routine
displays memory i n both hexadecimal and ASC I I rep resentations, with a
t itle produced on every 1 28 byte boundary. The p urpose for this vector table
entry i s for easy i m plementation of a user rout ine for spec ial pu rpose
hand l i n g of a block of data. (The data cou l d , for exam ple, be sent to a high
speed pri nter for l ater analysis.) The parameters are a l l passed on the
stack. The envi ronment is as fol lows:
Input: S + 4 = Start add ress
S + 2 = Stop address
S + 0 = Return Add ress
D P - ASSIST09 work page
Output: Any p urpose desi red
Volatile Registers: X, 0
Description: A l l i nterrupt req uests are passed to the rout i n e poi nted to by this vector.
H exadeci m a l FFF8 is the M C6809 location w here t h i s i nterrupt vector i s
fetched. The stack a n d processor status i s that defined f o r t h e I RQ i nter
rupt upon entry to the hand ler. Since the routi ne's address is in the vector
table, an i n d i rect j u m p must be done to i nvoke it. Th is adds eleven cycles to
the i nterrupt ti me before the I RQ handler receives contro l . The default I RQ
handler pri nts the reg isters and enters the ASSIST09 command handler.
8·31
.N M I Non·M askable Interrupt Vector Appendage .N MI
Code: 16
Description: Th is entry contains the pad count for characters and new l i nes. The f i rst of
the two bytes is the count of n u l l s for other characters, and the second is
the n u m ber of n u l ls (SOO) to send out after any l i ne feed is transmitted . The
ASCI I Escape character (S1 0) never has n u l l s sent fol lowing it. The d efault
.CODTA handler is responsible for transm itting these n u l ls. A user handler
m ay or may not use these counts as req u i red .
The " N U LLS" com mand a lso sets these two bytes with user specified
values.
8-32
. PAUS E Processing Pause Routine . PAU S E
Code: 40
Description: I n o rder to support real-t i m e (also known as mult i-taski ng) envi ronments
ASSI ST09 cal ls a dead-time ro ut i ne whenever processing must wait for
some external change of state. An exa mple would be when the OUTCH ser
vice routine attem pts the sendi n g of a character to the ACIA through the
default .CODTA hand ler and the ACI A status reg isters shows that it can not
yet be accepted. The defau lt dead-t i m e rout ine resides in a reserved fou r
byte area which contains t h e s i n g l e i n struction, " RTS". The . PAUSE vector
entry poi nts to this routine after standard i n itial ization. This poi nter m ay be
changed to point to a user routine w hich d ispatches ot her prog rams so that
the M C6809 may be ut i l ized more efficiently. Another exam ple of use wo u l d
be t o i n c rement a cou nter s o that dead-t i m e cycle counts may be ac
c u m u l ated for stat i st ical or debug g i ng p urposes. The reason for the fou r
byte reserved area (wh i ch exists i n the ASSI ST09 work page) is so other
code may be overlayed without the need for another space i n the address
map to be assigned. For example, a master mon itor may be usi ng a memory
management unit to assign a com plete 64 K block of memory to ASSI ST09
and the prog rams bei n g executed/tested under ASS I ST09 contro l . The
master mon itor wishes, or course, to be reentered when any "dead t i m e "
occ u rs, s o it overlays the default rou t i n e (" RTS") w i t h i t s o w n "SW I " . S i nce
the m aster mon itor wou l d be "front e nd ing" al l "SWI 's" anyway, it knows
when a "pause" call is being pe rformed and can red i spatch ot her systems
on a t i me-sl ice basis.
Al l reg i sters m ust be transparent across the pause hand l er. Along w ith
selected poi nts i n ASSIST09 user service processi n g , there i s a special ser
vice cal l specifical ly for user program s to i nvoke the pause rout ine. It m ay
be suggested that i f no servi ces are bei ng req uested for a g iven time period
(say 10 ms) user programs should cal l the . PAUSE service rout ine so that
fai r-task d ispatch i n g can be g uaranteed .
Description: Th i s entry contains the add ress of the M C6840 program mable timer mod u le
(PT M ). Alterat ion of t h i s slot shoul d occur before the M O N ITR start u p ser
vice i s cal led as explai ned i n Parag raph 8.4 I n itial izat ion. If no PTM i s
ava i lable, then t h e address s h o u l d b e changed t o a zero s o that no i n
it ial izat ion attem pt w i l l take p l ace. N ote that i f a zero i s suppl ied, ASSI ST09
B reakpo i nt and Trace com mands should not be issued.
8-33
. RESET Reset Interrupt Vector Appendage . R ESET
Code: 18
Description: T h i s entry returns the add ress of the RES ET rout i ne which i nitial izes
ASS IST09. Chang i n g it has no effect , but it is i nc l uded in the vector table i n
c ase a user program w ishes to determi ne where t h e ASS I ST09 restart code
resides. For exam ple, if ASSIST09 resides in the memory map such that it
does not control the MC6809 hardware vectors, a user routine m ay wish to
start it up and thus need to obtai n the standard R ESET vector code ad
d ress. The ASSI ST09 reset code assigns the default in the work page, cal l s
the vector b u i l d subrout ine, and then starts ASSI ST09 proper w i t h the
M O N ITR service cal l .
Description: Th i s i s a poi nter to the reserved i nterrupt vector rout ine addressed at hex
adec imal F F FO. Th is M C6809 hardware vector is not defi ned as yet. The
default rout i n e setup by ASSIST09 w i l l cause a reg ister d i sp l ay and en
trance to the com m and handler.
.SWI .SWI
Softare Interrupt Vector Appendage
Code: 14
Description: This vector entry contains the address of the Software I nterru pt routine.
N ormal ly, ASSIST09 hand les these i nterrupts to provide services for user
p rog rams . If a user handler is i n place, however, these fac i l ities cannot be
u sed u n l ess the user routi n e "passes on" such requests to the ASS IST09
default handler. Th is is easy to do, si nce the vector swap fu nct ion passes
back the address of the default handler when the switch is m ade by the
u ser. Th i s "front ending" allows a user routine to exam ine all serivce cal l s ,
or alter/replace/extend them to his requ i rements. Of cou rse, the reg i sters
m u st be t ransparent across the transfer of control from the user to the
standard handler. A "J M P" i n struction branches d i rect ly to the routi ne
poi nted to by this vector entry when a SWI occurs. Therefore, the envi ron
ment is that as defined for the "SWI " i nterrupt.
Description: Th i s entry contains a poi nter to the SWI2 hand ler entered whenever that in
struction i s executed . The status of the stack and machine are those defi n
ed for the SWI2 i nterrupt which has its i nterrupt vector add ress at F F F4
h exadec i m a l . The default handler pri nts the regi sters and enters the
ASSIST09 command handler.
B-35
.SWI3 Software Interrupt 3 Vector Appendage .SWI 3
Code: 6
Description: Th is entry contai ns a poi nter to the SWI3 handler entered whenever that i n
struction is executed . The status of the stack and m ach ine are those defin
ed for the SWI3 i nterurpt which h as its i nterru pt vector add ress located at
hexadecimal F F F2. The default handler prints the reg isters and enters the
ASSIST09 co mmand handler.
8-36
8.1 1 MON ITO R LIST I N G
00004 *************************************
00005 * COPY RIGHT ( C ) M OTO ROLA , I N C . 1 9 7 9 *
00006 ***** ********************************
00017 *********************************************
0 00 1 8 * G LOBAL MODU LE EQUAT E S
00019 ********************************************
0 00 2 0 F800 A ROMBEG E Q U $F800 ROM START ASS EMBLY ADDRE S S
00021 E7 0 0 A RAMOFS EQU -$ 1 9 0 0 ROM OF F S ET TO RAM WORK PAGE
00022 0800 A ROM S I Z E QU 20 4 8 ROM S I Z E
00023 FOOO A ROM 20F E QU ROMBEG- ROMS I Z START OF EXTENS ION ROM
00024 E0 0 8 A AC I A EQU $E0 0 8 DEFAULT AC I A ADDRES S
00025 EO O O A PTM EQU $EO OO DEFAULT PTM ADDRE S S
00026 0000 A DFTC H P EQ U 0 DE FAULT CHARACTER PAD COUNT
00027 0005 A DFTN LP EQU 5 DE F AU LT NEW L I N E PAD COUNT
0 00 2 8 003E A PROMPT EQU ,> P ROMPT CHARACTER
00029 OQ 0 8 A NUMBKP EQU 8 NUMB E R OF BREAK PO I NTS
0 00 3 0 *********************************************
0 00 3 2 *********************************************
00033 * M I SC E LANEOUS EQU AT E S
0 00 3 4 ************** ************* ******************
0 00 3 5 0004 A EOT EQU $04 E N D O F TRANSM I S S I ON
00036 0007 A BELL EQU $07 BE L L CHARACTER
00037 OOOA A LF EQU $OA LINE FEED
00038 0000 A CR EQU $00 CARR I AGE RETU RN
0 00 3 9 0010 A DLE EQU $10 DATA L I N K ESCAPE
00040 0018 A CAN EQU $18 CAN C E L ( CTL- X )
00041 * p'rM ACC E S S DEF I N I T IONS
00042 EO O l A PT M ST A EQU PTM+ l RE AD STATUS REG I STER
00043 EO O O A PTMC 1 3 EQU PTM CONTROL REG I STERS 1 AN D 3
0 00 4 4 EO O l A PTMC 2 EQU PTM+ l CONT ROL REG ISTER 2
0 00 4 5 E0 0 2 A P T M T M l BQU PTM + 2 LATCH 1
0 00 4 6 E0 0 4 1\ PTMTM2 EQU PTM+ 4 LATCH 2
00047 E0 0 6 A PTMTM3 EQU PTM+6 LATCH 3
00051 *******************************************
00052 * AS S I ST0 9 MON ITOR SW I F U N C T I O N S
8-37
PAG E 00 2 ASS I ST0 9 . SA : 0 AS S I S T0 9 - MC6 8 0 9 MON I TOR
8-38
PAG E 003 AS S I ST0 9 . S A : 0 AS S I ST0 9 - M C 6 S 0 9 MON ITOR
0010 2 ******************************************
00103 * WORK AREA
00104 * TH I S WORK AREA IS AS S I G N E D TO THE PAGE ADDRE S S E D BY
0010 5 * -S l S 0 0 , PCR FROM THE BAS E ADDRE S S OF THE AS S I S T 0 9
0 0106 * ROM . THE D I RE CT PAGE RE G I ST E R DURI NG MOST ROUT I NE
00107 * OPERAT I ONS WI LL PO I NT TO TH I S WORK AREA . THE STACK
0 010S * I N I T I ALLY STARTS U N D E R THE RE S E RV E D WORK AREAS AS
00109 * DEF I N E D HERE I N .
00110 ******************************************
0 0111 DFO O A WORKPG EQU ROMB E G + RAMO F S S ETU P D I RECT PAG E ADDRE S S
00112 O O DF A SETDP WORK PG ! > S NOT I F Y AS S E MB LER
0 0 1 l 3 A EO O O ORG WORKPG+ 2 5 6 READY PAG E DEF I N I T I ONS
0 0114 * THE FO LLOW I NG THRU BK PTOP MUST RE S I DE I N TH I S ORDE R
00115 * FOR PROPER I N I T I AL I Z AT I ON
0 0 1 l 6A DFFC ORG *-4
00117 DFFC A PAU S E R EQU * PAUS E ROUT I N E
O O l l S A DFFB ORG *-1
00119 DF F B A SW I B F L EQU * BYPASS SWI AS BREAK PO I NT F LAG
0 0 1 2 0 A DFFA ORG *-1
00121 DFFA A BK PTCT EQU * BREAK PO I NT COUNT
0 0 1 2 2A DF F S ORG *-2
00123 DF F S A SLEVEL EQU * STACK TRAC E LEVEL
0 0 1 2 4 A DFC 2 ORG *-NUMVTR* 2
00125 DFC 2 A VECTAB EQU * VECTOR TAB LE
0 0 1 2 6 A DF B 2 ORG * - 2 * NU M B K P
00127 DF B 2 A BK PTBL EQU * BREAKPO I NT TABLE
0 0 1 2 S A DFA2 ORG *-2* NUMBKP
00129 DFA2 A BK PTOP EQU * BREAK PO I NT OPCODE TAB LE
0 0 l 3 0 A DFAO ORG *- 2
00131 DFAO A WI NDOW EQU * W I N DOW
0 0 1 3 2A DF 9 E ORG *-2
00133 DF9E A ADDR EQU * ADDRES S PO I NT E R VALUE
0 0 1 3 4A D F 9 D ORG *-1
00135 DF 9 D A BAS E PG EQU * BAS E PAG E VALU E
*- 2
0 0 1 3 6 A DF 9 B ORG
00137 DF 9 B A NUMBE R EQU * B INARY BU I LD AREA
0 0 1 3 SA DF99 ORG *-2
00139 DF 9 9 A LASTOP EQU * LAST OPCODE TRACE D
0 0 1 4 0 A DF 9 7 ORG *-2
00141 DF 9 7 A RSTACK EQU * RE S ET STAC K PO I NT E R
0 0 1 4 2A DF 9 5 ORG *-2
00143 DF 9 5 A PSTACK EQU * COMMAN D RECOVE RY STACK
0 0 1 4 4 A DF 9 3 ORG *-2
00145 DF 9 3 A PCNTER EQU * LAST PROG RAM COUNTER
0 0 1 4 6 A DF 9 1 ORG *-2
00147 DF 9 1 A TRAC E C EQU * TRAC E COUNT
0 0 1 4 S A DF 9 0 ORG *-1
*
00149 DF 9 0 A SW I C NT EQU TRACE " SW I " N E ST LEVE L COU NT
0 0 1 5 0 A DF S F ORG *-1 ( M I S F LG MUST FOLLOW SW I CN T )
00151 DF S F A M I S F LG EQU * LOAD CMD/T H RU BREAK PO I NT F LAG
0 0 1 5 2A DF S E ORG *-1
00153 DF S E A DEL I M EQU * EXPRESS I ON DE L I M IT E R/WORK BYTE
0 0 1 5 4 A DF 6 6 ORG *-40
00155 DF 6 6 A RO M2WK EQU * EXTE NS ION ROM RE S E RVED AREA
0 0 1 5 6 A DF 5 1 ORG *-21
00157 DF 5 1 A TSTACK EQU * TEMPORARY STACK HOLD
0015S DF 5 1 A STACK EQU * START OF I N IT I A L STACK
8-39
P AG E 004 AS S I ST0 9 . SA : 0 ASS I ST0 9 - MC6 8 0 9 MON I TOR
00160 ******************************************
0 0161 * DEFAULT THE ROM BEG I N N I NG ADDRES S TO ' ROMBEG '
00162 * AS S I ST0 9 IS POS I T I ON ADDRE S S I N DE P E N DENT , HOWEVE R
00163 * WE AS S EM B LE AS S UM I NG CONTROL OF TH E HARDWARE VECTORS .
00164 * NOTE THAT THE WORK RAM PAG E MUST BE ' RAMOFS '
00165 * F ROM THE ROM BEG I N N I NG ADDRE S S .
0 0166 * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * *
0 01 67A F 8 0 0 ORG ROMBEG ROM ASS EM B LY/DEFAULT ADDRE S S
0 0209 *****************************************************
0 0210 * RE S ET ENTRY PO I NT
0 0211 * HARDWARE RE SET ENTE RS H E RE I F AS S I ST0 9 IS ENAB L E D
00212 * T O REC E I V E TH E MC 6 8 0 9 HARDWARE VECTORS . WE CALL
0 0213 * THE BLDVTR SUBROUT I N E TO I N I T I AL I Z E THE VECTOR
8-40
PAG E 00 5 AS S I ST0 9 . SA : 0 AS S I ST0 9 - M C 6 8 0 9 MON I TOR
00225 ******************************************************
0 0226 * I N I TVT - I N I T I AL VECTOR TABLE
0 0 227 * TH I S TABLE IS RE LOCAT E D TO RAM AN D RE P RE S E NTS TH E
00228 * I lH T I AL STAT E OF THE VECTOR TABLE . ALL ADDRE S S E S
00229 * ARE CONVE R'£E D TO ABSOLU T E FORM . TH I S TABLE STARTS
0 0230 * W I TH TH E SECON D ENTRY , E N DS WITH STAT I C CON STANT
00231 * I N I T I A L I Z AT I ON DATA WH I C H CARRI E S BEYOND TH E TAB LE .
00232 ************************************************
0 0 2 3 3A F844 0158 A I N I TVT F OB CM DT B L - * DEF AU LT F I RST COMMAND TAB LE
00234A F846 0292 A F OB RS RVDR- * DEF AULT UNDEF I N E D HARDWARE VECTOR
0 0 2 3 5A F848 0290 A F DB S W I 3 R- * DE FAULT SW I 3
00236A F84A 028E A F OB S W I 2 R- * DEF AULT SW I 2
0 0237A F84C 0 27 0 A F DB F I RQ R- * DEFAU LT F I RQ
0 0238A F84E 028A A FDB I RQ R- * D E F AUL 'r I RQ ROUT I N E
00239A F850 0045 A FDB S W I R- * DE F AU LT SWI ROU T I N E
0 02 4 0A F852 022B A F DB NM I R- * DEFAULT NMI ROUT I N E
0 0 2 4 1A F854 FFE3 A F OB RE S ET- * RESTART VECTOR
0 0 2 4 2A F856 0290 A F OB C I ON- * DE F A U LT C I ON
0 0 2 4 3A F858 0284 A F DB C I D'£A- * DE F A U LT C I DTA
00244A F85A 0296 A F OB C IOF F- * DE F A U LT C IOFF
00245A F85C 0 28A A F OB COON- * DE FAU LT COON
0 0246A F85E 0293 A F OB CODTA- * DE F A U LT CODTA
0 0 2 4 7A F860 0290 A FOB COOFF- * DE F AU LT COOF F
0 0 2 4 8A F862 039A A F OB H S DTA- * DE F A U LT HS DTA
0 0249A F864 02B7 A F OB B S ON- * DE F AU LT BSON
0 0 2 5 0A F866 0 2 02 A F OB B S D TA- * DE F AULT B S DTA
0 0 2 5 1A F868 02BF A F OB BSO F F - * D E F AULT B SOF F
0 0 2 5 2A F86A E7 9 2 A FOB P A U S E R- * DEFAU LT PAUSE ROU T I N E
0 0 2 5 3A F86C 0470 A F OB EX P1 - * DE F AULT EXPRE S S ION ANALY Z E R
00254A F86E 012 D A F OB C M DT B 2 - * DEFAULT S E COND COMMAN D TABL E
00255 * CONSTANTS
002 56A F870 E0 0 8 A I NTVS F DB AC I A DE FAU L'£ AC IA
00257A F87 2 00 A FCB DFTCH P , DFTNLP D E F A U LT NU LL PADDS
0 0 2 5 8 1\ F874 0000 A FOB 0 DE FAULT ECHO
0 0259A F876 EO O O A FOB PTM DEFAU LT PTM
0 0 2 6 0A F878 0000 A F OB 0 I N I T I AL STACK TRAC E LEVEL
0 0 2 6 1A F87A 00 A FCB 0 I N I T IAL BREAK PO I NT COUNT
0 0 2 6 2A F87B 00 A FCB 0 SWI BREAK PO I NT L E V E L
0 0 2 6 3A F87C 39 A FCB $39 DE FAU LT PAU S E ROUT I NE ( RTS )
00264 F8 7D A I N TV E EQU *
00265 *B
00267 ***********************************************
B-41
PAGE 006 AS S I S'r0 9 . SA : 0 ASS I ST 0 9 - MC 6 8 0 9 MON I 'fOR
0 0 2 9 6A F89S 6A 8 D E6 F 7 SW I R DEC SWI CNT , PCR U P " SWI " LEVEL FOR TRACE
0 0 2 97A F899 17 0 2 2 5 FACl LBSR LDDP SETUP PAGE AND VER I FY STAC K
0 029B * C H E C K FOR BREAK PO I N'f TRAP
0 0 2 99A F89C EE 6A A LDU 10 , S LOAD PROGRAM COUNTER
0 0300A F89E 33 SF A LEAU -l , U BACK TO SWI ADDRESS
0 0 3 0 1A F BAO O D FB A TST SWI B F L ? TH I S · SW I " BREAK PO I NT
0 0 3 0 2A F 8 A2 2 6 11 FBBS BNE SW I DNE BRANCH IF SO TO LET TH ROUGH
0 0 3 0 3A F 8 A4 1 7 069B FF42 LBSR C B K LDR OBTA I N BREAK PO I NT PO I N T E RS
0 0 3 0 4A F BA7 5 0 NEGB OBTA I N POS I T I VE CO UNT
0 0 3 0 SA F B A B SA SWI LP DEC B COU NT DOWN
0 0 3 0 6A F 8 A9 2B OA F8BS BM I SW I DN E BRANCH WHEN DONE
00307A F B AB l l A 3 Al A CMPU , Y+ + ? WAS TH I S A BREAK PO I NT
0 0 3 0 BA F BAE 2 6 F8 F B AB BNE SW I LP BRANCH I F NOT
0 0 3 0 9A F B BO E F 6A A STU 10 , 5 SET PROGRAM COU NTER BACK
00310A F 8 B2 1 6 0 2 1 E FAD3 LBRA Z B K PNT GO DO BREAK PO I NT
0 0 3 l lA FBBS O F FB A SW I DN E C L R SWI B F L C LE AR I N CAS E SET
0 0 3 1 2A F 8 B7 37 06 A PU LU 0 OBTA I N F UNCT ION BYTE , U P PC
0 0 3 1 3A FBB9 Cl OB A CMP B # NUMFUN ? TOO H I GH
0 0 3 1 4A F B BB 1 0 2 2 0 2 0 F FAC E LBH I ERROR YES , DO BREAK PO I NT
0 0 3 1 SA F B BF E F 6A A STU 10 , 5 BUMP PROGRAM COUNTER PAST SWI
0 0 3 16A FBCl SB AS L B F UNCTION C O D E T I M ES TWO
0 0 3 1 7A F8C2 33 BC B8 LEAU SWI VTB , PCR OBTAIN VECTOR BRANCH ADDRE S S
0 0 3 l 8A F 8 C S EC CS A LDO B,U LOA D OF F S ET
0 0 3 1 9A F 8 C7 6E CB A JMP D,U JUMP TO ROUT I N E
0 0321 **********************************************
00322 * REG I ST E RS TO FUNCT ION ROUT I NES :
00323 * DP- ) WORK AREA PAG E
0 0 3 24 * D , Y , U = U N RE L I ABLE X=AS CALLED FROM US E R
8-42
PAGE 007 AS S I s 'r0 9 . S � : 0 �S S I s' r 0 9 - MC 6 8 0 9 MON I 'rOR
00328 **************************************************
0 0329 * [ S ri I P U N C T I U N 8 )
00330 * M O N I 'rU i{ E N 'r RY
0 0331 * F I R E U P 'ru E AS S I ST0 9 MON I 'rU R .
0 0332 * THE S T A C K WITH I'rs VA L ll E S P O R TI I l� l > I jU� CT PAm:
0 0333 * REG I S T E l{ AN D CO N D I 'r I O N CO D E F L AG S A R E U l:> t:: l) AS I ::i .
00334 * 1 ) I N I T I A L I Z 8 CO N l:> U L E I /O
00335 * 2 ) O P T I U N A L L Y P R I N T S I G NON
00336 * 3 ) I N I T I A L I Z E PTM P O R S I NG L � ST � P P I N G
00337 * 4 ) E N T E R COMMAND P ROC E � S O R
00338 * I N P U T : A= O I N l 'r CON S O L E A N D P IU N 'r STAH'ru p �I E S S A G E
0 0339 * A # O OM I 'r CO N SO L E m I 'l' AN D STA RTU P �If'; S S AG E
0 0 340 *** ************ ******************************** **
8-43
PAG E 008 ASS I S'ro 9 . S A : 0 AS S I ST 0 9 - M C 6 13 0 9 1>1 0 N I 'l'O R
00379 ***********************************************
0 0 3 8 0A F8F7 3F C 1>1 D S I'l I TU NEW L I N E
0 0 3 8 1A F 8 F 8 06 A FeB PCRLF F UN C T I O N
0 0 38 2 * D I SARM TiU': B H C A K PO I 1'�'l' S
0 0 383A F8F9 17 U646 F F 4 2 C M D tJ t:: P L B S R C B K I. D R OBTA I N B R E A K PO Hl 'r PO I NT E RS
0 0 3 8 4A F 8 FC 2A OC F90A BP L C !'t DNOL B RAN CH I F' NO'I' ARM E D OR N O N E
0 0385A F 8 FE 50 NEGB MAK E POS I 'r I V t::
0 0 3 8 6A F 8 F £o' D7 FA A ST� 13K P'rCT F LAG AS D I S A RM E D
0 0 3 8 7A F901 5 11. CM D D D L D E C B ? F ! N I S H E: D
0 0 3 88A F902 2B 06 F 9 0 /\ 8M I C�DNOLH� SO BRAN C H
00389A F904 A6 30 A I.J)A LOA D O P CODE S T O RE D
-NUMBK P * 2 , Y
0 0 3 9 0 A F 9 0 6 A7 B1 1\ [ , Y+ + )
STA STO RE BACK OV E R II S W I
It
0 0 3 9 1A 1" 9 0 8 2 0 F7 F901 C M D DD L
B RA LOOP UNT I L DON E
0 0 3 9 2A 1" 9 0 A AE 6A A CMD N O L LOX 10 , S LOAD U S E RS PROG RAM COUNT E R
0 0 3 9 3A F 9 0 C 9 F 93 A STX PCNT E R SAVE FOR EXPRE S S ION ANALY Z E R
0 0 3 9 4A F 9 0 E 8 6 3E A LOA # P ROM P T LOAD PROMPT CHARACTER
0 0 3 9 5A F 9 1 0 3 F SWI SEND TO OUTPUT HANDLER
0 0 3 9 6A F 9 1 1 01 A FCB DUTCH F UNCT ION
0 0 3 97A F912 3 3 E4 A LEAU ,S REMEMBER STACK RESTORE ADDRES S
0 0 3 9 8 A F 9 1 4 OF 95 A STU PSTACK REMEMBER STACK FOR ERROR USE
0 0 3 9 9A F 9 1 6 4 F CLRA PRE PARE Z E RO
0 0 4 0 0A F 9 1 7 S F CLRB PRE PARE Z ERO
0 0 4 0 1A F 9 1 8 DO 9B A STD NUM B E R C LEAR NUMBE R BU I LD AREA
0 0 4 0 2A F 9 1 A DO 8F A STD M I S F LG CLEAR M I S CE L . AND SW I CNT F LAGS
0 0 4 0 3 A F 9 1C DO 91 A STD TRAC E C CLEAR TRACE COUNT
0 0 4 0 4A F 9 1 E C6 02 A LO AS #2 SET 0 TO TWO
0 0 4 0 5A F 9 20 34 07 A PSIi S D , CC P LACE DEFAULTS ONTO STACK
00406 * C H E C K FOR " QU I C K " COMM A N DS .
0 0407A F922 17 0 4 5 4 F D7 9 LBS R READ OBTA I N F I RS T CHARACTER
0 04 0 8 A F925 30 80 0581 LEAX C DOT+ 2 , PCR PRE S ET FOR S I NGLE TRACE
0 04 0 9A F929 81 2E A CMPA iI ? QU I C K TRACE
•
8·44
P AG E 009 AS S I ST0 9 . SA : 0 ASS I S T 0 9 - M C 6 8 0 9 MON I TOR
00487 *
0 0488 * THE 'fAB LES TE RM I NATE WITH A ON E B YT E - l OR - 2 .
0 0489 * 'l'H E - 1 CONT I N U E S TH E COMMA N D SEARC H W I T H TH E
00490 * SECO N D CO MM A N D TAB LE .
0 04 9 1 * THE -2 TERM I NA'r E S COMMA N D S EARCH E::> .
00492 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *� * * * * * * * * * * * * *
B-4 5
PAG E 010 AS s I ST0 9 . sA : 0 AS S I ST 0 9 - MC6 8 0 9 MON I'fOR
00548 *************************************************
00549 * [ SW I F U NCT I ONS 4 AN D 5 )
8-46
P AG E 011 ASS I ST 0 9 . SA : 0 ASS I ST0 9 - MC 6 8 0 9 MON I TOR
00575 *************************************************
0 0576 * [ SW I F U NC T I ON 7 )
0 0577 * S PAC E - S E N D BLANK TO OUTPUT HANDLER
00578 * I NPUT : NONE
0 0 57 9 * OUT P UT : BLANK SE N D '::0 CONSOLt� lIAN DLER
00580 ***************** ********************************
0 0 5 8 1A F 9 F 6 8 6 20 A Z S PACE LOA #' LOAD BLANK
0 0 5 8 2A F 9 F 8 2 0 3D FA3 7 BRA ZOTC H 2 S E N D AN D RETU RN
0 0584 ***********************************************
0 0585 * [ Sri I FUNCT ION 9 )
00586 * SWAP VECTOR TABLE ENTRY
0 0587 * I NPUT : A-VECTOR TABLE CODE ( OF F S ET )
00588 * X=O OR REP LACEMENT VALUE
0 0589 * OUTPUT : X = P REVIOUS VALUE
00590 ***********************************************
0 0 5 9 1A F 9 FA A6 61 A ZVS WTH LOA 1,S LOAD REQUESTERS A
0 0 5 9 2A F 9 FC 81 34 A CMPA # H IVTR ? S U B-CODE TOO H IGH
0 0 5 9 3A F9FE 22 39 FA3 9 BH I ZOTCH3 IGNORE CALL I F SO
0 0 5 9 4A FAO O 10 9 E C2 A LDY VECTAB+ . AVTBL LOAD VECTOR TABLE ADDRE S S
0 0 5 9 5A FA0 3 EE A6 A LOU A,Y U=OLD ENTRY
0 05 9 6A FA0 5 EF 64 A STU 4 ,S RETU RN OLD VALUE TO CALLERS X
0 05 9 7 A FA0 7 AF 7E A STX -2 , S ? X= O
0 05 9 8A FA0 9 27 2E FA3 9 BEQ ZOTCH3 YES , DO NOT CHANGE ENTRY
0 0599A FAO B AF A6 A STX A, Y RE PLAC E ENTRY
0 0 6 0 0A FAO D 20 2A FA3 9 BRA ZOTCH 3 RETURN FROM SW I
00601 *0
8-47
PAG E 012 AS S I ST 0 9 . SA : 0 ASS I ST 0 9 - M C 6 8 0 9 MON I TOR
0 06 0 3 ************************************************
00604 * [ SW I FUNCT ION 0 ]
00605 * INCHNP - OBTA I N I N P UT CHAR I N A ( NO PARI TY )
00606 * NULLS AN D RU BOUTS ARE IGNORE D .
0 0607 * AUTOMAT I C L I N E F E E D I S S E N T U PON HEC I EV I NG A
00608 * CARRI AG E RE'l'URN .
0 06 0 9 * UNLESS �E ARE LOAD I NG F ROM TAPE .
0 06 1 0 ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0 0 6 1 1A FAO F 80 50 FA6 E Z I NCHP BSR XQPAUS HE LEAS E PROC E S S O R
0 0 6 1 2A FAl l 80 SF FAn Z I NCH aSR XQC I DT CALL I N PUT DATA APP E N DAGE
0 06 1 3A FA1 3 24 FA FAO F BCC Z I NCHP LOOP I F NONE AVA I LABLE
0 0 6 1 4A FA1 5 40 TSTA ? T E ST FOR NU L L
0 0 6 1 5A FA1 6 27 F9 FAl l BEQ Z I NCH IGNORE NULL
0 0 6 1 6A FA1 8 81 7F A CMPA # $7F ? RU BOUT
0 0 6 1 7A FA1A 27 F5 FAl l BEQ Z I NCH BRANCH YES TO I G NORE
0 0 6 1 8A FA1 C A7 61 A STA 1,S STORE I NTO CALL E RS A
0 0 6 1 9A FA1 E 00 8F A TST M I S F LG ? LOAD IN PROG RE S S
0 0620A FA2 0 26 17 FA3 9 BNE ZOTCH3 BRANCH I F SO TO NOT ECHO
0 0 6 2 1A FA2 2 81 00 A CMPA #CR ? CARR I AG E RETURN
0 0 6 2 2A FA2 4 26 04 FA2A BNE Z I N2 NO , TES'l' ECHO BYTE
0 0 623A FA2 6 86 OA A LOA # LF LOAD L I NE F E E D
0 06 24A FA2 8 80 C2 F9EC BSR SEND ALWAYS ECHO L I N E F E E D
0 0 6 2 5A FA2A 00 F4 A Z IN 2 TST VEC'l'AB+ . E CHO ? ECHO DES I RE D
00626A FA2C 26 OB FA3 9 BNE Z OTC H 3 NO , RETURN
0 0 6 27 * F AL L TH ROUGH T O OUTCH
00629 ************************************************
00630 * [ S W I FUNCTION 1 ]
00631 * OUTCH - OUTPUT CHARACT ER F ROM A
00632 * I N PUT : NONE
00633 * OUTPUT : I F L I N E F E E D I S TH E OUTPUT CHARACTE R TH E N
0 06 3 4 * C = O NO CTL-X REC I EVED , C= l CTL- X REC I EVED
00635 *************** *********************************
00636A FA2E A6 61 A ZOTCH 1 LOA 1,S LOAD CHARACTE R TO S E N D
0 0 6 3 7A FA3 0 30 8C 09 LEAX < Z PCRLS , PC R DEFAU LT FOR L I NE F E E D
0 06 3 8 A FA3 3 81 OA A CMPA #LF ? L I NE FEED
0 0639A FA3 5 27 OF FA4 6 BEQ Z P DTLP B RANCH TO CHECK PAU S E IF SO
0 0 640A FA3 7 80 B3 F9EC ZOTCH 2 BS R SEND S E N D TO OUTPUT ROUT I N E
0 0 6 4 1A FA3 9 OC 90 A ZOTCH3 I N C SWICNT BUMP UP A SWI n T RACE NEST LEVEL
0 0 6 4 2A FA3B 3B RT I RETURN F ROM n SW I n F UNCT I O N
00644 **************************************************
00645 * [ SW I FUNCTION 6 ]
0 0646 * PCRLF - S E N D CR/LF TO CONSOLE HANDLER
00647 * INPUT : NONE
00648 * OUT PUT : C N. AN D LF S E NT TO HANDLER
00649 * C = O NO CTL- X , C= l CT L-X REC I EV E D
00650 **************************************************
8-48
PAG E 013 ASS I �T0 9 . S A : 0 ASS I � T0 9 - M C 6 8 0 9 MON I T O R
8-49
PAG E 014 AS S I ST 0 9 . SA : 0 AS S I ST0 9 - MC 6 8 0 9 MON ITOR
00729 ********************************************
00730 * NM I DE FAULT IN'fE RRUPT HANDLER
00731 * THE NMI HAN DLER I S US E D FOR TRAC I NG I N STRUCT IONS .
00732 * TRAC E PRI NTOUTS OCCUR ONLY AS LONG AS THE STACK
0 07 3 3 * THACE LEV E L I� NOT B R E AC H E D BY FALL I NG BE LOW IT .
00734 * TRAC I NG CONT I NU E S UNT I L TH E COUNT TU RNS Z E RO O R
0 07 3 5 * A CTL-X I S E NTERED F ROM THE I N PUT CONSOLE DEV I C E .
00736 *********************************************
B·50
PAG E 015 AS S I ST0 9 . SA : 0 AS S I ST0 9 - M C 6 8 0 9 MON I TOR
0 0 7 6 6 A FAB O 1 6 0 3 F 7 F EAA NMI TRC LBRA CTRC E 3 NO , TRAC E ANOTH E R I N ST RUCT ION
00812 * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * * * * * * * * *
0 08 1 3 * F I RQ HAN DLER
00814 * JUST RETU RN FOR TH E F I RQ INTE RRU PT
00815 ********* * **************************** * * **
0 08 1 6 FABC A F I RQR EQU RT I I MME D I ATE RETURN
8·51
PAGE 016 AS S I S T0 9 S A : 0
. ASS I ST0 9 - MC 6 8 0 9 MON ITOR
00818 **************************************************
00819 * DEF AUL'r I /O DRIVERS
0 0 8 20 **************************************************
8·52
PAG E 017 ASS I ST0 9 . SA : 0 AS S I ST 0 9 - MC 6 8 0 9 MON I TOR
00889 *
B S OF F - T U RN OF F READ/VERI FY/PUNCH ME CHAN I SM
00890 * A , X VOLAT I LE
0 0 8 9 1A FB27 86 14 A BSO F F LDA # $ 14 TO DC4 - ST OP
0 0 8 9 2A FB29 3F SW I S E N D OUT
0 0 8 9 3A F B 2A 01 A FC B OUTCH F U NC T I O N
0 0 8 9 4A FB2B 4A DECA CHANGE TO DC 3 ( X-OF F )
Q 0 8 9 sA FB 2C 3F SW I S E N D OUT
0 0 8 9 6A FB2 D 01 A FCB OUTCH F U N CT I ON
0 08 9 7A FB2E OA 8F A DEC M I S F LG C L E AR LOAD I N PROGRE SS F LAG
0 0 89 8A FB 3 0 8E 61A8 A LDX #25000 DE LAY 1 SECOND ( 2 M H Z C LOC K )
0 0899A FB 3 3 30 IF A BSO F LP LE AX -l , X COUNT DOWN
00900A FB 3 s 26 FC FB3 3 B NE B SO F LP LOOP T I LL DONE
0 0901A FB 37 39 RTS RETURN TO CALLE R
00903 *
B S DT A - READ/VER I FY/PUNCH HAN DLER
0 0904 * I N PUT : S + 6 =CODE BYTE , VERI F Y ( - l ) , PUNCH ( O ) , LOAD ( l )
00905 *
S + 4 = START ADDRE S S
0 0906 *
S+ 2 = STOP ADDRE S S
*
00907 S+O - RETURN ADDRE S S
0090B *
OUTPUT : Z - 1 NORMAL COMP LET I ON , Z - O I NVAL I D LOAD/VE R
*
00909 REG I �T E RS A R E VOLAT I L E
8-53
P AG E 018 ASS I ST0 9 . S A : 0 AS S I ST0 9 - M C 6 8 0 9 MON ITOR
8-54
PAGE 019 AS S I ST0 9 . SA : 0 AS S I ST 0 9 - M C 6 8 0 9 MON I TOR
8-55
P AG E 020 AS S I ST 0 9 . SA : 0 ASS I S T0 9 - M C 6 8 0 9 MON I TOR
*
0 10 37 I N PUT : S + 4 = START ADDRE SS
*
0 10 3 8 S + 2 = STOP ADDRE S S
*
01039 S+O = RE T U RN ADDRE S S
0 10 4 0 *
X , D V<? L AT I LE
*
01042 S E N D T I T LE
0 10 4 3A FBFC 3F H S DT A SW I SEND NEW L I N E
0 10 4 4 A FBF D 06 A FCB PCRLF FUN C T I ON
0 1 0 4 SA FBF E C6 06 A LOB #6 PRE PARE 6 SPAC E S
0 10 4 6A FC O O 3F H S B LN K SW I S E N D BLAN K
0 10 4 7 A FC O l 07 A FCB S PAC E FUNCT ION
0 10 48A FC 0 2 SA DE C B COUNT DOWN
0 1 0 49A FC 0 3 26 FB FCO O BNE HS B LNK LOOP IF MO RE
O lO SOA FC O S SF C LR B SETU P BYTE COUNT
O l O S lA FC 0 6 lF 98 A HSHTTL TFR B ,A PRE PARE FOR CONVERT
0 1 0 S 2A FC 0 8 17 F DDB F 9 E 6 LBS R ZOUTHX CONVE RT TO A HEX DIG IT
0 10 S 3A FCO B 3F SW I SEND BLANK
0 1 0 S4A FC O C 07 A FCB S PAC E FUNCT ION
O lO S SA FC O D 3F SWI SEND ANOT H E R
0 10 S6A FCOE 07 A FCB S PACE B LANK
0 10 S7A FC O F SC INCB UP ANOTH E R
0 10 S8 A FC 1 0 Cl 10 A CMPB # $10 ? PAST 'F'
0 10 S9A FC1 2 25 F2 FC0 6 B LO HS HTTL LOOP U NT I L SO
0 10 6 0 A FC 1 4 IF H S U L N E SW I TO NEXT L I N E
0 10 6 1A FC 1 5 06 A FCB PCRLF F UNCT ION
0 1 0 6 2A FC 1 6 25 2F FC47 BC S H S D RTN RE'rURN I F U S E R ENTERED CTL- X
0 10 6 3A FC 1 8 30 64 A LEAX 4 ,S PO I NT AT ADDRESS TO CONVERT
0 10 6 4A FC1A 3F SW I PRI NT OUT ADDRE S S
0 10 6 SA FC I B 05 A FeB OUT 4 H S F UNCT ION
0 10 6 6A FCIC AE 64 A LDX 4,S LOAD ADDRE S S P RO P E R
0 10 6 7A FC I E C6 10 A LDB #16 NEXT S I XT E E N
0 10 6 8A FC 2 0 3F H S H NXT SWI CONVERT BYTE TO HEX AN D S E N D
0 1069A FC 2 1 04 A FCB OUT 2 H S F U N CT I ON
0 1 0 7 0A FC 2 2 SA DE C B COUNT DOWN
O l O 7 lA FC 2 3 26 FB FC20 BNE H S H NXT LOOP I F NOT S I XTEENTH
O l o nA FC 2 S IF SW I SEND BLANK
0 10 7 3A FC 2 6 07 A FCB S PACE F UNCT ION
0 1 0 7 4A FC 2 7 AE 64 A LOX 4 ,S RE LO AD F RO M ADDRE S S
0 1 0 7 SA FC29 C6 10 A LOB #16 COU NT
0 10 7 6A FC2B A6 80 A H S H C H R LDA , X+ NEXT BYTE
O l 0 77A FC 2 D 2B 04 FCl l BM I HSH DOT TOO LARG E , TO A DOT
0 1078A FC 2 F 81 20 A CMPA #' ? LOWER TH AN A BLANK
0 10 7 9 A FC 3 l 24 02 FC3 S BH S HSHCOK NO , BRANCH OK
0 10 8 0A FC l 3 86 2E A H S H DOT L DA #' • CONVERT I NVAL I D TO A BLANK
0 1 0 8 1A FC 3 S 3F HSUCOK SWI S E N D CHARACT E R
0 1 0 8 2A FC 3 6 01 A FCB OUTC H FUNCT ION
0 10 8 3A FC 3 7 SA DE C B ? DON E
0 10 84A FC 3 8 26 Fl FC2 B BNE HSHCHR BRANC H NO
0 1 0 8 SA FC3A AC 62 A C PX 2,S ? PAST LAST ADDRE S S
0. 1 0 8 6 A FClC 24 09 FC4 7 BHS H S DRTN QU I T IF SO
0 1087A FC 3 E AF 64 A STX 4 ,S U P DAT E F ROM AD DRE S S
0 10 8 8 A FC40 A6 65 A LOA 5,S LOAD LOW BYTE ADD RE S S
0 1089A FC4 2 48 AS LA ? TO SECT I O N BOU N DRY
0 1 0 9 0A FC 4 3 26 CF FC 1 4 8NE HSHLNE BRANCH I F NOT
0 1 0 9 1A FC 4 5 20 B5 FBFC BRA H S DTA BRAN CH IF SO
0 1 0 9 2A FC 4 7 IF H S DRT N SW I S E N D NEW L I N E
0 10 9 lA FC 4 8 06 A FCB PCRLF FUNCT ION
0 1 0 9 4A FC49 19 RTS RETURN TO CALLER
8-56
PAG E 021 ASS I ST0 9 . S A : 0 AS S I ST0 9 - MC 6 8 0 9 MON I TOR
01095 *F
01097 ***********************************************
0 10 9 8 * A S S I S T 0 9 C O M M A N D S
0 10 9 9 ***********************************************
0 1107 ********************************************
0 1 10 8 * REG PRT - PRI NT/CHANGE REG I S T E RS SUBROUT I N E
0 1109 * WI L L ABORT TO ' C MDBAD ' I F OVERF LOW DETECT E D DUR I NG
0 11 1 0 * A CHANGE OPERAT I O N . CHANGE D I S P LAYS REG I STERS WHE N
0 1111 * DONE .
01112 * REG I ST E R MASK L I ST CON S I STS OF :
0 1113 * A ) C HARACTE RS DENOT I NG REG ISTER
0 1114 * B ) Z E RO FOR ONE BYTE , - 1 FOR TWO
01115 * C ) O F F S ET ON STACK TO REG I S'r E R POS I T I ON
0 1116 * I N P UT : S P + 4 = STACK E D REG I STERS
0 1117 * A= O PRI NT , At O PRI NT AND CHANGE
0 1118 * OUT PUT : ( ON LY POR REG I STER D I S P LAY )
0 1119 * C = l CONTROL-X EN'rERE D , C = O OTH E RW I S E
01120 * VOLAT I LE : D , X ( CHANGE )
0 1121 * B , X ( D I S P LAY )
0 1122 *******************************************
0 1 1 2 3A FC 5 0 50 A REGMS K F C B ' P , ' C , - 1 , 1 9 PC REG
0 11 24A FC 5 4 41 A FCB ' A , 0 , 10 A REG
0 1 1 2 5A FC57 42 A FCB ' B,0 ,11 B REG
0 1126A FC5A 58 A FCB ' X , - 1 , 1 3 X REG
0 1127A FC S D 59 A FCB ' Y , - 1 , 1 5 Y R� G
0 1128A FC6 0 55 A FCB ' U , - 1 , 1 7 U RE G
0 1129A FC 6 3 53 A FC B ' 5 , -1 , 1 S REG
0 1130A FC 6 6 43 A FCB ' c , ' C , 0 , 9 C C RE G
0 1 1 3 1A FC6A 44 A FC B ' D , ' P , 0 , 1 2 DP REG
0 1 1 3 2A FC 6 E 00 A FC B 0 E N D OF L I ST
8·57
PAG E 022 AS S l I:iT0 9 . SA : 0 ASS I ST0 9 - M C 6 8 0 9 MON I TOR
0 1 l 4 9A FC S 9 26 12 FC 9 0 BU E REGC NG BRANCH YE S
0 1 l 50A FC S B 60 3F A TST -l , Y ? O N E OR TWO BYT E S
0 1 l 5 1A FC S O 27 03 FC 9 2 BEQ REG P 3 BRAN C H Z E RO M E A N S ON E
0 1 l 5 2A FC S F 3F SWI P E RF O RM WORD HEX
O 1 l 5 3A FC90 05 A FCB OUT4 H S FU N CT I O N
0 1 l 54A FC 9 l SC A FCB SKI P2 SK I P BYTl-� P R I NT
O 1 l55A FC 9 2 3F REGP 3 SW I P E RFORM BYTE HEX
0 1 l 56A FC 9 3 04 A FCB OUT2ffS FUNCT ION
0 1l 5 7A FC 9 4 EC AO A REG 4 LOO , Y+ TO FRONT OF N E X T ENTRY
0 1 l 5SA FC 9 6 SO TSTB ? E N D OF ENT R I E S
0 1 l 59A FC 9 7 26 OF FC7S BNE RE G P l LOO P I F MORE
O 1 l 60A FC 9 9 3F SW I FORC E NEW L I N E
O l l 6 lA FC 9 A 06 A FCB PCRLF F UNCT ION
O 1 l 6 2A FC 9 B 35 B2 A REGRTN P U LS PC , y , X , A RESTORE STACK AN D RE TU RN
0 1203 *********************************************
0 1204 * BLDNUM - B U I LDS B I NARY VAL U E F RO M I N P UT H E X
01205 * TH E ACT IVE E X P RE S S ION HAN DLER I S U S E D .
B·58
PAGE 023 AS S I ST 0 9 . S A : 0 AS S I ST0 9 - M C 6 8 0 9 MON ITOR
8-59
PAGE 024 ASS I ST0 9 . SA : 0 AS S I ST0 9 - M C 6 8 0 9 MON I TOR
0 1 2 6 4A F DI F 34 02 A PSHS A SAVE DE L I M I T E R
0 1 2 6 5A FD21 DC 9B A LDD NUMBE R LOAD N E W T E RM
0 1 2 6 6A FD23 30 8B A EX PADD LEAX D,X ADD TO X
0 1 267A FD25 9F 9B A STX NUMB E R STORE AS NEW RE S U LT
0 1268A F D2 7 35 02 A PULS A RE STO RE DE L I M I 'r E R
0 1269A F D29 20 EC F01 7 BRA E X P C DL NOW T E S T IT
0 1 2 7 0A FD2B 81 20 A EXPCHM C M PA #'- ? S U BTRACT O P E RATOR
0 1 2 7 1A FD2 D 27 07 FD36 BEQ EXPSUB BRANC H I F SO
0 1 2 7 2A FD2F 81 40 A CMPA #'@ ? I N D I RE C T I O N DE S I RE D
0 1 2 7 3A FD31 27 DA FOO D BEQ E X PT D I BRANC H I F SO
0 1 2 7 4A FD33 SF C LRB SET DE L I M IT E R RETURN
0 1 2 7 5A FD34 20 CF F DO S BRA EXPRTN AN D RET U RN TO CALLE R
01276A F D3 6 80 OA F D4 2 EXPSUB BSR EXPTRM OBTA I N NEXT T E RM
0 1277A FD38 34 02 A PSHS A SAV E DE L I M I T E R
0 1278A F D3A DC 9B A LDD NUMB E R LOAD UP NEXT TERM
0 1279A F D3 C 40 NEGA NEGATE A
0 1 2 80A FD3D 50 NEGB NEGATE B
0 1 2 8 1A F D 3E 82 00 A SBCA #0 CORRECT FO R A
0 1 2 8 2A FD40 20 El FD23 B RA EX PADD GO ADD TO E X P RE S ION
0 1283 * COMPUTE NEXT EX PRES S I ON T E RM
0 1284 * OUTPUT : X=OLD VALU E
01285 * ' N UMB E R ' =NEXT TE RM
0 12 86A F D4 2 8 0 90 FCEl EX PTRM a S R B LDNUM OBTAI N N E X T VAL U E
0 1 2 87A F D 4 4 27 32 F D7 8 BEQ CNVRTS RETU RN I F VAL I D NUMBER
0 1 288A F D4 6 1 6 FC1 3 F 9 5 C BLDBAD LBRA CMD�AD ABO RT COMMAN D I F I NVAL I D
0 1290 *********************************************
0 1291 * BU I L D B I NARY VALU E U S I NG I N PUT CHARACT E RS .
0 1292 * I N PUT : A=AS C I I HEX VALUE OR DE L I M IT E R
0 12 9 3 * S P + O = RETURN ADDRES S
0 1 2 94 * S P+ 2 = 1 6 B I T RE S U LT AREA
0 1295 * OUTPUT : Z = l A= B I NARY VALUE
0 1296 * Z = O I F I NVAL I D H E X CHARAC T E R ( A UNCHANG ED )
01297 * VOLAT I LE : 0
0 1298 ****************************************
0 1 2 99A FD49 OF 9B A B L DH X I C LR NUI-t B E R CLEAR NUMB E R
0 1300A F D4 B OF 9C A CLR NUMBER+ ! CLEAR NU M B E R
0 13 0 1A F D4 D 80 2A FD7 9 B LDHEX BSR RE AD GE'l' I l� P UT CHARACT E R
0 1 3 0 2A F D4 F 80 11 F D6 2 B L DHXC B S R CNVHEX CO NVERT AN D T E S T CHARACTER
0 1 3 0 3A FD51 26 25 FD7 8 BNE CNVRTS RE T U RN IF NOT A NUMBER
0 1 3 0 4A F D5 3 C6 10 A LOB #16 PRE PARE S H I F'!,
0 13 0 5A FOSS 3D MUL BY FOUR P LAC E S
0 1 3 0 6A F DS 6 86 04 A LOA #4 ROTATE B I NARY I NTO VALU E
0 1307A F D5 8 58 BLDS H F AS L B OBTAI N N E X T � I T
0 1 3 0 8A FDS9 09 9C A ROL NUM B E R+ l I NTO LOW BYTE
0 1309A F DS B 09 9B A ROL NUMBER I NTO H I BYTE
0 1 3 10A FDSD 4A DECA COUNT DOW�
0 1 3 1 1A F DS E 26 F8 FD58 BNE BLDSHF BRANC H I F MORE TO DO
0 1 3 1 2A F D6 0 20 14 F D7 6 B RA CNVOK SET GOOD RET U RN CO DE
01314 ****************************************
0 13 1 5 * CONVERT ASC I I CHARACT ER TO B I NARY BYTE
01316 * I NP UT : A=AS C I I
0 1317 * O UTPUT : Z = l A=B I NARY VALUE
01318 * Z = O I F I NVAL I D
0 1319 * ALL REG I ST E RS TRAN S PARENT
8-60
PAG E 025 AS S I ST0 9 . SA : 0 AS S I ST0 9 - M C 6 8 0 9 MON I TOR
8·61
PAGE 026 AS S I ST0 9 . SA : 0 · AS S I ST0 9 - MC 6 8 0 9 MON I TOR
8·62
PAGE 027 AS S I ST0 9 . SA : 0 ASS I ST0 9 - M C 6 8 0 9 MON I TOR
B-63
PAGE 028 AS S I ST0 9 . SA : 0 AS S I ST0 9 - MC 6 8 0 9 MON ITOR
8-64
PAGE 029 AS S I ST0 9 . SA : 0 AS S I ST0 9 - M C 6 8 0 9 MON I TOR
8-65
PAGE 030 AS S I ST0 9 . SA : 0 AS S I ST0 9 - M C 6 8 0 9 MON I TOR
8-66
PAGE 031 AS S I ST 0 9 . SA : 0 ASS I ST0 9 - MC 6 8 0 9 MON I 'fOR
B-67
PAGE 032 AS S I ST 0 9 . SA : 0 AS S I ST0 9 - MC 6 8 0 9 MON I TOR
0 1700 ****************************************************
0 1701 * DE FAULT I NTERRUPT TRANS F E RS *
0 1702 ****************************************************
0 1 703A F F D4 6E 90 DF EE RSRVD JMP [VECTAB+ . RSVD , PC R ) RE S E RVED VECTOR
0 1704A F F D8 6E 90 DFEC SW I 3 JMP [ VECTAB+ . SW I 3 , PC R ) SWI 3 VECTOR
0 1 705A F F DC 6E 90 DFEA SW I 2 JMP [ VECTAB+ . SW I 2 , PCR) SWI 2 VECTOR
0 1706A FFEO 6E 90 DF E S F I RQ JMP [ V ECTAB+ . F I RQ , PCR) F I RQ VECTOR
0 1 7 0 7A FFE4 6E 90 DF E 6 I RQ JMP [ V ECTAB+ . I RQ , PCR) I RQ VECTOR
0 1708A FFE8 6E 90 DF E4 Sill I JMP [ VECTAB+ . SW I , PCR] S W I VECTOR
0 1 7 0 9A FFEC 6E 90 DFE2 NMI JMP [ VECTAB+ . NM I , PCR ] NM I VECTOR
01711 * * * ***************************************************
0 1712 * ASS I S'f0 9 HA�DWARE VECTOR TABLE
0 1713 * TH I S TABLE I S U S E D IF TH E AS S I ST 0 9 ROM ADDRE S S E S
01714 * T H E MC 6 S 0 9 HARDWARE VECTORS .
0 1715 *** ***************************************************
0 1 7 1 6A FFF O ORG ROMBEG+ROMS I Z - 1 6 SETU P HARDWARE VECTORS
0 1 7 1 7A FFF O F F D4 A F OB RS RVD RES E RVED S LOT
0 1 7 1 8A FFF 2 F F DS A F OB SW I 3 SOFTWARE I NT E RRUPT 3
0 1 7 1 9A FFF 4 F F DC A F OB SWI 2 SOFTWARE I NT E RRUPT 2
0 17 20A FFF 6 FFEO A F OB F I RQ FAST I NT E RRU PT REQUEST
0 1 7 2 1A FF F 8 FFE4 A F OB I RQ INTE RRUPT REQUEST
0 1 7 2 2A FFFA FFES A F OB Sill I SOFTWARE I NT E RRU PT
0 1 7 23A FFFC FFEC A FOB NMI NON-MAS KAB LE I NTERRUPT
0 1 7 2 4A FFFE FS37 A F OB RESET RE START
B·68
PAGE 033 AS S I ST 0 9 . SA : 0 ASS I ST0 9 - MC 6 8 0 9 MON ITOR
0 0 1 2 . RESET 00081*
0 0 0 4 . RSVD 00074*01703
O O O E . SW I 00079*01708
0 0 0 8 . SW I 2 00076*01705
0 0 0 6 . SW I 3 00075*01704
E 0 0 8 AC IA 00024*00256
DF9E ADDR 00133*01239 01391 01392 01402 01421 01431 01437 01448 01456 01460
F DA7 ARMBK 2 00773 01357 01369*
F D8 E ARM B L P 01356*01360
F OAC ARM LOP 01371 *01 377
F 09 0 ARMNSW 01362 01364*
OF90 BAS E PG 00 1 3 5 * 0 0 1 8 6 0 0 7 8 4
0007 BELL 00 0 3 6 * 0 0 7 8 2
OFB2 BK PTBL 00127*01638
OFFA BK PTCT 00121*00386 01370 01594 01607 01634 01639
O FA 2 BK P'rO p 00129*
F81s BL02 001 9 2 * 0 0 1 9 6
F821 BL03 00198*00201
F 04 6 B LOBAD 012 8 8 * 0 1 3 3 9
F 04 D B LOH E X 01250 01301*
F D4 F BLOHXC 00421 0 1 3 0 2*
F 04 9 B LOH X I 01233 01299*
F C Olo' BLON N B 01164 01219*01397
F C E I BLONUM 01222*01286 01492 01588 01 592
F83s BLORTN 00205 00207*
F Os 8 BLDSHF 01307*01311
F800 BLDVTR 00183*00 218
O OOA BRKPT 00066*0 1384
FB6A BS OCMP 00942 00944*
FB70 BS OEOL 00940 00948*
FB40 BS DLD I 00919*00922 00949
FB42 BS DLD 2 00921*00928
FB60 BS DNXT 00939*00945
FB92 BSDPUN 00913 00977*
FB6E BSDSRT 00926 00946*00950
FB38 B S DTA 00250 00911*
FB27 B SO F F 00251 00891*
FB33 BSO F LP 00899 *00900
FBIB BSON 00249 00880*
FB22 BSON 2 00882 00884*
F BE F BS PEOF 01021 01033*
F BA 3 BS PGO 00987*01020
F BC 6 BS PMRE 01009*01011
F BAF BS POK 00990 00992*
F BE C BS PSTR 0 0 9 9 7 0 1 0 3 2*
FBE7 BS PUN 2 01003 01005 01006 01009 0 1 0 29 *
FBE9 BS PUN C 01017 01030*
FB75 BYTE 00930 00933 00935 00939 00953*
FB89 BYTH E X 00953 00956 00965*
F B8 8 BYTRT S 009 6 3 * 0 0 9 6 8
0018 CAN 00040 * 0 0 7 1 1 0 0 7 1 8 01338
FFlE CBKADD 01589 01619*
FF2E CBKA.DL 01627*01630
FF38 CBK A DT 01628 01632*
F E F !:: CBKDLE 01593 01597*
FF07 CBK DLM 01603*01606
FFOO CBKDLP 01598*01601
F Fl 4 CBKDSL 01610*01614
8-69
PAGE 034 ASS I ST0 9 . SA : 0 ASS I ST0 9 - M C 6 8 0 9 MON I TOR
B·70
PAGE 035 ASS I ST 0 9 . SA : 0 ASS I ST0 9 - M C 6 8 0 9 MON I TOR
F OE 8 CMNOTC 0 1 4 0 1 0 1 4 1 0 *
FEOE CMNOTL 0 1 4 2 7 0 1 4 3 4 *
F OF 8 CMNOTQ 0 1 4 1 1 0 1 4 1 9 *
FE1C CMNOTU 0 1 4 3 5 0 1 4 4 3 *
F E1 8 CMPAOP 0 0 4 1 1 0 0 4 6 5 0 1 4 3 2 0 1 4 4 0 *
F E1 6 CMPADS 0 1 4 3 8 * 0 1 4 4 4
F OFE CM SPCE 0 1 4 1 4 0 1 4 2 2 *
F EB 7 CNULLS 0 0 5 2 4 0 1 5 4 6 *
F 07 4 CNVGOT 0 1 3 2 5 0 1 3 3 1 *
F 06 2 CNVHEX 0 0 9 6 7 0 1 3 0 2 0 1 3 2 2 *
F 07 6 C NVOK 0 1 3 1 2 0 1 3 3 2*
F 07 8 C NVRTS 0 1 2 8 7 0 1 3 0 3 0 1 3 2 3 0 1 3 2 7 0 1 3 2 9 01333*01372
F AF I COOTA 0 0 2 4 6 0 0 8 5 2 *
FBOF COOTAO 0 0 8 6 9 * 0 0 8 7 2
F B1 2 COOTAO 0 0 8 5 4 0 0 8 6 4 0 0 8 7 0 *
F B07 COOTLP 0 0 8 6 4 * 0 0 8 6 6
FB03 COOT P O 0 0 8 5 9 0 0 8 6 1 *
FBOO COOTRT 0 0 8 5 6 0 0 8 6 7 *
F EC 8 COFFS 00527 01561*
F E OF COFNOI 0 1 5 7 2 0 1 5 7 5 *
FF8E CONVI 01645 01683*
FFB7 CONV2 01662 01691*
F AF O COO F F 00247 008 45*
F AE 6 COON 00 2 4 5 0 0 8 3 6 *
FE71 CPUNCH 0 0 5 3 0 0 1 5 0 2 *
0000 CR 00038*00427 00621 00667 00858 01034 01166 01185 01428 01496 01654
F C 4A CRE G 00533 01102*
F EBC CSTLEV 0 0 5 3 6 0 1 5 5 1 *
F EA4 CTRACE 0 0 5 3 9 0 1 5 3 5 *
F EAA CTRC E 3 0 0 7 6 6 0 1 5 3 8 *
F EAl CVE R 00 5 4 2 0 1 5 3 0 *
FE3E CWI N OO 0 0 5 4 5 0 1 4 6 9 *
DF8E DE L I M 00153*00751 00757 01223 01236 01256
0 00 0 DFTCH P 0 0 0 2 6 * 0 0 2 5 7
0005 OFTNLP 0 0 0 2 7 * 0 0 2 5 7
0010 OLE 00039*00855
0004 EOT 000 3 5 * 0 0 3 4 3 00652 00684 00738 00782 01032 01034
F AB D ERRMSG 0 0 4 3 6 0 0 7 8 2 * 0 0 7 8 9
F AC E ERROR 0 0 3 1 4 0 0 7 8 9 *
F CE 9 EXPI 00253 01232*
F D0 7 EX P 2 01234 01250*01251
FD23 EX PADO 0 1 2 6 6 * 0 1 2 8 2
F 01 7 EX P C DL 0 1 2 5 2 0 1 2 6 0 * 0 1 2 6 9
F D2 B EXPCHM 0 1 2 6 2 0 1 2 7 0 *
F CE S EXPDL� 0 1 2 3 3 * 0 1 2 3 7
F D0 5 EXP RTN 0 1 2 4 8 * 0 1 2 5 7 0 1 2 7 5
F 03 6 EXPSUS 0 1 2 7 1 0 1 2 7 6 *
F OO D EXPTOI 0 1 2 5 4 * 0 1 2 7 3
F OO F EXPTDL 0 1 2 4 1 0 1 2 4 4 0 1 2 4 7 0 1 2 5 5 *
F D4 2 EXPTRM 0 1 2 6 3 0 1 2 7 6 0 1 2 8 6 *
FFEO F I RQ 01706 *01720
F ABC F I RQR 0 0 2 3 7 0 0 8 1 6 *
F 08 3 GOADDR 0 1 3 4 4 0 1 3 4 9 * 0 1 3 8 0
F DA2 GONDFT 0 1 3 5 1 0 1 3 6 7 *
0034 H I VT R 0 0 1 0 0 * 0 0 5 9 2
FCOO HSSLN K 0 1 0 4 6 * 0 1 0 4 9
FC47 HSDRTN 0 1 0 6 2 0 1 0 8 6 0 1 0 9 2 *
F BFC HS OTA 0 0 2 4 8 0 1 0 4 3 * 0 1 0 9 1
8-71
PAGE 036 AS S I S T 0 9 . S A a O AS S I ST0 9 - M C 6 8 0 9 MON ITUR
PC2 a HS H C H R
01076*01084
FC3 5 HSH COK 01079 0108 1 *
FC3 3 HSU ooT 01077 Ol0 8 0 *
rC1 4 HSH �NE 01060*01090
tC20 HSH NXT 0 1 0 6 8 * 0 1 0 7 1
FC0 6 HS HTT� 0 1 0 5 1 * 0 1 0 5 9
0000 INCHN P 0 0 0 5 6 * 0 0 9 2 0 0 0 9 2 4 00966 Ol 337 01647 01653
r844 I N ITVT 0 0 1 8 8 0 0 2 3 3 *
r870 INTVE 00197 00264*
F870 I NTVS 0 0 1 9 7 0 0 2 5 6 *
FFE4 I RQ 01707*0172l
F A D8 I RQR 00238 00808*
OF99 �ASTOP 001 39*00752 0 1 5 39
FAC 1 �OOP 00297 00740 00784*00809
O OOA �F 000 3 7 * 0 0 6 2 3 00638 00669 0 1 0 3 4 01426
OF8F MISF� 00151 * 0 0 4 0 2 0 0 6 1 9 0074l 00 7 7 2 00886 00897 01364
0 00 8 000 6 4 * 0 0 2 2 2
MON I T R
FA79 M S HOWP
007 3 8 * 0 0 7 4 8
F E3 6 MUPBAO 01459 014 6 2*
FE2B MU P DAT 0 1 4 0 6 0 1 4 1 6 0 1 4 5 6 *
F F EC NM I 01709*01723
FAB 7 NM I CON 0 0 7 4 2 0 0 7 7 2 *
F A7 0 NM I R 00240 00740*
F AB O NM I 'rRC 0 0 7 4 4 0 0 7 4 7 0 0 7 6 6 *
DF 9 B NUMB E R 0 0 1 3 7 * 0 0 4 0 1 0 0 4 6 6 0 1 1 7 9 01255 01260 01265 01267 01278 01299 01300
01308 01309 01405 01497 01637
0 0 0 8 NUMBKP 0 0 0 2 9 * 0 0 1 2 6 0 0 1 2 8 0 0 3 8 9 01358 01374 01620 01633
O O O B NUMF UN 0 0 0 6 8 * 0 0 3 1 3
0 0 1 B NUMVTR 0 0 0 9 9 * 0 0 1 2 4 0 0 1 9 0
0 0 0 4 OUT2 HS 0 0 0 6 0 * 0 1 0 6 9 0 1 1 5 6 0 1 5 7 4 01677
0 0 0 5 OUT 4 H S 0 0 0 6 1 * 0 0 7 5 4 0 1 0 6 5 0 1 1 5 3 01452 01579 01612
0 0 0 1 OUTCH 00057* 0 0 3 9 6 00885 00893 00896 00983 01082 01142 01146 01396 01430
01465
O O O B PAU S E 00 0 6 7 *
OFFC PAU S E R 00 1 1 7 * 0 0 2 5 2
O F 9 3 PCNTER 0 0 1 4 5 * 0 0 3 9 3 0 1 2 4 2
0 0 0 6 PCRLF 00062*00381 01044 01061 01093 01161 01439 01581 01616 01679
0 0 0 3 POATA 00 0 5 9 * 0 0 3 5 2 0 0 7 9 1 0 0 9 9 9 01023
0 0 0 2 POATA1 0 0 0 5 8 * 0 0 4 3 8 0 0 7 5 0
0 0 3 E PROMPT 00 0 2 8 * 0 0 3 9 4
F E 2 1 P RTA DR 0 1 4 4 0 0 1 4 4 8 *
OF 9 5 PSTACK 0 0 1 4 3 * 0 0 3 9 8 0 0 4 3 5
E O O O PTM 000 2 5 * 0 0 0 4 2 0 0 0 4 3 0 0 0 4 4 00045 00046 00047 00259 00355 00356 00358
00359 00 3 6 1 0 1 5 4 2
E O O O PTMC 1 3 0 0 0 4 3 * 0 0 3 5 9
E 0 0 1 PTMC2 00044 * 0 0 3 5 8 00361
E 0 0 1 PTMSTA 0 0 0 4 2 *
E 0 0 2 PTMTM l 0 0 0 4 5 * 0 0 3 5 5 0 0 3 5 6 0 1 5 4 2
E 0 0 4 PTMTM 2 0 0 0 4 6 *
E 0 0 6 PTMTM 3 0 0 0 4 7 *
E 7 0 0 RAMOFS 0 0 0 2 1 * 0 0 1 1 1
F 07 9 REA D 0 0 4 0 7 004 2 4 01258 0 1 3 0 1 01336*01412
F C 9 4 RE G 4 01157 *01176 01186
F CC 3 REGAGN 0 1 1 6 7 0 1 1 8 9 *
F C 7 0 RE(:C H 3 01 1 0 4 0 1 1 3 5 *
F C 9 0 REGCNG 0 1 1 4 9 0 1 1 6 4 *
F C 5 0 RE GMSK 0 1 1 2 3 * 0 1 1 3 7
F C B l REGNXC 0 1 1 6 5 0 1 1 7 7 *
8-72
PAG E 037 ASS I ST 0 9 . SA : 0 ASS I ST0 9 - MC 6 8 0 9 �1ON ITOR
8-73
P AG E 038 ASS I ST0 9 . SA : 0 ASS I ST0 9 - M C 6 8 0 9 MON I TO R
8-74
AP PEN DIX C
MAC H I N E CODE TO INSTRUCTION C ROSS REFEREN C E
C.1 I NTRO D U CT I O N
Thi s appendix contai ns a cross reference between the mach i ne code, represented i n hex
adeci mal and the i n struction and addressing mode that it represents. The n u m ber of
M PU cycles and the n u m ber of program bytes is a l so g iven . Refer to Table C-1 .
C-1
'o
Table C·1. M achine Code to Instruction Cross Reference
r
00 N EG Dir ct 6 2 30 LEAX 4+ 2+ 60 N EG Indexed 6+ 2+
01 31 LEAY 4+ 2+ 61
02 32 LEAS 4+ 2+ 62
03 COM 6 2 33 LEAU Ind xed 4 + 2+ 63 COM 6+ 2+
04 LSR 6 2 34 PSHS I mmed 5 + 2 64 LS R 6+ 2+
�
05 35 PULS 5+ 2 65
06 ROR 6 . 2 36 PSHU 5+ 2 66 ROR 6+ 2+
07 ASR 6 2 37 PULU I mmed 5+ 2 67 ASR 6+ 2+
08 A S L, LSL 6 2 38 I nherent 68 ASL, LS L 6+ 2+
39 6+ 2+
I
09 ROL 6 2 RTS 5 69 ROL
OA DEC 6 2 3A ABX 3 6A DEC 6+ 2+
OB 3B RTI 6/ 1 5 1 6B
OC INC 6 2 3C CWAI 20 2 6C INC 6+ 2+
00 TST 6 2 3D MUL 11 1 60 TST 6+ 2+
OE JMP 3 2 3E 6E JM P 3+ 2+
OF CLR Direct 6 2 3F SWI Inherent 19 6F CLR Indexed 6+ 2+
LEG E N D :
- N umber o f M P U cycles ( less possible push pull or indexed-mode cycles)
I Number of program bytes
• Denotes unused opcode
C-2
Table C·1 . M achine Code to Instruction Cross Reference (Continued)
OP Mnem Mode # OP Mnem Mode # OP Mnem Mode #
90 S U BA Direct 4 2 CO SUBB I mmed 2 2
91 C M PA 4 2
r
Cl CMPB 2 2 Page 2 and 3 Machine
92 S B CA 4 2 C2 S B CB 2 2 Codes
93 S U BD 6 2 C3 ADDD 4 3
94 ANDA 4 2 C4 ANDB 2 2 1 021 LBRN R elative 5 4
95 BITA 4 2 C5 BITB I m med 2 2 1 022 LBHI 5(6) 4
96 LOA 4 2 C6 LOB 2 2
Immed 1 023 LBLS 5(6) 4
97 STA 4 2 C7 1 024 LBHS, LBCC 5(6) 4
98 EO R A 4 2 C8 EOR B 2 2 1 025 LBCS , L B LO 5(6) 4
99 ADCA 4 2 C9 ADCB 2 2 1 026 LBNE 5(6) 4
9A ORA 4 2 CA ORB 2 2 1 027 LBEQ 5(6) 4
9B ADDA 4 2 C t3 ADr 3 2 2 1 028 LBVC 5(6) 4
9C C M PX 6 2 CC LDD 3 3 1 029 LBVS 5(6) 4
90 JSR 7 2 CD 1 02A LBPL 5(6) 4
9E LOX 5 2 CE LOU 3
I mmed 3 1 02B LBMI 5(6) 4
9F STX D irect 5 2 CF 1 02C LBGE 5(6) 4
1 020 L B LT 5(6) 4
AO S U BA I n dexed 4+ 2+ DO SUBB Direct 4 2
1 02E LBGT 5(6) 4
Al
A2
C M PA
S B CA
4+
4+
2+
2+
01
02
CMPB
SBCB t 4
4
2
2
1 02F
l 03F
LBLE
SWI2
Relative
I n herent
5(6)
20
4
2
A3 S U BD 6+ 2+ 03 ADDD 6 2
1 083 CMPD I m med 5 4
A4 A N DA 4+ 2+ 04 ANDB 4 2
AS B ITA 4+ 2+ 05 BITB 4 2
l OSC CMPY I 5 4
l OSE LOY I m med 4 4
A6 LOA 4+ 2+ 06 LOB 4 2
1 093 C M P. D Direct 7 3
A7 STA 4+ 2+ 07 STB 4 2
i
1 09C CMPY 7 3
AS EO R A 4+ 2+ 08 EO R B 4 2
l09E LOY 6 3
A9 ADCA 4+ 2+ 09 ADCB 4 2
l 09 F STY Di ct 6 3
AA ORA 4+ 2+ DA ORB 4 2
1 0A3 CMPD I ndexed 7+ 3+
AB ADDA 4+ 2+ DB ADDB 4 2
�
1 0AC C M P Y 7+ 3+
AC C M PX 6+ 2+ DC LDD 5 2
2 1 0AE LOY 6+ 3+
AD JSR 7+ 2+ DO STD 5
l OAF STY I ndexed 6+ 3+
AE LOX 2+ DE LOU 5 2
5+
1 0B3 CMPD Extended 8 4
AF STX I ndexed 5+ 2+ OF STU Direct 5 2
: �
10BC C M P Y 4
EO SUBB Indexed 4+ 2+ l OB E LOY 4
BO S U BA Extended 5 3 El CMPB 4+ 2+ 10BF STY ExtenQed 7 4
Bl CMPA 5 3 E2 S B CB 4+ 2+ 1 0C E LOS I m med 4 4
B2 S B CA 5 3 E3 ADDD 6+ 2+ l OD E LOS Direct 6 3
B3 S U BO 7 3 E4 ANOB 4+ 2+ 1 0D F S T S Direct 6 3
B4 ANOA 5 3 E5 BITB 4+ 2+ 1 0EE LOS I n dexed 6+ 3+
B5 B ITA 5 3 E6 LOB 4+ 2+ 1 0EF STS I n dexed 6+ 3+
B6 LOA 5 3 E7 STB 4+ 2+ 1 0FE LOS Extended 7 4
B7 STA 5 3 E8 EO R B 4+ 2+ 1 0FF STS Extended 7 4
B8 EORA 5 3 E9 AOCB 4+ 2+ 1 1 3F SWI3 I n herent 20 2
B9 AOCA 5 3 EA ORB 4+ 2+ 1 1 83 CMPU I mmed 5 4
BA ORA 5 3 EB AOOB 4+ 2+ 1 1 8C CMPS I m med 5 4
BB ADOA 5 3 EC LDD 5+ 2+ 1 1 93 CMPU Direct 7 3
BC CMPX 7 3 ED STO 5+ 2+ 1 1 9C CMPS Direct 7 3
BD JSR 8 3 EE LOU 5+ 2+ l 1 A3 CMPU I ndexed 7+ 3+
BE LOX 6 3 EF STU Indexed 5+ 2+ 1 1 AC C M P S I ndexed 7+ 3+
BF STX Extended 6 3 l l B3 CMPU Extended 8 4
FO SUBB Extended 5 3
l l BC CMPS Extended 8 4
Fl CMPB 5 3
F2 SBCB 5 3
F3 ADOO 7 3
F4 ANOB 5 3
F5 BITB 5 3
F6 LOB 5 3
F7 STB 5 3
t
FD STO 3
FE
FF
LOU
STU Extended 6
� 3
3
C-3/C-4
AP PEN DIX D
P ROG RAM M I N G AI D
'
This appendix contains a com p i l ation of data th at w i l l assist you i n p rogramm i ng the
M6809 processor. Refer to Table 0-1 .
Branch InsbUcdons
Addreaing Addressing
Mode Mode
Relative 5 3 2 1 0 aIati\ 5 3 2 1 0
IllSIrUction Forms OP - , Description H N Z V C Instruction Forms OP - , Description H N Z V C
BCC BCC 24 3" 2 Branch C - O • • • · • BLS BLS 23 3 2 Branch Lower • • • · •
29 V= I
0-1
Table D·1. Programming Aid (Continued)
SIMPLE BRANCHES
OP , SIMPLE CONDITIONAL BRANCHES ( Notes 1 -41
BRA 20 3 2 Test True OP False OP
lBRA 16 5 3 N=l BMI 2B BPl 2A
BRN 21 3 2 Z= l B EQ 27 BNE 26
lBRN 1 021 5 4 V= l BVS 29 BVC 28
BSR 80 7 2 C=l BCS 25 BCC 24
lB S R 17 9 3
SIGNED CONDITIONAL BRANCHES (Notes 1 -41 UNSIGNED CONDITIONAL BRANCHES ( Notes 1 -41
Test True OP False OP Test True OP False OP
r> m BGT 2E BlE 2F r> m BHI 22 BlS 23
r�m BGE 2C B lT 20 r� m BHS 24 B lO 25
r=m BEQ 27 BNE 26 r=m B EQ 27 BNE 26
rs m BlE 2F BGT 2E r :s m BlS 23 BHI 22
r< m B lT 20 BGE 2C r< m B lO 25 BHS 24
N otes:
1. All conditional branches have both short and long variations.
2. All short branches a re 2 bytes and require 3 cycles.
3. All conditional long branches are formed by prefixing the short branch opcode with $ 1 0 and uSing a 1 6-bit destination offset.
4. All conditional long branches require 4 bytes and 6 cycles if the branch is taken or 5 cycles if the branch is not taken .
0·2
Table D·1 . Programming Aid (Continued)
Addressi ng Modes
Immediate Direct Indexed Extended Inherent 5 3 2 1 0
Instruction Forms Op - # Op - # Op - I Op - I Op - I Description H N Z V C
ABX 3A 3 1 B + X - X ( U nSigned ) • • • • •
AD C ADCA B9 2 2 99 4 2 A9 4+ 2+ B9 5 3 A + M + C- A I I I I I
A DC B C9 2 2 D9 4 2 E9 4+ 2+ F9 5 3 B + M + C- B I I I I I
ADD ADDA 8B 2 2 9B 4 2 A8 4+ 2+ BB 5 3 A+ M-A I I I I I
ADDB CB 2 2 DB 4 2 EB 4+ 2+ FB 5 3 B + M- B I I I I I
ADD D C3 4 3 D3 6 2 E3 6+ 2+ F3 7 3 D + M:M + 1 - D • I I I I
AN D ANDA B4 2 2 94 4 2 A4 4+ 2+ B4 5 3 AA M-A • I I 0 •
ANDB C4 2 2 D4 4 2 E4 4+ 2+ F4 5 3 B A M-B • I I 0 •
ASL
A N D CC
A S LA
ASLB
1C 3 2
48
58
2
2
1
1
A
B
} [H 1 1 1 1 1 1 1 f.- o
CC A I M M - C C
+- 8
8
I
I
I
I
I
I
7
I
I
�
ASL 08 6 2 68 6+ 2+ 78 7 3 M c b7 bO 8 I I I I
ASR ASRB 47 2 1 •
�} I I I I I I I�
A ----. 8 I I I
ASR 57 2 1 8 I I • I
ASR 07 6 2 67 6+ 2+ 77 7 3 7 bo c 8 I I • I
BIT B I TA 85 2 2 95 4 2 A5 4+ 2+ B5 5 3 8 i t Test A ( M A A ) • I I 0 •
BITB C5 2 2 D!: 4 2 E5 4 + 2+ F5 5 3 B i t Te�t B 1 M A Bi • I I 0 •
CLR CLRA 4F 2 1 O- A • 0 1 0 0
C LR B 5F 2 1 O- B • 0 1 0 0
CLR OF 6 2 6F 6+ 2+ 7F 7 3 O- M • 0 1 0 0
CMP CMPA 81 2 2 91 4 2 A1 4+ 2+ B1 5 3 Compare M from A 8 I I I I
CMPB C1 2 2 D1 4 2 E1 4+ 2+ F1 5 3 Compare M from B 8 I I I I
CMPD 10 5 4 10 7 3 10 7+ 3+ 10 8 4 Compare M : M + 1 from D • I I I I
83 93 A3 B3
CMPS 11 5 4 11 7 3 11 7+ 3+ 11 8 4 Compare M : M + 1 from S • I I I I
8C 9C AC BC
CMPU 11 5 4 11 7 3 11 7+ 3+ 11 8 4 Compare M : M + 1 from U • I I I I
83 93 A3 B3
CMPX 8C 4 3 9C 6 2 AC 6+ 2+ BC 7 3 Compare M : M + 1 from X • I I I I
CMPY 10 5 4 10 7 3 10 7+ 3+ 10 8 4 Compare M : M + 1 from Y • I I I I
8C 9C AC BC
COM COMA 43 2 1 A- A • I I 0 1
COMB 53 2 1 B- B • I I 0 1
COM 03 6 2 63 6+ 2+ 73 7 3 M- M • I I 0 1
CW A I 3C � 2 CC A I M M - C C Wait for I n terrupt 7
DAA 19 2 1 Decimal Adjust A • I I 0 I
DEC DECA 4A 2 1 A- 1-A • I I I •
DECB 5A 2 1 B- 1-B • I I I •
DEC OA 6 2 6A 6+ 2+ 7 4. 7 3 . M- 1-M • I I I •
EOR EORA 88 2 2 98 4 2 A8 4+ 2+ B8 5 3 A ¥- M - A • I I 0 •
EO R B C8 2 2 DB 4 2 E8 4+ 2+ F8 5 3 B J,l- M - B • I I 0 •
EXG R 1 . R2 1E 8 2 R 1 - R 22 • • • • •
JMP OE 3 2 6E 3+ 2+ 7E 4 3 EA J - PC • • • • •
JSR 9D 7 2 AD 7+ 2+ BD 8 3 J u m p to S u broutine • • • • •
LD LDA 86 2 2 96 4 2 A6 4+ 2+ B6 5 3 M-A • I I 0 •
LDB C6 2 2 D6 4 2 E6 4+ 2+ F6 5 3 M- B • I I 0 •
LDD CC 3 3 DC 5 2 EC 5+ 2+ FC 6 3 M:M + 1 - D • I I 0 •
LDS 10 4 4 10 6 3 10 6+ 3+ 10 7 4 M:M + 1-S • I I 0 •
CE DE EE FE
LDU CE 3 3 DE 5 2 EE 5+ 2+ FE 6 3 M:M + 1 - U • I I 0 •
LDX BE 3 3 9E 5 2 AE 5+ 2+ BE 6 3 M:M + 1 - X • I I 0 •
LDY 10 4 4 10 6 3 10 6+ 3+ 10 7 4 M:M + 1 - Y • I I 0 •
8E 9E AE BE
LEA LEAS 32 4+ 2+ EA3 _ S • • • • •
LEAU 33 4+ 2+ EA 3 _ U • • • • •
LEAX 30 4+ 2+ EA3 _ X • • I • •
LEAY 31 4+ 2+ E A3 _ y • • I • •
�}[H I I I I I I I �
LSL LSLA 48 A ....---
2 1 • I I I I
LSLB 58 2 1 O • I I I I
LSL 08 6 2 68 6+ 2+ 78 7 3 c b7 b() • I I I I
LSR LSRA
LSRB
LS R 04 6 2 64 6+ 2+ 74 3
44
54
2
2
1
1 �} -+/ I I I I I I I f-t{]
0
b7 bO c
•
•
•
b
0
0
I
I
I
•
•
•
I
I
I
MUL 3D 11 1 A x B - D ( U nSigned) • • I • 9
NEG N EG A 40 2 1 A+ 1-A 8 I I I I
NEGB 50 2 1 B+ 1 - B 8 I I I I
NEG 00 6 2 60 6+ 2+ 70 7 3 M+ 1-M 8 I I I I
NOP 12 2 1 N o O pera t i o n • • • • •
OR ORA 8A 2 2 9A 4 2 AA 4 + 2+ BA 5 3 A V M-A • I I 0 •
ORB CA 2 2 DA 4 2 EA + l+ FA 5 3 B V M-B • I I 0 •
ORCC 1A 3 2 CC V I M M - CC 7
PSH PSHS 34 5 + 4 2 P ush Registers on S Stack • • • • •
PSHU 36 5 + 4 2 Push Registers on U S taCk • • • • •
�}4HI I I I I I I P
ROL R O LA 49 2 1 • I I I I
ROLB 59 2 1 • I I I I
ROL 09 6 2 69 6+ 2+ 79 7 3 c b7 b() • I I I I
ROR RORA
RORB
ROR 06 6 2 66 6+ 2+ 76 7 3
46
56
2
2
1
1 �} 4}+j I I I I I I I P
c b7 b()
•
•
•
I
I
I
I
I
I
•
•
•
I
I
I
RTI 3B 6m 1 Return From I n terrupt 7
RTS 39 5 1 Return from S ubroutine • • • • •
SBC S B CA 82 2 2 92 4 2 A2 4+ 2+ B2 5 3 A - M - C- A 8 I I I I
SBCB C2 2 2 02 4 2 E2 4+ 2+ F2 5 3 B - M - C- B 8 I I I I
S EX 1D 2 1 Sig n Extend B into A • I I 0 •
ST STA 97 4 2 A7 4+ 2+ B7 5 3 A-M • I I 0 •
STB 07 4 2 E7 4+ 2+ F7 5 3 B-M • I I 0 •
STD DO 5 2 ED 5+ 2+ FD 6 3 0-M:M + 1 • I I 0 •
STS 10 6 3 10 6+ 3+ 10 7 4 S-M:M + 1 • I I 0 •
OF EF FF
STU OF 5 2 EF 5+ 2+ FF 6 3 U-M:M + 1 • I I 0 •
STX 9F 5 2 AF 5+ 2+ BF 6 3 X-M:M + 1 I . I I 0 •
STY 10 6 3 10 10 7 4 Y-M:M + 1 • I I 0 •
9F AF 6+ 3+ BF
SUB SUBA 80 2 2 90 4 2 AO 4+ 2+ SO 5 3 A- M-A 8 I I I I
SUBB CO 2 2 DO 4 2 EO 4 + 2+ FO 5 3 B - M- B 8 I I I I
SUBD 83 4 3 93 6 2 A3 6 + 2+ B3 7 3 0 - M:M + 1 - D • I I I I
SWI SWl o 3F 19 1 Software I n terrupt 1 • • • • •
T FR 1F 2 :.! • • • • •
R 1 , R2 6 R 1 - R2
TST T STA 40 2 1 Test A • I I 0 •
TSTB 5D 2 1 Test B • I I 0 •
T ST OD 6 2 6D 6+ 2+ 70 7 3 Test M • I I 0 •
Notes:
1. This column g ives a base cycle and byte count. To obtain total count, add the values obtained from the I N D EX E D A D D R E S S I N G M O D E table,
in Appendix F.
2. R 1 and R 2 may be any pair of 8 bit or any pair of 16 bit reg isters.
The 8 bit reg isters are: A, B, C C , D P
T h e 1 6 b i t reg isters are: X , Y , U , S , D ,P C
3. E A i s the effective address.
4. The P S H and P U L i nstructions req u i re 5 cycles plus 1 cycle for each byte pushed or pulled.
5. 5(6) means: 5 cycles if branch not taken , 6 cycles if taken ( B ranch instructions) .
6. SWI sets I and F bits. SWI2 and SWI3 do not affect I and F .
7. Conditions Codes set as a direct result o f t h e instruction .
8. Value of half-carry fla g is undefined .
9. S pecial Case - Carry set if b7 is S ET .
0·4
AP PEN DIX E
ASCII C H ARACTER SET
E.1 I NTRO D U CT I O N
Th is appendix contain s the standard 1 1 2 character ASCII character set (7-bit code).
�
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
Sir. b6 b6 0 1 0 1 0 1 0 1
.b4 b3 b2 b1 ...... Column 0 1 2 3 4 5 6 7
I , , I RoW Hex 0 1 2 3 4 5 6 7
0 0 0 0 0 0 NUL OLE SP 0
.
@ P p
0 0 0 1 1 1 SOH DCl I 1 A 0 a q
1
..
0 0 0 2 2 S TX DC2 2 B R b r
0 0 1 1 3 3 ETX DC3 , 3 C S c s
0 1 0 0 4 4 EOT DC4 $ 4 0 T d t
0 1 0 1 5 5 ENO NAK % 5 E U e u
0 1 1 0 6 6 ACK SYN & 6 F V f v
1 1 7 7
·
0 1 BEL ETB 7 G W 9 w
1 0 0 0 8 8 BS CAN ( 8 H X h x
1 0 0 1 9 9 HT EM ) 9 I Y i y
1 0 1 0 10 A LF SUB J j
·
Z Z
1 U 1 1 11 Ii VT ESC + ; K [ Ie I
1 1 0 0 12 C FF FS · < L \ I I
1 1 0 1 13 0 CR GS - = M 1 m J
1 1 1 0 14 E SO RS .> N " n -
1 1 1 1 15 F SI US / ? 0 0 DEL
E-1
Each 7-bit character i s represented with bit seven as the h i gh-order bit and bit one as the
low-order bit as shown i n the fol low ing exam ple:
b7 b6 b5 b4 b3 b2 b1 bO
1 0 0 0 0 0 0 1
The bit representation for the character "A" is d eve loped f rom the bit pattern for bits
seven through five found above the col umn des i g n ated 4 and the bit pattern for bits fou r
through one found t o the l eft of t h e row des i g n ated 1 .
A hexadec i m a l notat ion is commonly used to i nd i cate the code for each character. Th i s
i s easily developed b y assu m i ng a log i c zero i n t h e non-exi stant bit eight position f o r t h e
col u m n n u m bers and u s i n g t h e hexadecimal n u m ber for the row n u m bers.
The characters located in col umns zero and one of Fig ure E-1 are considered control
characters. By defi n i tion , these are characters whose occ u rrance i n a particular context
i n it i ates, mod i fies, or stops an action that affects the record i n g , processi n g , t ran s m i s
sion, or i nterpretation of data. Table E-1 provides the mean i ngs of the control characters.
E.4 G RA P H I C C H A RACTERS
The characters in co l u mns two through seven are considered graphic characters. These
characters have a visual representat ion which is normal ly d i s p l ayed or pri nted . These
characters and their names are g iven in Table E-2.
E-2
Table E·2. Graphic Characters
Symbol Name
SP S pace ( Normally Nonprinting)
Exclamation Point
Quotation Marks ( Diaeresis)
, N umber Sign
$ Dollar Sign
% Percent Sign
& Ampersand
Apostrophe ( Closing Single Quotation Mark; Acute Accent)
Opening Parenthesis
Closing Parenthesis
Asterisk
+ Plus
Comma ( Cedilla)
Hyphen ( Minus)
Period ( Decimal Point)
I Slant
0 . . .9 Digits 0 Through 9
Colon
S emicolon
< Less Than
Equals
> Greater Than
7 Question Mark
@ Commercial At
A . . .Z U ppercase Latin Letters A Through Z
[ Opening Bracket
\ Reverse Slant
1 Closing Bracket
1\ Circumflex
U nderline
Opening Single Quotation Mark ( G rave Accent!
a. . .z Lowerca� Latin Letters a Through z
Opening Brace
Vertical Line
Closing Brace
Tilde
E·3/E-4
APPENDIX F
OPCODE MAP
Th is appendix contains the opcode map and add itional information for cal c u l at i n g re·
q u i red mch i n e cycles.
F . 2 OPCO D E MAP
Table F-1 is the opcode map for M6809 p rocessors. The number(s) by each i n struction in·
d icates the n u m ber of machine cycles req u i red to execute that i n struction. When the
n u m ber contai ns an " I " (e.g ., 4 + I), it indicates that the i ndexed addressing mode i s being
used and that an add itional n u mber of m ach i n e cycles may be requ i red. Refer to Tabl e
F-2 t o determ i ne t h e add itional machi n e cycles t o b e added .
Some i n struct ions i n the opcode map have two n u m bers, the second one i n parenthesis.
Th i s indicates that the i nstruction i nvolves a branch. The parenthet ical number appl ies if
the branch i s taken .
The "page 2, page 3" notation i n col u m n one means that al l page 2 instructions are
preceded by a hexadeci mal 1 0 opcode and al l page 3 instructions are preceded by a hex·
adec i m al 1 1 opcode .
F-1
Table F·1 . Opcode Map
/
-
." III
0101 5 5161 1 BCS) P U lS BITA BITB 5
N ...
:J
6 5 3 BNEI 5 + l l by 2 2 6+ 1 7 2 4 4+ 1 5 2 4 4+ 1 5
01 1 0 6 ROR lBRA 5(6) l B N E PSHU ROR lOA
If · lOB 6
1: 6 9 3 BEQI 5 + l l by 2 2 6+ 1 7 -
4 4+ 1 5 4 4+ 1 5
�
-
01 1 1 7 ASR lBSR 5(6) lBEQ P U LU ASR STA STB 7
6 ASl 3 BVCI 2 2 6+ 1 7 2 4 4+ 1 5 2 4 4+ 1 5
-
]
6 2 3 BVSI 5 2 2 6+ 1 7 2 4 4+ 1 5 2 4 4+ 1 5
1001 9 ROl OAA 5(6) lBVS RTS ROl ADCA ADCB 9
6 3 3 BPLI 3 2 2 6+ 1 7 2 4 4+ 1 5 2 4 4+ 1 5
1 010 A DEC ORCC 5(6) lBPl ABX DEC ORA ORB A
3 BMII 6/ 1 5 2 4 4+ 1 5 2 4 4+ 1 5
/ /
- -
101 1 B 5(6) l B M I RTI AOOA AODB B
6 3 3 BGEI 20 2 2 6+ 1 7 4,6,6 + 1 ,7 5,7,7 + 1 ,8 5,7.7 + 1 ,8 3 5 5+ 1 6
1 100 C I N C ANDCC � (6) L B G E CWAI I NC CMPX CMPY CMPS LDD C
6 2 � B lTI 11 2 2 6+ 1 7 7 7 7+1 8 5 5+ 1 6
1 1 01 0 TST SEX 5(6) lBlT MUL TST BSR JSR STD 0
� BGTI
/
3+ 1 4
/
3 8 3,5,5 + 1 ,6 4,6,6 + 1 ,7 3,5,5 + 1 ,6
I
4,6,6 + 1 ,7
1 /
-
N o n I ndirect I n direct
Assem bler Postbyte x + Assem bler Postbyte + +
Type Forms Form OP Code -
# Form OP Code -
#
Constant O ffset F r o m R N o Offset ,R l R R 00 1 00 0 0 L RI l R R 1 0 l 00 3 0
(twos complement offsetl 5 Bit Offset n, R OR R n n n n n 1 0 defa u lt s to 8 - b i t
8 Bit Offset n, R l R R 0 1 000 1 1 (n, R ] l R R l l 000 4 1
1 6 B it Offset n, R 1 R R 0 1 00 l 4 2 (n, R ] l R R 1 1 00 1 7 2
Acc u m u lator O ffset From R A - R eg i ster O ffset A, R l R ROOl l 0 1 0 (A, R ] l RR 1 01 1 0 4 0
(twos complement offsetl B - R eg i ster Offset B, R l R R 00 1 0 1 1 0 (B , R ] l RR 1 0l 0l 4 0
o - R eg i ster Offset 0, R 1 RROl 01 1 4 0 (0, R ] 1 R R 1 1 01 1 7 0
F·3/F·4
APPENDIX G
PIN ASSIGNMENTS
G .1 I NTRO DUCTIO N
M C6809 E
M C6809
HAi:T HAlT
TSC
NMi XTAL
LIC
IRa EXTAL
RffiT
4 RffiT
AVMA
5 M R OY
a
a
E
OMA/BREa BUSY
R/W R/W
DO
DO
01
A3 01
02
A4 02
03
AS 03
A6 D4
A6 D4
A7 05
A7 05
AS D6
AS D6
AS 07
AS 07
Al0 A15
Al0 A15
Al l A14
Al l A14
A12 20 21 A13
A12 A13
G·1 /G·2
AP PEN DIX H
CONVERSION TAB LES
H .1 I NTRO D U CTI O N
H .2 POWERS OF 2, POWERS O F 1 6
161Tl 2n 16fT1 2n
m= n= Value m= n= Value
0 0 1 4 16 65,536
-
1 2 -
17 1 3 1 ,072
-
2 4 -
18 262 , 1 44
-
3 8 -
19 524,288
1 4 16 5 20 1 ,048,576
-
5 32 -
21 2,097 , 1 52
-
6 64 -
22 4, 1 94,304
-
7 1 28 -
23 8,388 , 608
2 8 256 6 24 1 6,7n,21 6
-
9 512 -
25 33,554,432
-
10 1 ,024 -
26 67 , 1 08,864
-
11 2,048 -
27 1 34,21 7 ,728
3 12 4 , 096 7 28 268,435,456
-
13 8 , 1 92 -
29 536,870,91 2
-
14 1 6,384 -
30 1 ,073,741 ,824
-
15 32,768 -
31 2 , 1 47,483,648
H-1
H .3 H EXAD ECI M AL AN D D ECIMAL CONVERSI O N
Table H -2 i s a ch art that can be u sed for convert i n g n u m bers. fro m either hexadec imal to
decimal or dec i m a l to hexadec i m a l .
H .3.1 CONVERTI N G H EXAD ECI MAL TO DECIMAL. Find the decimal weights for cor
responding hexadec imal characters beg i n n i ng with the least-s i g n ificant character. The
s u m of the dec i m a l wei g hts is the deci mal val ue of the hexadecimal n u m ber.
H .3.2 CO NVERT I N G DECIMAL TO H EXADECI MAL. Find the h i ghest decimal value in the
table which is lower than or equal to the decimal n u m ber to be converted . The correspon
d i ng hexadec i mal character is the most-s i g n ificant d i g it of the f i n a l n u m ber. Subtract the
decimal val u e fo und from the decimal n u m ber to be converted . Repeat the above step to
determ ine the hexadec imal character. Repeat this process to f i n d the su bseq uent hex
adecimal n u m bers.
15 Byte 8 7 Byte 0
15 Char 12 11 Char 8 7 Char 4 3 Char 0
Hex Dec Hex Dec Hex Dec Hex Dec
0 0 0 0 0 0 0 0
1 4,096 1 256 1 16 1 1
2 8, 192 2 512 3 32 2 2
3 1 2 ,288 3 768 3 48 3 3
4 16,384 4 1 ,024 4 64 4 4
5 20,480 5 1 ,280 5 80 5 5
6 24,576 6 1 ,536 6 96 6 6
7 28,672 7 1 ,792 7 1 12 7 7
8 32,768 8 2,048 8 1 28 8 8
9 36,864 9 2,304 9 1 44 9 9
A 40,960 A 2,560 A 1 60 A 10
B 45,056 B 2,816 B 1 76 B 11
C 49, 1 52 C 3,072 C 1 92 C 12
0 53,248 0 3,328 0 2(S 0 13
E 57,344 E 3,584 E 224 E 14
F 61 ,440 F 3 .840 F 240 F 15
H -2
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding
the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit,
and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters can and do vary in different
applications. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does
not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in
systems intended for surgical implant into the body, or other applicalions intended to support or sustain life, or for any other application in which the failure of
the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such
unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless
against all claims, costs, damages, and expenses, and reasonable attorney fees ariSing out of, directly or indirectly, any claim of personal injury or death
associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part.
Motorola and ® are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
_® MOTOROLA
PRINTED IN USA (1993) MPS/POD . M6809PM/AD
111111111111111111111111111111111111111111111111111111111111