You are on page 1of 24

UTILITY I/O MANAGER V4

for MC6800/MIKBUG Based Microcomputers


by D. R. Sentz
June 2015
1. Introduction
Over the past year I developed this program for my homebrew
MC6800-based microcomputer, to facilitate binary and text file
transfers among the following equipment;

Kleinschmidt AN/FGC-25 teletypewriter set


Audio Cassette Tape ("Kansas City Standard")
MacIntosh 512K Computer running MacTerminal 2.0
Windows 7 PC running Tera Term 4.86, with TRENDNet TU-S9
USB-to-RS232C adapter

I developed the program as three "modules";


UTMGR4
TTY4
READTTY

-Text I/O between Mac and PC, Mac and audio tape,
or PC and audio tape, or
-Binary I/O between microcomputer and audio tape
Adds output to teletype set from text buffer
Adds input to text buffer from teletype set

You can load and run just UTMGR4.OBJ.txt, or UTMGR4.OBJ.txt plus


TTY4.OBJ.txt, or all three programs at once, using the file
UTMGR4_TTY4_READTTY.OBJ.txt.
TTY4 installs patches to UTMGR4. READTTY installs patches to
both UTMGR4 and TTY4. Therefore, the programs must be loaded in
the order listed above.
Memory assignments (in hexadecimal);
Program
I/O buffer space
UTMGR4
1C00-1F71
0000-1BFF binary (7 kbytes), or
0100-1BFF text
(6 kbytes)
TTY4
0000-0088
00F6-00FF
1F72-1FF6
0100-1BFC text
(6 kbytes-2 bytes)
READTTY
0089-00DF
1B00-1B8E
0100-1AFF text
(6 kbytes)
If you load only UTMGR4 then you can read and write either text
or binary data, in the range 0000-1BFF, from/to audio tape, but
you cannot communicate with the teletypewriter set.
1

2. Starting Utility Manager from Windows 7 PC


A good ASCII console terminal emulator for this system is a
Windows 7 PC running Tera Term 4.86, and using a TrendNet TU-S9
USB-to-RS232 adapter.

Attach the TrendNet TU-S9 USB-to-RS232 adapter to PC.


Make sure RS232 cable is attached to microcomputer.
Start program Tera Term v4.86 (in Start menu).
Select serial COM3 port and then "OK".
In the "Setup" menu, "Restore setup" TERATERM6800_72.INI.
Turn on the M6800 microcomputer.
Press the Reset button on the microcomputer.

The MIKBUG asterisk should print in the Tera Term window;


*
Make sure PC keyboard is in CAPS LOCK mode
Type the letter L;
*L

From the Tera Term "File" menu, select "Send File"


Select desktop/UTMGR4_TTY4_READTTY.OBJ.txt

The Tera Term progress window will reach 100% and then vanish
about 20 seconds before the file transmission has completed.
Just wait patiently, until the microcomputer responds with an
asterisk;
*L
*

Type the letter G


The utility manager program should start;
*L
*G
M6800 I/O UTILITIES MANAGER
?

3. Using UTILITY MANAGER


3.0 Command H, PRINT COMMAND MENU

In response to the ? prompt, type H.

?H
COMMAND MENU
LOAD TEXT FILE FROM TERMINAL..1
SEND TEXT FILE TO TERMINAL....2
TELETYPE SEND OR RECEIVE......3
WRITE MEMORY TO TAPE..........4
READ TAPE TO MEMORY...........5
TURN OFF TAPE MOTOR...........6
PRINT COMMAND MENU............H
EXIT TO MIKBUG................E
?

3.1 Command 1, LOAD TEXT FILE FROM TERMINAL


After typing the number 1, enter text using
the keyboard, or
the Tera Term "Send file" command, or
the Tera Term "paste" command.
Note that the microcomputer does not echo the text input data
when processing command 1. If you are using the keyboard for
text input and want to see what you are typing, open the Setup
menu, select "Terminal...", and check "local echo" before you
start typing, and then uncheck local echo before typing CTRL-D.
In any case, after the text has been sent you must type CTRL-D
from the keyboard to terminate the text loading process. When
using the "Send File" or "paste" commands you must wait until
the Tera Term progress window vanishes before typing CTRL-D.
The size of the text buffer is 6 kbytes when all three programs
are resident. If the text input exceeds the capacity of the text
buffer, then the microcomputer does not store the excess text.
When CTRL-D is detected, the microcomputer stores $04 in the
current text buffer location, reports the address of that
location, and returns to the ? command prompt.
Example;
?1<type "THIS IS A TEST" and CTRL-D (there is no echo)>
EOT LOCATION= $010E
OPERATION COMPLETE
?

MS Notepad is convenient and simple to use for preparing text


files to be sent to the teletype machine via copy and pasting or
via Tera Term "Send File" command. When using just the keyboard
for text input, you can arbitrarily insert the following ASCII
codes (in addition to CTRL-D) that will be mapped to their
corresponding BAUDOT codes by the microcomputer;
ASCII
ASCII
ASCII
ASCII
ASCII

$00
$07
$0A
$12
$14

<CTRL-Space>
<CTRL-G>
<CTRL-J>
<CTRL-R>
<CTRL-T>

=
=
=
=
=

Null
<NULL>
Bell
<BELL>
Line Feed
<LF>
force LTRS mode <LTRS>
force FIGS mode <FIGS>

In command 1 only, UTILITY MANAGER always writes a <LF> to the


text buffer after detecting and writing a <CR> to the text
buffer.
3.2 Command 2, SEND TEXT FILE TO TERMINAL
The microcomputer outputs the text buffer to the ASCII console
terminal.
Example
?2THIS IS A TEST
OPERATION COMPLETE
?

3.3 Command 3, TELETYPE SEND OR RECEIVE


Example 3.3-1: Teletype SEND
?3
SEND(S) OR RCV(R)?S
OPERATION COMPLETE
?

The microcomputer sends a header string consisting of


<LTRS><LTRS><LTRS><LTRS><BELL><NULL><BELL><NULL><CR><LF> to the
teleprinter. The microcomputer then converts the content of the
text buffer to BAUDOT code for transmission to the teleprinter,
until CTRL-D is detected. The text buffer content is not altered
during this operation.
Example 3.3-2 Teletype RECEIVE
?3
SEND(S) OR RCV(R)?R
THIS IS A TEST
EOT LOCATION= $0111
OPERATION COMPLETE
?

The user typed carriage return <CR>, line feed <LF>, and the
text "THIS IS A TEST" using the keyboard on the teletype machine
(the paper tape reader would have worked just as well). To stop
the input process, the user operated the line break switch
located on the teleprinter. Note that a NULL ($00) is stored in
the text buffer in response to the line break signal, followed
by the CTRL-D code ($04), resulting in the EOT location being
$0111.
UTILITY MANAGER does not append <LF> to any <CR> received from
the teletype set. The <LF> must be explicitly sent from the
teletype set, if it is desired. For example, <CR><CR><LF> from
the teletype set keyboard will store exactly as typed, whereas
if the ASCII console terminal is the source this same typed
sequence would store as <CR><LF><CR><LF>).
3.4 Command 4, WRITE MEMORY TO TAPE
UTILITY MANAGER can write the contents of the text buffer to
audio cassette tape using the "Kansas City Standard". The
microcomputer has a tape cassette interface built according to
my merged implementation of two articles in the March 1976 issue
of BYTE Magazine;
1. "The COMPLEAT Tape Cassette Interface" by Jack Hemenway,
2. "Build the Bit Boffer" by Don Lancaster

Compare to Figure 1 of Jack Hemenway Article, March 1976 BYTE


5

It is necessary to create and maintain a standalone tape


directory using paper and pen, or Excel spreadsheet in order to
manage the stored files. You must enter both the starting
address and the ending address of the data to be written to tape.
UTILITY MANAGER reports the ending address of text data after it
has been input using command 1. Therefore, for text data loaded
by UTILITY MANAGER, use $0100 as the starting address and the
reported "EOT LOCATION" as the ending address. The EOT code $04
will be the last byte written to the tape, and then the tape
motor will be turned off. Record the tape counter value for both
the beginning and end positions of the tape.
2ND TAPE, SIDE A, LABELED "BIT BOFFER 2"
TAPE
COUNTER
007-010
010-013
013-016

PROGRAM NAME

TYPE

SHOOTINGSTARS
SHOOTINGSTARS
SHOOTINGSTARS

BINARY
BINARY
BINARY

START
ADDRESS
0000
0000
0000

END
DATE
ADDRESS
0243
JAN. 7, 2015
0243
JAN. 12, 2015
0243
JAN. 14, 2015

016-018.5

SHOOTINGSTARS

BINARY

0000

0243

020-023

QST_MESSAGE1

TEXT

0100

037A

023-052

RIBBON_GO_ROUND1

TEXT

0100

1AC4

052-070

RIBBON_GO_ROUND2

TEXT

0100

0FD6

UTILITY

NOTES

UTMGR3 BEFORE FIX TO LAST BYTE WRITE OP


UTMGR3 AFTER FIX TO LAST BYTE WRITE OP
PUNCHER2 AFTER FIX TO LAST BYTE WRITE OP
RE-TEST AFTER I'FACE REMOVED FOR
JAN. 15, 2015 PUNCHER2
PHOTO AND REPLACED- PASSED
TESTING BIT BOFFER AND TAPE
RECORDER FOR WRITE AND READ
PASSED AFTER I UNPLUGGED
MAY. 03, 2015 UTMGR3
"MICROPHONE" FOR READBACK.
VOLUME=4 (UPDATE 3OCT2015VOLUME=6 WORKS TODAY)
PART 1 OF RIBBON_GO_ROUND.txt
4-Oct-15
UTMGR4 VOLUME=7 WORKS BETTER
PART 2 OF RIBBON_GO_ROUND.txt
4-Oct-15
UTMGR4 VOLUME=7 WORKS BETTER

If you load and run just UTMGR4.OBJ.txt, then the memory range
that can be written to tape is from $0000 to $1BFF. This can be
handy for storing binary data, such as other programs and games,
in addition to text. Otherwise the available memory range is
from $0100 to $1AFF.
Example:
?4
START ADDRESS=?_$0100
END ADDRESS=?_$037A
POSITION TAPE, PRESS PLAY FOR READ OR RECORD FOR WRITE
WHEN READY, TYPE A TO ABORT, G TO PROCEED:_G
OPERATION COMPLETE
?

3.5 Command 5, READ TAPE TO MEMORY


If using the Panasonic RQ-212DAS tape recorder, a volume control
setting of 7 seems to work OK. This is very loud.
UTILITY MANAGER does not report when read errors occur during
command 5. When the tape spools stop, check the tape counter. It
should match the tape counter end-value recorded in the tape
directory. If the spools stopped prematurely there is some
problem with the audio quality, such as poor connections or too
low or too high volume setting setting.
The example below was
file that was written
"BitBoffer2", side A,
directory on previous

generated 03October2015 using the text


03May2015 to the cassette tape
at counter locations 020 to 023 (see
page):

?5
START ADDRESS=?_$0100
END ADDRESS=?_$037A
POSITION TAPE, PRESS PLAY FOR READ OR RECORD FOR WRITE
WHEN READY, TYPE A TO ABORT, G TO PROCEED:_G
OPERATION COMPLETE
?2
QST QST QST - FROM RANDOM73
TO ALL RADIO AMATEURS AND RTTY ENTHUSIASTS
8 APRIL 2015 12:35PM PDST
INSTRUCTIONS FOR PRINTING ASCII TEXT FILES ON TELETYPE1. PREPARE MESSAGE USING MACWRITE.
2. SAVE MESSAGE IN TEXT-ONLY FORMAT (FILENAME.TXT)
3. RUN MACTERMINAL 2.0
4. TURN ON HOMEBREW MC6800 COMPUTER RUNNING MIKBUG
5. MIKBUG "L", THEN SEND FILE UTMGR3.OBJ
6. MIKBUG "L", THEN SEND FILE TTY3.OBJ
7. MIKBUG "G"
8. UTMGR COMMAND "1", THEN SEND FILE FILENAME.TXT
9. WHEN MACTERMINAL CURSOR REAPPEARS, TYPE CTRL-D
10.TURN ON TELETYPE SET
11.UTMGR COMMAND "3" SHOULD START THE MESSAGE TRANSMISSION
-73
END MESSAGE
OPERATION COMPLETE
?

3.6 Command 6, TURN OFF TAPE MOTOR


Error condition 1: If, immediately after typing "G" during
command 4 or 5 above, you see that the tape spools are not
turning, then you most likely 1)forgot to press the Play/Record
button before typing "G", or 2)the remote plug is not connected.
Error Condition 2: If, during command 5, the spools continue
turning and the tape counter value goes higher than it should
for the file being read, then there may be an audio quality
problem.
To recover and start over, do this;
Press the Stop button on the tape unit.
Reset the microcomputer to get the MIKBUG prompt.
Load $0C00 to memory locations $A048 and $A049.
Type "G" to restart UTILITY MANAGER.
Type command "6" to clear the motor start signal.
Fix the problem and then try the command again.
3.7 Command E, EXIT TO MIKBUG
If you use the reset button to get to MIKBUG then you have to
reload the starting address of UTILITY manager to locations
$A048 and $A049. I implemented this command to provide a more
graceful transfer of control between UTILITY MANAGER and MIKBUG.
If "E" is used to get to MIKBUG to do stuff that does not upset
the integrity of the UTILITY MANAGER executable, then to go back
to UTILITY MANAGER just type "G" after the MIKBUG asterisk
prompt.
OPERATION COMPLETE
?E
*M 037A
*037A 04
*G
M6800 I/O UTILITIES MANAGER
?

4.0 Additional Notes


Conversion Table ASCII_TO_BAUDOT3.xlsx is in
Dons_Stuff/2015/April2015/TeletypeStuffApril2015
September 23, 2015- patched TTY4.OBJ to change the header string
to <LTRS><LTRS><LTRS><LTRS><BELL><NULL><BELL><NULL><CR><LF>

October 2, 2015- I added a patch to UTMGR4_TTY4_READTTY.OBJ.txt;


SEPT 23 2015 PATCH TO TTY HEADER STRING
S10D00F612121212070007000D0A8F
* NOV 04 2015 MANUALLY CHANGED TTY HEADER STRING;
* LTRS LTRS LTRS LTRS NULL NULL NULL NULL CR LF
S10D00F612121212000000000D0A9D
*
An SWTPC6800 microcomputer using MIKBUG should be able to load
and run this program. The audio cassette interface uses the
Motorola MC6850 ACIA chip. The teletype interface uses the
Motorola MC6820 PIA chip. See my other reports regarding

my homebrew MC6800 microcomputer,


audio cassette interface, and
teletype current loop interface

I do not have a null modem cable for a direct connection between


the Mac and the Win7 PC. To move text between the Mac and the PC
I upload the text buffer from one, swap the MIKBUG console
terminal cable to the other, and then download the text buffer.
This worked fine for what I wanted to do, for text files up to
6 kbytes. For example, I can print the resident assembler list
file on the Apple Imagewriter printer even though I ran the
assembler while using the PC as the MIKBUG console.
With just UTMGR4 loaded, I loaded from audio tape the binary
program image of a floating point arithmetic subroutine package.
Then I exited UTMGR4 using command "E" and downloaded the binary
image to the Win7 PC console terminal, using the MIKBUG command
"P". I did the same procedure for a scientific functions package
and their demonstration drivers. So I can now load these math
utilities to the microcomputer from the Win7 PC using MIKBUG
command "L", as well as from the audio tape.
The source and object code program listings that follow were
generated by the paper tape version of the M6800 Resident
Assembler MP-E that was sold by Southwest Technical Products
Corp. (SWTPC). There are some leftover references in the
comments to UTMGR3 and TTY3. Just read them as UTMGR4 and TTY4.
UTMGR4 and TTY4 incorporated patches that I made to UTMGR3 and
TTY3 during software testing.

--PAGE

001

M6800 UT

00001
00002

NAM
OPT

00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032

A002
A002
A004
A00C
A00C
A00D
A042
A042
A048
A048

M6800
O,S,NOG

UTILITY MANAGER
SEE ASSEMBLER DOC.

E0C8
E1AC
E1D1
E0D0
E0E3
E07E
8007
8010
8011

* JUNE 13, 2014 BY DONALD R. SENTZ


* 1ST TESTS JAN. 2015, CORRECTIONS 11 JAN 2015
* 15 MAY 2015 CHANGED WTERM LINE TO LDX #$0100
* THIS PROGRAM IS A USER INTERFACE FOR SWITCHING
* AMONG MY HOMEBREW I/O UTILITIES
*
* THIS PROGRAM WAS PREPARED USING MACWRITE AND THE
* RESIDENT ASSEMBLER MP-E.
*
OUT4HS EQU
$E0C8
MIKBUG DISPLAY HEX SUBR.
INEEE EQU
$E1AC
MIKBUG CHAR.INPUT TO A REG.
OUTEEE EQU
$E1D1
MIKBUG CHAR OUTPUT FROM A.
START EQU
$E0D0
INIT (TO RESTORE ECHO-BACK)
CNTRL EQU
$E0E3
MIKBUG RETURN POINT
PDATA1 EQU
$E07E
MIKBUG CHAR STRING PRINTER
PIASB EQU
$8007
ACIACT EQU
$8010
ACIA CONTROL REGISTER
ACIADT EQU
$8011
ACIA DATA REGISTER

0002
0002

BEGAD
ENDAD

0001
0001
0001
0002

ORG
RMB
RMB
ORG
XHI
RMB
XLOW
RMB
ORG
STACK RMB
ORG
RESTRT RMB

START ADDRESS
END ADDRESS
X REG HIGH
X REG LOW
STACK POINTER
RESTART VECTOR

00034 1C00
00035 1C00 20 52

STRT

00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054

*RTERM- LOAD TEXT FILE FROM CONSOLE TERMINAL.


*POINTER STOPS INCREMENTING AT END OF BUFFER.
*USER MUST TYPE CTRL-D WHEN "SEND FILE" PROCESS
*ENDS, I.E., AFTER BLINKING MACTERMINAL
*CURSOR REAPPEARS.
*
RTERM LDA A #$3C
STA A PIASB
DISABLE ECHO-BACK
LDX
#$0100
START BUFFER AT ADDR $0100
STX
BEGAD
GET
JSR
INEEE
GET CHAR FROM CONSOLE
GET2
STA A 0,X
PUT CHAR TO TEXT BUFFER
CMP A #$4
WAS IT EOT (CTRL-D)?
BEQ
DONE
CPX
#$1BFF
ARE WE AT END OF BUFFER?
BEQ
GET
IF SO, STAY THERE UNTIL EOT
INX
ELSE INCREMENT POINTER
CMP A #$D
WAS LAST CHAR A <CR>?

1C02
1C04
1C07
1C0A
1C0D
1C10
1C12
1C14
1C16
1C19
1C1B
1C1C

86
B7
CE
FF
BD
A7
81
27
8C
27
08
81

3C
8007
0100
A002
E1AC
00
04
0E
1BFF
F2
0D

ORG
BRA

$A002
2
2
$A00C
1
1
$A042
1
$A048
2
$1C00
UTSTRT

10

--PAGE

002

00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065

1C1E
1C20
1C22
1C24
1C26
1C29
1C2C
1C2F
1C32
1C35
1C38

26
86
20
86
B7
FF
CE
BD
CE
BD
20

ED
0A
EC
34
DONE
8007
A004
1DB2
E07E
A004
E0C8
06

BNE
LDA A
BRA
LDA A
STA A
STX
LDX
JSR
LDX
JSR
BRA

GET
#$A
GET2
#$34
PIASB
ENDAD
#MFOR
PDATA1
#ENDAD
OUT4HS
GOBACK

IF NOT GET NEXT CHAR


ELSE INSERT <LF> AFTER <CR>

00067
00068
00069
00070

1C3A
1C3D
1C40
1C43

CE
BD
CE
20

0100 WTERM
E07E
1D9D GOBACK
12

LDX
JSR
LDX
BRA

#$0100
PDATA1
#MTHR
REENTR

TEXT BUFFER START ADDRESS

00072 1C45 BD 1D63 TAPOFF JSR


00073 1C48 20 F6
BRA

RESET
GOBACK

00075 1C4A CE 1E52 HELP


00076 1C4D 20 08

LDX
BRA

#MATE
REENTR

00078 1C4F CE 1D8B NOCMD


00079 1C52 20 03

LDX
BRA

#MTWO
REENTR

ELSE INVALID COMMAND

#MONE
PDATA1
#STACK
#MZRO
PDATA1
INEEE
#'1
RTERM
#'2
WTERM
#'3
NOCMD
#'4
WM2TAP
#'5
RTAP2M
#'6
TAPOFF
#'7
NOCMD
#'8
NOCMD
#'9
NOCMD
#'H
HELP
#'E
NOCMD

<CR><LF>M6800 UTILITIES MANAG

00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108

1C54
1C57
1C5A
1C5D
1C60
1C63
1C66
1C68
1C6A
1C6C
1C6E
1C70
1C72
1C74
1C76
1C78
1C7A
1C7C
1C7E
1C80
1C82
1C84
1C86
1C88
1C8A
1C8C
1C8E
1C90

M6800 UT

CE
BD
8E
CE
BD
BD
81
27
81
27
81
27
81
27
81
27
81
27
81
27
81
27
81
27
81
27
81
26

1D6D UTSTRT LDX


E07E REENTR JSR
A042 NOHEX LDS
1D69
LDX
E07E
JSR
E1AC
JSR
31
CMP A
98
BEQ
32
CMP A
CC
BEQ
33
CMP A
DD
BEQ
34
CMP A
25
BEQ
35
CMP A
2B
BEQ
36
CMP A
C7
BEQ
37
CMP A
CD
BEQ
38
CMP A
C9
BEQ
39
CMP A
C5
BEQ
48
CMP A
BC
BEQ
45
CMP A
BD
BNE

RESTORE ECHO-BACK
REPORT EOT LOCATION IN MEMORY

OPERATION COMPLETE

CLEANUP STACK IF UTINHX BAILS


<CR><LF>?

LOAD TEXT FILE FROM TERMINAL


SEND TEXT FILE TO TERMINAL
RESERVED FOR BEQ ASC2BD
WRITE MEMORY TO TAPE
READ TAPE TO MEMORY
RESET ACIA (TAPE MOTOR OFF)
RESERVED
RESERVED
RESERVED
PRINT COMMAND MENU

11

--PAGE

003

M6800 UT

00109 1C92 CE 1C00


00110 1C95 FF A048
00111 1C98 7E E0D0

LDX
STX
JMP

#STRT
RESTRT
START

00113
00114
00115
00116
00117
00118
00119
00120
00121
00122

1C9B
1C9D
1C9F
1CA1
1CA3
1CA5
1CA7
1CA9
1CAB
1CAE

8D
81
27
8D
20
8D
81
27
BD
20

13
WM2TAP BSR
41
CMP A
9F
BEQ
69
BSR
9B
BRA
09
RTAP2M BSR
41
CMP A
95
BEQ
1D28
JSR
90
BRA

RWCOMN
#'A
GOBACK
WTAPE
GOBACK
RWCOMN
#'A
GOBACK
RTAPE
GOBACK

00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140

1CB0
1CB3
1CB6
1CB8
1CBB
1CBE
1CC1
1CC3
1CC6
1CC9
1CCC
1CCF
1CD1
1CD3
1CD5
1CD7
1CD9

CE
BD
8D
FF
CE
BD
8D
FF
CE
BD
BD
81
27
81
27
20
39

1DC4 RWCOMN LDX


E07E
JSR
22
BSR
A002
STX
1DD8 RWCOM2 LDX
E07E
JSR
17
BSR
A004
STX
1DEC RETRY LDX
E07E
JSR
E1AC
JSR
41
CMP A
06
BEQ
47
CMP A
02
BEQ
ED
BRA
CONT
RTS

#MFIV
PDATA1
BADDR
BEGAD
#MSIX
PDATA1
BADDR
ENDAD
#MSVN
PDATA1
INEEE
#'A
CONT
#'G
CONT
RETRY

00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162

1CDA
1CDC
1CDF
1CE1
1CE4
1CE7
1CE8
1CEA
1CEB
1CEC
1CED
1CEE
1CEF
1CF1
1CF2
1CF3
1CF6
1CF8
1CFA
1CFC
1CFE

8D
B7
8D
B7
FE
39
8D
48
48
48
48
16
8D
1B
39
BD
80
2B
81
2F
81

0C
BADDR
A00C
07
A00D
A00C

BYTE
XHI
BYTE
XLOW
XHI

BSR
STA
BSR
STA
LDX
RTS
09
BYTE
BSR
ASL
ASL
ASL
ASL
TAB
02
BSR
ABA
BYTERT RTS
E1AC UTINHX JSR
30
SUB
0F
BMI
09
CMP
0A
BLE
11
CMP

A
A

RESET PROG COUNTER IN STACK


EXIT TO MIKBUG

ASK AGAIN IF NO A OR G
THIS CODE COPIED FROM MIKBUG

UTINHX
A
A
A
A
UTINHX
SKIP MIKBUG CHECKSUM PART
A
A
A

INEEE
#$30
NOTHEX
#$09
IN1HG
#$11

12

--PAGE

004

M6800 UT

00163
00164
00165
00166
00167
00168

1D00
1D02
1D04
1D06
1D08
1D09

2B
81
2E
80
39
7E

07
16
03
07

00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185

1D0C
1D0F
1D11
1D13
1D16
1D18
1D1B
1D1D
1D1E

CE
8D
A6
B7
8D
BC
27
08
20

0802 WTAPE
34
00
CONTW
8011
42
A004
03

00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216

1D28
1D2B
1D2D
1D2F
1D31
1D33
1D34
1D37
1D39
1D3C
1D3E
1D3F
1D41

CE
8D
C5
27
8D
39
B6
A7
BC
27
08
8D
20

0401 RTAPE
18
70
CONTR
03
30
ENDOP

1D43
1D44
1D45
1D48
1D4B
1D4D
1D4F
1D52
1D55
1D58
1D5A
1D5D
1D60
1D62
1D63
1D65

0001
0001
FF 1D43
FE A002
8D 16
C6 1D
F7 8010
F6 8010
F5 1D43
26 F8
F6 8010
F5 1D44
27 F8
39
C6 5F
F7 8010

BMI
CMP A
BGT
SUB A
IN1HG RTS
1C5A NOTHEX JMP

NOTHEX
#$16
NOTHEX
#7
NOHEX

LDX
#$0802
COND. MASKS FOR WRITE
BSR
INIT
LDA A 0,X
GET BYTE FROM MEMORY
STA A ACIADT
PUT IT TO I'FACE
BSR
LOOP2
WAIT UNTIL ACIA REG. "EMPTY"
CPX
ENDAD
WAS IT LAST BYTE TO WRITE?
BEQ
ENDCH
INX
POINT TO NEXT MEM LOC.
F1
BRA
CONTW
* ENDCH SENDS LAST BYTE TO ACIA A SECOND TIME, SO
* THAT THE SERIAL OUTPUT OF ITS FIRST SENDING CAN
* COMPLETE.
1D20 B7 8011 ENDCH STA A ACIADT
PUT IT TO I'FACE AGAIN
1D23 8D 35
BSR
LOOP2
WAIT FOR SERIAL OUT DONE
1D25 8D 3C
BSR
RESET
NOW WE CAN TURN MOTOR OFF
1D27 39
RTS

8011
00
A004
F3
19
EA

LDX
#$0401
CODE MASKS FOR READ
BSR
INIT
BIT B #$70
ANY ERROR FLAG SET?
BEQ
LOOP3
IF NOT, KEEP GOING
BSR
RESET
ELSE TURN OFF MOTOR
RTS
LOOP3 LDA A ACIADT
GET BYTE JUST READ
STA A 0,X
STORE IT
CPX
ENDAD
ARE WE DONE?
BEQ
ENDOP
IF SO, RETURN
INX
ELSE POINT TO NEXT LOC
BSR
LOOP2
GET ANOTHER BYTE FROM TAPE
BRA
CONTR
*SUBROUTINE ENTRY POINTS ARE INIT AND LOOP2
FLAG1 RMB
1
ACIA CONDITION CODE MASKS
FLAG2 RMB
1
INIT
STX
FLAG1
SAVE R/W CODE MASKS
LDX
BEGAD
GET STARTING ADDRESS
BSR
RESET
GO INITIALIZE ACIA
LDA B #$1D
START MOTOR, DEFINE FORMAT
STA B ACIACT
8 BITS, ODD PARITY, 1 STOP
LOOP1 LDA B ACIACT
BIT B FLAG1
TEST DCD (READ), CTS (WRITE)
BNE
LOOP1
WAIT FOR FLAG TO CLEAR
LOOP2 LDA B ACIACT
BIT B FLAG2
TEST FULL (READ), EMPTY(WRITE
BEQ
LOOP2
WAIT UNTIL FLAG SET
RTS
RESET LDA B #$5F
STA B ACIACT

13

--PAGE

005

M6800 UT

00217 1D68 39
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269

1D69
1D6D
1D6F
1D8A
1D8B
1D8D
1D9C
1D9D
1D9F
1DB1
1DB2
1DB4
1DC3
1DC4
1DC6
1DD7
1DD8
1DDA
1DEB
1DEC
1DEE
1E10
1E24
1E26
1E43
1E51
1E52
1E54
1E69
1E6B
1E8A
1E8C
1EAB
1EAD
1ECC
1ECE
1EED
1EEF
1F0E
1F10
1F2F
1F31
1F50
1F52
1F71

0D
0D
4D
04
0D
55
04
0D
4F
04
0D
45
04
0D
53
04
0D
20
04
0D
50
20
0D
57
47
04
0D
20
0D
4C
0D
53
0D
43
0D
57
0D
52
0D
54
0D
50
0D
45
04

A048
A048 1C00

RTS
* MESSAGES
MZRO
FCB
MONE
FCB
FCC
FCB
MTWO
FCB
FCC
FCB
MTHR
FCB
FCC
FCB
MFOR
FCB
FCC
FCB
MFIV
FCB
FCC
FCB
MSIX
FCB
FCC
FCB
MSVN
FCB
FCC
FCC
FCB
FCC
FCC
FCB
MATE
FCB
FCC
FCB
FCC
FCB
FCC
FCB
FCC
FCB
FCC
FCB
FCC
FCB
FCC
FCB
FCC
FCB
FCC
FCB
*
* LOAD MIKBUG
ORG
FDB
END

$D,$A,'?,4
$D,$A
^M6800 I/O UTILITIES MANAGER^
4
$D,$A
^UNKNOWN COMMAND^
4
$D,$A
^OPERATION COMPLETE^
4
$D,$A
^EOT LOCATION= $^
4
$D,$A
^START ADDRESS=?_$^
4
$D,$A
^ END ADDRESS=?_$^
4
$D,$A
^POSITION TAPE, PRESS PLAY FOR READ^
^ OR RECORD FOR WRITE^
$D,$A
^WHEN READY, TYPE A TO ABORT, ^
^G TO PROCEED:_^
4
$D,$A
^
COMMAND MENU^
$D,$A
^LOAD TEXT FILE FROM TERMINAL..1^
$D,$A
^SEND TEXT FILE TO TERMINAL....2^
$D,$A
^COMMAND CODE RESERVED.........3^
$D,$A
^WRITE MEMORY TO TAPE..........4^
$D,$A
^READ TAPE TO MEMORY...........5^
$D,$A
^TURN OFF TAPE MOTOR...........6^
$D,$A
^PRINT COMMAND MENU............H^
$D,$A
^EXIT TO MIKBUG................E^
4
STACK PC WITH START ADDR
$A048
STRT

TOTAL ERRORS 00000

14

--PAGE

00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
* NOV
00048
00049
00050
00051
00052
00053
00054

001

TTY4

NAM
OPT

TTY4
O,S,NOG

*
* BY DONALD R. SENTZ JANUARY 2015
* MODS AND A CORRECTION APRIL 2015
* ASCII TEXT BUFFER TO BAUDOT TTY OUTPUT
* BASED ON FLOW CHARTS I DREW AND SUCCESSFUL
* TEST THAT I PERFORMED IN 1978-79.
* LOAD UTMGR3.OBJ BEFORE LOADING TTY4.OBJ
*
8008
PREGA EQU
$8008
ADDR. OF MEK6800D1 PIA CHIP
1C40
GOBACK EQU
$1C40
RETURN TO UTMGR3.OBJ
0000
ORG
$0000
*
* HERE IS THE 7-BIT ASCII-TO-BAUDOT-CODE
* LOOKUP TABLE I DESIGNED USING MS EXCEL 2010.
* DETAILS IN MY EXCEL FILE ON TOSHIBA LAPTOP
*
0000 00
FCB
0,1,1,1,1,1,1,202,1,1,68,1,1,80,1,1
0010 01
FCB
1,1,190,1,246,1,1,1,1,1,1,1,1,1,1,1
0020 48
FCB
72,218,226,1,210,1,244,214
0028 DE
FCB
222,228,1,1,216,198,248,250
0030 EC
FCB
236,238,230,194,212,224,234,206
0038 CC
FCB
204,240,220,252,1,1,1,242
0040 01
FCB
1,134,178,156,146,130,154,180
0048 A8
FCB
168,140,150,158,164,184,152,176
0050 AC
FCB
172,174,148,138,160,142,188,166
0058 BA
FCB
186,170,162,1,1,1,1,1
0060 D6
FCB
214,134,178,156,146,130,154,180
0068 A8
FCB
168,140,150,158,164,184,152,176
0070 AC
FCB
172,174,148,138,160,142,188,166
0078 BA
FCB
186,170,162,1,1,1,1,1
0080 FE
LTRS
FCB
254
0081 F6
FIGS
FCB
246
*
* WORKING REGISTERS
0082 00
LKADR FCB
0
MS BYTE OF 16 BIT ADDRESS
0083 00
LKADR1 FCB
0
LS BYTE OF 16 BIT ADDRESS
0084 00
LFFLAG FCB
0
INIT LFFLAG=0=LTRS MODE
0085 8008
PIADR FDB
PREGA
SAVES A FEW BYTES LATER
0087 0002
BADDR RMB
2
TEMP REG. FOR X
* ADDING OUTPUT HEADER STRING. TO USE, CHANGE
* INIT. OF BADDR FROM $0100 TO $00F6. THIS
* HEADER FORCES PRINTER TO LTRS MODE
* REGARDLESS OF CURRENT VALUE OF LFFLAG,
* AND THEN SENDS <CR> AND <LF>
00F6
ORG
$00F6
04 2015 LTRS LTRS LTRS LTRS NULL NULL NULL NULL CR LF
00F6 00
HEADER FCB
$12,$12,$12,$12,0,0,0,0,$0D,$0A
*
*----------MAIN PROGRAM STARTS HERE-------1F72
ORG
$1F72
*
* THIS CODE PRINTS ASCII TEXT BUFFER TO TTY
* INTERFACE UNTIL ASCII E-O-T ENCOUNTERED OR

15

--PAGE

002

TTY4

00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108

* POINTER IS AT END OF DEFINED BUFFER SPACE.


*
1F72 8D 22
START BSR
INIT
CONFIGURE PIA
1F74 C6 01
LDA B #1
SYNC TO START OF 1MS
1F76 8D 73
BSR
TIM1
TIM1 EXPECTS PIA ADDR. IN REG
1F78 CE 00F6
LDX
#HEADER INIT POINTER TO HEADER
1F7B DF 87
STX
BADDR
* HERE IS THE PRINTING LOOP
1F7D DE 87
NEXT
LDX
BADDR
GET POINTER
1F7F 8C 1BFD
CPX
#$1BFD
FAILSAFE TEST:END OF BUFFER+1
1F82 26 03
BNE
BCONT
IF NOT END, CONTINUE
1F84 7E 1C40 EXIT
JMP
GOBACK
ELSE PRINTOUT IS DONE
1F87 A6 00
BCONT LDA A 0,X
GET ASCII CHARACTER
1F89 81 04
CMP A #4
IS IT EOT?
1F8B 26 02
BNE
BCONT2
IF NOT, CONTINUE
1F8D 20 F5
BRA
EXIT
1F8F 08
BCONT2 INX
INCREMENT BUFFER POINTER
1F90 DF 87
STX
BADDR
1F92 8D 14
BSR
PRCHR
GO PUT OUT CHAR. TO TTY
1F94 20 E7
BRA
NEXT
*
* EXTERNALLY CALLABLE SUBR. TO INITIALIZE PIA
* CONFIGURE PIA PORT SUCH THAT PIA0-B7 IS
* AN INPUT, B6-B0 ARE OUTPUTS. ONLY B7 AND B0
* ARE USED BY THE TTY INTERFACE BOARD.
*
1F96 DE 85
INIT
LDX
PIADR
GET PIA ADDRESS TO X
1F98 4F
CLR A
ALL 0 TO CONTROL REG.
1F99 A7 01
STA A 1,X
POINT PIADR TO DATA DIR. REG.
1F9B 86 7F
LDA A #$7F
CONF. B6-BO AS OUTPUTS
1F9D A7 00
STA A 0,X
AND B7 AS INPUT.
1F9F 86 04
LDA A #4
CONTROL REG. B2 = 1
1FA1 A7 01
STA A 1,X
POINT PIADR TO DATA REG.
1FA3 86 01
LDA A #1
NOW OUTPUT A MARK SIGNAL TO
1FA5 A7 00
STA A 0,X
CLOSE THE TTY CURRENT LOOP
1FA7 39
RTS
*
* EXTERNALLY CALLABLE SUBROUTINE TO CONVERT
* 7-BIT ASCII CHAR. IN ACC. A TO BAUDOT CODE
* AND OUTPUT IT TO TTY INTERFACE. THIS ROUTINE
* CHECKS IF LTRS OR FIGS CODE NEEDS TO BE SENT
* BEFORE SENDING THE CONVERTED CHARACTER, AND
* DOES SO ONLY IF NECESSARY.
*
1FA8 84 7F
PRCHR AND A #$7F
ENSURE MSB=0 (FAILSAFE)
1FAA 97 83
STA A LKADR1
PREPARE LOOKUP ADDRESS
1FAC DE 82
LDX
LKADR
GET TABLE LOOKUP ADDRESS
1FAE A6 00
LDA A 0,X
GET BAUDOT CODEWORD
1FB0 85 01
BIT A #1
TEST: IS IT PRINTABLE?
1FB2 26 20
BNE
DONE
IF LSB=1 THEN SKIP PRINT
1FB4 36
PSH A
ELSE TEMPORARY SAVE CODEWORD
1FB5 85 80
BIT A #$80
IS IT CR, LF, OR SPACE?
1FB7 27 18
BEQ
CONT2
IF SO, SKIP L/F CHECK
1FB9 85 40
BIT A #$40
ELSE IS IT LTR OR FIG?

16

--PAGE

003

TTY4

00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158

1FBB 26 09
1FBD
1FBF
1FC1
1FC2
1FC4

D6
27
5F
96
20

1FC6
1FC8
1FCA
1FCB

D6 84
26 07
53
96 81

1FCD
1FCF
1FD1
1FD2
1FD4

D7 84
8D 04
32
8D 01
39

1FD5
1FD7
1FD9
1FDB
1FDD

DE
C6
8D
8A
A7

85
1F
10
40
00

1FDF
1FE1
1FE3
1FE5
1FE7
1FE8
1FEA

86
C6
8D
67
4A
2E
39

06
16
06
00

1FEB
1FED
1FEF
1FF1
1FF3
1FF4
1FF6

6D
2B
6D
2A
5A
26
39

00
FC
00
FC

00160
00161 0100
00162 0100 04

84
10
80
07

F7

F5

BNE
FIG
IF L/F=1 THEN FIGS
* ELSE SEND LTRS CODE IF NECESSARY
LDA B LFFLAG
CHECK LTRS/FIGS STATE
BEQ
CONT2
SKIP IF ALREADY LTRS MODE
CLR B
ELSE CLEAR L/F FLAG
LDA A LTRS
AND GET LTRS CODE
BRA
CONT3
AND SEND IT
* SEND FIGS CODE IF NECESSARY
FIG
LDA B LFFLAG
CHECK LTRS/FIGS STATE
BNE
CONT2
SKIP IF ALREADY FIGS MODE
COM B
ELSE SET L/F FLAG
LDA A FIGS
AND GET FIGS CODE
*
CONT3 STA B LFFLAG
UPDATE L/F STATE
BSR
BAUDOT
SEND LTRS OR FIGS
CONT2 PUL A
GET CHAR. TO SEND
BSR
BAUDOT
PRINT CHARACTER
DONE
RTS
*
* THIS SUBROUTINE OUTPUTS ACC.A B0-B6
* TO TTY INTERFACE.
* B0
= TTY START BIT = 0
* B1-B5 = BAUDOT CHARACTER
* B6
= TTY STOP BIT = 1
*
BAUDOT LDX
PIADR
LDA B #31
HOLD STOP FOR 31 MS
BSR
TIM1
ORA A #$40
PUT STOP BIT IN B6
STA A 0,X
* PUT START BIT OUT AT BEGINNING OF
* A 22 MS INTERVAL
LDA A #6
INITIALIZE BIT SHIFT COUNTER
SHIFT LDA B #22
SET TIMEOUT = 22 MS
BSR
TIM1
HOLD FOR 22 MS
ASR
0,X
PLACE NEXT BIT ONTO OUTPUT
DEC A
BGT
SHIFT
KEEP SHIFTING UNTIL B6
RTS
*
* THIS ROUTINES COUNTS PERIODS OF THE
* 1 MS TIMER ON TTY INTERFACE BOARD.
*
TIM1
TST
0,X
IS PIA0-B7 =1?
BMI
TIM1
YES, WAIT UNTIL B7=0
TIM0
TST
0,X
IS PIA0-B7 =0?
BPL
TIM0
YES, WAIT UNTIL B7=1
DEC B
BNE
TIM1
COUNT PERIODS UNTIL B=0
RTS
* INITIALIZE PRINT BUFFER WITH EOT
ORG
$0100
FCB
$04
PRELOAD ASCII E-O-T CODE

17

--PAGE

004

TTY4

00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181

* PATCHES TO UTMGR3. LOAD UTMGR3.OBJ


* BEFORE LOADING TTY PRINT UTILITY.
*
1BFD
ORG
$1BFD
1BFD 7E 1F72 TTY
JMP
START
LEAPFROG FROM UTMGR3
*
* PATCH END OF BUFFER ADDRESS
1C17
ORG
$1C17
1C17 1BFC
FDB
$1BFC
MAKE ROOM FOR "JMP START"
*
* PATCH COMMAND DECODER
1C70
ORG
$1C70
1C70 27 8B
BEQ
TTY
REPLACES BEQ NOCMD
*
* PATCH COMMAND MENU
1EAD
ORG
$1EAD
1EAD 50
FCC
^PRINT TEXT BUFFER TO TTY......3^
END

TOTAL ERRORS 00000

18

--PAGE

00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054

001

READTTY

NAM
OPT

0089
0089
008A

008B
0093
009B
00A3
00AB
00B3
00BB
00C3
00CB
00CD
00DF
1B00

1B00
1B03

READTTY
O,S,NOG

*
* JUNE 15, 2015 BY D.R. SENTZ
*
* UTMGR4.OBJ AND TTY4.OBJ MUST BE LOADED TO RUN THIS
* PROGRAM. THIS PROGRAM READS SERIAL DATA INPUT ON T
* L.S. BIT OF PIA REGISTER B OF THE MEK6800D1 CPU
* BOARD, PERFORMS THE BAUDOT-TO-ASCII CHARACTER
* CONVERSION, OUTPUTS THE ASCII CHARACTER TO THE
* CONSOLE TERMINAL (MACTERMINAL 2.0 IN MY CASE), AND
* STORES IT IN UTMGR4 TEXT BUFFER. THE CONSOLE
* INTERFACE DATA RATE SHOULD BE 600 BAUD (300 MIGHT
* WORK BUT I HAVEN'T TESTED IT). THE MEK6800D1
* SUPPORTS 600 BAUD OK. USE THE LINE-BREAK SWITCH ON
* THE TELEPRINTER TO EXIT THIS PROGRAM AND RETURN TO
* THE UTILITY MANAGER COMMAND LINE.
*
0085
PIAADR EQU
$0085
TTY3 PUT PIA ADDRESS IN THIS
0087
BADDR EQU
$0087
LOC OF TEXT BUFFER POINTER
1AFF
EOBADR EQU
$1AFF
NEW END OF UTMGR3 TEXT BUFFER
1C29
RTNUTM EQU
$1C29
UTMGR3 REENTRY ON LINE BREAK
1C4F
NOCMD EQU
$1C4F
UTMGR3 REENTRY ON COMMAND ERR
1F72
SEND
EQU
$1F72
TTY3 ENTRY POINT
1F96
INIT
EQU
$1F96
SUBROUTINE TO INIT PIA REG. A
1FEB
TIM1
EQU
$1FEB
TIMER SUBROUTINE IN TTY3.SRC
E07E
PDATA1 EQU
$E07E
STRING OUTPUT SUBROUTINE
E1AC
INEEE EQU
$E1AC
CHARACTER INPUT SUBROUTINE
E1D1
OUTEEE EQU
$E1D1
CHARACTER OUTPUT SUBROUTINE
*
ORG
$0089
0001
BITCNT RMB
1
INPUT DATA BIT COUNTER
0001
OFFSET RMB
1
LTRS/FIGS ADDRESS OFFSET
*
*BAUDOT TO ASCII CONVERSION TABLE
*
00
B2ASCI FCB
$00,$54,$0D,$4F,$20,$48,$4E,$4D
0A
FCB
$0A,$4C,$52,$47,$49,$50,$43,$56
45
FCB
$45,$5A,$44,$42,$53,$59,$46,$58
41
FCB
$41,$57,$4A,$00,$55,$51,$4B,$00
00
FIGS
FCB
$00,$35,$0D,$39,$20,$00,$2C,$2E
0A
FCB
$0A,$29,$34,$26,$38,$30,$3A,$3B
33
FCB
$33,$22,$24,$3F,$07,$36,$21,$2F
2D
FCB
$2D,$32,$27,$00,$37,$31,$28,$00
0D
MNINE FCB
$0D,$0A
53
FCC
^SEND(S) OR RCV(R)?^
04
FCB
$04
*
ORG
$1B00
TEXT BUFFER TO END AT $1AFF
*
* SOLICIT SEND OR RCV, IF RCV, INIT BADDR
*
CE 00CB SRTTY LDX
#MNINE
BD E07E
JSR
PDATA1
SOLICIT SEND OR RCV

19

--PAGE

002

READTTY

00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108

1B06
1B09
1B0B
1B0D
1B10
1B12
1B14
1B17
1B1A

BD
81
26
7E
81
27
7E
CE
DF

1B1C
1B1F
1B20
1B22
1B24
1B26
1B28
1B2A

BD
4F
A7
86
A7
86
A7
7F

1B2D
1B2F
1B31
1B33

A6
26
DE
20

1B35
1B37
1B39
1B3B
1B3E
1B40
1B42
1B44

A6
26
C6
BD
A6
26
C6
D7

1B46
1B48
1B4B
1B4D
1B50
1B52
1B53

C6
BD
AA
7A
27
48
20

E1AC
JSR
INEEE
S=SEND, R=RECEIVE
53
CMP A #'S
03
BNE
CONT6
1F72
JMP
SEND
OUTPUT TEXT BUFFER TO TELETYP
52
CONT6 CMP A #'R
03
BEQ
RCV
1C4F
JMP
NOCMD
RETURN TO UTMGR IF NOT S OR R
0100 RCV
LDX
#$0100
INIT TEXT BUFFER POINTER
87
STX
BADDR
*
* CONFIGURE PIA A AND B, INIT. TABLE OFFSET.
*
1F96
JSR
INIT
INIT PIA REG. A (TIMER INPUT)
CLR A
NOW INIT PIA REG. B
03
STA A 3,X
POINT 2,X TO DDRB
FE
LDA A #$FE
REG.B B7-B1=OUTPUTS, BO=INPUT
02
STA A 2,X
PUT I/O DEF. TO DATA DIR. REG
04
LDA A #4
POINT 2,X TO I/O REG.B
03
STA A 3,X
3,X IS PIA CONTROL REG.B
008A
CLR
OFFSET
INIT TO LETTERS MODE
*
* HERE IS THE TTY DATA RECEIVER
*
* AFTER COMPLETING TEXT ENTRY FROM TELETYPE SET,
* OPERATE THE LINE-BREAK KEY TO RETURN TO UTILITY
* MANAGER.
*
02
CHKMRK LDA A 2,X
GET A SAMPLE OF THE LINE STAT
04
BNE
WAIT
IF MARK, THEN PROCEED
87
LDX
BADDR
IF BREAK, GET TEXT POINTER
4D
BRA
EXIT
GO WRITE EOT AND WE'RE DONE
*
02
WAIT
LDA A 2,X
SAMPLE MARK/SPACE STATE
FC
BNE
WAIT
UNTIL MARK-TO-SPACE DETECTED
0B
LDA B #11
WAIT 11MS (HALF BIT PERIOD)
1FEB
JSR
TIM1
02
LDA A 2,X
TEST FOR START BIT (SPACE)
F3
BNE
WAIT
IF FALSE START, KEEP WAITING
05
LDA B #5
ELSE INITIALIZE BITCNT
89
STA B BITCNT
*
* ACC. A CONTAINS ALL ZEROES AT THIS POINT. READ
* CHARACTER CODE FROM TELETYPE SET.
*
16
LOAD5 LDA B #22
WAIT ONE BIT PERIOD
1FEB
JSR
TIM1
02
ORA A 2,X
INSERT BIT TO LSB OF ACC. A
0089
DEC
BITCNT
HAVE 5 BITS BEEN READ?
03
BEQ
CEEONE
IF SO, PROCEED
ASL A
ELSE LEFT SHIFT ACC.A
F1
BRA
LOAD5
AND GET ANOTHER BIT
*
* CHECK LTRS OR FIGS, SET OFFSET ACCORDINGLY
*

20

--PAGE

003

READTTY

00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162

1B55
1B57
1B59
1B5A
1B5C
1B5E
1B60
1B62
1B64
1B66
1B69

81
26
5F
20
81
26
C6
D7
C6
BD
20

06
1B
0B
20
8A
16
1FEB
C2

1B6B
1B6D
1B70
1B73

9B
B7
CE
A6

8A
1B74
008B
00

1B75
1B77
1B79
1B7C
1B7D
1B80
1B82
1B84
1B86
1B89
1B8B
1B8D
1B8F
1B92

DE
A7
BD
08
8C
26
86
A7
7E
DF
DE
C6
BD
20

87
00
E1D1

1F
03

1AFF
07
04
00
1C29
87
85
0A
1FEB
99

1BFD
1BFD 7E 1B00
1C17
1C17 1AFF
1EAD
1EAD 54
1F80
1F80 1B00

CEEONE CMP A #$1F


WAS IT THE LTRS CODE?
BNE
CONT2
IF NOT, CHECK FOR FIGS
CLR B
ELSE SET ACC. B =0
BRA
CONT3
AND GO UPDATE OFFSET
CONT2 CMP A #$1B
WAS IT THE FIGS CODE?
BNE
CONT4
IF NOT, PROCEED TO LOOKUP
LDA B #32
ELSE SET ACC. B =32
CONT3 STA B OFFSET
0=LTRS, 32=FIGS
LDA B #22
DELAY TO 11/31THS OF STOP BIT
JSR
TIM1
BRA
CHKMRK
GO TEST FOR STOP BIT OR BREAK
*
* HERE IS THE ASCII LOOKUP, OUTPUT TO MACTERMINAL,
* AND WRITE TO TEXT BUFFER. I CHOSE TO USE SELF* MODIFYING CODE HERE. THIS REMOVED A CONSTRAINT
* ON THE START ADDRESS OF TABLE B2ASCI, AND SAVED
* A FEW BYTES OF CODE.
*
CONT4 ADD A OFFSET
ADD OFFSET TO 5-BIT CODEWORD
STA A EMBED+1 UDPATE INDEX IN LDAA BELOW
LDX
#B2ASCI START ADDRESS OF TABLE TO X
EMBED LDA A 0,X
LOOK UP ASCII CODEWORD
*
* OUTEEE TAKES ABOUT 16.7MS TO EXECUTE AT 600
* BAUD. THIS DELAYS NEXT INSTRUCTION UNTIL ABOUT
* 6MS INTO THE 31MS STOP BIT PERIOD.
*
LDX
BADDR
GET TEXT BUFFER POINTER
STA A 0,X
SAVE CHARACTER TO TEXT BUFFER
JSR
OUTEEE
OUTPUT CHARACTER TO CONSOLE
INX
UPDATE TEXT BUFFER POINTER
CPX
#EOBADR HAS IT REACHED END OF BUFFER?
BNE
CFIVE
IF NOT, THEN CONTINUE INPUT
EXIT
LDA A #$04
EOT ON BREAK OR END OF BUFFER
STA A 0,X
WRITE EOT TO TEXT BUFFER
JMP
RTNUTM
AND RETURN TO UTILITY MANAGER
CFIVE STX
BADDR
SAVE UPDATED POINTER
LDX
PIAADR
RESTORE PIA ADDRESS TO X
LDA B #10
DELAY TO MIDDLE OF STOP BIT?
JSR
TIM1
BRA
CHKMRK
GO TEST FOR STOP BIT OR BREAK
*
*PATCH TTY3
ORG
$1BFD
JMP
SRTTY
LEAPFROG ADDRESS
*PATCH UTMGR3
ORG
$1C17
FDB
EOBADR
END-OF-BUFFER ADDRESS
*PATCH UTMGR3 COMMAND MENU
ORG
$1EAD
FCC
^TELETYPE SEND OR RECEIVE......3^
*PATCH TTY3
ORG
$1F80
FDB
EOBADR+1 END-OF-BUFFER PLUS 1

21

--PAGE

00163
PIAADR
BADDR
EOBADR
RTNUTM
NOCMD
SEND
INIT
TIM1
PDATA1
INEEE
OUTEEE
BITCNT
OFFSET
B2ASCI
FIGS
MNINE
SRTTY
CONT6
RCV
CHKMRK
WAIT
LOAD5
CEEONE
CONT2
CONT3
CONT4
EMBED
EXIT
CFIVE

004

READTTY

END
0085
0087
1AFF
1C29
1C4F
1F72
1F96
1FEB
E07E
E1AC
E1D1
0089
008A
008B
00AB
00CB
1B00
1B10
1B17
1B2D
1B35
1B46
1B55
1B5C
1B62
1B6B
1B73
1B82
1B89

TOTAL ERRORS 00000

22

ALL THREE PIECES UTMGR4/TTY4/READTTY IN ONE LOAD FILE


*UTMGR4.OBJ MAY 2015 BY D.R. SENTZ
S00B00004D3638303020555410
S11E1C002052863CB78007CE0100FFA002BDE1ACA7008104270E8C1BFF27F279
S11E1C1B08810D26ED860A20EC8634B78007FFA004CE1DB2BDE07ECEA004BDE3
S11E1C36E0C82006CE0100BDE07ECE1D9D2012BD1D6320F6CE1E522008CE1D79
S11E1C518B2003CE1D6DBDE07E8EA042CE1D69BDE07EBDE1AC81312798813206
S11E1C6C27CC813327DD813427258135272B813627C7813727CD813827C9812A
S11E1C873927C5814827BC814526BDCE1C00FFA0487EE0D08D138141279F8D10
S11E1CA269209B8D0981412795BD1D282090CE1DC4BDE07E8D22FFA002CE1D34
S11E1CBDD8BDE07E8D17FFA004CE1DECBDE07EBDE1AC81412706814727022092
S11E1CD8ED398D0CB7A00C8D07B7A00DFEA00C398D0948484848168D021B3941
S11E1CF3BDE1AC80302B0F81092F0A81112B0781162E038007397E1C5ACE08C5
S11E1D0E028D34A600B780118D42BCA00427030820F1B780118D358D3C39CEB9
S11D1D2904018D18C57027038D3039B68011A700BCA00427F3088D1920EA7D
S11E1D45FF1D43FEA0028D16C61DF78010F68010F51D4326F8F68010F51D449E
S11E1D6027F839C65FF78010390D0A3F040D0A4D3638303020492F4F205554EB
S11E1D7B494C4954494553204D414E41474552040D0A554E4B4E4F574E20436D
S11E1D964F4D4D414E44040D0A4F5045524154494F4E20434F4D504C4554452D
S11E1DB1040D0A454F54204C4F434154494F4E3D2024040D0A5354415254204D
S11E1DCC414444524553533D3F5F24040D0A2020454E4420414444524553539B
S11E1DE73D3F5F24040D0A504F534954494F4E20544150452C2050524553532B
S11E1E0220504C415920464F522052454144204F52205245434F524420464FD3
S11E1E1D522057524954450D0A5748454E2052454144592C20545950452041DC
S11E1E3820544F2041424F52542C204720544F2050524F434545443A5F040D0E
S11E1E530A202020202020202020434F4D4D414E44204D454E550D0A4C4F41FF
S11E1E6E4420544558542046494C452046524F4D205445524D494E414C2E2E40
S11E1E89310D0A53454E4420544558542046494C4520544F205445524D494E71
S11E1EA4414C2E2E2E2E320D0A434F4D4D414E4420434F4445205245534552B6
S11E1EBF5645442E2E2E2E2E2E2E2E2E330D0A5752495445204D454D4F5259B9
S11E1EDA20544F20544150452E2E2E2E2E2E2E2E2E2E340D0A52454144205435
S11E1EF541504520544F204D454D4F52592E2E2E2E2E2E2E2E2E2E2E350D0AF6
S11E1F105455524E204F46462054415045204D4F544F522E2E2E2E2E2E2E2E03
S11E1F2B2E2E2E360D0A5052494E5420434F4D4D414E44204D454E552E2E2E35
S11E1F462E2E2E2E2E2E2E2E2E480D0A4558495420544F204D494B4255472E75
S1141F612E2E2E2E2E2E2E2E2E2E2E2E2E2E2E450470
S105A0481C00F6
-----*TTY4.OBJ (PART OF UTILITY MANAGER)
INCORPORATES FIXES AND PATCHES TO TTY3.OBJ
SEE TTY4.LST.txt FOR PROGRAM LISTING
MAY 15, 2015 BY D.R. SENTZ
S00B000054545934202020203F
S11E000000010101010101CA01014401015001010101BE01F6010101010101BA
S11E001B010101010148DAE201D201F4D6DEE40101D8C6F8FAECEEE6C2D4E095
S11E0036EACECCF0DCFC010101F20186B29C92829AB4A88C969EA4B898B0AC7B
S11E0051AE948AA08EBCA6BAAAA20101010101D686B29C92829AB4A88C969EB5
S11E006CA4B898B0ACAE948AA08EBCA6BAAAA20101010101FEF6000000800842
S10D00F612121212000000000D0A9D
S11E1F728D22C6018D73CE00F6DF87DE878C1BFD26037E1C40A6008104260251
S11E1F8D20F508DF878D1420E7DE854FA701867FA7008604A7018601A700396B
S11E1FA8847F9783DE82A60085012620368580271885402609D68427105F9637
S11E1FC3802007D6842607539681D7848D04328D0139DE85C61F8D108A40A72C
S11C1FDE008606C6168D0667004A2EF7396D002BFC6D002AFC5A26F53907
S104010004F6
S1061BFD7E1F72D2
S1051C171BFCB0
S1051C70278BBC
S11E1EAD5052494E5420544558542042554646455220544F205454592E2E2EDC
S1071EC82E2E2E3355
------

23

*JUNE 15 2015 READTTY.OBJ (PART OF UTILITY MANAGER)


S00B00005245414454545920B7
S11E008B00540D4F20484E4D0A4C524749504356455A44425359465841574A31
S11E00A60055514B0000350D3920002C2E0A29342638303A3B3322243F0736F6
S11E00C1212F2D322700373128000D0A53454E44285329204F522052435628E1
S10700DC52293F045E
S11E1B00CE00CBBDE07EBDE1AC815326037E1F72815227037E1C4FCE0100DF28
S11E1B1B87BD1F964FA70386FEA7028604A7037F008AA6022604DE87204DA605
S11E1B360226FCC60BBD1FEBA60226F3C605D789C616BD1FEBAA027A0089276F
S11E1B51034820F1811F26035F2006811B260BC620D78AC616BD1FEB20C29B97
S11E1B6C8AB71B74CE008BA600DE87A700BDE1D1088C1AFF26078604A7007E87
S1101B871C29DF87DE85C60ABD1FEB2099EF
S1061BFD7E1B0048
S1051C171AFFAE
S11E1EAD54454C45545950452053454E44204F5220524543454956452E2E2EF2
S1071EC82E2E2E3355
S1051F801B0040
S9

24