PD,

N

 84- 18909

Or

Final Contract Report

Prepared for

George C. Marshall Space Flight Center

Marshall Space Flight Center, Alabama 35812

Intelligent Editor/Printer Enhancements

Contract No. NAS8-34969

Submitted by

Arizona State University

College of Engineering and Applied Sciences

Computer Science Dept

Tempe, Arizona 85287

Principal Investigators: Marvin C. Woodfill

Professor

David C. Pheanis

Assoc Professor

September 15, 1983

CR R 83005

https://ntrs.nasa.gov/search.jsp?R=19840010841 2018-11-09T14:37:11+00:00Z
Final Report

Contract NAS8-34969

ENHANCEMENT OF INTELLIGENT EDITOR/PRINTER

This report was prepaired by Arizona State University under

contract NAS8-34969 Enhancement of Intelligent Editor/Printer for Marshall

Space Fligh Center of the National Aernautics and Space Administration.

The purpose of this contract was to develop for and furnish to the

government for it's unrestricted use all microprocessor support hardware,

softwar e and cross assemblers relating to the Motorola 6800 and 6809

processor systems. Furthermore, a printer controller and intelligent CRT

(similar to the 6800 versions developed under NAS 8-32230) were to be

developed using the 6809, third generation microprocessor.

The following software was delivered and installed on a VAX 11-750

system at MSFC 13 May 1983:

1) The source program for the Motorola 6800/6909 assembler.

2) The source program for the Motorola 68000 assembler.

3) The source program of the Motorola Utility Debug

(MUDBUG ) packag e fo r th e Motorol a 6800 .

4) The source program of the Motorola Utility Debug

(MUDBUG ) packag e fo r th e Motorol a 6809 .

5) A documentatio n file for the MUDBUG system.

6) The executable image for the Motorola 6800 assembler.

7) The executable image for the Motorola 6809 assembler.

8) The executable image for the Motorola 68000 assembler.

9) The executable image for the ASU Compose (word proc)

package.

10)The command procedures developed at ASU to support the

VMS VAX system.

Appendix A of this report is a copy of the current User's manual

for MUDBUG-2, the latest version of the M6800 Debug Package. Appendix B of

this report is a copy of the design specifications for the MC6809 version

of the intelligent printer controller card. MSFC is currently constructing

a printed circuit card to implement this design. The software necessary to

use this card as a controller for a Diablo Hy-Type 2 printer is currently

unde r development and will be supplied to the government after it is

checked out on the finished version of this card which is to be supplied to

ASU by MSFC. Appendix C of this report is the design specification for a

132 Character by 64 Line intelligent CRT display system using a Motorola

6809 MPU. This version also has four pages of refresh memory. (A 68000

version of this design is under development.) Appendix D of this report is

a report-concerning~a feature .that-is-currently being addexfcrtP-4fiPDBSC-.which"—

will greatly increase it ease of use, especially for the in-frequent or

casual user. This feature consists of a one—line.-assembler;\and~ d±s—T~

assembler- This feature will.be added to the Memory-change-,, memory-dump, _-

and register display commands. Its use is documented .in this appendix.-

This capability has proved to be a significant aid because (it_;allows an-,

engineer to debug in assembly language .rather, than..machine language.
-2-

Final Report NAS8-34969

Conclusions:

The hardware developed for this contract seems to work well in

proto-type form. When the finished version of the printer card is

supplied, the software will be verified and that software will be supplied

to the government at no additional "'cost. Furthermore, the addition of the

one-line assanbler and dis-assembler to the debug package represents a

significant improvement in the usefulness of the system to any user, but

especially to those not intimately familiar with the machine language of

the MPU.

Recommendations:

The impact of the one-line assembler/dis-assembler has been

absolutely phenomenal. The amount of improvement that the one-line

assanbler/dis-assembler makes for a person who is developing and debugging

assembly-language programs is so great that it far exceeds our initial

expectations. Presently, the one-line assembler/dis-assembler for the 6800

microprocessor is available only in preliminary form and is not fully

integrated into MUDBUG, but the package is already tremendously useful.

A one-line assembler/dis-assembler package for the 68000

microprocessor is available commercially, but it is rather crude and

inconvenient to use. We are confident that we could develop a much better

package for the 68000, and we are also confident that we could develop a

good one-line assembler/dis-assembler for the 6809 microprocessor.

It is strongly recommended that the government fund a follow-on

projec t to work on. the development of one-line assembler/dis-assembler

packages for the 6809 and 68000 microprocessors. The integration of such

packages into the debuggers for the 6809 and the 68000 would represent a

significant advance of the state of the art, and the result would be

immediately useful to anyone who wants to develop and debug programs for

those two modern microprocessors.
Final Report

Contract NAS8-34969

ENHANCEMENT OF INTELLIGENT EDITOR/PRINTER

This report was prepaired by Arizona State University under

contract NAS8-34969 Enhancement of Intelligent Editor/Printer for Marshall

Space Fligh Center of the National Aernautics and Space Administration.

APPENDI X

A

The User's Manual for the Latest version of MUDBUG-2 the MC6800 Debug

Package.
MUDBUG-2/D 2

User's

David C. Pheanls

Fourth. Edition

August, 1983
I have gone to a great deal of effort to make MODBOG and this

as accurate and as usable as possible, but I have no doubt overlooked a few

shortcomings. In the interest of quality, therefore, I am offering a

reward of $1.00 in U.S. funds to the first finder of each error, whether it

is technical, typographical, grammatical, or otherwise. I hope that this

offer will convince people that I really do want to hear about my mistakes

so I can correct them. Students in my class who use MDDBOG and this manual

may elect to receive 20 points of class credit in lieu of a cash reward.

I shall appreciate receiving positive suggestions for improving this

manual or the MDDBOG system in any way. Some of the features that are

already implemented in MDDBUG evolved from discussions with M6800 users,

and future suggestions for improvements will be more than welcome.

DCP

(c) Copyright 1978, 1979, 1982, 198S by David C- Pheanis

All rights reserved.

First Printingr August, 1983
Table of Contents

Chapter Page

Table of Contents 3

1. Introduction , 4

2. Interrupt Vectors 6

3. MUDBUG Utilities 7

3.1. MJDBUG Command Summary 11

3.2. MODBOG Command Descriptions 12

4. Internal Routines and Subroutines 33

4.1. Summary of Internal Routines 34

4.2. Subroutine Descriptions 35
Chapter 1

Introduction

MDDBUG is a general-purpose Monitor-Gtility-DeBUG software package for

a Motorola M6800 microprocessor. The first version of MUDBUG, which was

known as MUDBOG-1, was designed and developed at Arizona State University

in 1975 by Dr. Marvin C. Woodfill and Ms. Mary L. Dryden to replace the

Motorola-supplied MAID and MHBUG systems, both of which were deficient in

several respects. In the summer of 1976 Mr. Don E. Smoker converted MUDBUG

from its original hand-written machine-language form into a machinereadable assembly-language file, and then in 1977 the MUDBUG system was

almost completely redesigned and rewritten by Dr. David C. Pheanis with the

help of some background information from Dr. Woodfill.

Until 1982 MUDBUG existed as a 1-K program capable of running in a 1-K

EPROM such as a 2708. Falling memory prices and rising chip capacities

eventually modified the marketplace to the extent that 2-K EFROMs such as

the 2716 were actually cheaper than 1-K 2708 EPHOMs. In 1982, therefore,

Dr. Pheanis started using a 2-K 2716 EPROM and modified MUDBUG by adding

several enhancements that bad not been possible when the program had been

restricted to a 1-K EPROM.

Anyone who has any suggestions, comments, or questions regarding

MUDBUG should contact:

Dr. David C.. Pheanis

6822 S. Butte Avenue

Tempe, Arizona 85283

(602) 839-5229

Also, in the unfortunate event that anyone ever detects any error in

MUDBUG, the author would appreciate receiving a detailed report of the

suspected error and its symptoms. Finally, the author will appreciate

receiving any well-conceived ideas for useful features that could be

included in the next release of MUDBUG.

In its present form MUDBUG requires 2-K (i.e., 2,048) words of ROM

program space in locations $F800 through $FFFF. (Note: A leading "$" is a

standard M6800 notation that indicates a hexadecimal number. A decimal

number is normally indicated by the absence of a leading "$"f and an octal

number is indicated by a leading zero. A binary number is indicated by a

leading "$" character.) In the rest of this document we'll use the label

ROM to refer symbolically to the first location of the MUDBUG ROM.

rrrr-^rr Besides requiring a-2-K^-block of: ROM, MUDBUG also-reqnlrssrra- i28Srord

block of RAM for its stack and internal variables. This block of RAM_can
start at any convenient location, and its starting location is indicated by

the label RAM, which is defined by an equate near the beginning of MDDBOG.

Locations RAM+$40 through RAM+$7F of the MGDBUG RAM area are currently

reserved for use by the user's programs, and, In particular, the user's

default stack grows downward froo location RAM+$7F toward location

Besides using ROM and RAM, MUDBOG also needs an ACIA for RS-232

communications with the user's terminal. The memory location of the ACIA1 s

control register is indicated by the label ACONT, and the location of the

ACIA's data register is indicated by the label ADATA. Both of these labels

are defined by equates near the beginning of MtJDBOG, so they can be

modified easily to fit various hardware configurations.
Chapter 2

Interrupt Vectors

MODBOG is designed such that the last eight locations of its ROM space

function as the interrupt yectors for the microprocessor system, and the

interrupt vectors are set up in the MtJDBUG ROM to make the M6800 interrupts

function as follows:

Hardware Interrupt (IRQ): Branch indirectly through locations RAM and

RAM+1. (Note: The label RAM is used

throughout this document to designate the

first location of the MUDBOG RAM area.)

Software Interrupt (SWI): Branch indirectly through locations RAM+2

and RAM+3-

Nonmaskable Interrupt (NMI): Branch indirectly through locations RAM+4

and RAM+5.

Restart Interrupt (RSI): Initialize or restart the MCJDBOG system as

if a power-up condition had occurred.

Locations RAM and RAM+1, RAM+2 and RAM+3, and RAM+4 and RAM+5 are

automatically set up at MUDBOG-initialization time so that a hardware

interrupt (IRQ), a software interrupt (SWI), or a nonmaskable interrupt

(NMI) invokes a routine that prints the contents of all of the registers

and returns control to the top of the MDDBOG command-decoding routine.

For purposes of flexibility, the indirect ihterrupt-vector- pointer

values in the first six locations of the MtJDBUG RAM can. be modified quite

easily via the MUDBOG memory-change (i.e.., "C") command to allow the user

to capture the various interrupts and to service them via his or her own

specialized interrupt-handling routines if necessary. MUDBOGfs memorychange command is explained in detail later.

Users who capture the interrupts for their own interrupt-handling

routines should carefully note the fact that the values of the XR and the

CC register are not preserved in the registers upon entry to a user-defined

interrupt handler because MUDBOG loads the XR with the appropriate indirect

interrupt vector to route control to the user-defined interrupt-handling

routine. Loading the XR, of course, modifies some of the bits in the CC

register. The original values of all of the registers (including the XR

and the CC register) are always preserved on the stack, so they are readily

recoverable by any interrupt-bandling. routine. that ever_needs_.them.
Chapter 3

MJDBDG Utilities

Whenever control "comes to the top of MDDBOG (i.e., following system

initialization, upon the completion of a MODBOG command, at the termination

of a user's program, etc.), the system outputs a prompt (usually a ">lt but

sometimes a "?") on a new line and waits for an input character. The user

can then activate a MDDBOG utility routine by typing a command mnemonic

followed by the appropriate parameter(s) (if any) for the selected command.

MODBOG command mnemonics currently consist of only one or two characters

each, so the user can type them quickly and easily.

When MUDBOG receives a valid command mnemonic in response to a prompt,

it outputs a single blank space to the terminal to show that it recognizes

the command. Then it reads the parameters) (if any) that are required for

the given command. If MODBOG receives an invalid command mnemonic in

response to a prompt, it outputs a backslash ("X") and a bell to reject the

bad input, and then the system prompts the user again for a good MJDBDG

command mnemonic.

Individual MDDBDG commands require from as few as zero to as many as

four parameters, and the parameters are known as STABT, STOP, SET, and

MASK, respectively. The values of the parameters are input following a

command mnemonic as hex-number inputs, which are described below.

A hex-number input may be signed or unsigned, and it is terminated by

a comma, a blank space, a tab, an asterisk, a period, a solidus ("/"), or a

carriage return. We'll frequently use the notation

 n<CH>lf in this document

when we wish to emphasize the presence of a carriage return. At other

times, we'll simply assume the presence of a carriage return at the end of

an input line.

A solidus termination character has a rather special global meaning in

that it immediately aborts the MDDBDG command that is currently being

typed. A solidus is therefore useful as an abort character, and a user can

easily abort any MDDBDG command line by simply typing a solidus before the

input line has been completed.

A carriage-return terminator also has a rather special global meaning

in that it always terminates the command that is being typed. If the user

types a carriage return before all of the command's parameters) have been

typed, MODBDG simply uses default values for the remaining parameter(s).

The period, comma, space, tab, and asterisk terminators don't have any

special..meanings, except as noted for certain, individual MDDBUG,—commands.

-"Most"- users -"use"—the- comma orvspacenteniiinator to-'te'ntft nate-eacir parameter-:

except the last parameter for a command, and they typically, use. a~carriage

return to terminate a command's last parameter. For"lexairipretlTa-"typical:"
8

command might be typed as "F 100, 200, 23, FF<CR>" where the <CH>

terminator is used to terminate the command's last parameter. Similarly, a

user might type "F 100 200 23 FF<CR>* to perform the same operation.

A hex-number input to MODBOG is always typed without a leading "$"

because a leading "$" would be redundant in view of the fact that MDDBOG

automatically assumes that,all input numbers are hexadecimal by default.

MDDBOG allows the user to type leading blank space(s) and/or leading

tab(s) with a hex-number input because many users like to insert white

space at the beginning of an input number for improved readability. No

leading white space is required, of course, but blanks and tabs are allowed

until the first hextet of the input number has been typed. Since MDDBOG

allows the user to type leading blanks and/or leading tabs, a user can't

use a blank or a tab to terminate an empty (i.e., missing) input number. A

user who wants to omit an input number entirely must type one of the other

termination characters to indicate the missing number. For example, a user

could type "I 100, , 0<CH>" to obtain a default value for the second input

parameter, but a user could not use a blank or a tab to terminate the

missing second parameter.

Since a blank space or a tab can't be used to terminate a missing

input number, we refer to the blank space and the tab as soft termination

characters. The other termination characters (asterisk, comma, period,

solidus ("V), and <CR» are all known as hard termination characters

because they can be used to terminate any input number including a missing

input number.

A leading minus sign negates a hex-number input value, and a leading

plus sign has no effect on the value of a hex-number input. Two minus

signs (or any even number of minus signs for that matter) cancel each,

other, so a user can conveniently change his or her mind after* typing a

minus sign by mistake. Any odd number of minus signs, of course, results

in the negation of the hex-number input value. Leading sign characters are

permitted until the first hextet of the input number has been typed, and

after that time sign characters are rejected (see below).

A user who makes a mistake when typing an input number can quickly

correct the error by simply typing enough hextets to shift the mistake out

of the left end of the number. For example, "1241234" is equivalent to

"1234" as a four-hextet input number, and "-1202" is equivalent to "-02" or

just

 B-2B as a two-hextet input number. Similarly, "-1000F" is equivalent

to

 n-Fw as an input number.

A user can also correct a typing error in a hex-number input by typing

a backslash ("X") before the number's termination character has been typed.

A backslash deletes all previous input characters for a number, so a user

rcan.-easily restart-an input ;;-number-from-its first1oharacteri"r:Fpr:.examplejjr:

"—127X-3D75\-\3C51" is equivalent to "3C51W as a hex-number input,, and

"5ADDD\ - 5ADD" is equivalent to "-5ADD" as a-hex^number . input.- Notice ':

that the backslash, correction feature can. be used a3rmany_:time_3i-aa--desired-^
in a single input number, and also notice that a backslash deletes all

previous input characters for the number, including sign characters.

If MDDBDG receives an invalid input character when it thinks it should

be reading a hexadecimal number, the system outputs a bell and a question

mark to the terminal to alert the operator to the fact that the bad input

character is being rejected. The invalid input character is effectively

ignored, and MDDBOG reads -the next input character as the next character of

the hexadecimal input number. Only the following ASCII characters are

valid for hex-number inputs:

blank tab + -Ol23456789ABCDEFabcdef\.,» / <CR>

The first two characters in this list (blank and tab) are valid as

leading characters before the first hextet of the input number has been

typed, and they are also valid as termination characters after the first

hextet of the input number has been typed. The next two characters in the

list (+ and -) are valid only before the first hextet of the input number

has been typed, and they are rejected as invalid inputs if they are ever

typed anywhere other than at the beginning of a number. A backslash ("\")

can always be used to restart an input number, so a user can go back and

type a forgotten sign character by first typing a backslash. Notice that

lower-case alphabetic hextets (a-f) are accepted as being equivalent to the

corresponding upper-case alphabetic hextets (A-F), so users don't need to

worry about pressing or not pressing the shift key when talking to MUDBOG.

MDDBDG always remembers the values of the START, STOP, KEY, and MASK

parameters from one command to the next, so a user can conveniently specify

the previously-existing value of a parameter by typing only a hard

termination character (in this case, a comma, period, asterisk, or- <CR>)

for that parameter. For example, if the last value that was used for the

START parameter was $89AB, then simply typing "C." is equivalent to typing

"C 89AB." This feature reduces the number of characters that the user must

type, so it helps prevent mistakes that are caused, by simple typing errors.

Additionally, it alleviates frustration because the user doesn't need to

retype the same input number over and over.

Recall that a user can specify default values for the remaining

parameters ) on a command line by typing a carriage return to terminate the

command. For example, a user might want to type new values for the first

two parameters and then use a carriage return to specify the default values

for the command's remaining parameters.

MDDBDG maintains a complete set of pseudo-register values, and the

user can easily inspect and/or change these pseudo-register values via the

MDDBDG register-change commands, which are explained in detail later. The

user can also inspect and/or change individual memory locations, and one

can initialize memory in blocks , load object modules_into, memory:,. ..compare,

object modules to memory, write object 'modules- front-memory- to: a^-.tape>- dump. -

memory to the terminal in a readable format, search. z memory ___ to ,_find. . any..

•specified, values, and/or execute any program. MDDBDG Conveniently. .performs .

self-relative addressing calculations for- the- user,- and, MDDBDG. also- does
10

hexadecimal addition and subtraction for the user. Interactive debugging

Is quick and easy because the user can tell MUDBUG to trap control at any

specified point in his or her program. Finally, if the hardware of the

user's system supports step-mode operations, the user can tell MUDBDG to

execute a single instruction or a specified number of instructions.

The table on the following page, which is intended to be used as a

handy reference sheet, briefly summarizes all of the MUDBDG commands, and

the pages that follow the command-summary table describe the individual

MUDBUG commands in sufficient detail to serve as a programmer's manual.

The table provides a brief functional description of each command, and the

table also includes a number with each command to tell how many parameters

the command requires.

Upper-case command mnemonics (e.g., A, B, and C) are used throughout

this document in all descriptions and examples, but MDDBUG also accepts

lower-case command mnemonics (e.g., a, b, or c) as being equivalent to the

corresponding upper-case command mnemonics. Therefore, users can always

type MUDBUG commands with either upper-case or lower-case alphabetic

characters, whichever happens to be more convenient.
11

3.1. MDDBUG Command Summary.

Parameters: START, STOP, KEY, and MASK.

Pseudo Registers: AH, BR, XR, PR, SP, and CC (H I M Z 7 C).

———— Command Mnemonic

I —— Number of Parameters

I I

V V Description of Command's Function

• 0 An asterisk introduces a comment line.

A 0 Print the Afi value in hex, and accept a new hex AR value.

B 0 Print the BR value in hex, and accept a new hex BR value.

C 1 Change (after printing) the contents of memory location START.

E 0 Establish a new CC value after printing the existing CC value.

F 4 Find KEY under the bits of MASK in locations START through STOP.

G 1 Go to location START to execute the user's program.

H 0 Halt return. Go to the location that is addressed by the PR.

I 3 Initialize locations START through STOP to the value KEY.

K 2 Kalculator. Set START <— START -t- STOP, and print START.

L 1 Load (.) or compare (,) an object module to memory; Disp = START.

M 3 Memory dump of locations START through STOP to the terminal.

N 1 & N step. Execute START instructions beginning at location PR.

0 1 & One step. Execute one instruction at START. Default START = PR.

PE 1 Peek at memory. Like C except that it never writes to memory.

PO 1 Poke into memory- Like C except that it never reads from memory.

PR 0 Print the PR value in hex, and accept a new hex PR value.

Q 0 Query the registers. Print AR, BH, XR, PHr SP, HINZVC.

R 1 Relative address: Print and/or set the destination of a branch.

S 0 Print the SP value in hex, and accept a new hex SP value.

T 4 # Trap. Go to START; trap control when it reaches STOP KEY times.

V 4 & Verify ROM Program. Like "Tw except that, it can be used in ROM.

W 2 Write locations START through STOP to tape in object format.

X 0 Print the XR value in hex, and accept a new hex XR value.

Z 0 Zero the AR, BR, XR, PR, and CC, and initialize the SP.

& Commands that are marked with an "&" are available only if the system on

which MUDBOG is running has the necessary hardware to support step-mode

operations.

t Only the first two parameters of the "T" command are available if the

system on which MUDBOG is running doesn't have the necessary hardware to

support: step-mode operations. - . .^rrrc.••c^^rr^o-j^^^^^rrr
12

3.2. MUDBUG Command Descriptions.

This section contains user-oriented descriptions of all of the MDDBUG

commands. The descriptions are alphabetized by the command mnemonics for

the convenience of the reader.

"*" Command; No Parameters; Comment.

The "*" command, which has no parameters, is used to introduce a

comment line into the transcript of the user's session at the terminal. If

the user inputs an asterisk in response to the prompt (*>* or

 n?B

) for a

MDDBUG command mnemonic, MDDBDG reads and echoes (but otherwise ignores)

all subsequent input characters (including solidus characters) until a

carriage return is input. Users can therefore annotate and document the

listings of their MUDBUG transactions by typing any desired comments on

lines that begin with asterisks. Also, the comment facility effectively

turns the user's MUDBUG transcript into a handy scratchpad for recording

ideas and problems as they occur (before they are forgotten).

The use of an asterisk to introduce a comment line in MUDBUG is

compatible with the definition of a comment line in the M6800 assembly

language, so MUDBUG comment lines should seem quite natural to most users.

"A" Command; No Parameters; Change AR.

The "A" command, which, has no parameters, displays the current hex

value of the pseudo AB, and then it accepts a new hex value for the AR. If

a user types a hard termination character (/ * , .or <CB» alone without a

number for a new AR value, the pseudo AR retains its present value.

"B" Command; No Parameters; Change BR.

The "B" command, which has no parameters, displays the current hex

value of the pseudo BR, and then it accepts a new hex value for the BR. If

a user types a hard termination character (/ • , .or <CR» alone without a

number for a new BR value, the pseudo BR retains its present value.

"CTM Command; 1 Parameter; Change Memory.

^ . The--I'C'Vcominand, which haa onej-parameter, .displays the^addreas-and-thei:.

current hex value of the contents~of memory - location-STAHTy~and"then"It "

accepts a new hex-value to be pufr-into that location^—— "~~ ~~~~~:
13

If the new hexadecimal value for location START is terminated by a

carriage return, MUDBDG automatically continues the "C" command by setting

START <— START + 1 and performing the "Cn command's function for the next

location in memory. If an asterisk, blank, or tab termination character is

used to terminate the new hexadecimal value for location START, MUDBDG sets

START <— START - 1 and automatically performs the "C» command with the

preceding memory location. If a comma terminator is used to terminate the

new hex value for location START, MODBDG performs the "Cn command's

function again with the same location. If the new hex value is terminated

by a period, the "C" command returns control to the top of MJDBUG after it

installs the new value into memory. Finally, if a solidus ("/") terminator

is used, the "C" command is aborted and control returns at once to the top

of MUDBDG with no change to the contents of location START.

If a user types a hard termination character (/ * , .or <CR>) alone

without a number for a new memory value, the contents of the memory

location remain unchanged, but the function of the termination character

regarding the continuation or termination of the "C" command is still

effective. Users can therefore examine several consecutive memory

locations rather conveniently by using carriage-return or asterisk

terminators, and they need to type new values only when new values are

actually desired.

The "CTM command reads back and verfies the value that it stores into

memory, so any attempt to use the "C" command to alter a value in ROM or in

nonexistent memory is automatically aborted with a backslash and a bell.

This feature is included so the user won't think a value is changed when it

is, in fact, not changed.

The "Cn command is not intended for use with read-only or write-only

registers such as the status and control registers of an ACIA. A user who

wishes to examine a read-only register should use the "PE" (peek) command,

and a user who wishes to put a value into a write-only register should use

the "PO" (poke) command.

"En Command; No Parameters; Establish a CC Value.

The "E" command, which has no parameters, is used to establish a value

for the pseudo CC (condition-code) register. The "E" command displays the

current eight-bit hexadecimal value of the condition-code register, and

then it accepts a new hexadecimal value for the pseudo CC register.

Notice carefully that the pseudo CC register contains eight bits. The

top (i.e., leftmost) two bits are essentially meaningless and will always

be set following the execution of any portion of any user's program, because

:

the, M6800-hardware always sets — theser.two condit^on-code_Jbiits..._We_refer_toi.

the^other-'s'iaF co ndition-code" bits ~(from left to-righ.ttas.-HV-r^-H^ZWfrr:

and... C^ and they are generally--quite-important.for—_par.pose3_^of_;_^debugging_

-programs. . The condition codes are interpreted~as._fbllowsr^__:^ir_:__TM;_~_:~:_'_
14

H = half carry I = interrupt mask H = negative

Z = zero 7 = overflow C = carry/borrow

If "a user types a hard termination character (/ • , . or <CR>) alone

without a new value for the CC register, the pseudo CC register retains its

present value.

"F" Command; 4 Parameters; Find Memory Values.

The "F" command requires all four parameters, and it is used for

finding specified kinds of values in a specified area of memory.

If the MASK parameter is nonzero, the "Fn command searches memory

locations START through STOP to find any words that contain the value KEY

when considering only the bit(s) that are set in MASK. MUDBUG displays

both the memory address and the contents of each, word that is a match.

When the MASK parameter is nonzero, therefore, the MUDBUG "F" command finds

and lists all words from location START through location STOP such that

[(WORD) .and. MASK] = [KEY .and. MASK]. To find words that exactly equal

KEY, of course, a user should specify a MASK value- of $FF (i.e., -1).

If the MASK parameter is zero, the "F" command searches memory

locations START through STOP for any words that do not contain exactly the

value KEY. MODBDG displays both the memory address and the contents of

each such word that is found.

"Gn Command; 1 Parameter; Go to START.

The "G" command, which has one parameter, is used to transfer control

to the user's program. The "G" command sets the pseudo PR equal to START.

Then it loads the M6800 hardware registers from the software-defined pseudo

registers and transfers control to location START to execute the user's

program.

MODBDG temporarily treats the "G" command as an illegal command when

the pseudo stack pointer has been set to address ROM or nonexistent memory.

This feature protects the user from inadvertently transferring control to

his or her program with an invalid value in the stack pointer. Please

refer to the discussion of the "S" command for details.

"H" Command; No Parameters; Halt Return.

The-"H" command,- which- is-"—known as the halt-return-command";—

parameters. It loads the .M6800 hardware registers—from—-thei__pseudp__.

registers, and then it transfers control to the _location^that.-i3_designated--

by the pseudo PR. . "•"-" "" ~" --"""- .

s . . ':;-"c^v '•--. -'"
15

The pseudo PR normally points to the memory location Immediately

following the location from which the last halt (i.e., SWI) was executed,

but the user can, of course, change the pseudo PH by using the "PR"

command, which is described elsewhere in this chapter.

The "H" command is convenient for executing a user's program in.

segments where the end of each segment is marked by the occurrence of an

SWI instruction. The "H" command is also useful for returning control to a

program that has been interrupted by a nonmaskable Interrupt (NMI). A user

who suspects that his or her program is lost in an Infinite loop oan

generate a nonmaskable interrupt (usually by pressing a button marked NMI),

and this action normally halts the program and dumps the registers to the

terminal just as if an SWI instruction had been executed. If the user then

decides to continue the execution of his or her program, an "H" command

conveniently and automatically returns control to the precise point of the

interruption just as if no interruption had occurred.

The NMI interrupt and MUDBUGfs "H" Command can be used together as

described above to monitor the progress of a program, that has a very long

execution time.

MUDBUG temporarily treats the "H" command as an illegal command when

the pseudo stack pointer has been set to address ROM or nonexistent memory.

This feature protects the user from inadvertently transferring control to

his or her program with, an invalid value in the stack pointer. Please

refer to the discussion of the

 BSn command for details.

"I" Command; 3 Parameters; Initialize Memory.

The "I" command requires three parameters, and it initializes memory

locations START through STOP (inclusive) to contain the value KET. MUDBUG

automatically aborts any attempt to use the "I" command to alter any ROM or

nonexistent memory locations, and the system notifies the user of the error

by output ting a backslash and a bell to the terminal. All RAM locations

that were initialized before the ROM or nonexistent memory location was

encountered remain initialized just as requested, so part of the command's

function may be performed successfully even in the event of an error.

The "I" command is useful for backgrounding memory areas with desired

values, and it can also be used to initialize tables and data areas.
16

"K" Command; 2 Parameters; "Kalculator" Utility.

The "K" command, which requires two parameters, is convenient for

performing 16-bit two's-complement hexadecimal additions and subtractions.

The "K" command sets START <— START + STOP, and then it prints the

updated 16-bit value of STABT in hexadecimal. Notice that MODBDG puts the

sum. into the STABT parameter to facilitate subtotaling operations via

several consecutive executions of the "K" command- For example, the

following "K" commands could be used to compute the sum of $2A12, $21,

-$B4C, $591A, and -$1F2E:

K 2A12, 21.

K , -B4C.

K , 59U.

K , -1F2E.

The "K" command is also useful for finding the 16-bit two's complement

of a hexadecimal number. To find the two's complement of a value, one can

simply use the "Kn command to subtract the value from zero. For example,

t<? find the two's complement of $B7C, a user could type either "K 0, -B7C"

or "K -B7C, 0." Similarly, to find the two's-complement representation of

-$1A8, one could type "K -1A8, Ow or "K 0, -1A8."

In another application, the "X" command can be used to find the 16-bit

one's complement of a hexadecimal number. The one's complement of a number

id Just its two's complement minus one, so subtracting a number from minus

one yields the one's complement of the number. For example," a user could

find the one's complement of $DA9 by typing "K -1, -DA9" or T -DA9, -1.1*

Similarly, one could type "K -1, -B5Ctt or "K -B5CT -1n to find the one'scomplement representation of -$B5C.

"L" Command; 1 Parameter , Load/Compare.

The "L" command, which requires one parameter, loads or compares an

M6800 object tape to memory. MPDBUG takes the value of the START parameter

as a 16-bit positive or negative signed relocation displacement, and the

parameter's termination character specifies the function that is to be

performed. A carriage return or a period termination character tells

MODBUG to load the values from the object tape into memory, and a comma,

space, tab, or asterisk termination character tells MUDBUG to compare the

object tape to memory.

The object tape that is loaded or compared to memory is offset from,

its normal memory locations by a displacement that is equal to the START

parameter. For example, if START ^ -$1000, an object module with an origin

„ of. -$4000 would be loaded-" into ^or—compared to) memory^ starting—at locatioir:.

-

;

$"3000^r -Similarly," if ~a user "specifies START = +$2oVov-"an^obiTect- module

with, an origin of $5000 would be loaded into — Cor^-compared

starting at location $7000.- For normal lab work^me^trusera- empioy— the

command' with- START- = -0 to load or compare programs-with/ ho displacement,
17

but nonzero displacement values are frequently necessary when MUDBDG is

used in special applications such as M6800-based FROM programmers.

When MODBOG performs a compare function, the MODBUG Load/Compare

routine prints three hex values for each object-tape word that fails to

match the corresponding word in memory. The three values that are printed

are as follows:

Memory Address Memory Value Tape Value

When MUDBDG performs a load function, the loader generates a compare

printout as above for any word that can,11 be loaded, so attempts to load

Into ROM or nonexistent memory are flagged for the user.

If an invalid object tape is input to the loader or if a bad read

occurs or if a checksum error is detected, the Load/Compare routine aborts

execution with a backslash and a bell.

"M* Command; 3 Parameters; Memory Dump.

The "M" command requires three parameters known as. START, MSTOP, and

SCREEN. If MSTOP >= START and MSTOP is not typed with a leading plus sign,

the "M" command nominally dumps locations START through MSTOP in both,

hexadecimal and ASCII format to the user's terminal. If MSTOP < START on

the other hand, (or if MSTOP is typed with a leading plus sign), the "M"

command uses MSTOP as a count and nominally dumps MSTOP locations beginning

with location START. The third parameter for the "M" command, which is

known as the SCREEN parameter, specifies the maximum number of lines that

MUDBDG will dump before pausing. The SCREEN parameter allows the user to

control the dump interactively, so the user can prevent information from

scrolling off the top of a CRT screen too quickly.

MODBDG prints the memory dump with 16 values per line, and the dump is

formatted for ease of readability. Each line of the dump begins with the

hexadecimal memory address of the first value on the line. Then the line

contains 16 hexadecimal values corresponding to the values of the 16 memory

locations that are being dumped. At the end of each line MDDBDG prints 16

ASCII characters corresponding to the ASCII character codes (if any) that

reside in the 16 memory locations that are being dumped. If a location

doesn't contain a printable ASCII character, MODBDG prints an underscore

for that location.

The memory dump actually starts with the location whose address is

FLOOR[START/16]*16, so the hexadecimal memory address of the first word of

the dump always ends with zero, Thejiefault value for START is the current

rvalue of: the MUDBUG; START-parameter." -^--=:.w •^'.^z.^^^^..:^~-

The "M" command uses its own private MSTOP parameter- instead of. .using

MODBDGf s global STOP parameter, -.and ..the MSTOP parameter^ t&ELa^MODBUGi where

to stop dumping, IT MSTOP >= START- and the MSTOP parameter- is not typed
18

with a leading plus sign, the memory dump ends with the location whose

address is FLOOR[STOP/16]*16 + 15- Notice that the memory dump always

starts with the line that contains location START, and the memory dump ends

with, the'line that contains location MSTOP.

If MSTOP < START, MDDBDG conveniently interprets the MSTOP value as a

count of the number of locations to dump. For example, if START = $2000

and MSTOP = $100, MtJDBUG 'dumps $100 locations starting at location $2000.

Since MDDBDG always prints values for 16 memory locations on each line of

the dump, MDDBDG sometimes dumps a few more locations than the actual

number that were specified by the MSTOP parameter. For example, if

START = $2005 and MSTOP = $3, MDDBDG actually dumps locations $2000 through

$200F.

If the user types a plus sign as a leading sign character with the

MSTOP parameter, MDDBDG interprets the MSTOP value as a count of the number

of locations to dump even if MSTOP >= START. This feature allows a user to

use the count option even when the starting address for the memory dump is

a small number. For example, a user could type "M 10, +20" to dump $20

locations beginning at location $0010.

The MSTOP parameter doesn't have a default value. If the user omits

the MSTOP parameter, MDDBDG potentially dumps forever and never stops the

dump at any particular address. Instead, MDDBDG stops the dump only when

the user interactively chooses to stop it. The user can. interactively tell.

MDDBDG to stop the dump by typing a termination character during the pause

at the end of a screen. This feature is extremely convenient because it

allows the user to dump interactively and to terminate the dump only when

desired.

The SCREEN parameter tells MDDBDG how many lines it should dump to the

terminal before pausing to let the user control the dump interactively. The

default value for the SCREEN parameter is $10 = 16, so MDDBDG normally

dumps 16 lines containing $100 locations per screen. MDDBDG accepts SCREEN

parameters in the range from. $00 through. $FF (255), and MDDBOG interprets

any value larger than $FF by taking its value modulo 256. Notice that the

SCREEN parameter, like all MDDBOG parametersr is typed as a hexadecimal

number, not as a decimal number.

Zero is a special value for- the SCREEN parameter, and it means that

MDDBDG should never pause. Zero is therefore equivalent to an infinite

value for the SCREEN parameter, and a zero SCREEN parameter is useful for a

person who is using a hardcopy terminal. Notice that a user can put MDDBDG

into an infinite dump by specifying zero for a SCREEN parameter and also

omitting the MSTOP parameter. This somewhat dubious feature allows a user

to make MDDBDG run continuously over a weekend to verify that a particular

microcomputer can run that long without- any glitches..

When. MDDBDG "reaches the end of~~a screen of the memory dumpr~the: systemrpauses with the cursor at the beginning of- the-next..l±ng~on— the—^terminal-.—

-MDDBDG waits at this.-.point-(forever- if necessarykiuHtlfLwthe-^aaerr typ«a-.-an-__

input-character to tell. MDDBDG-what'to do next,- so; the .user-can, controL-.the -.:
' 19

dump interactively. The choices are similar to the choices that a user haa

with the memory-change command.

If the user types a carriage return (<CH», MJDBOG displays the next

screen of data. The <CR> therefore allows a user to scroll through memory

until, all relevant values have been displayed. MDDBOG considers memory to

be. circular,, so location $0000 logically follows location $FFFF in memory.

If the user types a comma, MQDBDG re-displays the current screen of

data. A comma therefore allows a user to re-examine a particular area of

memory as often as desired. A user might want to use commas to keep

examining some locations that correspond to the registers of an input

device that is receiving inputs from an external source.

If the user types an asterisk, a blank space, or a tab, MJDBDG

displays the previous screen of data. The previous screen of data is the

screen of data that corresponds to the memory locations that immediately

precede the locations of the current screen in memory. The asterisk,

blank, and tab allow a user to scroll back through memory until all

relevant values have been displayed. A user can use a <CR> after one

screen and an. asterisk, after the next screen to bounce back and forth

between two screens of data.

If the user types a period, a solidus, or any other character that

hasn't been mentioned above, MJDBOG terminates the dump and returns control

to the top of MUDBUG to wait for the next command.

The interactive dumping feature is much like the memory-change

command, and it is extremely convenient to use. For- example, a user "-«"

interactively dump memory starting at location $2000 by simply typing

"M 2000<CH>n to tell MDDBDG to start the dump in. the interactive mode. On

the other hand, a user who wants to dump $80 locations beginning at

location $2000 caa perform the dump non-interactively by typing either

"M 2000, 207F<CH>B or "M 2000, 80<CR>" to tell MDDBDG to dump the desired,

area of memory.

"N" Command; 1 Parameter; H-Step Command.

The "N" command, which requires one parameter, is useful for debugging

an otherwise intractable section of a program. The "N* command is known as

the N-step command, and it tells MDDBUG to execute the next H instructions

of the user's program where the value of H is defined by the "N" command's

parameter. For example, a user could type "N 5* to tell MQDBOG to execute

the next five instructions of hrt.9 or her program. WJDBOG provides a

register dump after executing- the next H instructions of the user's

program, .and- their., control goes back, ta the top of MJDBOG

another MDDBDG command from, the user*.

Suppose that a user types *N~ 5W" as suggested above to execute the nextfive instructions, of hia or her program.. Suppose-rforther- that the; user
20

then wants to execute five more Instructions. In this case, the user could

simply type "N<CH>B because MJDBUG remembers that, the previously-specified.

parameter value was five. The default value for- the "NB command's

parameter is always taken from the previously-defined STABT parameter.

The N-step command tells MODBUG to. execute the next U instructions, of

the user's program, and the next, instruction: to be executed in. a program, is.

always indicated by" the PRi An N-step command therefore causes MUDBUG to

execute the next N instructions starting at the location that is indicated

by the pseudo PR. Clearly, the pseudo PR must point to the desired program

segment before the N-step command can be used. Therefore, the N-step

command should normally be used after the user has executed part of a

program, and has trapped control at some point of interest in. the program.

Control can be trapped at some desired point in the user* s program by

including a software-interrupt instruction (SHI) at that point or by using

MUDBUG

 rs "T* command. There are other ways to trap control at some

specified point, but MUDBUG 's "T" command,, which is explained elsewhere in.

chapter, provides the most convenient method.

A user can also use the "PR" command, which is explained elsewhere in.

this chapter, to set the pseudo PR to a desired location before using the

"Hff command. However, this approach, is error prone because it allows the

user to start somewhere in the middle of a program without executing the

first part of the program. The first part of the program may be necessary

to set up the conditions that allow the next part of the program to execute

properly.

Most users employ the "N* command as follows. First they use the

command to trap control at the beginning of a suspected problem: area, and

then they use the "H" command to execute a few instructions, at a, time in

the problem area to examine the problem, in detail.

The user should always remember that the. "N * command* s parameter, like

all of MUDBUG 's parameters, is interpreted as a hexadecimal number. Typing

"N 10," therefore, tells MJDBUG to execute the next $10 (i.e., 16)

instructions of the"" user's program. For purposes of debugging, most users

tend to execute only two to six instructions with each use of the "Nn

command, and there is no difference between hex and decimal numbers in this

range of values.

Although most people use the "N" command with -?nali parameter values,

the "N1* command accepts any 16-bit unsigned number for its parameter. A

parameter value of zero is interpreted to mean 65,536, so a user can

execute a ma TrimTM Of 65,536 instructions with a single use of the "N"

Some users employ the "N* f-ommand with, large- parameter- values to

_ determine- how many:. instructions are-^executed-- in.

subroutine. In this application the "N* command, is usefuL." as: anr~aidrfbr

making timing measurements. Cin terms of — ther — number — of-— instructions

executed). ' ; " - ------ ~ — : ------- .-
21

Using the "N" command puts MUDBDG into step mode. When MUDBUG Is In

step mode, the system changes Its prompt from the normal *>" to a *?" td

let the user know that MUDBUG is in. step mode. Step mode is Just like

normal, mode with one important exception. When MUDBDG is in. step mode, the

user ran simply type a carriage return as a MDDBOG command to tell MUDBUG

to execute the next instruction of the user's program. Thus a user can

conveniently step through, a program one instruction, at a time by simply

typing- a carriage return, at each step. In this case MUDBDG provides a

register dump after each instruction is executed.

When MUDBDG is not in step mode, a carriage return alone is treated as

a do-nothing command. A user ran therefore type a carriage return as a

MUDBDG command in normal mode to advance the cursor to a new line.

MUDBUG automatically returns from step mode to normal mode whenever

the user types any non-debugging command (except a comment command) or- when,

the user types an. invalid command. The debugging commands are the "N"

command,- the "O* command, the "T* command, and the T* command. In other

words, any command that tells MUDBDG to execute a portion (but not all) of

the user1 s program is a. debugging command.- Debugging commands normally put

MUDBDG into step mode, and other commands (except the comment command) take

MUDBDG out of step mode. Step mode is designed to provide a convenient

single-step mechanism, for the user who is debugging a program.

MUDBDG temporarily treats the "N" command as an illegal command when:

the pseudo stack pointer has been set to address. ROM. or nonexistent memory.

This feature protects the user from- inadvertently transferring control to

his or her program with an invalid value in. the stack, pointer. Please

refer to the discussion of the "S* command for details.

The "N" command is available only on systems that have the necessary

hardware to support step-mode operations. If the system: on which MUDBDG is

running doesn* t have the necessary hardware to support step-mode

operations, MUDBUG treats the "H" command as an invalid, command.

"0" Command; 1 Parameter; One-Step Command.

The "0* command, which requires one parameter, tells MUDBUG to execute

one instruction in the user's program. The "0" command's parameter tells

MUDBUG the address of the instruction that is to be executed. MUDBUG

executes the specified- instruction and provides a register dump after the

instruction has been executed.. Then MUDBUG automatically goes into step

mode, and control returns, to the top of MUDBUG to wait for the user's next

command.

.—-r -The.. _ default -.value for the:One-step command1 s parameter: .is._not-. taken

from the"::previousllr-3^Bcified.r START parameter-. Instead*rthe--defraulfetvaiue^:

for the One—step command's parameter- is taken-front-the-4iseudo_^r-antL-^the

START, parameter- is neither* used nor affected-- by;7_anv?03L:conmand>. ijBy using-—

the. pseudo. PR as a default value for the "0* commandos- parameter?.. - MDDBOG- -'
22

conveniently allows the user to execute the next instruction of his or- her

program by simply typing "0<CH>" with no parameter value.

The One-step command is a powerful debugging aid. If all else fails,

a desperate programmer can always use the "0" command to single step

through a small program, segment that is causing problems that temporarily

seem to be insoluble.

Most users employ the "0" command as follows. First they use the "T*

command to trap control at the beginning of an. intractable problem area,,

and then they use the "0" command with its default parameter value to

execute one instruction at a time in the problem, area until they've

discovered the exact cause of the problem.

A successful use of the "0" command always puts MODBOG into step mode.

MUDBUG changes its prompt from the normal •>" to a "?" to let the user know

that the system is in step mode, and. a carriage return as a response to a

*?" prompt tells MDDBGG to execute the next instruction in the user's

program. Thus a user doesn' t even need to type an "O" to request another

"0" command; a carriage return alone is sufficient when the system is in

step mode. MJDBUG provides a register dump after executing an. instruction

in step mode, and the user can conveniently step through, a program one

instruction at a time by simply typing a carriage return at each step.

When MUDBOG is not in step mode, a carriage return alone is treated as

a do-nothing command- A user ^«" therefore type a. carriage return as a

MUDBUG command in normal mode to advance' the cursor to a new line.

MUDBUG automatically returns from step mode, to normal mode whenever

the user types any non-debugging command (except a comment command) or when

the user types an invalid command. The debugging commands are the "N"

command, the "0" command, the

 WTW' command, and the T^ command, so any

command that tells MUDBOG to execute a portion (but not all) of the user's

program is a debugging command. Any debugging command that is executed

successfully puts MUDBUG into step mode, and other- commands (except the

comment command) take MUDBOG out of step mode. Step mode is designed to

provide a convenient single-step mechanism for the user who is debugging a

program.

MDDBOG temporarily treats the "0" command as an illegal command when

the pseudo stack pointer has been set to. address ROM or nonexistent memory.

This feature protects the user from inadvertently transferring control to

his or her program with an invalid value in the stack pointer. Please

refer to the discussion of the "S" command for details.

The "0" command is available only on systems that have the necessary

hardware to support step-mode operations. If the system, on which HTDBOG is

:_runningrrdoesn'_t- have - the necessary hardware - to-m 3uppoct.-^:zstep-mode

"operations^"MUDBOG treats the "0* command as-an"invalidrcommand.:'

 :"
23

"PE" Command; 1 Parameterj Peek at Memory.

The "PE" command allows a user to peek at a memory location with the

assurance that MtJDBUG will not write anything to the memory location- The

"PE" command, which has one parameter, displays the address and the

contents of memory location START, and then it waits for the user to type a

termination character. Actually, the "PE" command waits after displaying

the address and value of' location START for- the user to type a hex input

number, but the command ignores the value of the input number and uses only

the number's termination character.

The termination character allows a user to continue the "PE" command

the same way a user can continue the "Cn command, and the termination

characters that are used with the "PE" command hare the same meanings that

they have with the "C" command. The "PE" command is therefore exactly like

the "C" command except that MUDBDG never writes anything to the specified

memory location when the user uses the "PE" command.

The "PE" command is extremely useful when a user wants to examine a

read-only register such, as the status register of an ACIA. If a user tried

to use the "C" command to examine- the status register of an ACIA, MtfDBUG

might try to write a new value back into the location of the status

register, but the write operation would fail because the status register of

an ACIA is a read-only register. Furthermore, the write operation in. this

case would have bad side effects because the read-only status register of

an ACIA shares its memory address with the ACIA's write-only control

register, and the status register's value would actually be written into

the ACIA's write-only control register.

The "PETM command, is generally intended for users who are dealing with

special hardware devices that have read-only registers^ but other users can

also use the "PE" command to examine ordinary memory locations.

"PO" Command; 1 Parameter; Poke a Yalue into Memory.

The "PO" command allows a user to poke a value into a memory location

with the assurance that MDDBOG will not try to read from the specified

location. The "PO" command, which has one parameter, displays the address

(but not the contents) of memory location START, and then it waits tor the

user to type a value that is to be put into location START.

The termination character of the new value allows a user to continue

the "POB command the same way a user ?-«" continue the "C" command t and the

termination characters that are used with the "PO" command have the same

meanings that they have with the "C" command. The "PO"^ command is

^therefore- exactly:; like the "C^-command- except, that MOpBJJff,jQe^DeE

the~ specif ied" memory" locatibn~when~the user- uses the-JfPOf-^ooinmand-'

If a user types a. hard termination character (/ »- y ^ or^<^>).; jalone..

without a. number- for an. input value^ MJDBUG doesa1 1 poke: anything intoV the
24

specified location. The function of the termination character regarding

the continuation or termination of the "PO" command is still effective,

though, so a user can conveniently skip over a location with the "FO"

command.. •

The TO" command, is extremely useful, when a user wants to put a value

into a write-only register- such, as the output data, register of an. AdA_ If

a. user tried to use the *CW" command to put a value into the output data

register of an. ACIA, MUDBUG would try to read back the value to verify that

it was stored correctly. The verification would fail, though, because the

output data register of an. ACIA is a write-only register. Furthermore, the

attempted verification would have bad side effects in this case because the

write-only output data register of an ACIA shares its memory address with

the ACIA's read-only input data register. The attempted verification would

cause MUDBUG to read from the ACIA's read-only input data register, and a

read operation that accesses an ACIA's input data register causes the ACIA

to change some of its internal status flags.

The "PO" command is generally intended for users who are dealing with

special hardware devices that have write-only registers or registers that

are sensitive to read accesses, but other users can also use the TO"

command to poke values into ordinary memory locations.

•PR" Command; No Parameters; Change PR.

The "PR" command, which, doesn' t require any parameters, displays the

current hexadecimal value of the pseudo PR, and then it accepts a. new hex.

value for the PR. If a. user types a hard termination character (/ * , .or

<CR» alone without a number for a new PR value, the pseudo PR retains its

present value. The "PR" command really isn't necessary for ordinary

operations,, but some users like to use it to control the value of the PR.

WQW Command; Ho Parameters; Query Registers.

The "Q" command doesn't require any parameters, and it prints the

values of the pseudo registers just, as the execution of a software—

interrupt instruction (SWI) normally does in the following format:

AH BR XR PR SP HINZYC

aa bb TTT pppp ssss cccccc

All values are printed in hexadecimal with the exception of the conditioncode values, which are printed in binary for ease of interpretation. Since

..there are only aiy actual, bits- in the: condition-code .register, only six

printed. The-conditton^codft" bits: are interpr_eted=asr:foilawarr^-:rjr:

H s. h«T f carry I = interrupt mask. _ ' ------ — H" st— negative -

Z. =~ zero T ^ overflow- ' -.-(L ^ carry/borrow:
25

The "Q" command provides a disctinctive output, so the "Q" command is

a good command to use if the user wants to see if control is actually In

MUDBUG. The "Q" command is also a good command to use if the user wants to

change MQDBUG from step mode to normal mode with no side effects.

"H" Command; 1 Parameter? Relative Addressing.

The "R" command, which requires one parameter, is used to determine

and/or to set the destination address of a branch-class instruction. The

second word of a branch-class instruction in the M6800 always contains a

signed, self-relative displacement value, so the destination address of a

branch-class instruction isn't immediately obvious to most people by

inspection. The

 nRn

 command, however, allows the user to determine and/or

to set the destination address of a branch-class instruction rather easily.

The START parameter is assumed to be the memory address of the second

word of a branch-class instruction, and the "R" command computes and prints

the instruction's destination address based on that assumption.

Then the "H* command waits for the user to type a. new value for the

destination address. If the new destination address that is typed is out

of range for the branch-class instruction that is being processed,. MUDBUG

outputs a backslash and a bell and aborts the "R" command. Otherwise t the

"R" command computes and prints the new self-relative displacement value

that will give the branch-class instruction the desired new destination

address. Additionally, the "R" command puts the new self-relative

displacement value into the second word of the branch-class instruction in

memory, so the instruction is automatically changed in memory to address

the desired new destination. If the second word of the branch-class

instruction happens to be in ROM or nonexistent memory, of course, the "R"

command aborts with a backslash and a bell instead of changing the selfrelative displacement value in memory.

The termination character (blank tab / * , .or <CH» that is used to

terminate the new destination address is interpreted just aa the

termination character is interpreted by MDDBUG's

 BCW command: A carriage-^

return terminator causes MJDBUG to proceed automatically into the "C"

command after first setting START <— START -t- 1, so the location

immediately following the branch-class instruction in memory is opened for

changing via the "C" command. An asterisk, blank, or tab termination

character causes MUDBUG to proceed into the

 WCB

 command after first setting

START <— START - 1, so the first word of the two-word branch-class

instruction is opened for changing via the "Cw command. A comma terminator

causes MUDBUG to proceed into the "Cw command with no change to the START

parameter, so the second word of the two-word branch-class instruction is

^opened- for* changing... .via the "C* command—- A. pedjOjcL-terminator1 returns

control to the top of MUDBUCPafter "the "H"7 coamand-hM^pul^^e-jieir^self-^

relative displacement- value into memory, and a aolidus.__ terminator aborts

the "S* command at once- before it

 f*gtT

 change anything; in. memory- -~^H_THriHZ
26

If a user types a hard termination character (/ * , .or <CR>) alone

without a number for a new destination address, MJDBOG retains the existing

destination address and treats it as the desired destination address. The

function of the termination character regarding the continuation or

termination of processing as discussed above is still effective, so the "R"

command is conveniently useful for checking destination, addresses without

necessarily changing them.-

The "Rn command alleviates some of the headaches of self-relative

addressing by allowing a user to follow the logical flow of his or her

Program conveniently and easily. In fact, if the second word of a branchclass instruction has Just been examined via the "C" command, the user

needs only to type "R." or "R<CR>11 to invoke the "R" command since the

START parameter is already set properly from the previous

 HCn

 command*

The "R" command is also extremely convenient for users who write small

programs in machine language, and it is equally useful for making machinelanguage patches to larger programs during debugging. When the user

employs the "R" command, MDDBUG takes care of all of the annoying details

of self-relative addressing, so the user can conveniently think, in terms of

direct memory addresses.

"S" Command; No Parameters; Change SP, the Stack Pointer.

The "S" command, which has no parameters, displays the current hex

value of the pseudo stack pointer (SP), and. then it accepts a new hex value

for the pseudo stack pointer. If a. user types a hard termination character

(/ * , . or- <CR» alone without a new stack-pointer value, the pseudo stack

pointer retains its present value.

The user should exercise a certain amount of caution and good, judgement when changing the pseudo stack pointer because the stack pointer must

always point into a. RAM area of memory with at least 7 locations of RAM at

and below the stack pointer. In other words, if SP represents the value of

the stack, pointer, locations SP, SP-1, SP-2, ..., and SP-6 must all be

locations in a HAM (read/write) area of memory. At least 7 locations of

RAM must be available for the user's stack at all times because 7 locations

are required for saving the M6800 registers in the event of an interrupt.

Most users would be wise to provide quite a few more than 7 locations for

the stack because multiple interrupts can always occur. In fact, users

should even be cautious about changing the stack pointer via instructions

in their programs because all M6800 programs should (indeed must) be ready

to accommodate an Interrupt at any time.

If the stack pointer is ever set in. such a way that fewer than 7

._.„ locations:- of- RAM'-arez available -for the-.stack^ MJDBUG . teaporar lly jnakes^tha-

~"(jfw " "H,"*" "N," "Op1 and: " "T* commands illegal, sa the- errant- user—is

protected, from being able to transfer control.. into_his_or--heis-cwn=-pr-ogramwith: the stack, pointer initially pointing into ROM: or. nonexLst;ent-:mempr-y:.^— -_.
27

Moat beginning users will never need the "S" command, but the command

is made available as a convenience for the relatively sophisticated users

who will want and need it. The "S* command can be used to reset the pseudo

stack pointer following a program error or a partial execution of a

program, so the user can always keep the pseudo stack pointer pointing into

a desired RAM area.

"T" Command; 4 Parameters; Trap.

The "T* command, which is used to trap control at any desired point in

the user's program, can accept as many as four parameters. Before we

consider the case of a four-parameter "T" command, though, let us first

discuss a two-parameter "T" command. If the user types a carriage return

to terminate the TB command's second parameter, MUDBUG automatically

provides innocuous default values to make the remaining two parameters

transparent to the user.

The first two parameters for the Tw command are known as TSTART and

STOP. The "Tn command starts execution of the user's program at location

TSTART, and then it uses a software interrupt to trap control when or if

control reaches location STOP. When (i.e., if) control reaches location

STOP, the trap interrupt returns control to the top of MJDBUG after first

Invoking a routine that prints the values of the registers Just as if a "Q"

command had been input. The user's instruction at location STOP is not

executed, so following a successful trap operation the pseudo PR points to

location STOP, which contains the first word of the next sequential

instruction to be executed in the user's program. This particular value of

the pseudo PR conveniently allows the user to continue the execution of his

or her program if desired. For example, the user might employ an "ETM

command, an "N11' command, an "0" command, or another "T" command to continue

execution of his or her program..

Notice that the first parameter for the "T" command is called TSTART.

The T" command uses its own private TSTART parameter instead of using the

system-defined START parameter that is used by most other MUDBUG commands.

Therefore, the T" command can have a unique default value for its TSTART

parameter instead of using the standard default value of the generalpurpose START parameter. The "T" command uses the value of the pseudo PR

as the default value for the TSTART parameter, so the user can conveniently

continue trapping through his or her program from one segment to the next

without typing a new TSTAHT parameter at each step. For example, typing

"T , 2100* continues execution from the present point in the program and

traps control at location $2100. Using the pseudo PR as the default value

for the TSTART parameter is particularly convenient because the pseudo PR

retains its useful significance even if several operations (e.g., memory

,; dumps^ ."C*" commandsr-_ etci) are-performed between, successive •!» commands.«- ---

MJDBUG's "T*" command is probably the single ..most_powerful debuggingtool that is. available to the system-'s users. Bruising.:_the;"TCT.:command^ a.-

user can execute any selected portion of a program",: so a_ programmer can.
28

interactively trace the flow of a program at execution time and easily

isolate an, error to a small routine or even to a single instruction. Users

who quickly master the efficient use of the "T* command inevitably find

that debugging their programs becomes an almost trivial task.

As with other commands that request execution of the user's program,.

MUDBCG temporarily treats the "T* command as an illegal command when the

pseudo stack pointer has' been set to address ROM or nonexistent memory.

This feature protects the user from inadvertently transferring control to

his or her program with an invalid value in the stack pointer. Please

refer to the discussion of the "S" command for details.

The T" command is also illegal if location STOP happens to be in. ROM

or nonexistent memory. This restriction is necessary because the routine

that implements the T" command*s function must temporarily store a

software-interrupt instruction (SHI) into location STOP. If the user tries

to specify a STOP address, in HOH or nonexistent memory, MJDBOG aborts the

T" command with a backslash and a bell.

The "Tw command traps control at location STOP via a software

interrupt, so users who employ the "T" command should carefully insure that

their programs always keep the stack pointer pointing into enough BAM to

support an interrupt. If the user's program fails to maintain the stackpointer in such a way that- the stack can support an. Interrupt properly at

the trap point (i.e., when control reaches location STOP), the T" command

still traps control successfully at location STOP, but the invalid stackpointer value generally causes some or all of the software-defined pseudo

registers (other than the pseudo stack pointer) to be set erroneously

following the trap at location STOP.

Notice carefully that the trap point (i.e., STOP) must be the first

word of an, instruction. Control cannot be trapped in the middle of an.

instruction, and, any users who try to trap control in the middle of: an.

instruction will experience erroneous results.

A successful use of the "T" command automatically puts. MUDBDG into

step mode if the hardware of the system supports step-mode operations. The

"T" command is considered to be successful if control is successfully

trapped at the specified STOP location.. If control stops somewhere else,

of course, the "Tn command is not considered to be successful.

When MDDBOG is in step mode, the MJBBUG prompt is changed from, the

normal ">" to a w?

w

 to let the user know that the system is in step mode.

The user can simply type a carriage return as a response to a "?" prompt to

tell MJDBCG to execute the next instruction of the user's program. Thus a

user who has Just trapped control with the "T" command can conveniently

step through the next section of his or- her program one instruction at a

- time-by-simply.,.typing a carriage return. _ at each. step-= MDBBlJG...provides a

register- dump-after-each.- step-when instructions. are--~executed^one-atla-time,

in step. mode. . - .„,
29

When MDDBDG is not In step mode, a carriage return alone is treated as

a do—nothing command. A user can therefore type a carriage return as a

MUDBDG command in normal mode to advance the cursor to a new line.

MUDBUG automatically returns from step mode to normal mode whenever

the user types any non-debugging command (except a comment command) or vhen

the user types an invalid command^ The debugging commands are the "N1*

command, the "0° command* the T" command, and the "7* command. In other

wordsr any command that tells MUDBDG to execute a portion (but not all) of

the user's program is a debugging command. Debugging commands that are

executed successfully put MUDBDG into step mode, and other commands (except

the comment command) take MUDBDG out of step mode. Step mode is designed

to provide a convenient single-step mechanism for the user who is debugging

a program.

How let us consider the "T" command's third and fourth parameters.

The "T" command's third and fourth parameters are available only if the

system, on which MDDBOG is running has the necessary hardware to support

step-mode operations. If the system's hardware doesn't support step-mode

operations, MUDBDG allows only the first two parameters for the "T"

OQUXZIlcLQu.»

The "Tw command's third parameter is generally known as the stop-count

parameter. The stop-count parameter, which is useful for debugging loops,

can be used when the user wants control to go through a loop some specified

number of times before- control is trapped, at a specified instruction, in. the

loop. If the value of the stop-count, parameter is nine,, for example,

MUDBDG traps control the ninth time that control reaches location STOP (if,

in fact, control reaches location STOP nine times). The instruction at

location STOP is executed normally the first eight times, it is encountered,

but control is trapped and the instruction is. not executed, the ninth time.

Following a successful trap operation, the pseudo PR points to location

STOP, which, contains the first word of the next sequential instruction to

be executed in the user's program. The PR is therefore set properly to

allow the user to continue the execution of hj,g or her- program, via any of

several MUDBDG commands. For example, the user might want to use MUDBDG's

step-mode feature to execute the next few instructions one step at a time.

The user should always remember that the stop-count parameter, like

all of MUDBDG's parameters, is interpreted as a hexadecimal number. Typing

"100" for the stop-count parameter therefore tells MUDBDG to trap control

the $100th (i.e., 256th) time that control reaches location STOP. MUDBUG

treats the stop-count parameter as a 16-bit unsigned value, and MUDBDG

interprets the value zero to mean 65,536.

The default value for the stop-count parameter is. always one, so a

_user-who wants to trap control-the .first- time, control^r.eacb.ea location STOP

~

r

can~ simply omit the. stop-count--parameter*. The-_st op-count-feature-is^

therefore conveniently transparent when, it is .not being^used.. ..
30

Notice that the stop-count parameter is a private parameter that is

used only by the "T" command. The stop-count parameter is not related to

the system-defined KEY. parameter that appears as the third parameter of

some other MQDBUG commands.

The "T" command's fourth parameter, which is useful only if the stopcount parameter has been, specified, is known as the print-count parameter.

The print-count parameter- tells MCTDBUG how frequently the system should

generate a register dump. For example, if the value of the print-count

parameter is three, MUDBUG generates a register dump every third time that

control reaches location STOP. MDDBOG generates the register dump

immediately before the instruction at location STOP is executed.

The print-count parameter provides a method for obtaining dynamic

register dumps as the user's program is executing. MJDBUG always generates

a register dump when control is actually trapped at location STOP, and the

print-count parameter <*-»" be used when the user wants to see some register

dumps at some intermediate steps as well.

The user can specify any desired value for the print-count parameter

if intermediate register dumps are desired. For example, if a user

specifies the value one for the print-count parameter, MffDBDG prints a

register dump every time control reaches location STOP. Similarly, if a

user specifies the value five for the print-count parameter, MODBUG prints

a register dump every fifth time control reaches location STOP.

The default value for the print-count parameter is always taken from,

the value (if any) that was specified for the stop-count parameter. By

default, therefore, MDDBDG generates a register dump only when control is.

actually trapped. The default value for the print-count parameter

conveniently makes the print-count feature transparent when it is not being

used.

Like all other MUDBUG parameters, the print-count parameter- is always

interpreted aa a hexadecimal number. MtJDBDG treats the print-count

parameter as a 16-bit unsigned number, and the value zero is interpreted to

mean 65,536. The print-count parameter is a private parameter that is used

only by the "T" command, and the print-count is not related to the systemdefined MASK parameter.%

"Vn Command; 4 Parameters; Verify ROM Program.

The "7" command is functionally identical to the "T" command^ but the

command pan be used with a program that resides in ROM whereas the "T"

command cannot be used with a program, that resides in ROM. The "7" command.

. is available only if the system on.which. MUDBUG is running has the hardware

- that -^ is-- necessaryr—to — support step—mode operations^ _ If . the~;sy»teBt-can?,.t:

support step-mode operations, MUDBOG treats _the__irV^ Command, aa an invalid

command. • • -• -
31

Although the "Yn command can be used with programs that reside in RAH

or pseudo ROM, the "T" command is better for those programs. The "Vn

command executes a program much more slowly than the "T* command does, so

the "V" command is clearly unsuitable for any programs that contain any

real-time segments.

The "Tn command is provided as a special command that is occasionally

useful in a ROM environment, but most users seldom have any real need to

use the "V" command.

*Wn Command; 2 Parameters; Write Object Tape.

The "W" command, which requires two parameters, writes the values of

memory locations START through STOP to the terminal in M6800 object format*

If a tape-producing device is attached to the terminal, the "Vn command

produces an object tape that is compatible with any standard M6800 loader.

If the STOP parameter is terminated by a comma, a blank space, a tab,

or an asterisk, the "S9n record and the trailer (i.e., nulls) that normally

mark the end of an M6800 object tape are not written, so users can

conveniently write severaL disjoint areas of memory onto a single object

tape by simply invoking the "Wn command severaL different times with comma

terminators.

A carriage-return or period terminator for the STOP parameter, of

course, causes the "39" end-of-tape record and six inches of trailer to be

written normally, and the carriage-return terminator is therefore the

terminator that most users type for ordinary lab work.

The "W" command is useful for obtaining a reloadable object tape of a

program, that has been modified in memory during debugging. This object,

tape can then be reloaded later (via the "L" command) if the user's program

is ever accidentally destroyed in memory, so the user doesn' t need, to waste

any time recreating patches and modifications that have already been made

once* Since a power interruption or- a minor programming error can. easily

destroy a program that resides in HAM, users can potentially save a great

deal of time and effort by using the "¥" command before their programs are

destroyed.

"X" Command; No Parameters; Change ZR.

The "X" command, which doesn't require any parameters, displays the

current hexadecimal value of the pseudo XR, and then, it accepts a new hex

value for the XR, If a user types a hard termination character^/ * , . or

<CB» alone-without-a-number-for-a new XR value, the.-pseudb7'&~retains, its_

present value.
"Z" Command; No Parameters; Zero Registers.

32

The "Z" command, which doesn't require any parameters, initializes the

registers as follows: It clears the pseudo AR, BR, IS, PR, and CC

register, and it reinitializes the pseudo stack pointer to point to the

user's default stack area in the MDDBUG RAM.

The "Z" command provides a quick way of reinitializing all of the

pseudo registers with a single command, so the user doesn' t need to type

individual commands to initialize each register individually.

0sers should carefully note the fact that a restart interrupt (RSI)

performs the function of a "Z" command besides restarting MUDBCG as If a

power-up condition had occurred.
Chapter 4

Internal Routines and Subroutines

MDDBDG quite naturally includes several internal subroutines, and many

or these internal subroutines are potentially useful for general-purpose

applications. Some of MUDBDG'3 internal subroutines have therefore been

made available to the system's users, and programmers who wish to invoke

any of MDDBUG's internal subroutines can simply call the desired routine(s)

from their own programs. MODBDG users can thus avoid the unnecessary

effort of re-inventing and re-coding any routines that have already been

implemented in MDDBDG.

There is one caution that users must observe before writing any

programs that call any of MUDBDGTs internal routines: Future releases of

MUDBUG will not necessarily be completely compatible with, the current

version of MDDBDG with regard to internal subroutines. MDDBDG's internal

subroutines are offered to the system's users only as a convenience factor,

not as a fully-supported feature, and any users who lock themselves

inflexibly into MUDBDG's current set of internal routines may have some

difficulty upgrading to subsequent new releases of the MUDBDG system.

The alphabetized list of routines on the next page summarizes the

internal MUDBDG routines that are available to the system's users, and

interface characteristics such as calling-sequence requirements and return

conditions are given for each, subroutine in the pages that follow. Notice

that the entry points for the available internal routines all occur as

consecutive entries in. a vector table that starts- at the first memory

location of the MODBDG ROM. This vector table is provided as a convenience

for- the user so that the entry-point addresses for MDDBDG's internal

subroutines will not change from one sub-version of MDDBDG to another.

33
34

4.1. Summary of Internal Routines and Subroutines.

The- list below summarizes the internal MJDBDG routines that are

available for direct access by the system1s users- The symbolic label

"ROM" is used here and throughout this document to represent the memory

address of the first word of the MUDBOG ROMEntry

Name Point Function

CRLF ROM+$00 Output a CRLF to the terminal.

CRLF4H ROM+$03 Output a CRLF and the four-hextet value of Iocs ZR & ZR+1.

ERROR HOM+$06 Output a backslash and a bell; then return to MUDBOG.

INCHH ROM+$09 Input a single character from the keyboard to the AR.

MUDBUG ROM+$OC Return control directly to the top of MDDBOG.

NEWVAL ROM+$OF' Read a four-hextet number into locations ZR and ZR+1..

NDMBI ROM+$12 Read a four-hextet number into the AR (MSB) and. BR (LSB).

OUT2H ROM+$15 Output the two-hextet hexadecimal value of location ZR.

OUT2HB ROM*$18 Output the two-hextet hexadecimal value of the BR.

OUT2HS ROM+$1B Output the two-hextet value of location ZR and a space.

OUT4HS ROM+$1E Output four-hextet value of Iocs ZR 4 ZR+1 and a space^

OUTCHB ROM+$21 Output an ASCII character from the AR to the terminal.

OUTS ROM+$24 Output a single blank space to the terminal.

POWEROP ROM+$30 Restart the system as if from a cold start~

PRTZM ROM+$27 Print the four-hextet ZR value and the value of loc ZR.

READPT RQM+$2A Read one character from the tape reader into the AR.

STAAB HCM+$2D STAA 0, Z; STAB 1, Zf RTS.
35

4.2. Subroutine Descriptions..

This section contains interface information for the internal MDDBOG

routines that are available for direct access by the system's users. Each

routine is briefly described, and then its calling sequence and return

conditions are documented as may be appropriate. The routines are listed

in alphabetical order for the convenience of the user.

Subroutine CHLF; Entry Point = ROM*-$00.

Subroutine CHLF outputs a carriage return and a line feed (CRLF) to

the user's terminal.

Calling- Sequence: JSR CRLF Output a carriage return and a line

feed to the terminal.

Return Condition: Part of the CC value is destroyed, and the AR

contains a line-feed code ($OA), but the CC.I bit and

all of the other register values are preserved.

Subroutine CRLF4H; Entry Point = ROM*$03.

Subroutine CRLF4H outputs a CRLF followed by the four-hextet value of

the two words that are addressed by the ZR and ZR-M, and the subroutine

outputs a blank space following the four-nextet value.

Calling Sequence: LDX =7ALOE This example calling sequence shows

JSR CRLF4B how to output the four-hertet value

from locations VALUE and VALUE+1.

Return Condition: Part of the CC value is destroyed,, and the AR

contains an ASCII blank ($20), but the CC.I bit and all

of the other register values are preserved..
36

ERROR Routine; Entry Point = ROM+$06.

The ERROR routine outputs a backslash (*\B) and a bell to alert the

user to some error condition, and then it transfers control to the top of

MCDBDG with no updating of the pseudo-register values. Notice that the

ERROR routine is not a subroutine. Instead of returning control to the

calling program, the ERROR routine transfers control directly to the top of

MJDBUG.

Calling Sequence: JMP ERROR N.B.: JMP, not JSR.

Return Condition: There is no return. Control returns directly to the

top of MODBUG.

Subroutine INCHR; Entry Point = ROM*-$09.

Subroutine INCHR inputs a single ASCII character from the terminal's

keyboard through the ACIA (Asynchronous Communications Interface Adapter;

part number MC6850). Subroutine INCHR returns the input character to. the

calling routine with zero parity in the AR. Besides returning the input

character to the calling routine, subroutine INCHR automatically echoes the

character to the terminal. If the input character is a carriage return,

however, subroutine INCHR does not echo it to the terminal. This feature

allows the software to control the position, of the cursor on the user's

terminal.

If subroutine INCHR receives an. XOFF flow-control character, the

subroutine waits until it receives a matching ION flow-control character-.

Then subroutine INCHR gets the next input character- and returns that input

character to the calling routine. Subroutine INCHR also ignores any

extraneous ION characters that it receivest and. the subroutine does not

echo ION or IOFF characters to the terminal.

Subroutine INCHR doesn't treat ION and IOFF characters as ordinary

input characters because those flow-control characters can be transmitted

automatically by many terminals. A terminal can transmit an IOFF character

to tell MDDBUG to suspend I/O processing, and the terminal can transmit an

ION character to tell MDDBUG to resume I/O operations.

Calling Sequence: JSR INCHR Input one character to the AR.

Return Condition: The AR contains the 7-bit, zero-parity value of the

input , character, and the condition codes are set to

reflect a comparison of the input character against a

carriage return. The BE, IR, and SF are all preserved,

and the CC.I bit. is also preserved. .,_,_., .

Stack Usage: Subroutine INCBH requires._ 6- locations of. stack.

memory. These 6 stack locations include- the two

locations that, contain, the subroutine's return, address.
3T

MtJDBUG; Entry Point = HOM+$OC.

Users can return control, directly to the top of MJDBOG without

changing 'the old values of the pseudo registers by jumping to location

MUDBUG. This entry point to MUDBUG is used when the user wishes to

terminate execution without generating a register dump.

Calling Sequence: JMP MDDBUG N.B.: JMP, not JSR.

Return Condition: There is no return. Control remains in MUDBUG,

and MUDBUG prompts the user for the next MUDBUG command.

Subroutine NEWVAL; Entry Point = ROM*-$OF.

Subroutine NEWVAL reads a 4-hextet hexadecimal number from the user's

terminal, and the subroutine stores the value of the input- number into the

locations that are addressed by the XR and ZR-i-1. If the input number- is

terminated by a solidus or if the input consists of a termination character

with no hertets, subroutine NEWVAL doesn't change the value that is already

in. memory.

Subroutine NEWVAL uses subroutine. NUMBI internally, so the readershould refer to subroutine NUMBI for more details regarding NEWVAL's

operation and its return conditions. In particular, the documentation for

subroutine HUMBI explains how subroutine NUMBI sets certain variables to

provide some detailed information about the nature of the input number- and

its termination character.

If the input number is

transfers control directly back

returns to the calling routine.

Calling Sequence:

Return Condition:

LDX

JSR

=VALUE

NEWVAL

terminated by a solidus,. subroutine NEWVAL

to the top of MUDBUG~ Otherwise, control

This example **i1 "T"g sequence shows

how to read a new value for the doubleprecision number that is. in locations

VALUE and VALUE+1.

1. Normal return. The AH and the BR contain the new

(or preserved) value that is in locations XR and XR-t-1,

and the other registers (except the CC register) are

preserved. Location TERMCH is set to reflect the

termination character that was used.

2. Solidus terminator. If the input number is

terminated by a solidus, control goes directly to the

top of MUDBUG.- . instead, of returning to the call ing

routine. - -----—-
38

Subroutine NUMBI; Entry Point = HCH«.$12.

Subroutine NUMBI reads an ASCII-coded hexadecimal number from the

terminal; and it returns the 16 least-significant bits of the number's

value in the IB (most-significant byte) and the BH (least-significant

byte).

The input number must be terminated by one of seven termination

characters: a period, a comma, an asterisk, a blank space, a tab, a

solidus (*/"), or a carriage return. A solidus termination character both

terminates and cancels the input number, so subroutine NUMBI returns the AH

and the BR unchanged to the calling routine when the user types a solidus

terminator. The other six termination characters merely terminate the

input number.

If the user types a carriage return as the termination character,

subroutine NUMBI does not echo the carriage return to the user* s terminal..

This feature allows the calling routine's software to control the position

of the terminal's carriage or cursor.

Subroutine NUMBI always leaves a special, easy-to-test termination

code in location TEBMCH (i.e., HAM+$06) to represent the particular

termination character that terminated the input number. The termination

codes for the various termination characters are as follows:

blank

tab

n»tt

",*

B

.

n

•t/it

<CB> s

-7

-7

-5

-3

-1

0

+13 &

$F9

$F9

$FB

$FD

$FF

$00

$00

z.

$1111100t

$11111001

$11111011

$11111101

$11111111

$00000000

$0000110T

Besides leaving the termination code in location TERMCH, subroutine

NUMBI always returns the condition codes reflecting the value that is in

TERMCH, so the user can employ a conditional branch following a call to

subroutine NUMBI to determine something about the termination character.

Subroutine NUMBI allows the user to type leading blank space(s) and/or

tab(s) with a hex-number input because many users like to insert white

space at the beginning of an input number for improved readability. No

leading white space is required, of course, but blanks and tabs are allowed

until the first hextet of the input number has been typed. Since

subroutine NUMBI allows the user to type leading blanks and/or leading

tabs, a user can't use a blank or a tab to terminate an empty (i.e.,

missing) input number. A user who wants to omit an input number entirely

must type one of the other termination characters to Indicate the missing

number..

The input number for subroutine NUMBI qa» be signed. A leading minus

sign causes subroutine NUMBI to return the two.' s -complement, of- ther-input —

number as. the input value, and leading plus signs have . no, effect.- on the-
39

value of the Input number. Two minus signs (or any even number of minus

signs) cancel each other, but any odd number of minus signs result in the

negation of the input value. Leading sign characters are permitted until

the first heztet of the input number has been typed, and after that time

sign characters are rejected as invalid input characters.

If a user types a leading plus sign* subroutine NUMBI clears location.

PLUSFLG (i.e., RAM+$2C). -Otherwise, subroutine NUMBI puts a nonzero value

into location PLUSFLG, so the calling routine can check location PLUSFLG to

determine whether or not a leading plus sign, was typed.

The terminal operator pan correct any typing errors in an input to

subroutine NUMBI by simply typing a backslash ("\") before the number's

termination character has been typed, i backslash cancels everything that

has already been typed for the input number and restarts the number from

its first character.

The operator can. alternatively correct simple typing errors by- talcing

advantage of the fact that subroutine NUMBI retains only the 16 leastsignificant bits of the input number. By simply typing new heztets,- the

operator effectively shifts old heztets out of the left end of the number.

If no valid heztets (0-9, A-F, or a-f) are input to subroutine NUMBI

(i.e., if a termination character other than, a blank or a tab is typed

without any valid heztets preceding it), the subroutine returns the AH and.

the BE to the calling routine with their original values unchanged. This

feature allows the calling routine to provide a default value for the input

number. Additionally, subroutine NUMBI. puts a nonnegative value into

location SEXTETS (i.e., HAM+$2B) if the subroutine receives aa empty

number. Otherwise, subroutine NUMBI puts a negative value into location

HEZTETS.

If subroutine NUMBI receives an. invalid character for an input, it

outputs a bell (ASCII code = $07) and a question mark (»?»; ASCII code =

$3F). Aside from making these outputs, subroutine NUMBI ignores the

invalid input character. Only the following characters are accepted as

valid inputs by subroutine NUMB I i

blank tab * - , * . <CH> /O 1 23*56789ABCDEFabcdef \

The first two characters in this list (blank and tab) are valid as

leading characters before the first heztet of the input number has been

typed, and they are also valid as termination characters after the first

heztet of the input number has been typed. The next two characters in. the

list (+ and -) are valid only before the first heztet of the input number

has been typed, and they are rejected as invalid inputs if they are ever

typed anywhere other than, at the beginning of a number. A backslash ("N")

can always be used, to .restart an input number, so a user can go back, and

type- a forgotten sign character-. by- first typing a-bactraTanh-^-- -

: -- - — '-~-'- "-.----

The falltrre sequence an^ return,- conditions. f6r-'~subrouti-ne- NUMBI. arenas

follows: ":-t . .:.-.",_-.->--; r
40

Calling Sequence: Typically, JSR NUMB I or BSR NUMB I

Return Condition: 1. Normal return. The AR-BH contains the double—

precision input value, and locations TERMCH, PLUSFLG,

and HEZTETS have all been set as specified above. The

CC.I bit is preserved, and the other CC bits reflect the

value of the TERMCH code. All other register values are

preserved.

2. Solidus terminator. The AR and the BR are both

returned containing their original values, and location

TERMCH contains the termination code for a solldus

(i.e., 0). The CC.I bit is preserved, and the other CC

bits reflect the zero value in TERMCH. ill other

register values are preserved. Location HEZTETS is

nonnegative to indicate that no hextets were retained,

and PLUSFLG is set to indicate whether or not the user

typed a leading plus sign.

3. No number input. If no valid hextets are input

ahead of the termination character, the AR and the BR

are both returned unchanged, and the special code for

the termination character is returned in location

TERMCH. The CC.I bit is preserved, and the other CC

bits reflect the value of the TERMCH code. All other

register values are preserved. Location HEZTETS is

nonnegative to indicate that no heztets were typed, and

PLUSFLG is set to indicate whether or not the user tyed

a leading plus sign.

Subroutine OUT2H? Entry Point = HOM+$15.

Subroutine OUT2H outputs the two-hextet hexadecimal value of the

memory word that is addressed by the ZR.

Calling Sequencer LDZ =7ALUE This example calling sequence shows

JSR OTT2H how to output the two-next et value from

location VALUE.

Return Condition: The AR and part of the CC value are destroyed, but

all other register values and the CC.I bit are

preserved.
41

Subroutine ODT2HB; Entry Point =• ROM«.$18.

Subroutine OUT2HB outputs the two-hextet hexadecimal value of the BR

to the user's terminal.

Calling Sequence: LDAB VALUE This example oalltng sequence shows

JSR ODT2HB how to output the two-nextet value that

is in location 7ALUE.

Return Condition; The AR and part of the CC value are destroyed, but

the other registers and the CC.I bit are preserved.

Subroutine OUT2HS; Entry Point = HQM<-$1B.

Subroutine OUT2HS prints the two-hextet hexadecimal value of the

memory word that is addressed by the XR, and it prints a blank, space

following the two-hextet value.

Calling Sequence: LDX =7ALUE This example «*TMng sequence shows

JSR OUT2HS how to print the two-hextet value from,

location VALUE.

Return Condition: Part of the CC value is destroyed, and the AB

contains an ASCII blank ($20), but the CC.I bit and all

of the other register values are preserved.

Subroutine OUT4HS; Entry point = RQM*-$1E.

Subroutine ODT4HS prints the four-nextet hexadecimal value of the two

memory words that are addressed by the XR and XR+1, and it prints a blank

space following the four-hextet value.

Calling Sequence: LDX =VALDE This example calling sequence shows

JSR OUT4HS how to output the two-byte value from,

locations VALUE and VALUE+1.

Return Condition: Part of the CC value is destroyed, and the AR

contains an ASCII blank ($20), but the CC.I bit and all

of the other register values are preserved.
42

Subroutine OUTCHR; Entry Point = ROM«-$21.

Subroutine OUTCHR outputs a single ASCII character from the AH to the

ACI1, which is interfaced to the terminal.

Calling Sequence: JSR OUTCHR Output an ASCII character from the

AR to the user's terminal.

Entry Conditions: The AR contains the ASCII character that is to be

output.

Return Condition: Fart of the CC value is destroyed, but the CC.I bit

and all other register values are preserved.

Subroutine OUTS; Entry Point = ROM*$24.

Subroutine OUTS merely prints a blank space at the user's terminal.

Calling Sequence: JSR OUTS Output one blank space.

Return Conditions Part of the CC value is destroyed, and the AR

contains an. ASCII blank: ($20), but the CC.I bit and all

of the other register values are preserved.

POWERUP Routine; Entry Point = ROM*-$30.

Users can transfer control to location POWERUP to restart the MUDBUG

system as if it were coming up from a cold start. The POWERUP routine

initializes the system's hardware and MUDBUG's pseudo-register values, and

this same routine is invoked by a restart interrupt (RSI) at power-up time.

Calling Sequence: JMP POWERUP Restart the system.-

Return Condition: There is no return. Control remains in MUDBUG.
43

Subroutine PRTZM; Entry Point = HOM+$27.

Subroutine PRTZM prints a CHLF and the four-heztet hexadecimal value

of the IE followed by two blank spaces. Then it prints the two-nextet

value of the contents of the memory location, that is addressed by the ZR,

and finally it prints another blank space. The output format for subroutine PRTXM is therefore as follows;

"znx MM ".

Calling Sequence: JSR FRTZM Print the ZR and the value of the

location that is addressed by the ZR.

Return Condition: Part of the CC value is destroyed, and the AH

contains an. ASCII blank ($20), but the CC.I bit and all

of the other register values are preserved.

Subroutine READPT; Entry Point = ROM+$2A.

Subroutine READPT reads a single character from the terminal's tape

reader. The input character is returned in the AR, and it is not echoed to

the terminal.

Calling Sequencei JSR READPT Read one frame of tape.

Return Condition: The AR contains the input character, and part of the

CC value is destroyed. All of the other register values

and the CC.I bit are preserved.

Subroutine STAAB; Entry Point = HOM+$2D.

Subroutine STAAB uses indexed addressing to store the values from the

AS and the- BR into the locations that are addressed by the ZR and ZR-»-1.

Calling Sequence: JSR STAAB Store the AH and the BR.

Return Condition: The AR and the BR have been stored, and all registers

(except the CC register) are preserved. The CC.I bit is

preserved.
Final Report

Contract NAS8-34969

ENHANCEMENT OF INTELLIGENT EDITOR/PRINTER

This report was prepaired by Arizona State University under

contract NAS8-34969 Enhancement of Intelligent Editor/Printer for Marshall

Space Fligh Center of the National Aernautics and Space Administration.

APPENDI X

B

The design specifications for the MC6809 version of the intelligent printer

controller card. MSFC is currently constructing a printed circuit card to

implement this design. The software necessary to use this card as a

controller for a Diablo Hy-Type 2 printer is currently under development

and will be supplied to the governnent after it is checked out on the

finished version of this card which is to be supplied to ASU by MSFC.
Printer Controller PWB

(6809)

NOTES:

(1) The distance from the 3.686 MKz crystal to the MC6809 is

critical and must be less than 20 mm. Also the two 24 pf caps on

each leg of the crystal must be within 20 mm of each other (refer

to the Motorola Data book for clarification).

(2) All discrete resistors are 1/4 watt carbon composition.

(3) Decoupling caps should be added between -t-5 VDG and.

Ground liberally (1 for every 4 I.C.'s).'

r(4) 1C numbers (Ux) should be reassigned per the layout of

the PWB. Suggest Ul be the upper left hand corner, U2 to its

right, and so forth.

(5) It would be nice to have four mounting holes (min 3/16""

dia.) located as symmetrical as possible and close to the corners.

(6) The connections to hex inverters, AND gates, and other

generic ICTs can be changed during layout, as long as the change is

electrically equivalent.. Gates required to be Schmidt-Triggered

are marked accordingly and should NOT be replaced by a regular

totem pole-gate.. Also ensure that open collector gates are not

used in place of totem pole outputs and vice versa.

Parts List

Printer Controller — 6809

A. Integrated Circuits (IC's)

Part- . I pins Page +5 VDC Ground

Ul

U2

U3

U4

U5

U6

U7

U8

U9

U10

Ull

U12

U13

U14

U15

U16

UT7

U19

U20

U21

U22

U23.

U24

U25

U26

U27

U28

U29

U31

U32

U33

U34

U35

U36

U37

MPU — MC6809 40

PIA0 — MC6821 40

PIA1 — MC6821 40

ACIA1 — MC6850 24

PROM0 — 2764 28

PROM1 — 2764 28

74LS138 16

82S129 16

PTM — MC6840 28

RAM0 — 2016 28

RAM1 — 2016 28

RAM2 — 2016 28

RAM3 — 2016 28

PIA2 — MC6821 40

SW1 — Dip Switch 16

SW2 — Dip Switch 16

74LS244 20

74LS244 20

74ES244 20

74LS14 . 14

74LS14 14

7404 14

7410 14

7400 14

7432 14

Res. Pack 899-1-lk 16

Res. Pack 899-1-lk 16

Res.. Pack 899-1-lk 16

MC1488 14

MC1489A 14

7416 14

7416 14

7416 14

7416 14

ACIA0 — MC6850 24

1

4

4

5

6

6

2

2

2

3

3

3

3

7

2,7

7

7

1

1

1,4

. 4,7

1,2

2,4

1

2,7

2,4

. 4,7

7

5

5

4

4

4

4

5

7

20

20

10,12

1,26,27,28

1,26,27,28

16

16

14

26,28

26,28

26,28

26,28

20

—

—20

20

20

14

14

14

14

14

14

16

16

16

—14

14

14

14

14

10,12

1

1

1

1,23.

14

14

4,5,8

1,8,13,14

1,2,4,5,7,28

14

14

14

14

1

1,2,3,4,5,6,7,8

1,2,3,4,5,6,7,8

10

1,10,19 '

r,10,19

7

7 ,

7

-7

7

7

—

—

—7

7

7

7

7

7

1,23
B» Discrete Components

Des Part. Page

Rl

R2

R3

R4 .

R5

R6

R7

R8

Cl

C2

C3

C4

C5

Dl

Al

10K Resistor

3.3K Resistor

3.3K Resistor

. 3.3IC Resistor

3.3K Resistor

3.3K Resistor

10K Resistor

10K Resistor

24pf Cap — Ceramic

24pf Cap — Ceramic

1.0uf Cap — Ceramic

1.0uf Cap — Ceramic

33uf Cap — Tantalum

Diode

7812 — +12VDC regulator

1

1

1

1 --, --

1 • "

1

5

5

1

1.

5

55__r _

1

 \ r

5 ) C

er /~ r - 4 (o 0.1. /A' Cap - t-eroL^rt. —~

~f , ' - ^A.'

' (?.4-LK.r Cx« —Cer«L>^Cc»

_- * " ~ /\ ••

C. Connectors

Jl — 50-pin right angle ribbon connector

J2 — 40-pin right angle ribbon connector

J3 — 6-pin right angle power connector .

D- Miscellaneous : "

(1) Connector Jl. should have the following Ground connections:

Jl-2,8,11,14,16,18,20,22,25,30,31,32,35,38,41,44,47

C. Spare Gates

Des Part Spares

U22

U23

U24

U25

U26

U29

U36

74LS14

7404

7410

7400

7432

Resistor Pack

7416

2

1

1

2

2

3

L

- •-.:; f^-7--'' • : ' '. -

'-- -i --- '. • " ~" '•"-•

•;A:i

x

fijjC:^i3 . - ., , •, .-• ; J. -<-, .V -, . - . i '--f {. - •

-'.r ..,-'.f --

,'^wi - '"•!'??'"

K

-^Tr^:

•':-';i'-T -/I- -r^"-''

(

. ' ~

7' * ^-' I .. 7"

'.•'< ';! •'"•' ' '

']l ' °! ",-•;'; , -\

At

a,

/O '' 'V'1'' '4 . A" i

C-LK

-t>

/

?&p

CLK

+5V

2fc7

_^ 1

14

Oi 5aoa

csi

00

P7pt VS

8-

it22222413^^nlo

/T»

•oVrti/

P7

-Opr

-OP1

•O P3

-O P«

o Pa

IVw

p »
It!!

•'V-'.V,'.;! : ,; "•-/.'.'-

•_' •."*':' 'l'.:.;,;,!;j',v<:

;

:

.OM:; ;> ',- ';•

.'-^V't' ' '', ',''. .'»'"•""

^>K:':!; :';-:';.. U^-C

i • •' i • '- X i

J

 \ »" ' T ,' ' , 1. ' . ^ .

J1

 . .,' ' . . " . 1- v"

' ' ' .1 ' . . I- i 1 *

.' -N.'^W-" w'-t* U. -•-'-. f'K* '. ,

I' ' t < ;

' _' ' • • ' ' \

v;Mv':;,M;:|?:,

• « ; • ' • • • • r,' r ' ..•.!".' • . ' ,:,.- «

'. ' ' i " 'i * * • ' " ' , '

i '• ' "?' *•, '• % • •»»••{•• *

' ' '• •! ' '• !-". ' ' ' ,' " ''<

K^M'M

f -!;.;.^PT l»i\rnp ; ; ! ' : .- •, - - ; - . ;•• » . — ; : — r- '

[NV : t-:"\

r K^ — t !-• <••• - -

!

k.«" ' ' -i

.n**;-1 "i;1,-

 :

rf,?r .^^.,

'•At— [T7

fp . ! ' •

,M-' .:* .. •

^!n; ' ' :' '

n ''' ' '

fir

•P* ' , ..-

/^ -' '. '

J

\ *'| / r",

J' -71 ' ,|tr'''''

h

 ' ,:'

 ;! '

^ >?' ''

;r'r. .;». .

». ''- f;'''

 :

A* i - '<.

1U ' ^'' '' " yi,: ' l:

tl ' ' '

^' ' "i' ' -•

'H^! ' '• '

^/T '»

t\ 4 ' -

V..f\ • '?'"•

P

:L;

 '''-' •

•-'

 ; • .i^." ' 1 ! ,;

: .. , . \>:. \

:.jc:^:>':-

27

*•*! ^^ t%fi*V

— **O*f

<-6*i <*l)W

»(5) (t*)«

^^m^ ,

H Cl) (It) I*'

14- til? , t»)|S

. • '» HV i" ••'•,•." • • ; ' , •; • • nu , „ ,

1

 ^? v. , '*—! if ft • .',;.,, . "'^ , '. . -

fT

 ! I *7

An ' ' i • ' : ' A •*•.".,.,,

- - - - IH ' . M"*"

______ j^T? /~l iRT)/ ,

—.,__.. fz- ./n Rftttffly

w -. / QA O\

, 07 . c n 4J

....,—-».. n/ .

... - 6?

,. ,., .... o ^

r " .

k <l&

2 '7

3(0 ^^ C£-t)2t5/3^ («'ts

'24

C,M\ ('023

7(*J I/Ill (tote

^(7) (S:^

1 1 f<A (( fc) /*•

HO';] 1^1*:

'

^j i^w^»C,f J^ •

" ' --^W ^

v

lit c /*~i TTo

» f> A?

< • >

i - i Alt ^iTJfr l

P

_

•

Al

A

'" Ti.'J'-

.. . .Vf '. : • • -•"

•TW

x i./r, .

M"

/IT

i'

C '

/HI Mlj \yir) ni

«_X-i -RKM1 / iTi

riT ^^^"^/ j ' 3 \ AX

C^J P^

*^^ C^pU "" '

LT

Z

' , '

?1

-f - 25

1 - 22 !

8 IJ|2. 21

q Zo

1

b l l

II IK

12 '17

• S - it.

U2J (13) IS

<

1 ^ Pt2. 2.1

3d)

 w (*!Jac

,/ Of

1 Ci

' 37

7i 2 *2t

MI3

 l

• i

i/ ix

'* ) /

'"

•

 (r^ 63) 15

.- •-

p-l 1 .. ' ! ^ _ i — '

' L-' weC v f~\

j

 Ul "/rR - .

L ...^ k 5> i

'< in

..-.';<.

ifi? -O RD/

T>< '

.

_ r>»

' Vt r " ' '

—————

.A. r Vtc,

AT •

. ,....-,—_ cf " — ^3 P^O/

r *fc "^L-J T^A tt ^/

^2 ^k*D --*

.'. • r - '. , '

r

/T I D /*

/ . .. V-^urvfi ., p V

'

:

-"'

 !K:;;:; "•!»•:•;'< • • - -. ••• ,. • • .- .-• - • • ,•- . -/ -

,:

-k._^.._,__
•: : — i

••^4';A|2;P>: ...'.;

 fts

'" "•'''

 j Ai rS!

 ' :' ""*•» .' •. :'~ ,- : H f k-^TT:', • "

• ^' i_;!i_i i, t\t r*^>

;-.-Af

,'-"><-tr~'i"'"

•••''•-'•^•'-'- A^ r-j' • ! ! <^3

"~T-v57 n^-t-p!A,.',j ,_,.. [

,-x±^w

u

lo

500-

', ' K' V, '.','i!.Vu',.' ' ,. . ."'''

^..\Jv •] ,'-.', t '""'''?";•'. ' ~-~'''ifi '"^

if

03) E5

(n)li

Of)\7

Vu.

t

All

OB/Vff

Cg

C?T

04

OS

04

Q3

Al^

A7

AH

A1C>

"•

oo

i'

'

Z

3(1)

E«

__?!

(24) Zt

5(5)

7(5}

•\W

(.22);

21

21

EP

n

18

n

15

\fecr

Vcc

AT

C-E

01

Al

3>7 <w«>

"-B
j.g[£ Jjjtp^w- i .> M

i ''*SX 'if~fa I .'•" i Vn1 r ' " -riS,/
Final Report

Contract NAS8-34969

ENHANCEMENT OF INTELLIGENT EDITOR/PRINTER

This report was prepaired by Arizona State University under

contract NAS8-34969 Enhancement of Intelligent Editor/Printer for Marshall

Space Fligh Center of the National Aernautics and Space Administration.

APPENDI X

The design specification for a 132 Character by 64 Line intelligent CRT

display system using a Motorola 6809 MPU. This version also has four pages

of refresh memory.
DE.BU&

AMD

LINK

tt-ZM

rift

O.HD

Mo

-8 B(T l/o R.6&.

BLiS f~

COKTKOL

r-V

rV

O-CHfc

L-N CXCHfc

r\ri-

*£&.

:H>o»Acrei

atwfcRxtc

LED

DOT

5HIFTER

BUfftBi
t>M<\

ADDR..

COOKirtR

_J

<,

--JAH

"* HI

\ r-~

• Z.

RAM

CK.TY

CKCH6

CKT
SPECIAL

F6ATUM.S

SCAKl

CouMT;

,

FKat*

., /»/«F/ /A//: K

/ f )

XEC/STE* £

f/ ;

- \/

1 ••-

^ CHMlAUlTtR. CLO

iHARAtfTER.

GEHE-RKTOR.

2.

IjUtL

3toa

\K-X6 PKOWg

1\

;

V

C.K.

T T L

TO

ECL

TRAMS un-OR

1

i

i

i

ecu

TO

TTL

|

Ns

Y'

1

ECU

SHIFT

R6G\STER

C*

 LB

K^lnJ DaTtf

T

TlMIMO

dHtFTER.

4

CHARACTtR

CuaCK.

GtHtRAToR

stuc

SPICIA.L. ».

PSATORt

u»«.Kno(4 — *"

CK L-D ^s

I»oT Ct-K

OSCILLATOR

<-roMnz

TTL

CHARACTER.

DiA.GRJMv\

ClR.CUnrR.X

M
$?*>(i D

Ikev kCV60Mtb B |

tun it.

SF3CL2

L *-•

<8.F3C|

BlT

I , I

K)°P

-Ret>uc6D

UND6f-it4ED

S -- B.IT -f-

, * R£AD » CLtAR.

BLIMKKE1BO INW

AuTa READ AUTO yj

NoP

TOP

i i

IlllMK.

IV.DtO

MOP WoRt>/

CHML

MOP

t-e^s•r 5

"BCt>

BCD LIME

»a COLUMN 6, CURSOR.-

7 I BIT G. -J-BIT 5 | B.IT 4 ]- BlT 3 4 B.IT a. -I-B.IT

MODE:

Moot

CRT. C. OfOTR ouL6 R.
c

a-.T

I I

J

Mo f

Soor4t> E.&I.U

7 BIT & --B.I -J- T SIT 2>- BIT -jI -MEMDK.X

[LOCK. LET)

fi I ICHe

t 2ICHL

SiL

CR.T
4-ifC

EXFC

VMA.

R-/VJ

TJATA.TUflieVMPU

•fcMK VS».Ub FROU MPU/WfUTt)

ZK«=<} -I ~~

AfcWS. FROM MUX.

' * I1 u

CACHE WR.T ADR.

c

"R£FRjesM"t?.6MS D*.TA

•^ ' -«L I ' . ,s

-->.- . ,

t'O j;s C2S 875 looo 112. S

/ a •» ts Wflljw 529 S« 54S 781 400

IZSo

It7i |

5t7 01 (SO

2

WX///A Y/AY//A Y//X///A

5J4 Cat C79 io*< inr n 75

W////X/7////A Y77///Y////A

JOS 310 45« not •

V/////////X///////////A

205 3l< 13*

Y7///AS////////////

not iiti

v//AW//////00r-^

•SSS i |p23 (=«OM pt. loot VOBSTC

643 770 301

liO itS 344iJ«-»<->

W//////////X/////////J7X

iota me

 AF|t

Y/////////7ZV7 ^

cso

m. 122.

46 Tl HO ; I9+ 571 CIO C3+ 7ZB 785

• V/A////Z\

147 IV IBO ad£ Jil

^g?^r V/A/////A

1046

 >o71

 mo "3+ 'Mc 'Mt

V///////A

457 C«^ 73Z 1157 II6»

88Z 965.

M

7Z8 770

-W////A* :m OOUT CAtt

188 C46, 688 7z« 910 9Z« t>t(< llftt (ZIS

C^^l

•Wo ^^

daz. n«« 1156

S5S

6SZ 7W 701

OLD V/A7///\

36S 535

^////W/////////A Y///^///y///&A^TM

it i» Ca.\Cv»\a-^-e4

il- IS Ca.
•1-XFC

i ay

(LEKD

DATA VAUID FRoU '_

MPU

IZS 250

41

Sfc

Y//X///A

•A IIT l»

Y/^/Ay///^

156 BIS

28}

SCT COI

5J6

Y/Y///XZS////A

310 436

•X///////////X////////////A'

498

V//7///////XS////////////A

125*

W\

VS/XtS/A

HIT HIS

Y///7A7///A

FH

IIA6 & FK.OWI

IUC

llfl*

v////Ay///////,

ir- .1':

i

•/,.' : -, i'

,ii - !L I/O
BLMWNG

HoR.ilo.-VTMHIGH SftfcD

SfeU.

CHOW I- <iUCf

CMML. CLOCK?

TjijnjnjijnjTjnjiJiJTJij"^^

I I 3 •> S 4 6 T Si 6.2 43 «- 6b « C7 C8

T/M/A/6
MP\J-X>b

ZX.FC

MPU-D7

MPU-T)<i

1 StV-_ » -tj , f la-r

V -B

»S ,TB ^ux

J— * STB l-l

L

 | — | '

.i IA

->. .» " in

5

 ?)V - . -, . .

6 ,„ IYJ

,, I* *Y •>

1* V*

,3 « 'T "•

F

74I.S**. T4LS«

JX^ ,— ^

r

T^usaa

r— = J

1 ^

_^>

1

— c TRI OCTAL

T fir

— >*•*•

1 IB 19 ^

_* ?.t» la 5

T n -?q e.

_3 4t> 4q .-5

13 an jq ia.

I*- CB CO IS" ^-OR-Jk

11 7]> -rq I& - ^.-Dft-^

18 BT> flQ 13 -D«,-R

•R6SKT6R.

EMKOLe

AUTO

REVO

P/P

EHA6V.6

^UTO

WBIT6 F/P

v<?<:

Jl

-SET

T) <S

>Cx.

Q

ClU.

f

VCC

y«

A

saT

"ft O

9

ClR

yvcc

7*L.S7VAi

0-

1+uS74-^

>-

8T5»

PNo j^"0* 7 '

[> -

J^N- -_-&?>, S 1_

^<

— D^° — —"BB 3 u

r^o . T^^ ? i -

^<.

f^N? ^ TSi 1 L.

P^Ss ».na * L

T4I-510

^

y —

— ^, i»- A.»To- «O

CRT
- P

CAS -p.

RtfRESH-AS

-A\

WRITS.

OS

15.

V1RIT6

CAS

At

A*

i.

15,

13

to*

12

WRJtt

CA5

VbO.".

J

«UT

AloronocA

MCAI 66334

TV*

(4-

i-v

CAS -P

REFRESH -

REFRESH -

REFRESHPfM 8

6633/1

WRITS.

14.

15.

WRITS

CA.S

At

14-

BJ

WRJTt

HAS

P,a "CW

iv •FRESH- T
fFiCZ-lMRTPPMPU-RT

UPli-rVJ

MPl)-P>CV

MPU-OV

MPU-0%

UPU-t>*-

UPU-bt ,. . _

JJPU -00

fcF 5C.3- MKTPP-

-^T-^ /s — tvV

0R-TL

\JOi-ToPF

•

r4

J

.

r— c

3

4

7

8

13

14

17

16

l*»P

RS

i

( C "*

3

4

7

a

13

14

17

18

LSoT.

•\

^

riosmiw

C.LK O4TM.

O F/p

\O la

2o ^a

I>D ia

4o 40

5D 5tt

CD tea

10 Ta

so 8a

V<K;

OF- %iR£6K

SISTER.

*a^rM^

,C*-K OtTM.

DP/f

ID iq

2D £q

3o iq

4t> 4€(

5O 5H

GD S<^

3-D W

L

~BMAK

ML$OO

N

>

' n-t»-

T*-\.V3MZ

5

f

9

IZ

IS

16

13 .

I

>

" 74-L$314

Z.

s

c

3

12

1C

19

"1

)>

r

•IS

•

V

,

/<;<•

*•(•

c

vc

4JC

t

"09

r

'r'

G

5

*

,

^

7

10

9

1

?

C

5

4

3

10

9n

| r

c

s

4

3

^

10

i

•z

C

5

4

3

1-4

r «-V-R

CAR*

o ao

C. QkC

e> aa

A HA

iN P I 1

- ;r

^ww

D ad

C ac.

B as

A, CXA

fcM P

6NT t!"1

L«

 tTR

CVR

V(AJK>

,1 f%y» \

B QR '

A /54 '

ftMP "'" ' S

T

 ^T

C.VK tKRRY

t> qo

. i QC.

. & <^°

_ -

»rw

T4A.v^3A

r 15

12.

^

"7>*AATMAl2-

""

,„- .

„ -nuA-KH

1^

13 -BM4..AO,

1+ r>MA-A«

74L^I^^^

1 -TMA^-^C.

"T^V.^lk'^A

is

II -hMA-X^

,2 TM^-X2_

.

15 -" ^OMK-A,\

14 -jic»«fc-^a

_

!*• .- j
DM A -

"DMA-AC

A&-14-H

•DMA-AS

Aa-lJ-H

A&-5.-W

-DMA -A4-

AB-I2-M

A&-V-H

•PMA-AH

AB-i-H

TJMA-AlO

"DMA -A2.

CJZ.-TTI.

"DMA- A9

T>M^ - Af

AB-9-H

A&- I- W

OMA-Ag

"DMA - Atf

AB- ff- H

A»-ai- H

-»-R6FRESrt-fl7

1*

\l

13

(CO

aca

2CI

2C2 •*- REFRESH -A4-

ie

ii

iz

13

'"

IC.3

-A3

-*-REFRESH-AI

ia .H-^S*-- -

IS

StW.

seu

IS3

> M -it-ze

f 7 -,o-«S

|%-|1 -19

,7-zS-3«

MUX
-RAM-A0

/

&STf Sffcgf -

REFRESH MEMORY TO CACHE

MEMORY UNE. COUMTER.
T4LS04.

(S2-TTL .

M«3

74 LS #9

TW4M.

TIMIM&;

K- 3

RAS-P

WRTT

V MAV et Rqo FOB.

PRJVt.

VCC.

T1MIHIG
C<Kcue-i-ioKrF-_

R6FR£gH-tijaa.

«

i

e,

^

i£

SC.

M-

-

ffJTC.

1

Cy

a

k4-

^2,

?

i

nf

5?,

t

"~2-

1

T

e. (

if

t8t

2#

T

5

ZJ

a

^

IS

\i

n

0)

19.

19

 c

20

7

C

3

^l

i

z

3

4-

IS,

(3

n

^

I3_

17

ia

i<t>

7

C

s

21

1

2

3

j. +

IS

13

M

•3

:si

T

5i

ftN»*V

06

Ulf '5CX>^

*J

KS

KS

\4-

*KS

A>t

M

•Q4- O4-

B3 O3 J

Di o? '

Dl O| -

PAIR.CHILD

CSI .

o c

we

A.S

AS

^3

Ki.

^\

A.<^

. ti4. 04-

. G'i O3

.!>< O\

TA«R£.H\CC

CSI

Qt ._...,.

2S6X4-

M

AS

AS

A4-

A3

Ai

Al

/M»

_ bv 04-

_i>s 01

_DZ oz

_u> 01

6

4 - :

z - :

* i

1C.

14- c

\a

5

16

 ^ 14.

12

Id

CR.T

#1
331.4*2.

•_A<iH6-2.-A4-

AiHe-2-A.i

lA.CHe-2.-A2.

SFRSSH -t

ft

17

'8r

2*r

r

c

s

z/

i

Z

3

+

IS

i3

II

3

'?_

IT

I9t

a*,.

7

C

3

Z»

l_

Z

3

4-

15

\3

II

•a

'?,

n

'*t

1^

T

&

s

z\

I

i

3

+

|!

I:

i

<

r«si

S2

OE

WF

AT

AS

AS

MA3

AU

N

Ay(

T>4-

.03

Til

(

c

(*<?!

i*S?

oe

we.

A.7

A.C

AS

A4-

AvIV

AZ

,M

A<^

-•Q4-

n?i

h?

T)|

CSl

:ss

Qt

VIE

AT

«S«

AS

A4-

KS

AZ

N

/k.0

5 h*

I T*

D7

!> W

RAN\

WCX4

o^ .

03 J

0O7Z i

O| -

:MR.CHIU>

«U4ZZ

RKH

2S6X4-

O4-

Q3

Oi

O\

PNRCWCC

•a-»v.-«.i

RAlM

256X4-

04-

01

oz

01

6

4

2

 ' \

* *-

16

14

ia

\<s *,

&

16 i

14 ^

\2

1(4 r

— CAC.He.-T3 4-

•*• CACHE -

H\

CR.T
CUoev

HORte-SLAMf.

256-lgZ* f 5*0 I 23
IA)R>T£-RRM-A7 '

KEATS-ISAM-(V7

-RE-KD-RAM-ASlORj-ns-RAM-M- -

REA.D-RAHA-M-

-BUFi'eR-Se-,

VM*.in&-RAM-AI

neAO-RAM-M

l.0_

14-

i3

3A

36

4-B

2Y

4-Y

14-

13

2A

Z6

3A

4-A

4-B

2Y

3Y

(V

13

3Y

4-8

-2.-A2.

-a-A\

•^-dAcme^^A:^;

•9 -CACHS-l-Al

—

C-BCH6 JRAK\S_
L-MAB-Glkt

R.-MAR.QIH

-i c.

CACHE: -

141.4374

1

( >

3

4

7

a

i)

(4

17

18

TOSTKJW

»C.vx

ID

3D

40

SO

CO

flT»

oerw.

OVF

14

29

39

59

CQ

79

a

5

6

9

J2_

15

16

n

.HAlf7414*74.

iACHe-T

^

II

3

4

7

a

15

14

17

16

TUVIKH

OCTAt

>L

 -Q vi*

ID 10

3D -iQ

4D 47

5D 5<J

6D SQ

7D 7<»

3D 88

2 ^ in

5 , /•

•5

12 _ r

IS fc r

19

74L-S374

^

T

3

4

7

8

I3

14

•"rrr

^JS

Ki^TKTK

OCTAI.

OK. TSf/f.

ID to

zo ZQ

40 4<?

50 5<?

St> SQ

7D "~ np

ao a<?

e

5

 f^o «-u

s _ <

9

 » e

12 ._<•

»S • fc .

IS

!^_

».UHD6RUrt6.-TTL

tH^R-^.

CRT COM.TROl-l.eR_
" "Page missing from available version
UMOfiRUNe-TTL

•DOT4"

C.UR&OR-F

-TTt_P

V.-

-TTV.

6CL.

7l

s

101

J j+

*

J

1012.4.

_-».ecu

to MS

J '13

10

— EC.U

3

JS

'2.

"DoT =. -

- ec\_
-O err 4- ecu

oar-ex K.

- eci_

-DoTZ.- ECU

DOTI-&CU

"DOT

lo.OOO -

DOT SHIFTER, (f

T\KAI

CCT
2.3

LOAO-F

~DOT-C>-K»

T

CKTY

014 ecv. t

PRACTICE.
74LSIC3A

<1ACH& -~

SCAM-3

SCAM- I

*

T

i«

9

Z

G

^s

3

tup

6MT

LD

O.R.

. D

- C

CTK.

Ol

<

<

C

c

wtr

?D

>fi

}B

i>A

11

11

li

M- l.ars K SE.C , ^

7*1.

7

w~tn

z

-S

i

3

EMP

LC>

. D

. C

a

Sis3A.

CTR.

Oi

q

5

<;

<;

1

KStf

r>

>e

?B

?^

15

M 3.75 X«C i x

J. \ 5 x =,v<i

^ .m<«_._. r^^

-^

 :r-^— ^ — ' •1^ - - - --'-• •

.-*F

muMle

CR.T COMTR.OLLER.
L.-

•REXD - A.7

i_-

u.-

-R.e

•R.EKT2. - K2_

-R.-N\AK&IKl -i

'R.eA'D- RANA-A4s_

"R.EA.-C)

•R£M5rRAM-Att-

15

74-US 8S

14

13!

->_V--MARQ.lNi
-L\o

5Lin»-».S

\-IMfc -A

COR.SoB.-UN6\

UIMfe-Al

UNfe-AZ

E.6AD-RAM-AS

.- G.CA.Z

-Cov.8*

vce

13

14

A«

A3

IS

14

A-a,

7*L« as

74LSOS

13

15

74L.SB5
ABI-H

A8.0-H

CBR/W-*

ZKPi

A&C.-H

CBVMA.-H

/KBS-H

AB3-U

A>BI\-«

A.510-H

iP3C«-*lR.TP>P-

-5.TR.oat
:__."

"Page missing from available verson
MPU-D7

MPU-D&

VAPU-Ol

-WRTPP.

-£~~ir ^

z

4

7

8

13

M17

18

't 1

3

4

7

8

11

\4-

17

18

•&!?[

3

4

7

3

13

14-

\1

18

i

3

4

7

3

11

I<V

\7

IS

^if

3

*

7

a

13

14

(7

IP

'HI OCTAl

n*^ ^

1T> 19 .

3D 34 !

SD %q

CD <iQ

*o 39

TT locrAi. 1

tin ''

 P/F

 1

ID rq

2ft 2q

3D 5Q

SD SO

CD W)

7D 7Q

8t) gq

IXjL OCTH.

I'D IQ

2°b 29

4D 4Q

50 39

7D 7Q

yo 39

TR1 IOCIAV.

XiV-K ' '• •

ID tq

2D *Q

3D 14

56 M

CD 5Q

7t> 7Q

- 8T> 89

ft locmu

to iq

SD W

41) -VQ

5D 3q

GD. <^

. TD 7<^

L 813 84

t

5 r

^ r

3 e

>s

 J ?

1C. ,-

19 * <•

~~

•v**TM

z

s ,

C f

IZ. c

IS e

13 C

141.4374

^ i

S j_L

£ v.

9 ^L

li _- V

15 ^L

1C L

13 L

-,«*m

i 1

5 1

C F

3 ,_J

'* J-T

(C, f

>« •?

>3 ' f

,4*374-

Z

5 p_

C

a.

it

1C SUMK

19 RM VIBto

.- Lmfc&

. CU«."aO«.-UutV

.-ce»-5

,L-MKRS\kV-MMKRQM, CUR-^OIt, I,
CACHE -I-

. CACHE- \- w RTF

KJSV2.S

CACH6
CF.12.

Z/JV

RSfl

VlbEO

INPUT

SHI6UJ

f

'5 _

R 57

ECU UMt RCVR.

-*- I

TS.BO

(5

EdU Uut PCVR.

MClOIIC

EC\_ UMfc R.CVR.

R-G5

82-a I

-5V

KCZ

RSa*R.7o'R.T\ 'R1Z

CRZS . .

CRl*

+ &YCKOS&S OTHER.

K isroe. TO TOR.K!

(R6*. 33J11I R63-

-5V

(4.

"•

.VIDEO

VIDEO t>R.\ve LOGIC

^ECSR

C.PT
•DB 71-

"D6 C l_

T>& 5 L.

T>6 4- U

•DB Z I.

\

-•D(S

AB-I4-H

AB-IS-I-I

VM^>>

Hi •

^

-t>7

MPU -t)4

. MPV1-"O£

•DA.TA BUS

i HL£fR£SH
CRT CoNTROU_ER_
vet

LlMfc *

> COIUMK)

vie- cm ic

W 8

CURSOR. POSITION

CRT
741*1+

T> Q

tXTK

o

vdC }-•

STRING

VCt

T) <»

t>«

9

em.

rT 510.0.

.VCfi

}

KEYBOA*

UDM-I-M

PFP*

I

, — !ci

'II .

Yl!it 3

^JL

,£.

\3

14

n

18

1 "

jr^U: 1

" n .

Vit. J.

7

8

13

14

n

IS

rut

in

zt>

3t>

4-D

5D

RD

7D

RD

«

ID

t.o

in

4T>

sn

&n

7O

8D

OCTAL

D P/P

)Q

2Q

3<?

4Q

w

69

79

89

74U$-

DCTAL

O f/f

IP

29

39

4<?

59

o?

79

&O

M • — i

i ^ ^

&

a 74

it r

IS PULU I

IS PARA

is uue rI

PULL |

I

7

, 1

*• r i. I c

a PARA,

12. StMTEMCfc I

\S UKtfc

« r U-oiiU

u — I

CHA«> r

VfiC

MEMORY

MODE?

Vtftf

T406

Slgr-n.

vex.

{<—*w—*

74"

O43 ww—

EDIT

"DISCRETE

TMSPLXXg

CRT
CRT
v . p.uccER-Sfeu

Dj*-WRT| f7 3g>SEC

C. LlNfc-Al

OHt-SHoX

rar i/^ SEC

(LR.T

BELL CIRCUITRY
Final Report

Contract NAS8-34969

ENHANCEMENT OF INTELLIGENT EDITOR/PRINTER

This report was prepaired by Arizona State University under

contract NAS8-34969 Enhancement of Intelligent Editor/Printer for Marshall

Space Fligh Center of the National Aernautics and Space Administration.

APPENDI X

A One-Line Assembler/Dis-Assembler for the MC6800 MPU. This is a feature

that is currently being added to MUDBUG which will greatly increase it ease

of use, especially to the in-frequent or casual user. This capability will,

allow an engineer to debug in assembly language rather than machine

language.
"Page missing from available version11

JUT
ABSTRACT

A user's manua l de?cri b ins the operatio n of a rio i-oro 1 a

M68OO—based One-! in* Assembler/Disassemble r is pr esented .

This One-1 ine AssemD I er/Di sassembl er is a three-subroutin e

softwar e packase that is desisned to increase the

functiona l it. <~<J<- -urne riLiDBiJi-i f.nrrimand 5 - an-1 i' ma'i h^v e soin<a

othe r application ? i n thv - futui^ , Th e Or-^-'-in e A=?enibl.-r /

DI saspemb 1 er is capabl e fif tran s 1 « tins ^ssetib 1 T —1 jr. =si.iaae

i n <= t r- u c 11 o r- ? t o n-a c n 3 r i c- •. ••> d e s - ^ :~i - 3 t 3 .- •-. I ;• ri ,; a pa t- i -r ••>::

t r ans 1 at i n? mach i ne- I a n <=i u ^ g <=• \ns trui: t 1011= int o assetnol'ilanBuap e i nt t'-

 uct i rm& r fhe a:- sarnt-1 sr- port:o n oj.

:

 the Onelin e Assembler/Disassemble r i? =.:mila r ir. i-unc'fio n t^ a t'uo —

pass assembler, Th- v pr-irrsar i di ft ?r en-'.e berueen tns

assemble r piirtto n -if the Csne —lin ^ Asseinhle r 'Disas ;e-nb i er and

a norma l assemD 1 ?r i? Tha i the On^-'in ? Asseiob 1 er /

Disassemble r canno t accept labels i n eithe r th e iab^ l fiel- i

or the operan d <-ie1.1, Nuriier-i.- and se 1 '. —re 1 ^ 11 ve value s must

be typed instead of usin g labels, The manua l doi'utient ? the

One —lin e As = emb l er-/Disasserv-r.. i =rr -uurr a =!TiL'-=.. forinstruction^ ^ e - Pr ?ss i on ^ •• and ^sesjJ'-i IOST- " u-t! " ' on ;, anil it

provide s interfacE ; i nfrn - rnat i on f^r the 3 riternq 1 ,'"'tie—I me

Asseinb I er/Di sas = -=-rrib I er si'.ffwars ^acl-'ase r nu

 l; ines.

IV
4. One-line Disassembler S.-

FABLE 0!- CONTENT;.

Chapter

1. ' Introduction . . , , . , . , , . . , , . , . , \

2. Internal Routines and Subroutines 5

2. 1. •ourc'inarv o :: Int.arn.il Routine? „,,., , •'••

2.2. Subroutine Des..:r i pt i on= ....... . 7

One-Sine A?1? erriD i er- '..-.our -te S'rnta:,-

E.i'pr???i fTis » and P^^ndo i nstruct i ons

':'..'!, l:pe—iir.e A =. }.?,T,h 1 ,5 r ^,;, Ur C>- -':.'. n r^-: , , , , 13

3.2. One—line Asseiibier E -press 3 .-ins 20

3.3. !';ne-1ine Af ?erio 1 er- p'-eudo Instructions , 24

i. The Applicatio n o£ the One —lin e

Assembler/Disassembler in MUDBUG ...... . 34

"5.1, T'-i.- Application o+- the On*-line Assembler/

Di pas^senifc. 1 er in the "C" Comma no . -. . . 34

5.2. The application of- the One —lin e Assembler-/

L:I 55 £• ? ?mb 1 -?r t n the "M" Oommand ... . 3?

6. C >:< n c 1 u s t o n

BIBL1CGPAPHY
I ri t P o d u c 1 1 o n

MUDBUG i? a Mon i tor-lj t i 1 i t-,— DeBUn so f tuuar e pac'r.ase tnat

help? the pposr arnmer- uior'r u:itn hi? or her macln nv--.-,-, r|>--o

pr 0-3 r am on th-^ f'ioropola I'ld-iiuO micropro'.. ? = jor , Th>i

Fro=!rarr,mer .-«.n us-? th-? u till tic-? off.?r ? d b • MUfiBUG to v=T,r^r ,

r^|i;^r-, a TIM .jishu'-i h i =L rip h-'^p oii-n ^rof"" ^.1.1, ! r-e I^IJ'JHSJC-, ^T? : .>-ifp

u)a= uiritt^n t<-,- Dr . David C. Ph^arnp. in 1':'77, Thi? On-5-in-,^

A53-riTib I ^p/i-iiB^.ss-riTib"! «=• r i. = '1 •.- s i =3 n & d ^or fl! JUL« Jb , Th^ Un--lin<;

As?€fm b 1 *r -'Lii = 5 5 r^mb 1 ?r was uir-ii'r*n b ,- Mr . Yih— l.ianB l.ieri j n

1°83 iL'ifh the h<- I FS o f- soine b'i'i^yr-oijn-3 im-orrna!: 3 ..in f-r-oro DP.

Fh aani s .

Th-j? On,:--'! i ne A==*mbl -a-r /Di sass^'oM tr- is a thr-??-

subroutine so F tw^r <=• p^.':k".3^ tr-.a.r nrrupi^i 4-k tuopils oF RUM,

and :t r^su i r es a 3^2-uor-d bl.-.cf: r.+- RAM. It 35 ci*=isr.?d lo

incr-eas-s ':'r;---i f un-: 1 1 on^i it-,- m- certain riUDBUG 'rorr-mand?,

3l 1 "T in th^ !'!>- MI o ,'••••.• — c h^-ris^ ( i . ^ . •. ":" " ) --r-inniann an-:!

ior '-i — dump ( i „ 5 , •. "rl") i:'imma.nd •> ii" in.:r ea^e? irne

r eada b i 1 i tv of the d^bu?Pir.9 tran = cript and helps ih?

amrner d>fbuy hi? or her .-a.>n p

'The One-line Assemb 1 ep/Disas'semb ler- translate?:

rriach i ne— t'ansuage instruct ion starting in th'e "tnemorT" 1 ctcation

that is addr-esseci by the XR to an assetnbl r-lansuase
instruction* and the Disassembler output? irhe assembl vlanguage instruction to the terminal* Then the One--I i ne

Assembler allows the user to change the assembly-1ansuase

instruction bv tvpins a neu< assembl v-1 ansuage instruct i on.

The user can alternative! r l-'eep the s.ssen-.o i-,- 1 5 n^ua^e

instruction unchanged bv f, Piny onl v a terminator. l>i-.r i.u,^-

lin e As<?emb 1 er/Ui sas = emb 1 ^r accept? the five character-* ","-

PR, "-*", "."- gi-i«1 "/" a? "!=•=!%! ir,?-rr- UCtj ,-,:, t 5 r |fa i i^ t :..-=• r ^

user tiih'"' attempts to use anv other ch-tr-ic cei" e .i'-apr r-ir

above five char-act sr-t as an instructi "-ri ter f. i na^or uul l

receive an error message.

An assemb! ,-•-"! an?i.i^.g? insti uccio n thav 3= inrii t to the

One-line Assernhl «=-r/D is-is^ernb'er t-. r3i-"a! ', . -.onvains r!-ree

fields: an oprr.rj.:. field - ar. operand field - and a terminator

field. The user can tvpe blank character(s> or Tab

character (s ) or an-,- combs nation of Morn's ar.-j tab? i. ?iruieen

tuo fields, At least one coiurn n of uihife ^Fa'.s is n^cessar.

bv-tween the opcode fiel d and rhe op?"-riri -i- i e • d. j ..-

necassit'i- for white space between th-? OP<-r-in>j fiel d arid Lne

terminator field defend? on the terminator»

A comma terminator tell s the One-lin^ Assemoler/

Disassembler that it should next .process the:'-'-i:rLs:t.raction

 : a-t*

the same location asain. A- carriage return as a term i'na tortell s the One—line Assembler/Disassembler to process, the
next sequential instruction in memory after it f i ru 5h>=-;

pr o ce s s i n3 the c u r r e n t ins t r >J c 11 o n. An * s t;? r j s !• te rin i na t or

tell s the One-line Assembler/Disassembler to process the

previous sequential instruction in memory after it finishes

process i n-3 the current instruction. A F^I in.j i-,--(- .-ftu.a ;.-..,-

tell s the On? —lin e A&semb ! er/D:isa=.?enib"! ,

:-r ti- r & '•: u>- r- rnntr--. !

to fhe top of MUDBUU after- pr ocess i n--3 thv? c u r r e-i i:

inptr-uct ion. F3riHii-i > a so Isdu s < "/" ) r-r i,|i ;,,-\ s-.p t ? i I = t!.-

One —lin e Assembl er/Dis^ssemb I er to abort h=r o-res si n=» !:•••• \

return in? contr-ri l imin?d :• ate I'. to the top rif r-IUDSUO iDithou"!-

even finishing ^h^ Fro."?5?3n= ! t->"«r- hhe current .instruction.

There are three entr-'i points for ca I I 3 ns the One-line

Assernb I er/Bisas-serrib 1 er soi"-f i.jar •=• pacl-age. On •• entr'r PI-. sni: ?

labele d D1SASM> is use-j as the- entr--,- point of subroutine

DISAoM. Subroutine Dl'iASr-l translates a T.ach i r<e -1 an3ua=5~

instruction to an assembl .'-lansuase insxr ucti on and print s

the assemb 1 -r-! ansuase insti uction on the uj-;r s tersrunal,

' r i- - - •{- f. -,,-. -j-1 ,,- - .- j« v ,— . ., - j- * l—i - i -, ,~i A' _ "vi * c_" o M — . -< '"»' «_ r_ >i - i -. i r> c; u x \iv! r >. unj r 111 f i P •-• 111 • ;• •• i -.-ii- r- i •=; o n ..<> • • i_i ,i • 0.1 • •_• -i _•.'!_--. i •• -\. --

1

used as the enn-.- Foint'; ••!: subroutine A:f-MT!-£RM anu

suDroutine ASSEM- r es^ecti vc-1'.'. These two subrour ines

assemble assernbl r-language i nstr uct x-'ins t- nincnin^ coiles ^r,ii

store those cod^s into memorr. Subroutine A'oMTEF^'ri takes

care -. of the terminator of the-, input asseinb 1 v—1 an-suase

instruction and adjusts the XR to point...to -the location.of

the next" instruction to be processed 'uhere the ne;::t
instruction is determined according to the in PUT: terminator.

Subroutine ASSEfu on the other hand-. retui ns tne ASCII cod*

of the terminator in the BR to the callin g program instead

of takins care of it.

Ths first iijord of the One— !ir,%- A?£ein!;- ! er 'Di sassemb ! er

ROM- is referred to s , .Tib o 1 i i~* ! ! '• as lo.rarion ASMRiJrti an-3 the

first sjjord of th~ On ^-1 i r,e A^^effifc. ! =?r /Dj = A= P HnD"! er RAH is

s xmi 1 ar I , des i snared as location A'l.f-IRAn, 1 :-,^ entire Oneline Assembl er /Ui sassen-ih "! er proysaff i is written in

complete! v s rmDo ' i c fa^hiorij of coMrse? so -A

 ! I of- 1^-5

esses can easil . be cnansed to ?'-ji.t an."

i cation.

n
Chapter 1:

Internal Routines and Subroutines

The One —1 in* Assembi er/Disassembl =-r software

i nco rpor at'1?s three internal subr c-u 11 nes •• and these three

subi outines are potential1 . .- useful f-or a wide varietv of

application-;, Pro3ramrri«=r'5 'iiho uish i~o invoke anv of the

thrse iriternal subr out ines can siripl-, cal l tNe .desired

routine's) from their own pi-u^r an-,s ,

The lis t or. the next pase summarize? th>:- internal Onelin e Assembl er / Di 3-i-r serr.b I er rou tines that are availabl e to

the =-. sterrc ? user-=, and intirface cf-ar acter ist i cs such a =

ca! 1 ina —sequence resui r ernents an'j return condition-; are

siven t-or each subroutins in the Fa?e? that t-ollom. Notice

that the entr'-i Faints For- the avrtilabli internal routines

all occur- in consecutive lo-a":i-".ns of * vector table that

starts at the Firs t locatio n *f <-;-,; Une-line A = sembl er /

!Ji ?a = >=rrilr. 1 er pnri. This -/ect-.-i tat-i 5 is; p r •:• ^'3 <l e-' as a

conven lenci- f-'-r the us-^r _•-:• rhat t!ie •=•"•, -t-r- ,• -po i n~ addresses

fnp the One-1 in? ASS ?mb ! er /Bi ta? = efntil er" s internal

suor-i"'U 11 nes wil l not- chanse fri""Ti on--i suh -ver s ion of •'•Tie i3n r —

lin e Assemo 1 er /Di s^ ssemh "i er to anotfier.
2.1. Summar f of Internal Routines.

The list beloti.' summarizes the internal One-line

Assembler/Disassembler routines that are available for

dxrert acces? bY th^ SiStem •= user-^. The b-, rnboiic late!

"ASMROM" 3 <? used her? an.I r hr i->ij=>hou t thi s 'Jocument- :-.;.

esen^ the merfior. address o;- the first uiord or the i.'ne—

A^s-n-ib 1 er /Di =s 5s T.TI!- 1 "--r ? !<0h.

Name

En I rv

P.-.mt Funct 3 or,

OiSASM

ASM TERM

ASSEM

Translate the machine—

lansuaBe instruction

startji'ss i r! the mem or v

1 o f 5 11 o n thai' 15 addressed

b'i the ^i^1 to an assembl i —

instruction? and

tha assemblv-1an^uase

struct i..in to the ter-mina I ,

Iran slate an assembly —

mac h in- i a n ? u a? e - a n d •? r o r .=•

th? n.ach i ne-1 ansuase

3 n 51 r i j r11o o i n t o memo rY.

Jh,a XH pm. "its- c^ the srcn^T-r

>T,e in o r . ! o.~ a 11 o n a c c o r o ins * •:•

the jnpiit tei-ianatof upon

r e t u r n .

Fran slat? an assembly —

'lan=nj*ye instruction to

machine 1 an="ia<=ie - and sb". re

the ' inachi ne-1 ansujase

instruction into memor-Y.

The- BR contains the ASCII

code of the input terminator

return.
2.2. Subroutine Descriptions

This section contains interface information tor the

internal One—1ine Assembler/Disassembler software package

routines that are availaole foi direct access hr users.

Each routine is briei-l v described •« - and then its cal lin s

sequence and retui n condi 11 >-.ns 4re documented as ma. L-e

a F P r 11 F r i a t e .

S u b r o u t ] n e B J". •=• ASM? £ n t r -,- P r, me = A S n R 0 M+* (.) 0

'-E-ubrout i r.rf BI'J-ASM trans 1 ates rhe macn i ne-1 an^uave

instruction njhose first t>v'te is at the tr.e.Tiorv location

addressed b.- fhe '<R tn asseinbl f lansuase and outputs it to

the user's t?rminai.

l.ENBUF it a ^l-bvts buffer 3 n AT-MRAM, Each Dvte of

LE^iBU!:-' contains a n umber that represent? the length >i£ a

rn^chin .=• —1 arigtJT?;^ i ns- tr uct i -ri, The iensth^ '"-f tw-=ni" r

consecutive previous i .--FT O'". ?ssed i n struct-1 I-FHS can be kept in

this buffer- so subroutine ASMTERM can use LENBUF tr,

determine th-- address of a previrujsl f—^r 0'-'-5sed i n? ITIJC f i or,.

LENPTR is a pointer that points to the location where tne

latest value tuas stored into the LENBUF area.- -' LENPTR. must,

point to the first word of the LENBUF area-before* s~u±>n:aifirfe

BISASM \s called for the first time, and subroutines DISA3M
and ASMTERM automatical 1Y update LENPTR as thi-v process

instructions. The XR must aluiaYS contain the- address of the

instruction to be disassemoled before control enters

s u bro ut i ne DI3ASM.

SuDroutine DISASN contains internal r .iut i nes kn^um a?

ONEBYTE, TWUBYTE^ TRIBYTE, and FCBB/TE, fhese internal

routines update LENPTR tn ^oir.t to a neii.i entrv in the LfcNSijfar-ea- and then the-,- store i-he value of an instructxorr' s

length into the LENBUF enr; Y that is designated h', ths

updated LiiNPTR value. These routine? ai-tua II- sn-ire a lot

of common instructions' and t

entfi- PI--in!:3 into one routine,

LENPTR must point to the first- u'ord of the i_EMBUF area

before subroutine DCSAo.N1 is calle d for tn-i first tune- out

the user doesn't need to update tr-e •/•=.}»& of LENPTR after

that because subroutines 'DiSASh and A:;"1 iT-R,^ autorna t T cal I -,

update LENPTR. Tn? user car, reinitialise i LT-^TF; i.ih;n«-ve! t

she or he wishes to start proce?sir.? a r-eu» sroup o iinstructions. Subroutines ASMTERM and ASSFifl store a special

sentinel ^alue into location LENBUP to roarj-- the he-3 i nn ins of

the LENBUF table, and tlie first word in the LENBUF table is

therefore no-t used to containrthe- Vengfh of an rnstructvon.- :
Subroutine DI3ASM outputs "PCS $hh " on the user's

terminal if the operatins code that is addressed by the XR

is an invalid code. The $hh value represents the invalid

operating code.

Ca 1 1 ins Se q u e n •: e :

LDX =LENBUF or LDX =LENBUF

STX LENf-'"R STY L^P-i,-' rr-;

LDX =::lopcod<=- address.": LDX -•.r.Fco.ie address!

.JSR DISARM 8'": !"? Di'5ttSM

Return Condition: The XR contains the adorsss ."-f rhe

ne -:t oper-atins c-'id^i -ATIIJ rne CC registeris destro ,-eo- but a!! other i-eeisrsrs are

preserved. The value of- LEf'JpfR h^s !'>een

incremented^ and the value of the

i nstruc t ion •' 5 length h^s t-eeri stored into

the LENBUF entr-T that 35 now desisnated b~i

LEfiPTR. Also, the varisr. ie INLOC hi= b?en

set to point to the instruction that uas

Subroutine ASMTERM; Entrv Point = ^SMHu

Subroutine ASMfERM translates an assembl v-1 ansuase

instruction to machine code and stores the-mach-ine code- into
1 O

memory star-tin^ at the location to which INLOC points,

Subroutine ASMTERM adjusts the XR to point to the location

of the next instruction to be processed where rnt; next

instruction is determined according to the terminator of the

input assemb I v-1 ari^uase instruction, INL.!.!!- i; a tuo-b.te

memory "location in ASflRAM. It contains the va i ue of The

address' where the input assemb 1 y-1 ansna^e x n?truc^ion ' 5

itiachine codes should so. The va! ue or fNLOC '•'•-:; he=-n sat b ,

subroutine BISASM i F control comes to sufcrour j r=e A^.MT'EF'.'M

fo 1 1 owi ns a ca i 1 to subroutin e DI'f-ASM.

Subroutine ASMTERM proc^ssef the i. n^ui: as semb ; ,--

lansuase instruction and upd?. ces the L.E.NBUF enrfr th^t j.s

addressed b-( LENPT'R. LENP fP points to The locatio n that

contains the lensth value of tns asseti'C. 1 •-,-i ansuasa

instruction that i-jay oust Ji SP! av«5d b- i- subroutine DrJA'SM.

Subroutine ASMTERM call s subroutine PTRAfi-J to .Increment ths

value of LErJPTR b ,- on«, and then subroutine Abfl r^Rf! -al 1 f

suht outine ONi£bV TF ...r TUObY f£ or [^iBvTL r.r Hf.DHVlt

depending on the rnemori- =ine ut tl'ie iTiacnine code for toe

input assemb 1 i'-l ariBuase instruction to update the LENE-iiJF

entrv. The reason for cal l ins subroutin e P i'RAD-J Firs t

before callin g subroutine ONEBYTE or TWOBYTE or TR1BYTE or

"FCDBYTE is- that, subroutines ONEBYTE, TWOBY TE,^ TRIBYTE, .and

FCDBYTE increment the value of. LENPT-R — -fry— x-xue. in or?!«r to

point to next available location .in the LENBUF area and then
store the value of the machine-language instruction's length

into that location. The length value of The assembly—

language instruction that was processed bv subroutine DISASM

is overwritten by the length value of the new assembV-, —

language instruction that was jusf as jombl to by subroutine

ASMTEPM.

Subroutir.e ASMTERT. updacc-s tf-s valu e o*- LEN.-'fR

according fo the input- asser.ib 1 '• -1 ansuage i nstr MC t •• >"«rr' s

t ? rm i nat o r . S i n c-? = u b r o u 1 1 ~ e AS 1*1 f ER^ i s- «-ie s i 3 ne c! t o be us-- d

mi bh subroutine DISASM^ the v^iue r, -|- LtNPTR thar T s set in

s LI b r o u t i n e AShTERM m u =• t ma t c h T h =• t u i . - c i o n o f s :.•• D r o u 1 1 n cDISASM.

When the terminator of the 3'nF-ut ass^mL-1 r- i ang

instruction is a carr lase— return ter minatoi- , the value of

LENPTR is unchanged but the value ol" tne LENBUF entry that

is designated b ,•• LENFTR Ka^ b«en undated. Lat--r nru

subroutin e D IS ASM di Easf-'emb I e= the r-e t sr-achi r.^-'i snpuase

instruction to an assemb"! r — 'i anguase instruction and store;

the value of the rnachine-1 ansuag-? instruction * '«ngth into

the ne.-.'t available entry in the LEN8UF area,

When the terminator of the input assembly-languageinstruction is a cc.mma terminator •> the value—- of LENP FR - i sdecremented by one after the value of the LENBUF entry that
12

was original I Y designated bv LENP1R has been updated. Later

on» subroutine DISASfl disassembles the rnachi ne-1 anguase

instruction that is in the same mernor," location addressed bv

the XR to an assembl v—1 anguage instruction and stores the

value of the machine-1 ang'Jage instr u.:t i orr' s length into the

same entr-,- in the LEN5UF ar ;a as the eni.rr that was

addressed h-, LENGTH before the valu-- ot LENPTR was

d e c r e m e n t e d t. ••. o n •? .

When the terminator .if th-? in^ut as?embl r-1 ansuase

instruction is an aster-isi- terminator, the value •:• £ l.ENPTR

is decremented b r tmo aft«r the vah'.e of ths LENBUF entry

that was origina l 1, des isnfire d Dv LENGTH has be»n updated.

We can set the valu-- of the previous ! v—processed

instruct ion--5 length when LENPTR \s decremented b',- one,

Then we decrement the value .--f LE'MPTR b ,- one again. Later

on, subroutine Di'5ASM d i sa ssemb i e -• the machine—1 ansuascinsrruction that is in th3 FJ ?vi-ius rTietnor-'.' locariori

a d d r e s s e d b . t h v-v - R t o a n a c ; r rr,;-. ] • ,-• - ~\ a n 3 u 3 " •- i n s t •- u -~ ~c i o n a n d

stores the value ot tns macnine-1ansuasi instrucrion's

length into the previous eni-rv in the LEMB!.if area,

When the terminator of the input assernb 1 v-1 ansuase

instruction is a period termina'to:r» the vaVue- -of"LENPTR is

unchanged but the value ot the LEN6UF-—• entrv- -tha-t i-s~

designated bv LENPTR has been updated.
When the terminator of the input assembly—I

instruction is a sol ictus terminator 7 the value of LENPTR is

unchanged- and the value of the LENBUF entry that is

designated by LENPTR is not changed? either.

The terminator is not ?••• mean I.-,SH-U 1 when subroutine

ASMTERM is called al^ne. We stil l set th<? correct returned

value of the XK when th«=- term :.n^ i<~'<' i ~- a ':arri~;*e retur n or

a comma- but the returned value o-f the XR wil l be

unpredictable when thi terrnmato^ is an asterisk. This

problem occurs because u>e hav^. no idsa ac-out the value of

t h e P r <? v i o u s i n s t r u c 11 o n • s ' e n ? t h >

If LENPTR reaches t,'•,,-• end of the LE.NBUF area, the

length value stored in the second location of the 21-brte

buffer is swept out and the rest of the values stored in the

LENBUF Cable are moved UP one location- sn a new value -ran

be stored at the end of th3 buffer arsa.

An error message* "INVALID: i-h* whole input

i nstruct i on string"* wil l t«s printed on the user's t=""-mirial

when the asserr.b 1 y— 1 anguage instruction is incorrect.
14

Calling Sequence:

1. General Calling:

LDX =<addressl:-

SIX INLOC

.JSR ASMT ERM

or LDX = Caddress:

STX INLOC

ESR ASM TERM

Ca 11 with s u b r o u 11 rte DISASM:

LDX --=LENBUF or

STX

LDX

.JSR

.JSR

STX

LDX

BSR

BSR

=LENBUF

LENPTR

= •'" opcode

DISASM

ASMTERT-I

LENPTR

=

 :'opcc-de addre?s>

EHSASM

ASMTERM

<5 turn C o n d i 1 1 n n :

1. Norms, l rsturn. The XP coritains the address of th*

next instruction to be processed where the

n-s-'-'t instruction is determined according

t'-i the terrnxnator of the in^ut

instruction. The CC r-esister i =

tie * t roved - hut a! ! *ther r e=> l s t ar 5 ar«

preserved. The value of the instruction £

lensth has been stored info the LEMBUF

entrv that uias designated bv the original

LENPTR value, and LtENPTR ha? been updated

according to the'- terminator .
15

2. Solidus terminator. IF the input assemb1Y—1ansuase

instruction is terminated bv a solidus*

the value of the memory location addressed

t-Y the XR is unchanged and control goes

directly to the top of rlUBBUG instead of

return ins to the cal l in? routine. The

value of the LENBUF entr," that is

designated lv,- LENF TP is nnchansed- and

LENPTR is unchanged, too,

3. Period tarminator. If th-? input assemM .•—language

instruction is terminated bf a period* the

value of the memor-r location addressed bv

i

the XR i? updated and control goes

dir-ectlY to the top of MlJDBUG instead of

returning, to the callin g routine. The

value of the instruct ion'r length has been

stored into the LENBUF entrv that is

designated bv LENPfR- and LENPTR is

u n c h a n g e d .

4. Error return. The XR rc-ntain& the value of INLOC

and the CC register LS destroved, but all

other resisters are preserved. The value

of the memory location addressed by the-XRis unchanged. The r value of the LENBUF
16

entry that is designated b .' LENPTR is

unchanged-. too. The value of LENPTR is

decremented bv one Just as .if a comma

terminator had been used.

Subroutine ASSEM; Ent,-',- P.iinf- = AS

S u b r- o u t x n e ASSEM is s i rra 1 5 «' t o s u f- r • • u 1 1 n «•• MSMT EHi"1 . 1 1

translates an assembly-language instruction to machine code

and stores the equivalent mach3 ne- ! anguass instruction into

memorv starting at the location Hi-.at 15 addiess^d bv the XR.

Subroutine ASSEM return? the ASCII code of the input

instruction's terminator in tfie BR to the .".ailing program.

When subroutine ASSEM is calle-ii th-= ^R inutt contain the

value of the a«jdress at iLihi'~h the machine— 1 anguase

instruction is t^ be stored.

An error message- "INVALID: the <a\ir>}-s

instruction ?tring"i wil l oe OM^PUT t.~> ^ne u.?e''- >? termi n

when the input assembly—language instruction is incorrect.

Calling Sequence:

LDX =<addressl:- or LDX =::addr

- JSR ASSEM . - - , BSR ASSEM
3 /

1. Normal return. The X.R contains i~he memor-- address

of the location that immediate! f f o ! 1 otas

the ne>u instruction in memo TV when the

terminator is a carriage return- a comma*

an asterisk- or a period., The value c-F

the XI"-' is unchaiisea when the terminator is

a soliduf , The BR contain? the ASCiI code

of the input instruction F. t .T is-ihator - *no

the iI'C register Is destroyed* but all

other resssters are preserved. 1 lie vnlue

of the fnemorv location addressed b ,• the

previous XR' is. undated when ths terminatoris a carriage return, a comma, an

asterisk^ or a period.- The value of the

memor-'i- location addressed bv the original

v

XR value is uncfiansed uihen the terminator

is a so1 idus.

2. Error return. The CC rs^ister js H>?trf. ,-ed -, l-u*.

all other register values are pr-e-.-er ved.

The value of the ii'?mor ••' location addressed

bv i-he XR is unchanged.
Chapter 3

The One-line Assembler Source Svntan,

Expressions* and Pseud* Instructions

3,1, One-line Asseffir- 1 er Source S ,-r, tax

A source line in the One-line A = 5<s'nF' ] er ' s asreinbl r

lanyufl.se ma'.- contain IIP to rhre* field1 1 ! ar* o " c o d <~; field'

an operand field? and a terminator- field. Since the Oneline assefibler n~ia!--5s no connection frrirr< one source 1 3 ne to

another- no symbol tab'ie is established* and labels nre not

accepted. A typical source lin e that i? t , ped at a terrni.-.-i]

general 1 -r 1 o o ^ s lit e this:

LDAA Q, x -J;R:

o P c o d e o pe r a n d t^rrnjnat r, ,-

fiel d fiel d f i =• 1 d

Tho One-1 in-s Assembler al ! ouj th'- user to type leading

blanKsi and/^r tab(s> uith a s-c-ur-fe li^e input because in%.n-.

users 1 !!••<=• to insert white- ?p-ce at fn=; bey j.r..-i i ng nf a-i

input source line for improved r eadab i 1 it •, . No leadiny

white space is required^ of course, bur white space is

allowed until the t-irst non-whits charactei ot- the source

line has been tvped. The first field of a tvpical source

line is the opcode f ie 1 d»

 rand " 11 "must con-tain--, -one- of the

valid M6300 .opcode -or pseudo-opcode mnemonics. . (.See the
1'-'

M6SOO Programming Reference Manual for the opcodes 7 and see

section 3 of this chapter for the pseudo opcodes'

descriptions.) Some of the opcodes require an "A" or "6"

extension (e.g.* BIT or CMP) while other- opcodes permit the

"A" or "B" extension ( e . -3 . * RGL or AbK)< and stil l other

codes do not permit anr extension (e.s.? I NX or- BLE).

The opcode fiel d m-iv !:•<> terminated fc . one or mo re

blanks and/or tabs. Most pros rammers use a single tab to

advance to th<* operand field of the instruction. There are*

however- some instructions that do not need an operand

field j and fnr th^se instruction? the opcode field mar be

terminated bv one of the four terminators <"," or "." or "*"

or "/") uiith at least '-ine lead in 3 blank or tab or ma f be

terminated br a carriage return with or without leading

white space. A carriage return terminates the entire source

"I i ne .

The second fiel d of ^r, instruction lin s is the operand

field s which natural 1 r contain* the operand ffir the

instruction. Most instructions re^uir? at least a simple

operand field <e.3., STX SAM)7 whil< - oth^r instructions

require or allow two subfields in the operand field (e.s.7

LDAA -3,X or STAB-,, 0,X).- -Some instructions permit,

multiple operand-field entries • (e.g.T- — FCB, , .and, ., FpB) .
2O

Finally* there are some instructions (such as INX and DEX)

that do not require anv operand field at all .

If an operand field contains two or more subfields^ one

or more blanks and/or tabs ma-.- occur after the comma that

terminates one suhfield and before the beginning of the ne:.t

subfield. This rule makes the One-line Assembler source

svnta:- compatible with a standard tvpins rul e 'hat requires

a blank space after a comma.

The operand fiel d can be terminated bv one or more

blank spaces and/or tab characters (e:--cept after a comma*.

Most users type a single blank space to skip to the

terminator field HI hen the terminator is one of the four

nonblank terminators ("•>" or "*" or "." or "/'"!. The usercan tvpe a carriage return without anr leading white space

to terminate both the operand field and the entire source

line with a carriage-return terminator,

3.2. One-line Assembler Expressions

The One—line Assembler evaluates e--pr es<* ions that are

found in the operand field. A simple operand fiel d contain?

only one .expression* but an operand field ..with _ subf i«4 ds-;

contains an expression- in. each -subf i-el-d-. An- expres-sion.

consists of a term or multip!e terms connected bv operators,
and an expression can include any of the followin g tvpes of

terms:

1. Decimal number. Any series of digits (0-9)

starting with a nonzero digit is recognized as a decimal

number. The value must be unsigned and in the range 1

through 65-535 (i.e.* an unsigned 16-bit value).

2. Octal number. Ant series of octets (0-7) starting

with a zero is interpreted as an octal number. Octal

numbers are permitted to OCCUPY as many as 16 bits

(including the sign bit) because users sometimes find it

convenient to code 16-bit constants as octal values.

3. Binary number. A ""/." prehi:-: character followed by

a series of bit? (Os and Is) is recognized as a binary

number, Binarv numbers can be as large as 16 bits? so users

can specify ful l 16—bit values in binary if they are so

4. He'-.adecimal number. A series of hextets (0-v> A-F,

or a-f) that is prefixed with a "V is interpreted as a

hexadecimal (hex) number. Hex numbers- like numbers in

other bases? can-contain as many as 16 bits»>.so a hex: va.l ue

can contain as many as- four hexte.ts. , __-._- • -- - —
5. Present-location symbol. When an asterisk ("#") i?

used as a term* it represents the value of the assembler- s

location counter? which is always updated as the last order

of business when an instruction is assembled. The value of

the present-location svmbol therefore i^uals the address of

the current instruction, and for a two-word or three-word

instruction the value of "*" is the address of the -fir-jt

word of the instruction. Mfist users of ordinar-i two-pass

assemblers tend to avoid using the present-location Si-rnbol

except in special circumstances since the use of "•»-(-" or

"•*—" is an extreme 1 Y poor programming practice. For

e.-.ampl e? am one who codes an instruction such as -JMh' #+S is

making his or her program hard to read and hard to maintain.

If anv intervening code is inserted (or- deleted) after the

•JMP -*+5 and before the tarset address of the Jump - the

program wil l no lonser operate correct!v. however? since

the One-1 ine Assembler cannot accept labels - "<-\-" and "•*-"

addressins is useful durins debusging sessions.

6. Single A'dCII character. A singl e ASCII character

enclosed bv or preceded br apostrophes or =iuc.tatiori marks

<e.s.> "A" - "A", -A, or "A) ma,- be .used as a term, The

value that is generated for the quoted character is the

eight-bit ASCII code for the character with, J:he_ paritv bit

reset.
The terms of an expression are combined (using 16—bit

operations) according to the expression's binary operators

in let t-to-nght order with all operators having e^ual

precedence-. and the following binary operators are

r e c o g n i z e d '•

+ Additio n

- Subtraction

*• M ij 1 111= 1 i c a t i o n

/ In t-e g e r D i v i s i o n

.AND. Logical AND

.OR, Logical Inclusive UR

.XOR. Logical Exclusive OR

.MAX. Larger of Two Signed Terms

. MIN. Smaller of Two Signed Terms

.ril. Larger of Two Unsigned Terms

. LOisJ. Smaller of Two Unsigned "ierms

.LSR. Logical Shift Right (Zero Fill )

.ASR. Arithmetic Shift Right fSign Fill )

.RuR. P ota te Rign t

,ASL. Arithmetic Shift i_eft

.ROL. Rotate Left

Addi t i onal 1 -,-•> a single unary operator ("-•-•• or "-") ma r

appear at the beginning >->f an e:-. press ion •> and the unary

operator wil'i be applied to the first term 01 the

e -:pres s i on .

Note that the assembler can tel l by tne synta.. of an

expression if an asterisk <"*"; i-s being used to denoce

multiplication or the present—location =vrnbol.

The One-line Assembler computes -the- -val ue~_af__.an.

expression from left to right with equal precedence for al "I
operators. For example, the expression "4

 J.-b/2~4*3"

evaluates to "9/2-4*3", then to "4-4*3", then TO "O-s-3", and

finalIY to zero. Notice that integer division is performed,

and the remainder, if anv* is discarded. Since an

expression is evaluated from lef t to right - Par en the ses are

not mean i ngtu ! and are not all'~u.ied in an V-'^FP ;ss i on .

3.3. One-line Assembler Pseu-Jo Instructions

Like most assemblers' the One-line Hssemt-ler r ec.-.sni zes

some pseudo instructions, Pseudo instructions, which are

s o me 11 mes calle d as sefnDl e^ d i rect i vei - don t !ji>uai1r

correspond to machine—1ansuase insrructions on a one-to—one

ba&is as nor-Tial assemol f-'\ ari3u^.3e inst' uct3'-n= ao. Jnstsada pseudo instruction ma • tel l the assembler to tat-'e some

action, to the user directs trie asseint-l sr s operation

through the use of pseudo instructions, The re'nain-Jer of

this section contains descriptions of th; various pseud.-,

i n s tru ctions,

PCS. The FCB ^F^rm Constant B'.'te) instruction tell s

the assembler to evaluate the operan-J ^.-pr-=-s?3 on into an 3-

fcit value and to generate an object woro tnat contains the

8-bit value of the expression. , Th.e FCB instruction is thus

used for creating constant values- -that can" be" accessed by

the program at execution time. It the value of an FCB
expression field does not fit proper lv into y bits - the

assembler reports an error message.

The PCS instruction permits multipl e expression fields

separated br commas? and each expression fiel n senerat-ir one

word of nb-ject co-l^. The location counter is advanced aft^r

each expression fiel d of an FCB statement is evaluated.

rh-sref ore - the ! "cat i on— coun L~er svinoof '»"*") in -in FLB

instruction aluiavs refers to the memo!"-, adores? of ~h? wore!

that is oeins venerated b'r the e'-'p^-esiion that contains the

location-counter symbol .

FCC . T h e h L C ( F o ' m C o n s t a n t C h aracters^ i n E r r- u c 1 1 o n

tell s the assembler that the operand field contains a

character striae. The srrins must f-e enclosed beta.;eer. TWO

identical delimiters- , each be ins a sinsue nonblank printaole

character- ,

The fullowin s =• amp'.-? illustrat e wa .•? to code strmss

with the FCC instruction:

"Tr i- over -•• thins ,

-ou can."

'? D o e s • J o h n s o w i ;" h u 5 ?1

WIf music be the food of love? pla r on.w

D !#$%?<" <)_*•*• Trv -trv trv go so 30© hope YOU .win !.i!D
26

The FCC statement generates on-? object word for- each

character of the string (not includin g the string

delimiters* of course). The FCC statement is used to

generate character strings that are normally used by

progr ammer s For >'<u CPU tt ins messages or >•< e a d i n 3'i at e:.ecut ion

t ime.

Althoug h if i . iionnlaii! - character m^'i be used as a ?t:'3ng

delimiter ^ most FT ogr arnmer? use quotation marks (") as

string delimiters , A p r o g r anrr-e ~ u- n o wishes -c o i n c ! u o e a

quo tar ion mark a? a character nf the string or 13 mar 11 'f u^e?

apostropfies ('5 ?.s =tr-in g delimiters'. A usar wtio wishes to

include both quotation rnan-'S anu apos tr OFhes in a string

usual l'i chooses some other spsrial cl'iaracter <such as '» $1

"'., ;?-<, =, ; , +, <- - -, /, or ":-'; a s a string delimiter.

The Ona-lin e Assemoler carefu l 1v examines the string

that appears luit n an FLU statement? and it reports an error

i <- an'i-thinp 5-rears to f> - arr.iss lUitn tiie spring . ~or

evample? the line-line Assemoler report.- an error if a

nonblant character iinme^ i-ite 1 i fo1 lows the closing string

del imiter because the user probab!'.- tried to use the string

delimiter as a character in the string in this case. The

•One-line Assembler also reports a'n error i f- it • never _£inds

the closing string delimiter, and it simi-1 ar-1 Y- .r-.eFoc.ts an_

error i-f the string is
FOB. I he FDy (Form Doubl e Constant Bvre > instruction

is similar "to the FC3 instruction, but the FDB instruct ion

generates a 16—bit constant that forms tujo consecutive

object words. The most-significant half of the 16-bit

evpr-.-jssion v,ii ue is put into the first object word- an.3 ~'ne

1 east—sign i f i cant halt - of the 16-bit e -.PI es si ~.<n value is put

i nto the second ob J ect uor d »

The FDB instruction tell ? The One—line As seme. ] er to

evaluate the operand expr 2? 3 ion into a 16-bit value and •••:•

generate ttuo object words that contain the 16-biT value of

the e • • p r e s s i o n . T h e F D3 i n s t r u c 11 o n is c n u s us ^ d f o rgenera •: i n<3 doubl 5 — precisi or, coustarit values that can be

accessed bv the r=rograrri at e- ecution rime.

The FDB instruction permits multipl e e -.FT essi on fie las

separated b i commas- and each e-:pressi'T, field se.-ierate^ tujo

IL! o r d s o f ••• b i •? c t c o d e . l" h i 1 o c a 11 o n c •:• u n t 5 r is a d v a n c e d

after each >y p i-.-. = 31 o n fiel d >-< f an FiJB s tav 3 me.-, t 33

evaluated. Th i-p-;f or e , the 1 o cat ion —counter srmbol ("*"i in

an FDB instruction aluM.'s refers to the men-iorv address oF

the first word that is bsing senerated b'i the e: pre= = ion

that c o n ta i n s t h e 1 o cat i o n-c o u n te r s-rmb o 1 ,

SKI. The SKI (Skip 1 word) instruction 't'ells the-iDneline Assembler to generate a one-word instruction that wil l
skip the next one-word instruction during execution of the

assembled (user's) prosram. BY employing this instruction

(as opposed to a branch instruction) the programmer wil l

save one word of memory. For example> the followins

instructio n sequences execute the same wa i- - but tne cooe on

the risht uses one less u=o; d of memory:

BECX DEX DECK DEX

1H STAft 0, X SfAA

The generated opcode value ($85) for the SP1

instruction is the same value that is generated For the

first wore of B two-word BITA instruction with immediate

addressing. When the SKI instruction "-.s executedtheref ore-> the microprocessor taKes the following woi-d as

the second word •:> f a BITA instruction ijith immediate

addr e= ss ins. The Kiev effect is to ?'*. it= one word. As a side

effect, the 'ih-'l instructio n ma. modif • t.-.e ;'-! bit - t^e i n \ t. ,

and the V bit of the condition cooes.

SK2. The SK2 (Skip 2 words) instruction 12 ! "'3 the

assembler to generate a one—word instruction that causes tne

next two memory words to be skipped at execution time.

Similar to the SKI instruction?, the SK2 instruction saves-
the programmer one word of memory. For example; the

following instruction sequences execute the same war* but

the code on the right uses one less word of memory!

BRA IF SI-'J

LOOP ADDS -^ Ul'UP ADDS =4

1H STAB 2, X STAB 2, X

The opcode value <$SiJ) tnat is gen-rated for the ':K2

instruction is the same value that is generated foi the

first word of a three-word i~PX i ns truct i un ujitn immediate

addressing. When the SK2 i ns tr i:ct i on is executed,

therefore? the microprocessor takes the followin g two words

as the second and third words of a CPx instruction with

immediate addressing. The net effect i-- to skip fujo mortis.

The SK2 instruction mar tliere^ore c-e used to skip two

s i n=i I <=•— wor d instructions or one douD 1 -'•:— uior •! instruction

durin g program execution. As a =3 cU effect- the SK2

ins true c ion rna'. rnodif . the N bic ? the L bit , ti--e VJ bit - and

the C bit o t- the c o n d i t i o n c o d e s .
The One-lin e Assemble r translate s each sourc e lin e into

the prope r rl6:3OO inachi ne-I any uase coa s 5n>J stoi-? r ic inx.'<

rnemorY on a 1 ine-b i—1 ir-e b-is1 _- at The cj.in.5 u-": er.tr,-. in

orde r to displa y an ins truc t i >->n ? tii e mac in n-r cod ? musr he

d isassefnt'l e'l- arnj t»-,.;- i n.?tr'je t i on .Trr-er-'or. i ^ ^.nd ..«^.=r^.h.j3 -ire

displaced . ThoE i jobs- o isassemo 1 i ns ma chin e •"•:• aes ana

d i SP! a'fins iiistr ijc t i ••"•• nnerr.on-i •: ; and ...F?r unil ^ - ar r don e bv

the One —lin e Di = n5 = einc.i er .

The One-lin e Di sassemb 1 er increase s "ro3ra:r. r-eadat i "i i t'-i

whe n the user chec'r-s his or her pr-z-sr an-i in .Ti^mor t. Tne

disassemble d sourc e lin e rT>ai not- however- loo k identica l r o

the sourc e lin e that wa s orisinail' i enters tor- the

instruc t i fin . The disassemble r ^iii'ai'S ourputs numerica l

value s in hexadecima l p>rscedc-d b'r a "*" si an. For e::anip'-;-

LDX 3+f.f>4/i:- X

d 1 3 a 5 5 e III b i « 5 t O

LDX *10, X

The disass imc-1 er cannot output laoets. It outputs the

value of a label instead of the character .str_ln=t of> the

label. For example > the following sour'ce" 1 in-e - is-asseiru:. Veobv the- M630O assembler on the VAX:
STX SAVEX The address of SAVlfX is -fclOG,

This instruction disassembles to

STX $108

When an instruction uses the se i f-r -. "i at A v-r addrrs?in?

mode? the d i ^assombl er d i ? p l .i'-~ ; tr.e actual he .ad>2cir''a'i

address of tlv? dest inat i f?! instesd o-f d i?p i a ri 113 rh?

d i s F 1 ac«!7i'5fi t b-5 tvj-sen this i ns t r >i--11 on and l~u^ v-.r .->•; c

address. For- e .sample? the followin g source line is

«

assemble o b ,- t h <- f1 o 3 0 O a s 3 e m b 1 e r o n t h c- ' •' A," :

BRA LOOP The address of LOOP is i!„:'.».)

This instruction disassembles to

BRA $1200

Also- for some instructions? there ar? two valid

mnemonics for the same oner at in-3 ."ode? and the disasieinb I e--

ma i- choose a *orm different from the one orisi nal 1 ~i ent rr-5-d.

For exa'TiPl * i

a. B1TA with iir.med lat =• address i r,? is returned for

sr. i.

b. CPX with iminediate adaiessin g 1= returned <:or

SK2.

c. BCC is.returned for BHS.

d. BCS is returned for BLO.
Anv invalid rViyOO operating code wil l be d i SP i a r^d in

the following wav! "FCB ^machine coae> "" for exarnp I e,

FCC "ABODE"

disassembles to

FCB $41

FCB $42

COMA

L.SRA

FCB *45

Sine* the One-lin e Uis a ssernb 1 *•• is ofte n used wit h the

One—lin e Assembler - we sncul d e_-r=e ~ 13.1 1 v ri'"ite oi>e p-ir ci cu I-ir

situation . Suppose th^.t tl'ie usor t'ipes the fol !.:-knri3

instructio n as an inpu t ^o I'r.e One-lin e Assemol^r:

Fi'B 1,2,3-4

The instruction 1 ?nsth fot tMs pseudo instruction is

four bvtes. The valu e four Is ther e fnre stored int.j the

LENBUF area after this HI =-u.io i nst r u-' c i or, has bee'', processed

b'r the One-line As jernfcl er . Suppose that ^he user con 11 nues

to in^ut new a?semb"! v-1 ansuase instructions or to check his

or her Program at subsequent 1 ocac i'"-ns in a forward

direction. Later on, the user uses asterisk ("*-";

terminators to .back UP to this pse.udo instruction*-- arrd- a-- NOP

assemb 1 r-1 ansuage instruction is , disp] y.'ed... _at tne- u-ser'-sterminal. This NOP instruction-Appears because the va.l ue
$01. which is the value of the first byte of l;he four-b.'te

FCB instruction* is the opcode for a N'jP instruction. Th =

One-line Disassembler sees the $01 and assumes that it is

the opcode of a NOP assembl ••.— language instruction. The usercan continue to check the contents ft- the FCB pseudo

instruction's memor", locations bi t-i^ins car nase—retur n

ter m i

The FCB 1-2,3,4

disassembI as tn

IMUF

FCB 502

FCB -503

PCS $04

The One-line Disassembler is a ver f useful

tool, but the user stil l needs to nave a clear idea aoout

his or her ousn progr-arti. F-'T 2 ample- a user usho tries to

cJ i sas serrib '• e a strin g •', t- A'~ C 1 i cnar a-:ter 5 uil l

c o n I- u s i o n .
Chapter- 5

The Applicatio n of the One-1 me

Assemb l er /Disassem&l er- in MUDBUG

As mentione d in t..'-iapter 1> this One-1 in; Assembler /

Disassemble r softwar e PS c^as-? is cies ignea ror MltDB'-JU to

incr-r3.se the functionalit y of .-ercain fiuDBUG cornrnands . Whe n

a sourc e pr-osrairi 1= assc-rr.tleo ar.<.l dou.inloa.aed to memor r? wnat

the user sees in memorv is the machme-lan3U4.se version of-

\

the Fro9raiTi. it is sorr.ot imes difficul t foi The user to

understand and debug hi^ or her program in machine lansua^e,

B

-, using this One —lin e Ass =-^t-1 er.' Di sas sernD 1 er sorru.:are

pac'r.age3 the user can inspect his or her pro-3ram in memorr

and change the pros ram t-'f simplv t'.-ping as = ernb 1-, - I anguage

instructions direct!-- instead of typing machine codes. The

following tuo sections describe the application of the Oneline Assembler/Disassembler in the memorv—chanse (i.e.7 "C")

command and the msrnor .-—dump 'i.e.- "rl"> command of MUDBUC-.

5.1. The Applicatio n of the One-line Assembler/

Disassembler in the "C" Command

The origina l "C" command* which has one parameter 7

displays the .current hex-value- of the contends, of -rrrsiriorv

location START, and then it accepts a"new "he?r-val ue -to beinput into that Ideation. The user can read his or- her
program in machine language and modify the program b f typing

hex values. After the One-line Assemb 1 er/Di sassemo 1 er

software package is applied* the "C" command, which stil l

has one parameter* displays the current assembly-language

instruction that starts at memory location START. Tnen t-he

"C" command accepts a new assemc-1 .-- I ansuase instr u.-. T \ on,

asse.nb 1 es it to machine language, and puts lh= machine code

if the new assemb 1 'r-l ansuase instruction 15 terminated

bv a carri5.se return sxtitn no other ten mi nat i ori character,

the On«— lin e fis^embl er / Disasserrib 1 er aur onvat i cal i y continues

the "C" command bv set bins START

 :I --- START -t- ( i nz tr uct ion

lensth) and per forming the "C" command s hunction For the

ne . :. t instructi o n i n me rn o r •. . T h & n o t a 1 1 o n " ( i n s t r u c 1 1 o n

lengthJ" as it is used here means the length of the nsu

i r, s t r u c 1 1 o n - n o t t h e 1 e r i x t h •:< f t n a o Id i r. s t f- u c 1 1 •:• n » ifi fi e

user doesn t tvr=e a ne'jj instruction - nouiever ? the o i o

i iistruct 3 on ir used as rlis neu> instruction.

I F a comma terminator is used to terminate the new

assemb 1 y— 1 anguats? i nstr-uct i on for location START, the Oneline AssernD 1 er/Di sassemb 1 ^r >uil l keep the same value in the

.START "parameter without... changing it. T-he.n- the-- One-1 ine

Assembler/Disassembler mil 1 perform— -tlte----- "C" - --"command -'s

function again for the same START location in memory.
If an asterisk terminator is used to terminate the new

assembler—language instruction t-or location START- the On*--

line Assembler/Disassembler sets START < START

(previou.s instruction length) and automatically performs the

"i."1 command's Function with the precedins instruction in

memor-i-. The AsserTib I er / Di sassernc. i er remembers the lengtn? 01"

as many as the last .-.<"' instructions' that have c<een inpub or

e a mined with the cui r-^i(t ir. v'oca fion >:•* me "C • ._.:..7. IT-J o c«,

The user can therefore use the "•*•" terminator to oac^: UP OT

as man r as 20 instructions or to tne or i sin a I STAFiT ad cresswhichever' occurs First, An attempt to b^ck UP be.onij either

limi t causes the "C" command to sta, oil the instruction at

tne 1 iiru t.

if the neu.i assembl .— lansuase instruction is terminstad

br a period) the "C" command returns contro l <:>•• the to? of

MUDBUG after it install s tn-c ma en me code of tne new

assernbl i-language instruction.

/

Fma'ii'i, if a so lid us ("/") terminator is used, th =• "C"

command is aborted and control returns at once to tne top of

rlUDBUG with no change to the contents o+- locations starting

at START.

If a termination character <CR * •> . or /) is input

alone without a new assembl Y-lran3uase instruction* the
contents of the memory locations remain unchanged* but che

function of the termination character regarding the

continuation or termination of the "C" command is stil l

effective. MUDBUG uses the instruction length of the

existing instruct ion in memory when the user uoesn't type a

new instruction. Users can therefor-? examine fevei-al

consecutive instruction? rather conveniently bv us ins

carr lase-r-etur n or asterisk terminators, and they need to

type new assembl.—lansuase instructions only when new

assembly-language instructions are actual 1'. desired.

The cor.fTia^ periods asterisk* and solidu s terminators

are different from the carriage-return terminator. The user

who f-i pes a comma; periods asteri.?!-- or solidus terminator

must stil l trpe a carriage return after the comma- period*

asterisk, or solidus. When :.ue refer to a carriage-return

terminators therefore* we are\ actual! .' ref -?rri ns to the lack

of anv special termination character immediately preceding

the carriage retur n that alwa.-i cer-rr, i r-a ces the input line to

tne One-line Assembler.

The user can correct e.'tansiv^ f. PH.S errors, b". typing

a backslash ("\") to rub out the encire input line before

the carriage return is typed to terminate the,i,h.put line to

the One-line Assembler. Then the user-...can __t.yps, another

assemb 1 y—1 anguase instruction ri'ght after th-s backslash
character. However? the recommended procedure is . to t". pe a

backslash followed bv a comma followed by a carr-ia.se return

before restarting the input line.

The Ons— line Assemh ! er/Ui sajr ^emo ! en *. I 1 ow= the user to

correct trPin^ errors bv us if 1-3 the b-iCr's 1 ash as many tinier

as desired. The user must t". pe an entire new assernol "i —

language instruction inrTead of typiny PHT^ of t!•,-=• a s s e m.-. 1 flansuase i n?truc.t lor, aft^=M•• the bacj-slasn is tvpsd. Ones th^

can be riiade.

The user can correcc nunor- Li-t-in s -=Troi-p. t>v t-i'Pins

backspace char-4 •: ter ( s K Wi-^n th\j user t , pe ? a backsp-i-t^T

the One-line Asseinc-lir deletes ofe xnput character and

erases it from the screen of che user * terminal. The

cursor is left in the position of th=- character- ~nat mas

erased. The user can use r-a-ir space c'iar s.cter 3 TO -;r^.je

input charactsrs. r e »:- a t e d 1 i M 11" i 1 the ^ i. r i r e j. n •= • \ ~ i i i i i n ^ =

been erased, AKter all input characters have been eras^athe One-line Assembler refuses to accsi-r additional

backspace characters anu rejects them o , rin^iiis tne b«r I I at

the user-"s terminal.

The user who wishes to erase a tap character from -an

input line is advised to use a backslash- to delete the
entire input line instead oh trvins to use a backspace to

delete the tab character. The One-line Assembler doesn't

adjust the cursor position to account for the possible

multi-column aspect of a tab character that is deleted-) and

the us--r who ueletes a tab char a<- ter uiich a La«:k jpT.ce ioa r

becorr.e confused b .• the irn ?."! ead i n& inf c-rmat 3 i'.n that Appears

o n t h e s c r e e n .

The One-'! me Assembler accepts a iria:-:imum of S'.' input

character? on a sing],? input" line., After SO inpMt

characters hava been acc.-pteo into the input ouffer? the

One—line Asseint "i *r refuses to ac':5P-r an r more input

characters and rejects arrv additiona l input character- bv

ringing the bel l at tne user s terminal. !~h\- onl'i

exceptions to this rule are as follows . The One—sine

Assembler accepts a backspace or ^ backslash even uhen the

input buffer is ful l because tne?e input char act ;r •=- remove

characters Frorr. the input buf-;-er. Trie One-line A--;errib 1 or

also accepts a carriage return mhfn the inpnc biji-t-c-r is ful l

because a carriage return terminates tne input line.

5.2. Th.5 Applicatio n ut ti'ie One-line As =<?ir,r' 1 51 /

Disassembler in the "!*!" Command

The origina l "M" command requires two- par-ameters?--and

it dumps locations START through STOP in hexadecimal format
4O

to the terminal. The memorr dump actual 1 .' starts 'tilth the

location whose address is FLOOR CST ART/16 J<-16, so the

hexadecimal memoTV adaress of the fir*!: njmrd of tne dump

al'wavs ends in rero. The memory dump is printed with 16

values per lin e (e'-'~epfr possib l r for me last line - which

inav be shorter )> and it 1 = formatted for ease of

readab i 1 11 i'. Alsn, the rrn;mo,^ , aodres? •"' £ the <-irst value on

the tin e i.- prin t = u a I th^ L-^? in runs 01 sacn line . tjnat

users see on the termi nal are me 'Tiachme cooes of the

I

I con t e n t s o f '! •.> c a 11 o 11 s S f A!-' 7 r i i i • o u «i i S T 0 P r

t

: A^ter tne One-line A^yefni.. 1 ?r ''Ui 5-a.sserio 1 ?r so ft ware

p.act-age is applied in the "M" conv.nai'ai the "M" cominand still

requires two Parameters' and i * dumps 1 o c -a. 11 o n s 'START

i

throush STOP in assemb I-i - ! ansijase instruction format to the

terminal. The memor . dump i r spirited wiirri one assemb 1 v —

l;anguage instructio n per line - and the memor-i- address of

each a s s e rn b \ i -1 a n g u a 3 e i n s t r u ~ 11 •:• M i •? p r i n t e d at t n e

beginning 01- .-acn line. if ':• TOP is i r. The middl e of an

i

in tr uc 11 on 7 the "P!" command print s the entir e instruction

I

instead of truncating rhs instruction. Truncatins the

i n s t r u c 11 o n w o u 1 d c •:• n f u s e t h e u •; e c - =• '~> f n «•:• real s t o P p i n 9

location of the "M" command is STOP or '=• rOP+i or STOP+2

Depending on the instruction leng,th of the last instruction

ipracessed. Control returns directl- , to the top of MUDBUG
41

after the assemb1v-1an9ua=>e instructions from START through

STOP are printed on the terminal .

The output of the "M" command is illustrated bv the

followin g sample memo?- ,• duniF.

Sarripl e Dump

2UU'J 7F O073 CLR sO'J75

2O03 36 01 LDAA =<50l

20O5 B 7 SUOS STAA $8008

2UO3 B7 F80U STAA sFtf'X;

200"B CE UOSO LD". = 5^0050

200E 6D 13 TSf $i3, X

2010 26 05 BNE *2O17

2012 A6 12 LDAA "51.2, X
Chapter &

Conclus ion

One—1 ins Assembler/Disassemoler software package* the source

svntax» expressions^ and pseudo instructions of the One-line

Assembler, the One-line Disassembler svntax> and

applications of the One—line Assembler/Disassembler to the

existing functions of MUDBUG.

The One—line Assembler/Disassembler software package

has following restrictions:

a. Labels and line numbers are not used. Labels are

commonlY used in assembly language to refer to

other lines and locations in a program. The Oneline Assembler has no knowledge oF other program

lines and therefore cannot make the required

association between a label and the label

definition located on a separate line.

b. Source lines are not saved. In order to read back

a program after it has been entered* the machine ",.-.,. .--_'.-

V*-:'\^4^f?^M:ode ."-

 <T is\'Vdisass^mbTeHtlf-^d^

".~"7._. _: ^ mnemonics and-operands.;.•_ ' - :"_:r\V."~ JZI" '

'^Sft^S^fe "\ S?^-§SS:

."jv>*'Wi4B4raf;lV.^J*t-»A15''*?»-*;r'''. •^•--."'•••v -"2^4. »'^<^'--3ii^-:¥!;',rt-':gfe^i-«i-f-?.:,'Ji'is£ ixj^t^ns^esi^ySilwsSrfj^jMapi

>

'^J«.JS."Aft?iSv. 5^-3:--*-;—. ^- ,-.

-^ * — -- 'J::^-.~.<r.~-~-Y- -/-?>,.;>

icSSi^^^S*^g=SSfeHfei^^

?Mffl

_ i§S£aii^|A

•»Mia

£s?iy*m*m*s£iti_ —*^-K C.T>*. -^ J-j
43

c. Limited error indication. The One-line Assembler

shows only one error message* "INVALID^ the tunole

input string", to the user. In contrast the cross

assembler generates specific error messages for

different tvpes of errors.

d. Onlv a few directives (pseudo instructions) are

accepted.

e. No conditional assembly is used.

The One-line Assembler is a true subset of the 116800

cross assembler. The format and syntax that are used with

the One—I me Assembler are acceptable to the cross

assembler. The One—Iine Assembler/Disassembler is a

powerful tool for creating? . modi fvins> and debugging Mt-800

code.
MC68000 Educations"! L-r-rr.FUTer Uoa; d User s

Motorola Inc.. 19G2.

David C. Ph^anir- ^UuL:-.!:_•-,.: • u._ ...s;r = Masi-j

D^partm^nt o F ConiPU't^f- Sc i iriC =•-

Arizona Sc^ta- Uni'-<&r= i r-i - l':':.-.if.

Davi'J C . Ph-sanis? M6800 r^ssor.n:-- =;?• Li^.Tf ;

Department of Lomput-sr '-• >~ i^ 1-1 c = -

Arizona State- Univ^r s i'"i s i'':3i.

David C. PK^anis, MUDBUG-j ':...!ji-.i:- f-r-,.,sr-ar.'

Department of Computer ici-rnc;?

Ariz o n a 3 c a t e U n i v -5 r s 11 •, , i':' a 3.