SYM-1 SUPERMON AND AUDIO CASSETTE INTERFACE SOURCES

COMBINED AND CONVERTED TO TELEMARK ASSEMBLER (TASM) V3.1
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055

0000
0000
0000
0000
A600
A600
A620
A620
A630
A631
A632
A633
A634
A635
A636
A637
A638
A639
A63A
A63B
A63C
A63D
A63E
A63E
A63F
A640
A645
A646
A649
A64A
A64A
A64A
A64A
A64A
A64B
A64C
A64D
A64E
A64F
A650
A651
A652
A653
A653
A654
A654
A655
A656
A657
A658
A659
A659
A659
A659

;
;*****
;***** COPYRIGHT 1979 SYNERTEK SYSTEMS CORPORATION
;***** VERSION 2 4/13/79 "SY1.1"
*=$A600
;SYS RAM (ECHOED AT TOP OF MEM)
SCPBUF .BLOCK $20
;SCOPE BUFFER LAST 32 CHARS
RAM
=*
;DEFAULT BLK FILLS STARTING HERE
JTABLE .BLOCK $10
; 8JUMPS - ABS ADDR, LO HI ORDER
TAPDEL .BLOCK 1
;KH TAPE DELAY
KMBDRY .BLOCK 1
;KIM TAPE READ BOUNDARY
HSBDRY .BLOCK 1
;HS TAPE READ BOUNDARY
SCR3
.BLOCK 1
;RAM SCRATCH LOCS 3-F
SCR4
.BLOCK 1
TAPET1 .BLOCK 1
;HS TAPE 1/2 BIT TIME
SCR6
.BLOCK 1
SCR7
.BLOCK 1
SCR8
.BLOCK 1
SCR9
.BLOCK 1
SCRA
.BLOCK 1
SCRB
.BLOCK 1
TAPET2 .BLOCK 1
;HS TAPE 1/2 BIT TIME
SCRD
.BLOCK 1
RC
=SCRD
SCRE
.BLOCK 1
SCRF
.BLOCK 1
DISBUF .BLOCK 5
;DISPLAY BUFFER
RDIG
.BLOCK 1
;RIGHT MOST DIGIT OF DISPLAY
.BLOCK 3
;NOT USED
PARNR .BLOCK 1
;NUMBER OF PARMS RECEIVED
;
; 3 16 BIT PARMS, LO HI ORDER
; PASSED TO EXECUTE BLOCKS
;
P3L
.BLOCK 1
P3H
.BLOCK 1
P2L
.BLOCK 1
P2H
.BLOCK 1
P1L
.BLOCK 1
P1H
.BLOCK 1
PADBIT .BLOCK 1
;PAD BITS FOR CARRIAGE RETURN
SDBYT .BLOCK 1
;SPEED BYTE FOR TERMINAL I/O
ERCNT .BLOCK 1
; ERROR COUNT (MAX $FF)
; BIT 7 = ECHO /NO ECHO, BIT 6 = CTL O TOGGLE SW
TECHO .BLOCK 1
;TERMINAL ECHO LAG
; BIT7 =CRT IN, 6 =TTY IN, 5 = TTY OUT, 4 = CRT OUT
TOUTFL .BLOCK 1
;OUTPUT FLAGS
KSHFL .BLOCK 1
;KEYBOARD SHIFT FLAG
TV
.BLOCK 1
;TRACE VELOCITY (0=SINGLE STEP)
LSTCOM .BLOCK 1
;STORE LAST MONITOR COMMAND
MAXRC .BLOCK 1
;MAXIMUM REC LENGTH FOR MEM DUMP
;
; USER REG'S FOLLOW
;
PCLR
.BLOCK 1
;PROG CTR

0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113

A65A
A65B
A65C
A65D
A65E
A65F
A660
A660
A660
A660
A663
A666
A669
A66C
A66F
A672
A672
A672
A672
A674
A676
A678
A678
A67A
A67A
A67C
A67E
A680
A680
A680
A680
A680
A680
A680
A680
A680
A680
A680
A680
A680
8000
8000
8003
8006
8009
800C
800F
800F
800F
800F
8010
8011
8012
8013
8014
8017
8019
801B

4C
20
20
20
4C

7C
FF
4A
71
03

8B
80
81
81
80

08
48
8A
48
BA
BD 04 01
29 10
F0 07
68

PCHR
.BLOCK 1
SR
.BLOCK 1
;STACK
FR
.BLOCK 1
;FLAGS
AR
.BLOCK 1
;AREG
XR
.BLOCK 1
;XREG
YR
.BLOCK 1
;YREG
;
; I/O VECTORS FOLLOW
;
INVEC .BLOCK 3
;IN CHAR
OUTVEC .BLOCK 3
;OUT CHAR
INSVEC .BLOCK 3
;IN STATUS
URSVEC .BLOCK 3
;UNRECOGNIZED SYNTAX VECTOR
URCVEC .BLOCK 3
;UNRECOGNIZED CMD/ERROR VECTOR
SCNVEC .BLOCK 3
;SCAN ON-BOARD DISPLAY
;
; TRACE, INTERRUPT VECTORS
;
EXEVEC .BLOCK 2
; EXEC CMD ALTERNATE INVEC
TRCVEC .BLOCK 2
;TRACE
UBRKVC .BLOCK 2
;USER BRK AFTER MONITOR
UBRKV =UBRKVC
UIRQVC .BLOCK 2
;USER NON-BRK IRQ AFTER MONITOR
UIRQV =UIRQVC
NMIVEC .BLOCK 2
;NMI
RSTVEC .BLOCK 2
;RESET
IRQVEC .BLOCK 2
;IRQ
;
;
;I/O REG DEFINITIONS
PADA
=$A400
;KEYBOARD/DISPLAY
PBDA
=$A402
;SERIAL I/O
OR3A
=$AC01
;WP, DBON, DBOFF
DDR3A =OR3A+2
;DATA DIRECTION FOR SAME
OR1B
=$A000
DDR1B =$A002
PCR1
=$A00C
; POR/TAPE REMOTE
;
; MONITOR MAINLINE
;
*=$8000
MONITR JMP MONENT
;INIT S, CLD, GET ACCESS
WARM
JSR GETCOM
;GET COMMAND + PARMS (0-3)
JSR DISPAT
;DISPATCH CMD,PARMS TO EXEC BLKS
JSR ERMSG
;DISP ER MSG IF CARRY SET
JMP WARM
;AND CONTINUE
;
; TRACE AND INTERRUPT ROUTINES
;
IRQBRK PHP
;IRQ OR BRK ?
PHA
TXA
PHA
TSX
LDA $0104,X
;PICK UP FLAGS
AND #$10
BEQ DETIRQ
PLA
;BRK

0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171

801C
801D
801E
801F
8022
8023
8024
8025
8026
8029
802C
802D
8030
8032
8035
8036
8039
803A
803D
8040
8042
8045
8047
804A
804D
804E
8051
8053
8053
8053
8053
8053
8054
8057
805A
805D
805E
8061
8064
8067
806A
806D
806E
806F
8072
8074
8077
807A
807C
807F
8082
8085
8088
808B
808E
8091
8092
8093

AA
68
28
6C
68
AA
68
28
6C
20
38
20
A9
4C
08
20
38
20
EE
D0
EE
A9
4C
20
18
20
A9

48
20
20
20
68
20
4C
8D
8E
8C
BA
D8
BD
69
8D
BD
69
8D
BD
8D
BD
9D
BD
9D
E8
E8
E8

F6 FF

F8 FF
86 8B
64 80
31
53 80
86 8B
64
59
03
5A
33
53
86

80
A6
A6
80
8B

64 80
30

D3 80
4D 83
37 83
47
03
5D
5E
5F

8A
80
A6
A6
A6

04
FF
59
05
FF
5A
03
5C
02
05
01
04

01
A6
01
A6
01
A6
01
01
01
01

TAX
PLA
PLP
JMP ($FFF6)
DETIRQ PLA
TAX
PLA
PLP
JMP ($FFF8)
SVIRQ JSR ACCESS
SEC
JSR SAVINT
LDA #'1'
JMP IDISP
USRENT PHP
JSR ACCESS
SEC
JSR SAVINT
INC PCLR
BNE *+5
INC PCHR
LDA #'3'
JMP IDISP
SVBRK JSR ACCESS
CLC
JSR SAVINT
LDA #'0'
; INTRPT CODES 0 =
;
1 =
;
2 =
;
3 =
IDISP PHA
JSR DBOFF
JSR CRLF
JSR OPCCOM
PLA
JSR OUTCHR
JMP WARM
SAVINT STA AR
STX XR
STY YR
TSX
CLD
LDA $104,X
ADC #$FF
STA PCLR
LDA $105,X
ADC #$FF
STA PCHR
LDA $103,X
STA FR
LDA $102,X
STA $105,X
LDA $101,X
STA $104,X
INX
INX
INX

;IRQ (NON BRK)

;SAVE REGS AND DISPLAY CODE

;USER ENTRY

BRK
IRQ
NMI
USER ENTRY
;OUT PC, INTRPT CODE (FROM A)
;STOP NMI'S

;SAVE USER REGS AFTER INTRPT

0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229

8094
8095
8096
8097
809A
809B
809E
809F
80A2
80A5
80A8
80AA
80AC
80AF
80B2
80B5
80B8
80BB
80BD
80C0
80C3
80C4
80C7
80CA
80CD
80D0
80D3
80D6
80D8
80DA
80DD
80E0
80E2
80E4
80E7
80E9
80EB
80EE
80F1
80F3
80F6
80F9
80FB
80FE
80FF
80FF
80FF
80FF
8102
8104
8107
810A
810C
810E
8110
8112
8114
8114

9A
E8
E8
8E
60
20
38
20
20
AD
D0
A9
4C
20
AD
20
20
90
4C
20
38
20
20
6C
20
4C
AD
29
09
8D
AD
09
D0
AD
29
09
8D
AD
09
8D
AD
29
8D
60

20
A9
20
20
F0
C9
F0
C9
F0

5B A6
86 8B
64
D3
56
05
32
53
37
5D
4A
5A
10
03
86

80
80
A6

64
D3
74
E4
FD
01
DF
10
01
03
30
0F
01
EF
20
01
03
30
03
03
CF
03

80
80
A6
80
83
AC

80
83
A6
83
83
80
8B

AC
AC
AC
AC
AC
AC
AC
AC

4D 83
2E
47 8A
1B 8A
F3
7F
F7
00
F3

C9 53

TXS
INX
INX
STX SR
RTS
SVNMI JSR ACCESS
;TRACE IF TV NE 0
SEC
JSR SAVINT
JSR DBOFF
;STOP NMI'S
LDA TV
BNE TVNZ
LDA #'2'
JMP IDISP
TVNZ
JSR OPCCOM
;TRACE WITH DELAY
LDA AR
JSR OBCRLF
;DISPLAY ACC
JSR DELAY
BCC TRACON
;STOP IF KEY ENTERED
JMP WARM
TRCOFF JSR ACCESS
;DISABLE NMIS
SEC
JSR SAVINT
JSR DBOFF
JMP (TRCVEC)
;AND GO TO SPECIAL TRACE
TRACON JSR DBON
;ENABLE NMI'S
JMP GO1ENT+3
;AND RESUME (NO WRITE PROT)
DBOFF LDA OR3A
;PULSE DEBUG OFF
AND #$DF
ORA #$10
STA OR3A
LDA DDR3A
ORA #$30
BNE DBNEW-3
;RELEASE FLIP FLOP SO KEY WORKS
DBON
LDA OR3A
;PULSE DEBUG ON
AND #$EF
ORA #$20
STA OR3A
LDA DDR3A
ORA #$30
STA DDR3A
DBNEW LDA DDR3A
;RELEASE FLIP FLOP
AND #$CF
STA DDR3A
RTS
;
; GETCOM - GET COMMAND AND 0-3 PARMS
;
GETCOM JSR CRLF
LDA #'.'
;PROMPT
JSR OUTCHR
GETC1 JSR INCHR
BEQ GETCOM
;CARRIAGE RETURN?
CMP #$7F
;DELETE?
BEQ GETC1
CMP #0
;NULL?
BEQ GETC1
; L,S,U NEED TO BE HASHED 2 BYTES TO ONE
CMP #'S'

0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287

8116
8118
811A
811C
811E
8120
8123
8126
8129
812C
812F
8131
8133
8134
8135
8138
813B
813D
813E
8141
8143
8145
8147
814A
814A
814A
814A
814C
814E
8151
8154
8156
8159
815B
815D
8160
8162
8164
8167
8169
816B
816E
8171
8171
8171
8171
8173
8174
8177
8179
817C
817E
8181
8184
8185
8188
8188
8188

F0
C9
F0
C9
F0
8D
20
20
20
4C
A9
10
0A
0A
8D
20
F0
18
6D
29
09
10
FF

1B
55
17
4C
0F
57
42
08
08
20
01
02

C9
D0
AD
AE
D0
4C
E0
D0
4C
E0
D0
4C
E0
D0
4C
6C

0D
20
57
49
03
95
01
03
DA
02
03
19
03
03
14
6A

90
48
20
A9
20
A9
20
20
68
4C

44

A6
83
82
82
82

57 A6
1B 8A
C2
57 A6
0F
10
D9
FF FF

4D
45
47
52
47
42

A6
A6
83
84
86
87
A6

83
8A
8A
83

FA 82

BEQ HASHUS
CMP #'U'
BEQ HASHUS
CMP #'L'
BEQ HASHL
STOCOM STA LSTCOM
JSR SPACE
JSR PSHOVE
;ZERO PARMS
JSR PSHOVE
JMP PARM
;AND GO GET PARMS
HASHL LDA #$01
;HASH LOAD CMDS TO ONE BYTE
BPL HASHUS+2
HASHUS ASL A
;HASH 'USER' CMDS TO ONE BYTE A
ASL A
;U0 = $14 THRU U17 =$1B
STA LSTCOM
JSR INCHR
;GET SECOND
BEQ GETCOM
CLC
ADC LSTCOM
AND #$0F
ORA #$10
BPL STOCOM
.DB $FF,$FF,$FF ;NOT USED
;
;DISPATCH TO EXEC BLK 0PARM, 1PARM, 2PARM, OR 3PARM
;
DISPAT CMP #$0D
;C/R IF OK ELSE URSVEC
BNE HIPN
LDA LSTCOM
LDX PARNR
BNE M12
JMP BZPARM
;0 PARM BLOCK
M12
CPX #$01
BNE M13
JMP B1PARM
;1 PARM BLOCK
M13
CPX #$02
BNE M14
JMP B2PARM
;2 PARM BLOCK
M14
CPX #$03
BNE HIPN
JMP B3PARM
;3 PARM BLOCK
HIPN
JMP (URSVEC+1) ;ELSE UNREC SYNTAX VECTOR
;
; ERMSG - PRINT ACC IN HEX IF CARRY SET
;
ERMSG BCC M15
PHA
JSR CRLF
LDA #'E'
JSR OUTCHR
LDA #'R'
JSR OUTCHR
JSR SPACE
PLA
JMP OUTBYT
;
; SAVER - SAVE ALL REG'S + FLAGS ON STACK
; RETURN WITH F,A,X,Y UNCHANGED

0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343
0344
0345

8188
8188
8189
818A
818B
818C
818D
818E
818F
8190
8191
8194
8197
819A
819D
81A0
81A3
81A6
81A9
81AC
81AF
81B0
81B3
81B4
81B5
81B6
81B7
81B8
81B8
81B9
81BA
81BD
81BE
81BE
81BF
81C0
81C1
81C4
81C4
81C5
81C6
81C7
81C8
81C9
81CA
81CB
81CB
81CB
81CB
81CD
81CF
81D1
81D2
81D3
81D6
81D9
81DC
81DF

08
48
48
48
08
48
8A
48
BA
BD
9D
BD
9D
BD
9D
BD
9D
BD
9D
98
9D
68
AA
68
28
60

09
05
07
09
01
07
08
04
06
08

01
01
01
01
01
01
01
01
01
01

06 01

08
BA
9D 04 01
28
08
68
BA
9D 04 01
68
A8
68
AA
68
28
60

C9
F0
C9
38
60
20
20
20
20
B0

20
02
3E
FA
3A
1B
75
14

82
83
8A
82

; STACK HAS
FLAGS,A,X,Y, PUSHED
SAVER PHP
PHA
PHA
PHA
PHP
PHA
TXA
PHA
TSX
LDA $0109,X
STA $0105,X
LDA $0107,X
STA $0109,X
LDA $0101,X
STA $0107,X
LDA $0108,X
STA $0104,X
LDA $0106,X
STA $0108,X
TYA
STA $0106,X
PLA
TAX
PLA
PLP
M15
RTS
; RESTORE EXCEPT A,F
RESXAF PHP
TSX
STA $0104,X
PLP
; RESTORE EXCEPT F
RESXF PHP
PLA
TSX
STA $0104,X
; RESTORE ALL 100%
RESALL PLA
TAY
PLA
TAX
PLA
PLP
RTS
;
; MONITOR UTILITIES
;
ADVCK CMP #$20
;SPACE?
BEQ M1
CMP #'>'
;FWD ARROW?
M1
SEC
RTS
OBCMIN JSR OUTBYT
;OUT BYTE, OUT COMMA, IN BYTE
COMINB JSR COMMA
;OUT COMMA, IN BYTE
INBYTE JSR INCHR
JSR ASCNIB
BCS OUT4

0346
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399
0400
0401
0402
0403

81E1
81E2
81E3
81E4
81E5
81E8
81EB
81EE
81F0
81F3
81F4
81F5
81F7
81F9
81FC
81FE
81FF
8201
8204
8206
8207
8208
820A
820D
8210
8213
8216
8219
821C
821D
821F
8220
8223
8225
8228
822B
822E
8231
8233
8235
8237
8239
823B
823E
8241
8244
8246
8248
824A
824D
824F
8251
8254
8257
8258
825A
825D
8260

0A
0A
0A
0A
8D
20
20
B0
0D
18
60
C9
D0
20
D0
B8
50
2C
C9
38
60
A2
0E
2E
2E
2E
2E
2E
CA
D0
60
20
A9
8D
8D
20
20
C9
F0
C9
D0
A2
8E
EE
AE
E0
D0
F0
20
B0
A2
0E
2E
CA
D0
0D
8D
A9

33
1B
75
11
33

A6
8A
82
A6

3A
05
1B 8A
F5
03
04 82
0D
10
4A
4B
4C
4D
4E
4F

A6
A6
A6
A6
A6
A6

EB
88
00
49
33
08
1B
2C
04
2D
11
FF
33
49
49
03
E3
1D
75
18
04
4A
4B

81
A6
A6
82
8A

A6
A6
A6

82
A6
A6

F7
4A A6
4A A6
FF

ASL
ASL
ASL
ASL
STA
JSR
JSR
BCS
ORA
GOOD
CLC
RTS
OUT4
CMP
BNE
JSR
BNE
OUT1
CLV
BVC
OUT2
BIT
CRCHK CMP
SEC
RTS
PSHOVE LDX
PRM10 ASL
ROL
ROL
ROL
ROL
ROL
DEX
BNE
RTS
PARM
JSR
LDA
STA
STA
PM1
JSR
PARFIL JSR
CMP
BEQ
CMP
BNE
M21
LDX
STX
INC
LDX
CPX
BNE
BEQ
M22
JSR
BCS
LDX
M23
ASL
ROL
DEX
BNE
ORA
STA
LDA

A
A
A
A
SCR3
INCHR
ASCNIB
OUT2
SCR3
#':'
OUT1
INCHR
GOOD
CRCHK
CRCHK
#$0D
#$10
P3L
P3H
P2L
P2H
P1L
P1H

;COLON ?
;CARRIAGE RETURN?

;CHECK FOR C/R
;PUSH PARMS DOWN

PRM10
SAVER
#0
PARNR
SCR3
PSHOVE
INCHR
#','
M21
#'-'
M22
#$FF
SCR3
PARNR
PARNR
#$03
PM1
M24
ASCNIB
M24
#4
P3L
P3H
M23
P3L
P3L
#$FF

;GET PARMS - RETURN ON C/R OR ERR

;VALID DELIMETERS - ,

0404
0405
0406
0407
0408
0409
0410
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421
0422
0423
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438
0439
0440
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450
0451
0452
0453
0454
0455
0456
0457
0458
0459
0460
0461

8262
8265
8267
826A
826C
826F
8271
8272
8275
8277
8279
827B
827D
827F
8281
8283
8285
8287
8289
828B
828C
828D
828F
8291
8292
8293
8296
8298
829B
829C
829F
82A1
82A4
82A6
82A7
82AA
82AC
82AF
82B1
82B2
82B4
82B6
82B8
82BA
82BD
82BE
82C0
82C2
82C4
82C6
82C8
82CA
82CD
82CF
82D2
82D4
82D6
82D9

8D
D0
2C
F0
EE
C9
18
4C
C9
F0
C9
90
C9
B0
C9
B0
C9
90
C9
38
60
E9
29
18
60
EE
D0
EE
60
AE
86
AE
86
60
AE
86
AE
86
60
E6
D0
E6
D0
2C
60
A5
D0
A5
F0
C6
C6
20
A5
CD
D0
A5
CD
B8

33 A6
C7
33 A6
03
49 A6
0D
B8 81
0D
19
30
0C
47
08
41
08
3A
06
30
37
0F
4A A6
03
4B A6

M24
M25
ASCNIB

M26
M27
M28
M29
INCP3

4D A6
FF
4C A6
FE

P2SCR

4B A6
FF
4A A6
FE

P3SCR

FE
14
FF
10
BD 82

INCCMP

FE
06
FF
F2
FF
FE
88 81
FF
4B A6
05
FE
4A A6

WRAP
EXWRAP
DECCMP

M32
COMPAR

EXITCP

STA
BNE
BIT
BEQ
INC
CMP
CLC
JMP
CMP
BEQ
CMP
BCC
CMP
BCS
CMP
BCS
CMP
BCC
CMP
SEC
RTS
SBC
AND
CLC
RTS
INC
BNE
INC
RTS
LDX
STX
LDX
STX
RTS
LDX
STX
LDX
STX
RTS
INC
BNE
INC
BNE
BIT
RTS
LDA
BNE
LDA
BEQ
DEC
DEC
JSR
LDA
CMP
BNE
LDA
CMP
CLV

SCR3
PARFIL
SCR3
M25
PARNR
#$0D
RESXAF
#$0D
M29
#'0'
M26
#'G'
M26
#'A'
M27
#':'
M28
#'0'

;C/R?

;CARRY SET - NON HEX
#$37
#$0F
P3L
*+5
P3H

;INCREMENT P3 (16 BITS)

P2H
$FF
P2L
$FE

;MOVE P2 TO FE,FF

P3H
$FF
P3L
$FE

;MOVE P3 TO FE,FF

$FE
COMPAR
$FF
COMPAR
EXWRAP

;INCREM FE,FF, COMPARE TO P3

$FE
M32
$FF
WRAP
$FF
$FE
SAVER
$FF
P3H
EXITCP
$FE
P3L

;DECREM FE,FF AND COMPARE TO P3

;TEST TO WRAP AROUND

;COMPARE FE,FF TO P3

0462
0463
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503
0504
0505
0506
0507
0508
0509
0510
0511
0512
0513
0514
0515
0516
0517
0518
0519

82DA
82DD
82DE
82DF
82E0
82E3
82E6
82E8
82EB
82EC
82ED
82EE
82F1
82F4
82F5
82F6
82F9
82FA
82FB
82FC
82FD
82FE
82FF
8300
8303
8304
8307
8308
8309
830B
830D
830F
8311
8313
8315
8316
8319
831B
831D
8320
8322
8325
8328
832B
832E
8330
8333
8336
8337
833A
833B
833D
833F
8342
8343
8345
8348
8349

4C
08
48
18
6D
8D
90
EE
68
28
60
AD
AE
48
8A
20
68
48
48
4A
4A
4A
4A
20
68
20
68
60
29
C9
B0
69
90
69
60
20
A6
A5
4C
A9
4C
20
AD
4C
A9
8D
8D
60
20
48
A9
D0
20
48
A9
20
68
60

BE 81

36 A6
36 A6
03
37 A6

59 A6
5A A6
FA 82

44 8A
44 8A
0F
0A
04
30
02
36
4D
FF
FE
F4
3F
47
3A
36
FA
00
36
37

83
82
8A
83
A6
82
A6
A6

EE 82
2C
06
42 83
20
47 8A

JMP
CHKSAD PHP
PHA
CLC
ADC
STA
BCC
INC
M33
PLA
PLP
RTS
OUTPC LDA
LDX
OUTXAH PHA
TXA
JSR
PLA
OUTBYT PHA
PHA
LSR
LSR
LSR
LSR
JSR
PLA
JSR
PLA
RTS
NIBASC AND
CMP
BCS
ADC
BCC
NIBALF ADC
EXITNB RTS
CRLFSZ JSR
LDX
LDA
JMP
OUTQM LDA
JMP
OCMCK JSR
LDA
JMP
ZERCK LDA
STA
STA
RTS
OPCCOM JSR
COMMA PHA
LDA
BNE
SPC2
JSR
SPACE PHA
LDA
SPCP3 JSR
PLA
RTS

RESXF
;16 BIT CKSUM IN SCR6,7
SCR6
SCR6
M33
SCR7

PCLR
PCHR

;OUTPUT PC

OUTBYT
;OUTPUT 2 HEX DIGS FROM A
A
A
A
A
NBASOC
NBASOC
#$0F
#$0A
NIBALF
#$30
EXITNB
#$36

;NIBBLE IN A TO ASCII IN A
;LINE FEED

CRLF
$FF
$FE
OUTXAH
#'?'
OUTCHR
COMMA
SCR6
OUTBYT
#0
SCR6
SCR7

;PRINT CRLF, FF, FE

OUTPC

;PC OUT, COMMA OUT
;COMMA OUT

#','
SPCP3
SPACE
#$20
OUTCHR

;OUT COMMA, CKSUM LO
;INIT CHECKSUM

;2 SPACES OUT
;1 SPACE OUT
;SPACE

0520
0521
0522
0523
0524
0525
0526
0527
0528
0529
0530
0531
0532
0533
0534
0535
0536
0537
0538
0539
0540
0541
0542
0543
0544
0545
0546
0547
0548
0549
0550
0551
0552
0553
0554
0555
0556
0557
0558
0559
0560
0561
0562
0563
0564
0565
0566
0567
0568
0569
0570
0571
0572
0573
0574
0575
0576
0577

834A
834D
834E
8350
8353
8355
8358
8359
835A
835D
8360
8362
8365
8368
836B
836E
836F
8371
8374
8377
8379
837C
837E
8381
8383
8386
8386
8386
8386
8389
838B
838E
8390
8391
8392
8395
8395
8395
8395
8395
8395
8395
8395
8397
8399
839C
839E
83A1
83A4
83A7
83AA
83AC
83AF
83B2
83B4
83B7
83BA
83BD

20
48
A9
20
A9
20
68
60
AE
20
A9
8D
8D
0E
2E
CA
D0
20
20
B0
EE
D0
EE
D0
4C

FA 82

20
90
20
B0
38
60
6C

92 83
06
92 83
FB

C9
D0
20
A9
20
20
20
20
B0
8D
20
B0
8D
AD
8D
90

52
5A
4D
50
47
42
EE
D6
13
34
D9
0B
59
34
5A
09

0D
47 8A
0A
47 8A
56
88
FF
39
38
38
39
F7
03
86
0A
38
03
39
EE
BE

A6
81
A6
A6
A6
A6
89
83
A6
A6
81

67 A6

83
8A
83
82
81
A6
81
A6
A6
A6

OBCRLF JSR OUTBYT
;BYTE OUT, CRLF OUT
CRLF
PHA
LDA #$0D
JSR OUTCHR
LDA #$0A
;LINE FEED
JSR OUTCHR
PLA
RTS
DELAY LDX TV
;DELAY DEPENDS ON TV
DL1
JSR SAVER
LDA #$FF
STA SCR9
STA SCR8
DLY1
ASL SCR8
;(SCR9,8)=FFFF-2**X
ROL SCR9
DEX
BNE DLY1
DLY2
JSR IJSCNV
;SCAN DISPLAY
JSR INSTAT
;SEE IF KEY DOWN
BCS DLY0
INC SCR8
;SCAN 2**X+1 TIMES
BNE *+5
INC SCR9
BNE DLY2
DLY0
JMP RESXF
; INSTAT - SEE IF KEY DOWN, RESULT IN CARRY
; KEYSTAT, TSTAT RETURN IMMEDIATELY W/STATUS
; INSTAT WAITS FOR RELEASE
INSTAT JSR INJISV
BCC INST2
INST1 JSR INJISV
BCS INST1
SEC
INST2 RTS
INJISV JMP (INSVEC+1)
;
;
; *** EXECUTE BLOCKS BEGIN HERE
;
BZPARM =*
; ZERO PARM COMMANDS
;
REGZ
CMP #'R'
;DISP REGISTERS
BNE GOZ
;PC,S,F,A,X,Y
RGBACK JSR CRLF
LDA #'P'
JSR OUTCHR
JSR SPACE
JSR OUTPC
JSR COMINB
BCS NH3
STA SCR4
JSR INBYTE
BCS NH3
STA PCLR
LDA SCR4
STA PCHR
BCC M34

0578
0579
0580
0581
0582
0583
0584
0585
0586
0587
0588
0589
0590
0591
0592
0593
0594
0595
0596
0597
0598
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612
0613
0614
0615
0616
0617
0618
0619
0620
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635

83BF
83C1
83C2
83C3
83C6
83C8
83CA
83CB
83CD
83CF
83D2
83D5
83D5
83D8
83DB
83DE
83E1
83E4
83E6
83E9
83EB
83ED
83F0
83F2
83F3
83F5
83F7
83FA
83FD
8400
8401
8404
8405
8408
8409
840C
840D
8410
8413
8416
8417
8419
841B
841E
8421
8424
8426
8429
842C
842F
8431
8433
8436
8438
843A
843D
843F
8440

D0
18
60
20
D0
A0
C8
C0
F0
20
B9

02

20
20
20
B9
20
B0
99
90
F0
20
F0
60
C9
D0
20
20
AE
9A
AD
48
AD
48
AD
48
AC
AE
AD
40
C9
F0
4C
20
20
A9
8D
20
20
C9
D0
20
B0
D0
AD
F0
38
4C

47
42
3F
5A
D3
05
5A
DF
D4
CB
D8

CB 81
FA
00
06
CA
4D 83
99 8F
8A
83
83
A6
81
A6
81

47
20
4D 83
9C 8B
5B A6
5A A6
59 A6
5C A6
5F A6
5E A6
5D A6
11
03
A7
88
4D
00
52
2E
1B
3B
F9
A1
56
09
52
01

84
81
83
A6
83
8A
84
A6

B8 81

NH3
EXITRG
EXRGP1
NOTCR

BNE
CLC
RTS
JSR
BNE
M34
LDY
M35
INY
CPY
BEQ
JSR
LDA
; OUTPUT 3
JSR
JSR
JSR
LDA
JSR
BCS
STA
BCC
M36
BEQ
JSR
BEQ
RTS
GOZ
CMP
BNE
JSR
GO1ENT JSR
LDX
TXS
LDA
PHA
LDA
NR10
PHA
LDA
PHA
LDY
LDX
LDA
RTI
LPZB
CMP
BEQ
JMP
JSR
JSR
LDA
STA
LPZ
JSR
LP1
JSR
CMP
BNE
JSR
BCS
BNE
LDA
BEQ
SEC
JMP

NOTCR
ADVCK
EXRGP1
#0
#6
RGBACK
CRLF
RGNAM-1,Y
;GET REG NAME
SPACES TO LINE UP DISPLAY
OUTCHR
SPACE
SPC2
PCHR,Y
OBCMIN
M36
PCHR,Y
M35
EXITRG
ADVCK
M35
#'G'
LPZB
CRLF
NACCES
SR

;WRITE PROT MONITOR RAM
;RESTORE REGS

PCHR
PCLR
FR
YR
XR
AR
#$11
*+5
DEPZ
SAVER
CRLF
#0
ERCNT
ZERCK
INCHR
#$3B
LP1
LDBYTE
TAPERR
NUREC
ERCNT
*+3
RESXAF

;LOAD PAPER TAPE

;SEMI COLON

;ERRORS ?

0636
0637
0638
0639
0640
0641
0642
0643
0644
0645
0646
0647
0648
0649
0650
0651
0652
0653
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664
0665
0666
0667
0668
0669
0670
0671
0672
0673
0674
0675
0676
0677
0678
0679
0680
0681
0682
0683
0684
0685
0686
0687
0688
0689
0690
0691
0692
0693

8443
8446
8449
844B
844D
8450
8452
8454
8457
8459
845B
845D
845F
8461
8464
8466
8468
846A
846D
8470
8473
8475
8478
847A
847D
847F
8482
8484
8487
8489
848B
848E
8491
8493
8495
8497
849A
849C
849F
84A1
84A4
84A7
84A9
84AB
84AE
84B0
84B2
84B5
84B7
84B9
84BB
84BE
84C0
84C3
84C6
84C8
84CA
84CC

8D
20
B0
85
20
B0
85
20
B0
A0
91
D1
F0
AD
29
C9
F0
EE
20
CE
D0
20
B0
CD
D0
20
B0
CD
F0
D0
20
AD
29
C9
F0
AD
69
8D
D0
20
4C
C9
D0
4C
C9
D0
4C
C9
D0
A5
8D
A5
8D
4C
C9
D0
A0
4C

3D
A1
43
FF
A1
D7
FE
A1
35
00
FE
FE
0C
52
0F
0F
03
52
B2
3D
DF
D9
14
37
0C
D9
0A
36
A0
03
D9
52
F0
F0
92
52
10
52
88
D9
DD
44
03
E1
4D
03
17
56
0D
FE
4A
FF
4B
9A
12
05
00
78

A6
84
84
84

A6

A6
82
A6
81
A6
81
A6
81
A6

A6
A6
81
82
84
85

A6
A6
85

8C

NUREC

STA
JSR
BCS
STA
JSR
BCS
STA
MORED JSR
BCS
LDY
STA
CMP
BEQ
LDA
AND
CMP
BEQ
INC
LPGD
JSR
DEC
BNE
JSR
BCS
CMP
BNE
JSR
BCS
CMP
BEQ
BNE
BADDY JSR
TAPERR LDA
AND
CMP
BEQ
LDA
ADC
STA
BNE
LDBYTE JSR
JMP
DEPZ
CMP
BNE
JMP
MEMZ
CMP
BNE
JMP
VERZ
CMP
BNE
LDA
STA
LDA
STA
JMP
L1ZB
CMP
BNE
LDY
L1J
JMP

SCRD
LDBYTE
TAPERR
$FF
LDBYTE
LPZ
$FE
LDBYTE
TAPERR
#0
($FE),Y
($FE),Y
LPGD
ERCNT
#$0F
#$0F
*+5
ERCNT
INCCMP
SCRD
MORED
INBYTE
TAPERR
SCR7
BADDY
INBYTE
TAPERR
SCR6
LPZ
TAPERR
INBYTE
ERCNT
#$F0
#$F0
LPZ
ERCNT
#$10
ERCNT
LPZ
INBYTE
CHKSAD
#'D'
MEMZ
NEWLN
#'M'
VERZ
NEWLOC
#'V'
L1ZB
$FE
P3L
$FF
P3H
VER1+4
#$12
L2ZB
#0
LENTRY

;(ALWAYS)

;DEPOSIT, 0 PARM - USE (OLD)
;MEM, 0 PARM - USE (OLD)
;VERIFY, 0 PARM - USE (OLD)
; ... DO 8 BYTES (LIKE VER 1 PARM)

;LOAD KIM, ZERO PARM
;MODE = KIM
;GO TO CASSETTE ROUTINE

0694
0695
0696
0697
0698
0699
0700
0701
0702
0703
0704
0705
0706
0707
0708
0709
0710
0711
0712
0713
0714
0715
0716
0717
0718
0719
0720
0721
0722
0723
0724
0725
0726
0727
0728
0729
0730
0731
0732
0733
0734
0735
0736
0737
0738
0739
0740
0741
0742
0743
0744
0745
0746
0747
0748
0749
0750
0751

84CF
84D1
84D3
84D5
84D7
84DA
84DA
84DA
84DA
84DA
84DC
84DE
84E1
84E4
84E6
84E8
84EB
84EE
84F0
84F2
84F4
84F6
84F9
84FC
84FD
84FF
8501
8503
8505
8507
8509
850C
850E
850F
8510
8512
8514
8517
851A
851D
851F
8521
8524
8526
8528
852A
852C
852E
8531
8534
8535
8537
8539
853B
853D
853F
8541
8543

C9
D0
A0
D0
6C

13
04
80
F5
6D A6

C9
D0
20
20
A0
A2
20
20
B0
91
D1
F0
20
20
CA
D0
F0
F0
C9
D0
70
20
10
18
60
C9
D0
20
20
20
A0
B1
20
B0
A0
91
D1
F0
20
20
18
90
F0
50
C9
F0
C9
F0
C9

44
32
A7
16
00
08
42
D9
11
FE
FE
03
20
B2

82
83
83
81

83
82

E9
E0
0B
20
4C
F0
42 83
EB
4D
65
A7
16
3A
00
FE
D3
11
00
FE
FE
03
20
B2
E0
3E
04
3C
D8
20
EE
3E

82
83
83
81

83
82

L2ZB

CMP #$13
;LOAD HS, ZERO PARM
BNE EZPARM
LDY #$80
;MODE - HS
BNE L1J
;(ALWAYS)
EZPARM JMP (URCVEC+1) ;ELSE UNREC COMMAND
B1PARM =*
;
; 1 PARAMETER COMMAND EXEC BLOCKS
;
DEP1
CMP #'D'
;DEPOSIT, 1 PARM
BNE MEM1
JSR P3SCR
NEWLN JSR CRLFSZ
LDY #0
LDX #8
DEPBYT JSR SPACE
JSR INBYTE
BCS NH41
STA ($FE),Y
CMP ($FE),Y
;VERIFY
BEQ DEPN
JSR OUTQM
;TYPE "?" IF NG
DEPN
JSR INCCMP
DEX
BNE DEPBYT
BEQ NEWLN
NH41
BEQ DEPEC
CMP #$20
;SPACE = FWD
BNE DEPES
BVS DEPN
JSR SPACE
BPL DEPN
DEPEC CLC
RTS
MEM1
CMP #'M'
;MEMORY, 1 PARM
BNE GO1
JSR P3SCR
NEWLOC JSR CRLFSZ
JSR COMMA
LDY #0
LDA ($FE),Y
JSR OBCMIN
BCS NH42
LDY #$00
STA ($FE),Y
CMP ($FE),Y
;VERIFY MEM
BEQ NXTLOC
JSR OUTQM
;TYPE ? AND CONTINUE
NXTLOC JSR INCCMP
CLC
BCC NEWLOC
NH42
BEQ EXITM1
BVC *+6
CMP #'<'
BEQ NEWLOC
CMP #$20
;SPACE ?
BEQ NXTLOC
CMP #'>'

0752
0753
0754
0755
0756
0757
0758
0759
0760
0761
0762
0763
0764
0765
0766
0767
0768
0769
0770
0771
0772
0773
0774
0775
0776
0777
0778
0779
0780
0781
0782
0783
0784
0785
0786
0787
0788
0789
0790
0791
0792
0793
0794
0795
0796
0797
0798
0799
0800
0801
0802
0803
0804
0805
0806
0807
0808
0809

8545
8547
8549
854B
854D
854F
8551
8553
8554
8555
8558
8559
855B
855D
855E
8560
8562
8564
8566
8567
8569
856B
856C
856E
8570
8572
8574
8575
8577
8578
8579
857B
857D
8580
8583
8585
8586
8588
8589
858B
858C
858F
8590
8593
8596
8598
859A
859D
85A0
85A1
85A3
85A6
85A9
85AC
85AE
85B1
85B4
85B6

F0
C9
F0
C9
F0
C9
F0
38
60
20
18
90
A5
18
69
85
90
E6
18
90
A5
38
E9
85
B0
C6
18
90
18
60
C9
D0
20
20
A2
9A
A9
48
A9
48
AD
48
AD
4C
C9
D0
AD
8D
18
69
8D
AD
8D
69
8D
4C
C9
D0

EA
2B
10
3C
06
2D
16
BE 82
BC
FE
08
FE
02
FF
AE
FE
08
FE
02
FF
A0
47
19
4D 83
9C 8B
FF
7F
FF
4B A6
4A
08
56
1A
4A
4C
07
4A
4B
4D
00
4B
40
4A
1F

A6
84
A6
A6
A6
A6
A6
A6
86

BEQ
CMP
BEQ
CMP
BEQ
CMP
BEQ
DEPES SEC
RTS
PRVLOC JSR
CLC
BCC
LOCP8 LDA
CLC
ADC
STA
BCC
INC
M42
CLC
BCC
LOCM8 LDA
SEC
SBC
STA
BCS
DEC
M43
CLC
BCC
EXITM1 CLC
RTS
GO1
CMP
BNE
JSR
JSR
LDX
TXS
LDA
PHA
LDA
PHA
LDA
PHA
LDA
JMP
VER1
CMP
BNE
LDA
STA
CLC
ADC
STA
LDA
STA
ADC
STA
JMP
JUMP1 CMP
BNE

NXTLOC
#'+'
LOCP8
#'<'
PRVLOC
#'-'
LOCM8
DECCMP

;BACK ONE BYT

NEWLOC
$FE

;GO FWD 8 BYTES

#$08
$FE
M42
$FF
NEWLOC
$FE

;GO BACKWD 8 BYTES

#$08
$FE
M43
$FF
NEWLOC
#'G'
VER1
CRLF
NACCES
#$FF

;GO, 1 PARM (RTRN ADDR ON STK)
; ... PARM IS ADDR TO GO TO
;WRITE PROT MONITR RAM
;PUSH RETURN ADDR

#$7F
#$FF
P3H
P3L
NR10
#'V'
JUMP1
P3L
P2L
#$07
P3L
P3H
P2H
#0
P3H
VER2+4
#'J'
L11B

;VERIFY, 1 PARM (8 BYTES, CKSUM)

;JUMP (JUMP TABLE IN SYS RAM)

0810
0811
0812
0813
0814
0815
0816
0817
0818
0819
0820
0821
0822
0823
0824
0825
0826
0827
0828
0829
0830
0831
0832
0833
0834
0835
0836
0837
0838
0839
0840
0841
0842
0843
0844
0845
0846
0847
0848
0849
0850
0851
0852
0853
0854
0855
0856
0857
0858
0859
0860
0861
0862
0863
0864
0865
0866
0867

85B8
85BB
85BD
85BF
85C2
85C3
85C4
85C6
85C7
85C9
85CA
85CC
85CD
85D0
85D1
85D4
85D7
85D9
85DB
85DD
85E0
85E2
85E4
85E5
85E6
85E9
85EC
85EF
85F1
85F3
85F5
85F7
85F9
85FB
85FE
8600
8602
8603
8606
8607
8608
860A
860C
860F
8611
8614
8615
8616
8619
8619
8619
8619
8619
861B
861D
8620
8623
8625

AD
C9
B0
20
0A
A8
A2
9A
A9
48
A9
48
B9
48
B9
4C
C9
D0
A0
AD
C9
D0
38
60
20
20
4C
C9
D0
A0
D0
C9
D0
AD
29
C9
2A
4E
2A
0A
29
49
8D
A9
8D
18
60
4C

4A A6
08
26
9C 8B

C9
D0
20
AD
A0
91

10
12
A7 82
4D A6
01
FE

FF
7F
FF
21 A6
20 A6
08 84
12
14
00
4A A6
FF
02
08
08
78
13
04
80
E6
57
1B
4A
11
08

82
82
8C

A6

4B A6
0F
0F
01 AC
0F
03 AC
27 88

LDA P3L
CMP #8
;0-7 ONLY VALID
BCS JUM2
JSR NACCES
;WRITE PROT SYS RAM
ASL A
TAY
LDX #$FF
;INIT STK PTR
TXS
LDA #$7F
;PUSH COLD RETURN
PHA
LDA #$FF
PHA
LDA JTABLE+1,Y ;GET ADDR FROM TABLE
PHA
;PUSH ON STACK
LDA JTABLE,Y
JMP NR10
;LOAD UP USER REG'S AND RTI
L11B
CMP #$12
;LOAD KIM FMT, 1 PARM
BNE L21B
LDY #0
;MODE = KIM
L11C
LDA P3L
CMP #$FF
;ID MUST NOT BE FF
BNE *+4
SEC
JUM2
RTS
JSR PSHOVE
;FIX PARM POSITION
L11D
JSR PSHOVE
JMP LENTRY
L21B
CMP #$13
;LOAD TAPE, HS FMT, 1 PARM
BNE WPR1B
LDY #$80
;MODE = HS
BNE L11C
WPR1B CMP #'W'
;WRITE PROT USER RAM
BNE E1PARM
LDA P3L
; FIRST DIG IS 1K ABOVE 0,
AND #$11
; SECOND IS 2K ABOVE 0
CMP #8
; THIRD IS 3K ABOVE 0.
ROL A
LSR P3H
ROL A
ASL A
AND #$0F
EOR #$0F
;0 IS PROTECT
STA OR3A
LDA #$0F
STA DDR3A
CLC
RTS
E1PARM JMP CALC3
B2PARM =*
;
; 2 PARAMETER EXEC BLOCKS
;
STD2
CMP #$10
;STORE DOUBLE BYTE
BNE MEM2
JSR P3SCR
LDA P2H
LDY #1
STA ($FE),Y

0868
0869
0870
0871
0872
0873
0874
0875
0876
0877
0878
0879
0880
0881
0882
0883
0884
0885
0886
0887
0888
0889
0890
0891
0892
0893
0894
0895
0896
0897
0898
0899
0900
0901
0902
0903
0904
0905
0906
0907
0908
0909
0910
0911
0912
0913
0914
0915
0916
0917
0918
0919
0920
0921
0922
0923
0924
0925

8627
8628
862B
862D
862E
862F
8631
8633
8636
8639
863C
863E
8640
8643
8646
8649
864B
864E
8650
8652
8655
8658
865B
865D
865F
8661
8662
8664
8667
866A
866C
866D
866E
8671
8673
8675
8676
8678
867B
867E
8681
8684
8687
8688
868A
868C
868F
8691
8693
8695
8698
869A
869C
869D
86A0
86A3
86A6
86A8

88
AD
91
18
60
C9
D0
AD
8D
4C
C9
D0
20
20
20
A2
20
A0
B1
20
20
20
70
F0
B0
CA
D0
20
20
90
18
60
20
E0
F0
E8
10
20
20
20
AE
20
60
C9
D0
AD
C9
D0
A0
4C
C9
D0
18
20
20
20
B0
4C

4C A6
FE
4D
09
4C
4E
08
56
48
9C
2E
16
08
42
00
FE
DD
FA
B2
11
02
0D

A6
A6
88
82
83
83
83
82
82
82

E7
25 83
86 83
DA
BE 82
08
03
F6
25
4D
42
37
F4

83
83
83
A6
82

12
0C
4C A6
FF
F4
00
E9 85
1C
75
88
9C
FA
03
C4

81
82
86
81

DEY
LDA
STA
CLC
RTS
MEM2
CMP
BNE
LDA
STA
JMP
VER2
CMP
BNE
JSR
JSR
VADDR JSR
LDX
V2
JSR
LDY
LDA
JSR
JSR
JSR
BVS
BEQ
BCS
DEX
BNE
JSR
JSR
BCC
CLC
RTS
V1
JSR
CPX
BEQ
INX
BPL
JSR
JSR
JSR
LDX
JSR
RTS
L12B
CMP
BNE
LDA
CMP
BNE
LDY
JMP
SP2B
CMP
BNE
CLC
JSR
JSR
SP2C
JSR
BCS
SPEXIT JMP

P2L
($FE),Y
#'M'
VER2
P2L
P1L
MEM3C
#'V'
L12B
P2SCR
ZERCK
CRLFSZ
#8
SPACE
#0
($FE),Y
CHKSAD
OUTBYT
INCCMP
V1
*+4
V1

;CONTINUE MEM SEARCH W/OLD PTR

;VERIFY MEM W/CHKSUMS , 2 PARM

V2
OCMCK
INSTAT
VADDR
DECCMP
#8
*+5
V1
OCMCK
CRLF
SPACE
SCR7
OUTXAH
#$12
SP2B
P2L
#$FF
L12B-1
#0
L11D
#$1C
E2PARM
SAVER
P2SCR
DIFFZ
SP2D
RESALL

;LOAD KIM FMT TAPE, 2 PARMS
;ID MUST BE FF
;ERR
;MODE = HS
;SAVE PAPER TAPE, 2 PARMS

0926
0927
0928
0929
0930
0931
0932
0933
0934
0935
0936
0937
0938
0939
0940
0941
0942
0943
0944
0945
0946
0947
0948
0949
0950
0951
0952
0953
0954
0955
0956
0957
0958
0959
0960
0961
0962
0963
0964
0965
0966
0967
0968
0969
0970
0971
0972
0973
0974
0975
0976
0977
0978
0979
0980
0981
0982
0983

86AB
86AE
86B1
86B3
86B6
86B8
86BA
86BD
86BF
86C2
86C5
86C8
86CA
86CD
86CF
86D2
86D4
86D6
86D9
86DC
86DE
86E1
86E3
86E6
86E8
86EB
86EE
86F1
86F2
86F4
86F7
86FA
86FD
8700
8701
8703
8704
8707
8709
870B
870C
870E
870F
8710
8711
8714
8714
8714
8714
8714
8716
8718
871B
871D
8720
8723
8725
8727

20
CD
90
AD
B0
69
8D
A9
20
AD
20
A5
20
A5
20
A0
B1
20
20
B0
20
70
CE
D0
AE
AD
20
18
90
20
4C
20
AD
38
E5
48
AD
E5
F0
68
A9
60
68
60
4C

4D
58
05
58
02
01
3D
3B
47
3D
F4
FF
F4
FE
F4
00
FE
F4
86
CA
B2
C5
3D
EA
37
36
F4

C9
D0
20
A9
8D
AD
A0
91
D1

46
21
9C 82
00
52 A6
4E A6
00
FE
FE

AF
DD
FA
2E
4A

83
A6

SP2D

A6
A6

SP2E
SP2F

8A
A6
86
86
86
MORED2
86
83
82
A6
A6
A6
82
82
82
83
A6

SVBYTE
DIFFZ
DIFFL

FE
4B A6
FF
04
FF
DIFF1
27 88

JSR
CMP
BCC
LDA
BCS
ADC
STA
LDA
JSR
LDA
JSR
LDA
JSR
LDA
JSR
LDY
LDA
JSR
JSR
BCS
JSR
BVS
DEC
BNE
LDX
LDA
JSR
CLC
BCC
JSR
JMP
JSR
LDA
SEC
SBC
PHA
LDA
SBC
BEQ
PLA
LDA
RTS
PLA
RTS
JMP
=*

CRLF
MAXRC
SP2E
MAXRC
SP2F
#1
RC
#$3B
OUTCHR
RC
SVBYTE
$FF
SVBYTE
$FE
SVBYTE
#$00
($FE),Y
SVBYTE
INSTAT
SPEXIT
INCCMP
SPEXIT
RC
MORED2
SCR7
SCR6
OUTXAH

;SEMI COLON

;STOP IF KEY DEPRESSED

SP2C
CHKSAD
OUTBYT
ZERCK
P3L
$FE
P3H
$FF
DIFF1
#$FF

E2PARM
CALC3
;MAY BE CALC OR EXEC
B3PARM
;
; 3 PARAMETER COMMAND EXECUTE BLOCKS
;
FILL3 CMP #'F'
;FILL MEM
BNE BLK3
JSR P2SCR
LDA #0
STA ERCNT
;ZERO ERROR COUNT
LDA P1L
F1
LDY #0
STA ($FE),Y
CMP ($FE),Y
;VERIFY

0984
0985
0986
0987
0988
0989
0990
0991
0992
0993
0994
0995
0996
0997
0998
0999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041

8729
872B
872E
8731
8733
8735
8737
8739
873B
873D
8740
8742
8745
8748
874B
874D
8750
8752
8754
8756
8758
875A
875C
875E
8761
8763
8765
8767
876A
876C
876E
8770
8772
8774
8775
8778
877A
877C
877F
8781
8782
8784
8786
8788
878A
878C
878E
8791
8794
8797
879A
879D
87A0
87A2
87A4
87A6
87A8
87AB

F0
20
20
70
F0
90
B0
C9
F0
4C
A9
8D
20
AD
85
AD
85
C5
D0
A5
C5
F0
B0
20
E6
D0
E6
20
70
F0
90
B0
A5
18
6D
85
A5
6D
85
38
A5
E5
85
A5
E5
85
20
AD
8D
AD
8D
20
A5
D0
C6
C6
20
70

03
C1
B2
7C
EE
EC
76
42
03
CD
00
52
9C
4E
FC
4F
FD
FF
06
FC
FE
53
14
B7
FC
02
FD
B2
43
F0
EE
3D
FC

87
82

F3

F2
BLK3
87
A6
82
A6
A6

87

BLP

82

B2

4A A6
FC
FD
4B A6
FD
FC
FE
FC
FD
FF
FD
A7
4C
4A
4D
4B
B7
FC
02
FD
FC
BE
02

82
A6
A6
A6
A6
87

82

BLP1

BEQ
JSR
JSR
BVS
BEQ
BCC
BCS
CMP
BEQ
JMP
LDA
STA
JSR
LDA
STA
LDA
STA
CMP
BNE
LDA
CMP
BEQ
BCS
JSR
INC
BNE
INC
JSR
BVS
BEQ
BCC
BCS
LDA
CLC
ADC
STA
LDA
ADC
STA
SEC
LDA
SBC
STA
LDA
SBC
STA
JSR
LDA
STA
LDA
STA
JSR
LDA
BNE
DEC
DEC
JSR
BVS

F3
BRTT
INCCMP
B1
F1
F1
B1
#'B'
*+5
S13B
#0
ERCNT
P2SCR
P1L
$FC
P1H
$FD
$FF
*+8
$FC
$FE
B1
B2
BMOVE
$FC
*+4
$FD
INCCMP
B1
BLP
BLP
B1
$FC

;INC ERCNT (UP TO FF)

;(ALWAYS)
;BLOCK MOVE (OVERLAP OKAY)

;WHICH DIRECTION TO MOVE?

;16 BITS EQUAL THEN FINISHED
;MOVE DEC'NG
;MOVE INC'NG

;CALC VALS FOR MOVE DEC'NG

P3L
$FC
$FD
P3H
$FD
$FC
$FE
$FC
$FD
$FF
$FD
P3SCR
P2L
P3L
P2H
P3H
BMOVE
$FC
*+4
$FD
$FC
DECCMP
B1

;MOVE DEC'NG

1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099

87AD
87AF
87B2
87B3
87B5
87B6
87B7
87B9
87BB
87BD
87BF
87C1
87C4
87C6
87C8
87C9
87CC
87CD
87CF
87D1
87D3
87D6
87D8
87D9
87DA
87DC
87DE
87DF
87E0
87E3
87E6
87E8
87EA
87EC
87EE
87F0
87F2
87F5
87F7
87F9
87FC
87FE
8801
8803
8805
8808
880B
880D
880F
8811
8814
8816
8818
881A
881B
881C
881F
8821

B0
AD
38
D0
18
60
A0
B1
91
D1
F0
AC
C0
F0
C8
8C
60
C9
D0
A0
AD
D0
38
60
C9
D0
38
60
20
4C
C9
D0
A0
D0
C9
D0
AD
C9
D0
20
A0
4C
C9
D0
20
AD
A0
D1
F0
20
70
F0
90
18
60
20
90
C9

EE
52 A6
01
00
FE
FC
FC
0B
52 A6
FF
04
52 A6
1D
15
00
4E A6
02
FF
02
93
87
1E
04
80
E5
13
0F
4E
FF
E5
93
80
78
4D
22
9C
4E
00
FE
0B
B2
04
F0
EE

82
8E

A6
82
8C
82
A6

82

17 85
05
47

BCS
LDA
SEC
BNE
CLC
RTS
BMOVE LDY
LDA
STA
CMP
BEQ
BRTT
LDY
CPY
BEQ
INY
STY
BRT
RTS
S13B
CMP
BNE
LDY
S13C
LDA
BNE
SEC
RTS
CMP
BNE
S1NG
SEC
RTS
JSR
JMP
S23B
CMP
BNE
LDY
BNE
L23P
CMP
BNE
LDA
CMP
BNE
JSR
LDY
JMP
MEM3
CMP
BNE
JSR
MEM3C LDA
LDY
CMP
BEQ
MEM3D JSR
BVS
BEQ
BCC
MEM3EX CLC
RTS
MEM3E JSR
BCC
CMP
B1

BLP1
ERCNT

;FINISHED, TEST ERCNT

*+3
#0
($FE),Y
($FC),Y
($FC),Y
BRT
ERCNT
#$FF
*+6

;MOVE 1 BYT + VER

;INC ERCNT, DONT PASS FF

ERCNT
#$1D
S23B
#$0
P1L
*+4

;SAVE KIM FMT TAPE, 3 PARMS

#$FF
*+4

;ID MUST NOT = FF

INCP3
SENTRY
#$1E
L23P
#$80
S13C
#$13
MEM3
P1L
#$FF
S1NG
INCP3
#$80
LENTRY
#'M'
CALC3
P2SCR
P1L
#0
($FE),Y
MEM3E
INCCMP
MEM3EX
MEM3C
MEM3C

;USE END ADDR + 1

NEWLOC
MEM3F
#'G'

;MODE = KIM
;ID MUST NOT = 0

;SAVE HS FMT TAPE, 3 PARMS
;MODE = HS
;(ALWAYS)
;LOAD HS, 3 PARMS
;ID MUST BE FF
;ERROR RETURN
;USE END ADDR + 1
;MODE = HS
;MEM 3 SEARCH - BYTE

;FOUND SEARCH BYTE?
;NO, INC BUFFER ADDR

;SEARCHED TO BOUND
;FOUND SEARCH BYTE
;ENTERED G?

1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157

8823
8825
8826
8827
8829
882B
882E
8831
8832
8835
8838
8839
883C
883F
8840
8841
8842
8845
8846
8847
884A
884B
884C
884F
8850
8851
8853
8855
8855
8858
8858
885B
885D
8860
8863
8866
8869
886C
886F
8872
8875
8877
887A
887C
887D
887E
8881
8883
8885
8887
8889
888B
888D
8890
8892
8895
8896
8899

F0
38
60
C9
D0
20
20
18
AD
6D
A8
AD
6D
AA
38
98
ED
A8
8A
ED
AA
98
20
18
60
C9
D0

EC
43
26
4D 83
42 83
4E A6
4C A6
4F A6
4D A6

4A A6
4B A6
F4 82
45
57

AD 62 A6
CD
F0
8D
AD
8D
AD
8D
AD
8D
AD
85
AD
85
18
60
20
A0
B1
F0
E6
D0
E6
2C
10
20
18
4C
AD

73
15
3B
61
3A
72
61
73
62
4B
FB
4A
FA

A6
A6
A6
A6
A6
A6
A6
A6
A6
A6

88 81
00
FA
12
FA
02
FB
53 A6
03
47 8A
B8 81
3A A6

BEQ MEM3D
SEC
MEM3F RTS
CALC3 CMP #'C'
;CALCULATE, 1, 2 OR 3 PARMS
BNE EXE3
;RESULT = P1+P2+P3
C1
JSR CRLF
JSR SPACE
CLC
LDA P1L
ADC P2L
TAY
LDA P1H
ADC P2H
TAX
SEC
TYA
SBC P3L
TAY
TXA
SBC P3H
TAX
TYA
JSR OUTXAH
CLC
RTS
EXE3
CMP #'E'
;EXECUTE FROM RAM, 1-3 PARMS
BNE E3PARM
; SEE IF VECTOR ALREADY MOVED
LDA INVEC+2
;INVEC MOVED TO SCRA, SCRB
; HI BYTE OF EXEVEC MUST BE DIFFERENT FROM INVEC
CMP EXEVEC+1
;$FA, $FB USED AS RAM PTR
BEQ PTRIN
STA SCRA+1
;SAVE INVEC IN SCRA,B
LDA INVEC+1
STA SCRA
LDA EXEVEC
;PUT ADDR OF RIN IN INVEC
STA INVEC+1
LDA EXEVEC+1
STA INVEC+2
PTRIN LDA P3H
;INIT RAM PTR IN $FA, $FB
STA $FB
LDA P3L
STA $FA
CLC
RTS
RIN
JSR SAVER
;GET INPUT FROM RAM
LDY #$0
;RAM PTR IN $FA, $FB
LDA ($FA),Y
BEQ RESTIV
;IF 00 BYTE, RESTORE INVEC
INC $FA
BNE *+4
INC $FB
BIT TECHO
;ECHO CHARS IN ?
BPL *+5
JSR OUTCHR
CLC
JMP RESXAF
RESTIV LDA SCRA
;RESTORE INVEC

1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215

889C
889F
88A2
88A5
88A6
88A9
88AC
88AF
88AF
88AF
88AF
88B2
88B5
88B7
88B9
88BC
88BD
88BE
88BF
88C0
88C1
88C4
88C7
88C8
88C9
88CC
88CF
88D1
88D4
88D7
88D9
88DC
88DE
88DF
88E0
88E1
88E4
88E7
88E9
88EC
88EF
88F1
88F2
88F3
88F4
88F6
88F8
88FA
88FD
88FF
8900
8903
8906
8908
890B
890D
890F
8912

8D
AD
8D
18
20
4C
6C

61 A6
3B A6
62 A6

20
20
C9
D0
20
8A
0A
0A
0A
0A
8D
20
8A
18
6D
4C
A9
8D
20
F0
20
F0
48
8A
48
20
20
D0
20
20
D0
68
AA
68
C9
D0
A9
8D
D0
60
20
6C
A9
20
A2
A0
BD
8C

88 81
CF 88
FE
13
CF 88

1B 8A
B8 81
6D A6

3E A6
CF 88
3E
B8
00
55
03
FB
2C
F6

A6
81

72
23
FB
9B
23
F3

89
89

A6
89
89

89
89

FF
07
19
55 A6
D5
C1
70
09
A5
05
00
40
00

89
A6
89
A6
A4

STA INVEC+1
LDA SCRA+1
STA INVEC+2
CLC
JSR INCHR
JMP RESXAF
E3PARM JMP (URCVEC+1)
; ***
; *** HEX KEYBOARD I/O
; ***
GETKEY JSR SAVER
JSR GK
CMP #$FE
BNE EXITGK
JSR GK
TXA
ASL A
ASL A
ASL A
ASL A
STA SCRE
JSR GK
TXA
CLC
ADC SCRE
EXITGK JMP RESXAF
GK
LDA #0
STA KSHFL
GK1
JSR IJSCNV
BEQ GK1
JSR LRNKEY
BEQ GK1
PHA
TXA
PHA
JSR BEEP
GK2
JSR KEYQ
BNE GK2
JSR NOBEEP
JSR KEYQ
BNE GK2
PLA
TAX
PLA
CMP #$FF
BNE EXITG
LDA #$19
STA KSHFL
BNE GK1
EXITG RTS
HDOUT JSR OUTDSP
IJSCNV JMP (SCNVEC+1)
SCAND LDA #$9
JSR CONFIG
LDX #5
SC1
LDY #0
LDA DISBUF,X
STY PADA

;... ELSE UNREC CMD

;FIND KEY

;SCAN KB
;WHAT KEY IS IT?

;Z=1 IF KEY DOWN
;DELAY (DEBOUNCE) W/O BEEP

;IF SHIFT, SET FLAG + GET NEXT KEY

;CHAR OUT, SCAN KB
;SCAN DISPLAY FROM DISBUF

1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273

8915
8918
891B
891D
891E
8920
8921
8923
8926
8929
892B
892C
892E
8931
8933
8936
8939
893B
893D
893F
8942
8944
8946
8948
894A
894B
894C
894D
894E
894F
8950
8951
8954
8956
8959
895B
895C
895E
895F
8960
8961
8962
8965
8966
8969
896A
896D
896E
8970
8971
8972
8975
8977
897A
897C
897E
8981
8984

8E
8D
A0
88
D0
CA
10
20
AD
49
60
29
8D
A9
20
AD
29
49
D0
2C
30
C9
90
A9
0A
0A
0A
0A
0A
0A
18
6D
A2
DD
F0
CA
10
E8
60
8A
18
6D
AA
BD
60
20
18
F0
38
60
20
A9
20
A2
A9
8D
20
A9

02 A4
00 A4
10
SC2

FD
EA
A3 89
00 A4
7F
3F
3F
05
A5
02
07
07
05
00
1A
04
02
03

A6

KEYQ
H8926
LRNKEY

89
A4

A4
LK1
LK2

3F A6
19
D6 8B
05

LK3

F8
NOKEY
FOUND
55 A6
EF 8B
23 89

KYSTAT

01
88
0D
A5
70
08
02
95
06

81
89

BEEP
BEEPP3
BEEPP5
BE1

A4
89

STX
STA
LDY
DEY
BNE
DEX
BPL
JSR
LDA
EOR
RTS
AND
STA
LDA
JSR
LDA
AND
EOR
BNE
BIT
BMI
CMP
BCC
LDA
ASL
ASL
ASL
ASL
ASL
ASL
CLC
ADC
LDX
CMP
BEQ
DEX
BPL
INX
RTS
TXA
CLC
ADC
TAX
LDA
RTS
JSR
CLC
BEQ
SEC
RTS
JSR
LDA
JSR
LDX
LDA
STA
JSR
LDA

PBDA
PADA
#$10
SC2
SC1
KSCONF
PADA
#$7F
#$3F
SCRF
#$05
CONFIG
PBDA
#$07
#$07
LK1
PADA
NOKEY
#$04
LK2
#$03
A
A
A
A
A
A

; KEY DOWN ? (YES THEN Z=1)

;DETERMINE WHAT KEY IS DOWN

SCRF
#$19
SYM,X
FOUND
LK3

KSHFL
ASCII,X
KEYQ

;KEY DOWN? RETURN IN CARRY

*+3
SAVER
#$0D
CONFIG
#$70
#8
PBDA
BE2
#6

;DELAY (BOUNCE) W/BEEP
;DURATION CONSTANT

1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331

8986
8989
898C
898D
898F
8992
8995
8997
8998
899A
899B
899E
89A0
89A3
89A5
89A8
89AA
89AB
89AE
89B1
89B4
89B7
89B8
89B9
89BB
89BE
89C1
89C4
89C6
89C8
89CA
89CD
89D0
89D2
89D4
89D7
89D9
89DC
89DE
89E0
89E3
89E5
89E6
89E8
89EA
89ED
89EF
89F1
89F3
89F4
89F7
89FA
89FB
89FD
89FF
8A00
8A03
8A06

8D
20
CA
D0
20
4C
A0
88
D0
60
20
A9
4C
A9
20
A0
AA
BD
99
BD
99
CA
88
10
4C
20
20
29
C9
D0
4C
20
C9
D0
AD
09
8D
D0
A2
DD
F0
CA
D0
F0
BD
C9
F0
A2
48
BD
9D
E8
E0
D0
68
8D
4C
48

02 A4
95 89
ED
A3 89
C4 81
1A
FD

BE2
BE3

88 81
01
77 89
01
88 81
01

NOBEEP

C8
02
C6
00

CON1

F0
C4
AF
88
7F
07
03
75
06
2C
0A
45
80
45
25
3A
EE
05

8B
A4
8B
A4

81
88
81

89
8A

KSCONF
CONFIG

HKEY
OUTDSP

NBELL

A6
A6
8B

F8
19
28 8C
F0
12
00
41 A6
40 A6

OUD1
OUD2

GETSGS

OUD3

05
F5
45 A6
C4 81

EXITOD
TEXT

STA
JSR
DEX
BNE
JSR
JMP
LDY
DEY
BNE
RTS
JSR
LDA
JMP
LDA
JSR
LDY
TAX
LDA
STA
LDA
STA
DEX
DEY
BPL
JMP
JSR
JSR
AND
CMP
BNE
JMP
JSR
CMP
BNE
LDA
ORA
STA
BNE
LDX
CMP
BEQ
DEX
BNE
BEQ
LDA
CMP
BEQ
LDX
PHA
LDA
STA
INX
CPX
BNE
PLA
STA
JMP
PHA

PBDA
BE2
BE1
KSCONF
RESALL
#$1A
BE3
SAVER
#$01
BEEPP5
#$1
SAVER
#$01

;DELAY W/O BEEP
;(BNE BEEPP5, $FF)
;CONFIGURE FOR KEYBOARD
;CONFIGURE I/O FROM TABLE VAL

VALSP2,X
PBDA,Y
VALS,X
PADA,Y
CON1
RESALL
GETKEY
SAVER
#$7F
#$07
NBELL
BEEPP3
TEXT
#$2C
OUD1
RDIG
#$80
RDIG
EXITOD
#$3A
ASCIM1,X
GETSGS
OUD2
EXITOD
SEGSM1,X
#$F0
EXITOD
#0
DISBUF+1,X
DISBUF,X

;GET KEY FROM KB AND ECHO ON KB
;DISPLAY OUT
;BELL?
;YES - BEEP
;PUSH INTO SCOPE BUFFER
;COMMA?
;TURN ON DECIMAL PT

;GET CORR SEG CODE FROM TABLE

;SHOVE DOWN DISPLAY BUFFER

#5
OUD3
RDIG
RESALL
;UPDATE SCOPE BUFFER

1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389

8A07
8A08
8A09
8A0B
8A0E
8A11
8A12
8A14
8A15
8A16
8A17
8A1A
8A1B
8A1B
8A1B
8A1B
8A1B
8A1E
8A21
8A23
8A25
8A27
8A29
8A2B
8A2D
8A2F
8A31
8A34
8A36
8A39
8A3A
8A3C
8A3E
8A41
8A44
8A47
8A4A
8A4D
8A4F
8A52
8A55
8A58
8A5B
8A5D
8A5F
8A62
8A65
8A66
8A68
8A6A
8A6D
8A70
8A73
8A74
8A76
8A79
8A7B
8A7E

8A
48
A2
BD
9D
CA
10
68
AA
68
8D
60

20
20
29
C9
90
C9
B0
29
C9
D0
AD
49
8D
18
90
C9
4C
6C
20
20
2C
70
20
4C
6C
20
A9
85
AD
2D
38
E9
90
20
AD
2D
38
E9
2C
10
20
4C

1E
00 A6
01 A6
F7

00 A6

88
41
7F
61
06
7B
02
DF
0F
0B
53
40
53
E2
0D
B8
61
09
88
53
03
55
C4
64
88
00
F9
02
54

81
8A

A6
A6

81
A6
83
81
A6
8A
81
A6
81
A4
A6

40
F5
E9 8A
02 A4
54 A6
40
53 A6
06
D4 8A
87 8A

TXA
PHA
LDX #$1E
TXTMOV LDA SCPBUF,X
STA SCPBUF+1,X
DEX
BPL TXTMOV
PLA
TAX
PLA
STA SCPBUF
RTS
;
;***
;*** TERMINAL I/O
;***
INCHR JSR SAVER
JSR INJINV
AND #$7F
CMP #$61
BCC INRT1
CMP #$7B
BCS INRT1
AND #$DF
INRT1 CMP #$0F
BNE INRT2
LDA TECHO
EOR #$40
STA TECHO
CLC
BCC INCHR+3
INRT2 CMP #$0D
JMP RESXAF
INJINV JMP (INVEC+1)
NBASOC JSR NIBASC
OUTCHR JSR SAVER
BIT TECHO
BVS *+5
JSR INJOUV
JMP RESALL
INJOUV JMP (OUTVEC+1)
INTCHR JSR SAVER
LDA #0
STA $F9
LOOK
LDA PBDA
AND TOUTFL
SEC
SBC #$40
BCC LOOK
TIN
JSR DLYH
LDA PBDA
AND TOUTFL
SEC
SBC #$40
BIT TECHO
BPL DMY1
JSR OUT
JMP SAVE

;SAVE X
;PUSH DOWN 32 CHARS

;RESTORE X
;RESTORE CHR
;STORE CHR IN EMPTY SLOT

;INPUT CHAR
;DROP PARITY
;ALPHA?

;CVRT TO UPPER CASE
;CTL O ?
;TOGGLE CTL O BIT
;GET GET ANOTHER CHAR
;CARRIAGE RETURN?
;NIBBLE TO ASCII, OUTCHR
;LOOK AT CTRL O FLAG

;IN TERMINAL CHAR
;FIND LEADING EDGE

;TERMINAL BIT

;OR BITS 7,7 (TTY,CRT)
;ECHO BIT?

1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447

8A81
8A83
8A84
8A86
8A87
8A89
8A8C
8A8D
8A8F
8A90
8A92
8A95
8A96
8A99
8A9B
8A9D
8AA0
8AA2
8AA5
8AA8
8AAA
8AAD
8AAF
8AB1
8AB3
8AB4
8AB7
8ABA
8ABC
8ABD
8ABF
8AC0
8AC1
8AC2
8AC4
8AC6
8AC8
8ACA
8ACC
8ACE
8AD1
8AD4
8AD5
8AD8
8ADA
8ADC
8ADE
8AE1
8AE4
8AE5
8AE6
8AE6
8AE9
8AEA
8AEB
8AEC
8AED
8AEE

A0
88
D0
EA
66
20
48
B5
68
90
20
18
20
A5
49
4C
85
20
20
A9
8D
A5
A2
49
38
20
20
A0
88
D0
EA
4A
CA
D0
A5
C9
F0
C9
D0
20
4C
48
AD
29
90
09
2D
8D
68
60

07

DMY1
TLP1

FD
F9
E9 8A
00
D8
E9 8A
D4
F9
FF
B8
F9
88
E9
30
03
F9
0B
FF

8A
81
81
8A
A4

D4 8A
E6 8A
06
FD

F0
F9
0D
04
0A
03
32 8B
C4 81
02 A4
0F
02
30
54 A6
02 A4

20 E9 8A
08
48
8A
48
98
AE 51 A6

LDY
DEY
BNE
NOP
SAVE
ROR
JSR
PHA
LDA
PLA
BCC
JSR
CLC
JSR
LDA
EOR
JMP
TOUT
STA
JSR
JSR
LDA
STA
LDA
LDX
EOR
SEC
OUTC
JSR
JSR
LDY
PHAKE DEY
BNE
NOP
LSR
DEX
BNE
LDA
CMP
BEQ
CMP
BNE
GOPAD JSR
LEAVE JMP
OUT
PHA
LDA
AND
BCC
ORA
OUTONE AND
STA
PLA
RTS
;
DLYF
JSR
DLYH
PHP
PHA
TXA
PHA
TYA
LDX

#7
TLP1
$F9
DLYH

;TIMING

0,X
TIN
DLYH
OUT
$F9
#$FF
RESXAF
$F9
SAVER
DLYH
#$30
PBDA+1
$F9
#$0B
#$FF
OUT
DLYF
#$06

;TERMINAL CHR OUT
;DELAY 1/2 BIT TIME
;SET FOR OUTPUT
;DATA DIRECTION
;RECOVER CHR DATA
;START BIT,8DATA, 3STOPS
;INVERT DATA
;START BIT
;OUTPUT BIT FROM CARRY
;WAIT FULL BIT TIME

PHAKE
A
OUTC
$F9
#$0D
GOPAD
#$0A
LEAVE
PAD
RESALL
PBDA
#$0F
OUTONE
#$30
TOUTFL
PBDA

DLYH

SDBYT

;CARRIAGE RETURN?
;YES-PAD IT
;PAD LINE FEED TOO

;TERMINAL BIT OUT

;MASK OUTPUT

;DELAY FULL
;DELAY HALF

1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505

8AF1
8AF3
8AF4
8AF6
8AF7
8AF9
8AFA
8AFB
8AFC
8AFD
8AFE
8AFF
8B01
8B02
8B05
8B06
8B08
8B0B
8B0D
8B10
8B12
8B15
8B18
8B1B
8B1D
8B20
8B23
8B24
8B25
8B27
8B28
8B2A
8B2B
8B2D
8B30
8B31
8B32
8B35
8B38
8B39
8B3B
8B3C
8B3F
8B42
8B45
8B46
8B48
8B49
8B4A
8B4A
8B4A
8B4A
8B4A
8B4C
8B4D
8B4F
8B52
8B54

A0
88
D0
CA
D0
A8
68
AA
68
28
60
A9
A8
AD
0A
B0
20
90
20
B0
8C
BD
CD
B0
BD
8D
60
E8
10
C8
A2
CA
D0
AD
0A
60
AE
20
CA
D0
60
20
AD
2D
38
E9
60
FF

03

A2
9A
A9
8D
A9
48

FF

DLYX
DLYY

FD
F8

00

BAUD

02 A4

SEEK

FA
27
FB
27
FB
51
63
51
07
69
51

8B

CLEAR

8B

SET

A6
8C
A6

DEAF

8C
A6

EE
1C
FD
02 A4
50 A6
E6 8A

AGAIN
INK
INK1

PAD
PAD1

FA
A3 89
02 A4
54 A6
40

CC
0C A0
04

TSTAT

LDY
DEY
BNE
DEX
BNE
TAY
PLA
TAX
PLA
PLP
RTS
LDA
TAY
LDA
ASL
BCS
JSR
BCC
JSR
BCS
STY
LDA
CMP
BCS
LDA
STA
RTS
INX
BPL
INY
LDX
DEX
BNE
LDA
ASL
RTS
LDX
JSR
DEX
BNE
RTS
JSR
LDA
AND
SEC
SBC
RTS
.DB

#3
DLYY
DLYX

#0
PBDA
A
SEEK
INK
CLEAR
INK
SET
SDBYT
DECPTS,X
SDBYT
AGAIN
STDVAL,X
SDBYT

;DETERMINE BAUD RATE ON PB7

;LOAD CLOSEST STD VALUE

DEAF
#$1C
INK1
PBDA
A
PADBIT
DLYF

;PAD CARRIAGE RETURN OR LF
;WITH EXTRA STOP BITS

PAD1
KSCONF
PBDA
TOUTFL

;SEE IF BREAK KEY DOWN

#$40

$FF
;NOT USED
; ***
; *** RESET - TURN OFF POR, INIT SYS RAM, ENTER MONITOR
; ***
;
RESET LDX #$FF
TXS
;INIT STACK PTR
LDA #$CC
STA PCR1
;DISABLE POR, TAPE OFF
LDA #4
PHA

1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563

8B55
8B56
8B59
8B5B
8B5E
8B61
8B62
8B64
8B66
8B69
8B6C
8B6F
8B71
8B74
8B76
8B79
8B7C
8B7E
8B7F
8B80
8B83
8B86
8B89
8B8C
8B8E
8B91
8B94
8B96
8B99
8B9C
8B9F
8BA2
8BA4
8BA5
8BA7
8BAA
8BAC
8BAF
8BB2
8BB4
8BB7
8BBA
8BBC
8BBF
8BC2
8BC3
8BC5
8BC6
8BC6
8BC6
8BC6
8BC6
8BCA
8BCE
8BD2
8BD6
8BD6
8BD6

28
20
A2
BD
9D
CA
10
A9
20
20
20
D0
2C
10
20
20
A2
9A
D8
20
4C
20
AD
09
8D
AD
09
8D
4C
20
AD
29
18
90
20
A9
8D
AD
09
8D
20
A2
BD
9D
CA
10
60

00
00
00
00

86 8B
5F
A0 8F
20 A6
F7
07
47
A3
26
0B
02
F6
B7
FF
FF
86
03
88
01
01
01
03
01
03
C4
88
01
FE
E7
86
D5
51
54
40
54
86
08
6F
60

8A
89
89

NEWDEV
SWITCH
SWLP

A4
8B
8A

8B
80
81
AC
AC
AC
AC
81
81
AC

8B

MONENT

ACCESS
ACC1

NACCES

TTY

A6
A6
A6
8B
8C
A6

F7

80
7F
FF
00

DFTXFR

08
00
00
07

VECSW
SWLP2

PLP
JSR
LDX
LDA
STA
DEX
BPL
LDA
JSR
JSR
JSR
BNE
BIT
BPL
JSR
JSR
LDX
TXS
CLD
JSR
JMP
JSR
LDA
ORA
STA
LDA
ORA
STA
JMP
JSR
LDA
AND
CLC
BCC
JSR
LDA
STA
LDA
ORA
STA
JSR
LDX
LDA
STA
DEX
BPL
RTS

ACCESS
#$5F
DFTBLK,X
RAM,X
DFTXFR+2
#7
OUTCHR
KSCONF
KEYQ+3
MONENT
PBDA
SWLP
VECSW
BAUD
#$FF
ACCESS
WARM
SAVER
OR3A
#1
OR3A
DDR3A
#1
DDR3A
RESALL
SAVER
OR3A
#$FE
ACC1
ACCESS
#$D5
SDBYT
TOUTFL
#$40
TOUTFL
ACCESS
#$8
TRMTBL,X
INVEC,X

;INIT F, DISABLE IRQ DURING DFTXFR
;UN WRITE PROT SYS RAM
;INIT SYS RAM (EXCPT SCPBUF)

;CHANGE DEVC/BAUD RATE
;BEEP
;KEYBOARD OR TERMINAL?

;SWITCH VECTORS
;MONITOR ENTRY
;UNWRITE PROT MONITOR RAM
;UN WRITE PROT SYS RAM

;WRITE PROT SYS RAM

;UN WRITE PROT RAM
;110 BAUD

;UN WRITE PROT RAM

SWLP2

;
;***
;*** TABLES (I/O CONFIGURATIONS, KEY CODES, ASCII CODES)
;***
37 VALS
.DB $00,$80,$08,$37 ;KB SENSE, A=1
30
.DB $00,$7F,$00,$30 ;KB LRN, A=5
3F
.DB $00,$FF,$00,$3F ;SCAN DSP, A=9
3F
.DB $00,$00,$07,$3F ;BEEP, A=D
VALSP2 =VALS+2
SYM
=*
;KEY CODES RETURNED BY LRNKEY
TABLE =*

1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621

8BD6
8BD7
8BD8
8BD9
8BDA
8BDB
8BDC
8BDD
8BDE
8BDF
8BE0
8BE1
8BE2
8BE3
8BE4
8BE5
8BE6
8BE7
8BE8
8BE9
8BEA
8BEB
8BEC
8BED
8BEE
8BEF
8BEF
8BEF
8BF0
8BF1
8BF2
8BF3
8BF4
8BF5
8BF6
8BF7
8BF8
8BF9
8BFA
8BFB
8BFC
8BFD
8BFE
8BFF
8C00
8C01
8C02
8C03
8C04
8C05
8C06
8C07
8C08
8C08
8C09
8C0A
8C0B
8C0C

01
41
81
C1
02
42
82
C2
04
44
84
C4
08
48
88
C8
10
50
90
D0
20
60
A0
00
40
30
31
32
33
34
35
36
37
38
39
41
42
43
44
45
46
0D
2D
3E
FF
47
52
4D
13
1E
14
15
16
17
18

.DB $01
.DB $41
.DB $81
.DB $C1
.DB $02
.DB $42
.DB $82
.DB $C2
.DB $04
.DB $44
.DB $84
.DB $C4
.DB $08
.DB $48
.DB $88
.DB $C8
.DB $10
.DB $50
.DB $90
.DB $D0
.DB $20
.DB $60
.DB $A0
.DB $00
.DB $40
ASCIM1 =*-1
ASCII =*
.DB $30
.DB $31
.DB $32
.DB $33
.DB $34
.DB $35
.DB $36
.DB $37
.DB $38
.DB $39
.DB $41
.DB $42
.DB $43
.DB $44
.DB $45
.DB $46
.DB $0D
.DB $2D
.DB $3E
.DB $FF
.DB $47
.DB $52
.DB $4D
.DB $13
.DB $1E
; KB UPPER CASE
.DB $14
.DB $15
.DB $16
.DB $17
.DB $18

;0/U0
;1/U1
;2/U2
;3/U3
;4/U4
;5/U5
;6/U6
;7/U7
;8/JMP
;9/VER
;A/ASCII
;B/BLK MOV
;C/CALC
;D/DEP
;E/EXEC
;F/FILL
;CR/SD
;-/+
;>/<
;SHIFT
;GO/LP
;REG/SP
;MEM/WP
;L2/L1
;S2/S1
;ASCII CODES AND HASH CODES
;ZERO
;ONE
;TWO
;THREE
;FOUR
;FIVE
;SIX
;SEVEN
;EIGHT
;NINE
;A
;B
;C
;D
;E
;F
;CR
;DASH
;>
;SHIFT
;G
;R
;M
;L2
;S2
;U0
;U1
;U2
;U3
;U4

1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679

8C0D
8C0E
8C0F
8C10
8C11
8C12
8C13
8C14
8C15
8C16
8C17
8C18
8C19
8C1A
8C1B
8C1C
8C1D
8C1E
8C1F
8C20
8C21
8C22
8C23
8C24
8C25
8C26
8C27
8C28
8C29
8C29
8C29
8C2A
8C2B
8C2C
8C2D
8C2E
8C2F
8C30
8C31
8C32
8C33
8C34
8C35
8C36
8C37
8C38
8C39
8C3A
8C3B
8C3C
8C3D
8C3E
8C3F
8C40
8C41
8C42
8C43
8C44

19
1A
1B
4A
56
FE
42
43
44
45
46
10
2B
3C
00
11
1C
57
12
1D
2E
20
3F
50
07
53
58
59
3F
06
5B
4F
66
6D
7D
07
7F
67
77
7C
39
5E
79
71
F0
40
70
00
6F
50
54
38
6D
01
08
09

.DB $19
;U5
.DB $1A
;U6
.DB $1B
;U7
.DB $4A
;J
.DB $56
;V
.DB $FE
;ASCII
.DB $42
;B
.DB $43
;C
.DB $44
;D
.DB $45
;E
.DB $46
;F
.DB $10
;SD
.DB $2B
;+
.DB $3C
;<
.DB $00
;SHIFT
.DB $11
;LP
.DB $1C
;SP
.DB $57
;W
.DB $12
;L1
.DB $1D
;S1
.DB $2E
;.
.DB $20
;BLANK
.DB $3F
;?
.DB $50
;P
.DB $07
;BELL
.DB $53
;S
.DB $58
;X
.DB $59
;Y
; SEGMENT CODES FOR ON-BOARD DISPLAY
SEGSM1 =*-1
.DB $3F
;ZERO
.DB $06
;ONE
.DB $5B
;TWO
.DB $4F
;THREE
.DB $66
;FOUR
.DB $6D
;FIVE
.DB $7D
;SIX
.DB $07
;SEVEN
.DB $7F
;EIGHT
.DB $67
;NINE
.DB $77
;A
.DB $7C
;B
.DB $39
;C
.DB $5E
;D
.DB $79
;E
.DB $71
;F
.DB $F0
;CR
.DB $40
;DASH
.DB $70
;>
.DB $00
;SHIFT
.DB $6F
;G
.DB $50
;R
.DB $54
;M
.DB $38
;L2
.DB $6D
;S2
.DB $01
;U0
.DB $08
;U1
.DB $09
;U2

1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
RATE
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736

8C45
8C46
8C47
8C48
8C49
8C4A
8C4B
8C4C
8C4D
8C4E
8C4F
8C50
8C51
8C52
8C53
8C54
8C55
8C56
8C57
8C58
8C59
8C5A
8C5B
8C5C
8C5D
8C5E
8C5F
8C60
8C61
8C62
8C63

30
36
5C
63
03
1E
72
77
7C
39
5E
79
71
6D
76
46
00
38
6D
1C
38
6D
80
00
53
73
49
6D
64
6E
973D1F100800DECPTS

.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB
.DB

$30
;U3
$36
;U4
$5C
;U5
$63
;U6
$03
;U7
$1E
;J
$72
;V
$77
;A
$7C
;B
$39
;C
$5E
;D
$79
;E
$71
;F
$6D
;SD
$76
;+
$46
;<
$00
;SHIFT
$38
;LP
$6D
;SP
$1C
;W
$38
;L1
$6D
;S1
$80
;.
$00
;SPACE
$53
;?
$73
;P
$49
;BELL
$6D
;S
$64
;X
$6E
;Y
$97,$3D,$1F,$10,$08,$00

8C69
8C69
8C6F
8C6F
8C6F
8C72
8C75
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78
8C78

.MSFIRST
D54C24100601STDVAL .DW $D54C,$2410,$0601 ;STD VALS FOR BAUD RATES
.LSFIRST
; 110,300,600,1200,2400,4800 BAUD
4C 58 8A
TRMTBL JMP INTCHR
4C A0 8A
JMP TOUT
4C 3C 8B
JMP TSTAT
;

; TO DETERMINE BAUD

;****** VERSION 2 4/13/79 "SY1.1"
;****** COPYRIGHT 1978 SYNERTEK SYSTEMS CORPORATION
;******
BDRY
=$F8
;0/1 BDRY FOR READ TIMING
OLD
=$F9
;HOLD PREV INPUT LEVEL IN GETTR
CHAR
=$FC
;CHAR ASSY AND DISASSY
MODE
=$FD
;BIT7=1 IS HS, 0 IS KIM
;... BIT6=1 - IGNORE DATA
BUFADL =$FE
;RUNNING BUFFER ADR
BUFADH =$FF
;TAPDEL =$A630
;HI SPEED TAPE DELAY
;KMBDRY =$A631
;KIM READ BDRY
;HSBDRY =$A632
;HS READ BDRY
;TAPET1 =$A635
;HS FIRST 1/2 BIT
;TAPET2 =$A63C
;HS SECOND 1/2 BIT
;SCR6
=$A636
;SCR6
;SCR7
=$8637
;SCR7

1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794

8C78
8C78
8C78
A64A
A64A
A64B
A64C
A64D
A64E
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
A64F
8C78
8C78
8C7B
8C7E
8C81
8C83
8C85
8C87
8C89
8C8B
8C8B
8C8D
8C8E
8C90
8C93
8C96

;SCR8
;SCR9

=$A638
=$A639

;SCR8
;SCR9

EAL
EAH
SAL
SAH
ID

*=$A64A
.BLOCK 1
.BLOCK 1
.BLOCK 1
.BLOCK 1
.BLOCK 1

;P3L
;P3H
;P2L
;P2H
;P1L

EOT
SYN
TPBIT
FRAME
CHECK
LSTCHR
NONHEX

= $04
= $16
=%1000
=$FF
=$CC
=$2F
=$FF

;BIT 3 IS ENABLE/DISABLE TO DECODER
;ERROR MSG # FOR FRAME ERROR
;ERROR # FOR CHECKSUM ERROR
;LAST CHAR NOT '/'
;NON HEX CHAR IN KIM REC

;ACCESS
;P2SCR
;ZERCK
;CONFIG

=$8BB6
=$829C
=$832E
=$89A5

- END ADDR +1 (LO)
- (HI)
- START ADDR (LO)
- (HI)
- ID

;UNRITE PROTECT SYSTEM RAM
;MOVE P2 TO $FF,$FE IN PAGE ZERO
;MOVE ZERO TO CHECK SUM
;CONFIGURE I/O

; I/O - TAPE ON/OFF IS CB2 ON VIA 1 (A000)
;
TAPE IN IS PB6 ON VIA 1 (A000)
;
TAPE OUT IS CODE 7 TO DISPLAY DECODER, THRU 6532,
;
PB0-PB3 (A400)
VIAACR
VIAPCR
TPOUT
TAPOUT
DDROUT
TAPIN
DDRIN
TIMER
TIM8
DDRDIG
DIG

=$A00B
=$A00C
=$A402
=TPOUT
=$A403
=$A000
=$A002
=$A406
=$A415
=$A401
=$A400

;CONTROL CB2 TAPE ON/OFF, POR

;6532 TIMER READ
;6532 TIMER SET (8US)

; LOADT ENTER W/ID IN PARM 2, MODE IN [Y]
20
20
20
C9
F0
C9
D0
F0

A9 8D
52 8D
E1 8D
2A
06
16
F2
F3

06
6A
85
20
8D
CD

FD
FD
26 8E
00 A4
4E A6

*=$8C78
LOADT JSR START
LOADT2 JSR SYNC
LOADT4 JSR RDCHTX
CMP #'*'
BEQ LOAD11
CMP #SYN
BNE LOADT2
BEQ LOADT4
LOAD11 ASL
ROR
STA
JSR
STA
CMP

MODE
A
MODE
RDBYTX
DIG
ID

;INITIALIZE
;GET IN SYNC
;START OF DATA?
;NO - SYN?
;IF NOT, RESTART SYNC SEARCH
;IF YES, KEEP LOOKING FOR *
;GET MODE IN A, CLEAR BIT6
;READ ID BYTE ON TAPE
;DISPLAY ON LED (NOT DECODED)
;COMPARE WITH REQUESTED ID

1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
ERR
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851

8C99
8C9B
8C9E
8CA0
8CA2
8CA4
8CA6
8CA6
8CA8
8CAA
8CAD
8CAD
8CAD
8CAD
8CAD
8CB0
8CB3
8CB5
8CB7
8CBA
8CBD
8CC0
8CC0
8CC0
8CC0
8CC2
8CC4
8CC4
8CC7
8CC9
8CCC
8CCE
8CCE
8CD0
8CD2
8CD5
8CD8
8CDB
8CDE
8CDE
8CDE
8CDE
8CE1
8CE3
8CE6
8CE8
8CEA
8CED
8CEF
8CF2
8CF4
8CF6
8CF8
8CFA
8CFC
8CFE
8D00

F0
AD
C9
F0
C9
F0

29
4E A6
00
22
FF
07

BEQ
LDA
CMP
BEQ
CMP
BEQ

24 FD
30 16
4C 7B 8C

20
20
24
10
20
20
4C

74
74
FD
52
74
74
DE

8E
8E
8E
8E
8C

LOADT5
ID
#0
LOADT5
#$FF
LOADT6

BIT MODE
BMI HWRONG
JMP LOADT2

;LOAD IF EQUAL
;COMPARE WITH 0
;IF 0, LOAD ANYWAY
;COMPARE WITH FF
;IF FF, USE REQUEST SA TO LOAD
;UNWANTED RECORD, KIM OR HS?
;IF KIM, RESTART SEARCH

; SA (&EA IF USED) COME FROM REQUEST. DISCARD TAPE VALUES
;
(BUFAD ALREADY SET TO SA BY 'START')
;
LOADT6 JSR RDCHK
;GET SAL FROM TAPE
JSR RDCHK
;GET SAH FROM TAPE
BIT MODE
;HS OR KIM?
BPL LOADT7
;IF KIM, START READING DATA
JSR RDCHK
;HS, GET EAH, EAL FROM TAPE
JSR RDCHK
; ... BUT IGNORE
JMP LT7H
;START READING HS DATA
; SA ( & EA IF USED) COME FROM TAPE. SA REPLACES BUFAD

A9 C0
85 FD

HWRONG LDA #$C0
STA MODE

20
85
20
85

74 8E
FE
74 8E
FF

24
10
20
8D
20
8D

FD
37
74
4A
74
4B

LOADT5 JSR RDCHK
;GET SAL FROM TAPE
STA BUFADL
;PUT IN BUF START L
JSR RDCHK
;SAME FOR SAH
STA BUFADH
;(SAL - H STILL HAVE REQUEST VALUE)
BIT MODE
;HS OR KIM?
BPL LOADT7
;IF KIM, START READING RECORD
JSR RDCHK
;HS. GET & SAVE EAL,EAH
STA EAL
JSR RDCHK
STA EAH

8E
A6
8E
A6

;READ THRU TO GE TO NEXT REC
;BUT DON'T CHECK CKSUM, NO FRAME

; READ HS DATA
20
A6
EC
D0
A6
EC
F0
20
24
70
A0
91
E6
D0
E6
4C

E5
FE
4A
07
FF
4B
14
77
FD
04
00
FE
FE
E0
FF
DE

8D

LT7H

A6
A6
8E

LT7HA

LT7HC
8C

JSR
LDX
CPX
BNE
LDX
CPX
BEQ
JSR
BIT
BVS
LDY
STA
INC
BNE
INC
JMP

RDBYTH
BUFADL
EAL
LT7HA
BUFADH
EAH
LT7HB
CHKT
MODE
LT7HC
#0
(BUFADL),Y
BUFADL
LT7H
BUFADH
LT7H

;GET NEXT BYTE
;CHECK FOR END OF DATA + 1

;NOT END, UPDATE CHECKSUM
;WRONG RECORD?
;IF SO, DONT STORE BYTE
;STORE BYTE
;BUMP BUFFER ADDR
;CARRY

1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
CARRY
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908

8D03
8D03
8D05
8D07
8D09
8D09
8D09
8D09
8D0C
8D0E
8D11
8D13
8D15
8D17
8D19
8D1B
8D1E
8D1E
8D1E
8D1E
8D1E
8D21
8D24
8D26
8D29
8D2C
8D2E
8D30
8D30
8D32
8D34
8D34
8D36
8D38
8D38
8D3A
8D3C
8D3C
8D3E
8D3E
8D3F
8D41
8D41
8D42
8D42
8D44
8D46
8D48
8D4B
8D4B
8D4C
8D4D
8D4E
8D50
8D52
8D55
8D57

C9 2F
D0 29
F0 15

LT7HB

CMP #'/'
BNE LCERR
BEQ LT8A

;EA, MUST BE "/"
;LAST CHAR NOT '/'
;(ALWAYS)

; READ KIM DATA
20
B0
20
A0
91
E6
D0
E6
4C

2A 8E
26
77 8E
00
FE
FE
F0
FF
09 8D

LOADT7 JSR
BCS
JSR
LDY
STA
INC
BNE
INC
JMP

RDBYT
LDT7A
CHKT
#0
(BUFADL),Y
BUFADL
LOADT7
BUFADH
LOADT7

;NONHEX OR LAST CHAR
;UPDATE CHECKSUM (PACKED BYTE)
;STORE BYTE
;BUMP BUFFER ADR
;CARRY?

; TEST CHECKSUM & FINISH
20
CD
D0
20
CD
D0
F0

26
36
16
26
37
0E
11

8E
A6
8E
A6

LOADT8 =*
LT8A
JSR
CMP
BNE
JSR
CMP
BNE
BEQ

RDBYTX
SCR6
CKERR
RDBYTX
SCR7
CKERR
OKEXIT

;CHECK SUM

;CHECK SUM ERROR
;(ALWAYS)

A9 2F
D0 0A

LCERR

LDA #LSTCHR
BNE NGEXIT

;LAST CHAR IS NOT '/'
;(ALWAYS)

C9 2F
F0 E6

LDT7A

CMP #'/'
BEQ LOADT8
LDA #NONHEX
BNE NGEXIT

;LAST OR NONHEX?
;LAST
;FRAMING ERROR
;KIM ONLY, NON HEX CHAR READ
;(ALWAYS)

LDA #CHECK

;CHECKSUM ERROR

A9 FF
D0 02

FRERR
NHERR

A9 CC

CKERR

38

NGEXIT SEC

B0 01
18
24
50
A0
4C
68
68
38
A2
D0
AD
29
8D

;ERROR INDICATOR TO MONITOR IS

BCS EXIT
OKEXIT CLC

FD
08
80
78 8C

CC
69
02 A0
BF
02 A0

EXIT

BIT
BVC
LDY
JMP

USRREQ PLA
PLA
SEC
EX10
LDX
BNE
SYNC
LDA
AND
STA

;(ALWAYS)
;NO ERROR

MODE
EX10
#$80
LOADT

;READING WRONG REC?
;RESTART SEARCH
;USER REQUESTS EXIT

#$CC
STCC
DDRIN
#$BF
DDRIN

;STOP TAPE, RETURN
;CHANGE DATA DIRECTION

1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966

8D5A
8D5C
8D5F
8D62
8D64
8D66
8D69
8D6B
8D6D
8D70
8D72
8D74
8D76
8D78
8D7B
8D7E
8D80
8D83
8D85
8D87
8D89
8D8B
8D8D
8D90
8D92
8D94
8D95
8D97
8D9A
8D9B
8D9E
8D9F
8D9F
8D9F
8D9F
8DA1
8DA3
8DA6
8DA8
8DA9
8DA9
8DAB
8DAE
8DB0
8DB3
8DB6
8DB9
8DBB
8DBE
8DBF
8DBF
8DBF
8DBF
8DBF
8DC1
8DC3
8DC6
8DC8

A9
8D
AD
24
10
AD
85
A9
8D
A5
09
85
A9
8D
2C
10
20
66
A5
C9
D0
A2
20
C9
D0
CA
D0
8E
CA
8E
60

00
0B
31
FD
03
32
F8
6D
00
FD
40
FD
7F
01
00
CB
9F
FC
FC
16
EB
0A
E1
16
E2

24
10
20
B0
60

FD
69
CA 8D
22

SYNBIT BIT
BPL
JSR
BCS
RTS

MODE
RDBITK
GETTR
GETTR

;KIM OR HS?
;KIM
;HS
;IF SHORT, GET NEXT TRANS
;BIT IS ZERO

84
20
A9
20
20
20
A2
8E
60

FD
86
09
A5
2E
9C
EC
0C

START

MODE
ACCESS
#9
CONFIG
ZERCK
P2SCR
#$EC
VIAPCR

;MODE PARM PASSED IN [Y]
;FIX BASIC WARM START BUG

A0
A6
A6
A4

A4
A4
8D

8D

F6
00 A4
01 A4

LDA #0
STA VIAACR
LDA KMBDRY
;SET UP BOUNDARY
BIT MODE
BPL SY100
LDA HSBDRY
SY100 STA BDRY
LDA #$6D
STA DIG
;INDICATE NO SYNC ON LEDS
LDA MODE
;TURN ON OUT OF SYNC MODE
ORA #$40
;BIT6
STA MODE
SYNC5 LDA #$7F
;TEST FOR CR DOWN ON HKB
STA DDRDIG
BIT DIG
BPL USRREQ
;CR KEY DOWN - EXIT (ERRORS)
JSR SYNBIT
ROR CHAR
LDA CHAR
CMP #SYN
BNE SYNC5
SYNC10 LDX #10
;NOW MAKE SURE CAN GET 10 SYNS
JSR RDCHTX
CMP #SYN
BNE SYNC5
DEX
BNE SYNC10+2
STX DIG
;TURN OFF DISPLAY
DEX
;X=$FF
STX DDRDIG
RTS
;SYNBIT - GET BIT IN SYN SEARCH. IF HS, ENTER WITH
; TIMER STARTED BY PREV BIT, BIT RETURNED IN CARRY.

8B
89
83
82
A0

STCC

STY
JSR
LDA
JSR
JSR
JSR
LDX
STX
RTS

;PARTIAL I/O CONFIGURATION
;ZERO THE CHECK SUM
;MOVE SA TO FE,FF IN PAGE ZERO
;TAPE ON

; GETTR - GET TRANSITION TIME FROM 6532 CLOCK
; DESTROYS A,Y
A9
85
AD
29
D0

00
F9
00 A0
40
F9

KGETTR LDA
STA
KG100 LDA
AND
BNE

#0
OLD
TAPIN
#$40
KG100

;KIM GETTR - GET FULL CYCLE
;FORCE GETTR POLARITY
;WAIT TIL INPUT LO

1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
C
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023

8DCA
8DCA
8DCC
8DCF
8DD1
8DD3
8DD5
8DD7
8DDA
8DDD
8DDE
8DE0
8DE1
8DE1
8DE3
8DE5
8DE5
8DE5
8DE5
8DE5
8DE5
8DE5
8DE8
8DEA
8DED
8DEF
8DF2
8DF4
8DF7
8DF8
8DFA
8DFB
8DFD
8DFF
8E02
8E03
8E05
8E07
8E08
8E09
8E0C
8E0C
8E0C
8E0C
8E0F
8E11
8E14
8E16
8E18
8E19
8E1C
8E1E
8E21
8E23
8E25
8E26
8E26

A0
AD
29
C5
F0
85
AD
8C
18
65
60

FF
00 A0
40
F9
F7
F9
06 A4
15 A4
F8

24 FD
10 7A

GETTR
NOTR

LDY
LDA
AND
CMP
BEQ
STA
LDA
STY
CLC
ADC
RTS

#$FF
TAPIN
#$40
OLD
NOTR
OLD
TIMER
TIM8

;NO CHANGE
;RESTART CLOCK

BDRY

RDCHTX BIT MODE
BPL RDCHT

;READ HS OR KIM CHARACTER
;KIM

; RDBYTH - READ HS BYTE
; Y DESTROYED, BYTE RETURNED IN CHAR AND A
; TIME FROM ONE CALL TO NEXT MUST BE LESS THAN
;
START BIT TIME (TIMER STILL RUNNING)
8E
A2
20
B0
20
90
20
38
66
CA
D0
A5
AE
60
24
70
68
68
4C

38
08
CA
14
CA
04
CA

A6
8D
8D
8D

FC
F2
FC
38 A6
FD
F8
38 8D

RDBYTH STX
LDX
JSR
BCS
RDBH10 JSR
BCC
JSR
SEC
RDASSY ROR
DEX
BNE
LDA
H8DFF LDX
RTS
RDBH90 BIT
BVS
PLA
PLA
JMP

SCR8
#8
GETTR
RDBH90
GETTR
RDASSY
GETTR

;SAVE X
;GET START BIT TIME
;IF NOT 0, FRAMING ERR
;GET BIT IN CARRY
;BIT IS ONE, WAIT HALF CYC
;MAKE SURE "1"

CHAR
RDBH10
CHAR
SCR8
MODE
RDBH90-4

;GET IN ACC
;RESTORE X
;NO ERR IF NOT IN SYNC
;OR READING WRONG REC
;FIX STACK

FRERR

; RDBITK - READ KIM BIT - X,Y,A DESTROYED, BIT RETURNED IN
20
B0
20
B0
A2
E8
20
90
20
90
E0
60

BF 8D
FB
BF 8D
F6
00
BF 8D
FA
BF 8D
F5
08

24 FD

RDBITK JSR
BCS
JSR
BCS
LDX
RDB100 INX
JSR
BCC
JSR
BCC
CPX
RTS

KGETTR
RDBITK
KGETTR
RDBITK
#0
KGETTR
RDB100
KGETTR
RDB100
#$08

RDBYTX BIT MODE

;WAIT FOR LF
;GET SECOND
;COUNT LF FULL CYCLES
;GET SECOND
;GET BIT TO CARRY
;READ HS OR KIM BYTE

2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081

8E28
8E2A
8E2A
8E2D
8E2F
8E31
8E34
8E36
8E37
8E3A
8E3C
8E3C
8E3C
8E3C
8E3C
8E3C
8E3E
8E40
8E42
8E44
8E46
8E48
8E4A
8E4B
8E4D
8E4E
8E4F
8E50
8E51
8E53
8E54
8E56
8E57
8E59
8E5B
8E5C
8E5D
8E5E
8E5F
8E5F
8E5F
8E5F
8E5F
8E5F
8E60
8E61
8E63
8E64
8E67
8E69
8E6A
8E6B
8E6D
8E6E
8E6F
8E71
8E72
8E73

30 BB
20
C9
F0
20
B0
AA
20
86

5F 8E
2F
2C
3C 8E
26
5F 8E
FC

BMI RDBYTH
RDBYT

JSR
CMP
BEQ
JSR
BCS
TAX
JSR
STX
; AND FALL

RDCHT
#'/'
PACKT3
PACKT
RDRTN

;HS
;READ KIM BYTE INTO CHAR AND A
;READ ONE CHAR IF LAST
;SET CARRY AND RETURN
;NON HEX CHAR?
;SAVE MSD

RDCHT
CHAR
;MOVE MSD TO CHAR
INTO PACKT AGAIN

;PACKT - ASCII HEX TO 4 BITS
;INPUT IN A, OUTPUT IN CHAR AND A, CARRY SET = NON HEX
C9
90
C9
B0
C9
F0
90
18
69
2A
2A
2A
2A
A0
2A
26
88
D0
A5
18
60
38
60

30
1D
47
19
40
15
03
09

04
FC
FA
FC

PACKT

CMP
BCC
CMP
BCS
CMP
BEQ
BCC
CLC
ADC
PACKT1 ROL
ROL
ROL
ROL
LDY
RACKT2 ROL
ROL
DEY
BNE
LDA
CLC
RDRTN RTS
PACKT3 SEC
RTS

#$30
PACKT3
#$47
PACKT3
#$40
PACKT3
PACKT1
#9
A
A
A
A
#4
A
CHAR
RACKT2
CHAR

;LT "0"?
;GT "F" ?
;A-F?
;40 NOT VALID

;GET LSD INTO LEFT NIBBLE

;ROTATE 1 BIT AT A TIME INTO CHAR

;GET INTO ACCUM ALSO
;OK
;NOT HEX

; RDCHT - READ KIM CHAR
; PRESERVES X, RETURNS CHAR IN CHAR (W/PARITY)
; AND A (W/O PARITY)
8A
48
A9
48
20
66
68
0A
D0
68
AA
A5
2A
4A
60

RDCHT
FF
0C 8E
FC
F6
FC

KBITS

TXA
PHA
LDA
PHA
JSR
ROR
PLA
ASL
BNE
PLA
TAX
LDA
ROL
LSR
RTS

;SAVE X
#$FF

;USE A TO COUNT BITS (BY SHIFTING)
;SAVE COUNTER

RDBITK
CHAR
A
KBITS
CHAR
A
A

;DO 8 BITS
;RESTORE X

;DROP PARITY

2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
START
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138

8E74
8E74
8E74
8E74
8E77
8E77
8E77
8E77
8E77
8E78
8E79
8E7C
8E7F
8E81
8E84
8E85
8E86
8E86
8E87
8E87
8E8A
8E8C
8E8F
8E91
8E93
8E95
8E98
8E99
8E9A
8E9C
8E9F
8EA0
8EA2
8EA3
8EA4
8EA5
8EA7
8EA9
8EAC
8EAC
8EAF
8EB2
8EB2
8EB5
8EB8
8EBB
8EBE
8EBE
8EBE
8EC0
8EC2
8EC2
8EC5
8EC8
8ECB
8ECE
8ECE

; RDCHK - READ ONE BYT, INCLUDE IN CKSUM
20 26 8E

RDCHK

JSR RDBYTX

;FALL INTO CHKT

; CHKT - UPDATE CHECK SUM FROM BYTE IN A
; DESTROYS Y
A8
18
6D
8D
90
EE
98
60

CHKT
36 A6
36 A6
03
37 A6

TAY
CLC
ADC
STA
BCC
INC
CHKT10 TYA
RTS

FF
DUMPT

A9
8D
A2
A4
10
AE
8A
48
A9
20
88
D0
68
AA
CA
D0
A9
20

LDA
STA
LDX
LDY
BPL
LDX
DUMPT1 TXA
PHA
DMPT1A LDA
JSR
DEY
BNE
PLA
TAX
DEX
BNE
LDA
JSR

16
0A 8F
F8

F1
2A
0A 8F

SCR6
SCR6
CHKT10
SCR7

.DB $FF
*=$8E87
JSR START

20 A9 8D
07
02 A4
01
FD
03
30 A6

;SAVE ACCUM

#7
TAPOUT
#1
MODE
DUMPT1
TAPDEL

;BUMP HI BYTE
;RESTORE A
;NOT USED
;KEEP OLD ENTRY POINT
;INIT VIA & CKSUM, SA TO BUFAD &
;CODE FOR TAPE OUT
;BIT 3 USED FOR HI/LO
;KIM DELAY CONSTANT (OUTER)
;128 KIM, 0 HS
;KIM - DO 128 SYNS
;HS INITIAL DELAY (OUTER)

#SYN
OUTCTX
DMPT1A

;INNER LOOP (HS OR KIM)

DUMPT1
#'*'
OUTCTX

;WRITE START

AD 4E A6
20 3F 8F

LDA ID
JSR OUTBTX

;WRITE ID

AD
20
AD
20

LDA
JSR
LDA
JSR

;WRITE SA

4C
3C
4D
3C

A6
8F
A6
8F

SAL
OUTBCX
SAH
OUTBCX

;
24 FD
10 0C
AD
20
AD
20

4A
3C
4B
3C

A5 FE

A6
8F
A6
8F

BIT MODE
BPL DUMPT2

;KIM OR HS

LDA
JSR
LDA
JSR

;HS, WRITE EA

EAL
OUTBCX
EAH
OUTBCX

DUMPT2 LDA BUFADL

;CHECK FOR LAST BYTE

2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196

8ED0
8ED3
8ED5
8ED7
8EDA
8EDC
8EDC
8EDE
8EE1
8EE4
8EE7
8EEA
8EED
8EED
8EEF
8EF2
8EF4
8EF7
8EF7
8EF7
8EFA
8EFA
8EFC
8EFE
8F01
8F03
8F05
8F07
8F0A
8F0C
8F0E
8F0E
8F0E
8F0E
8F0E
8F10
8F13
8F15
8F18
8F1A
8F1C
8F1F
8F1F
8F22
8F23
8F25
8F27
8F29
8F2C
8F2C
8F2F
8F30
8F32
8F33
8F35
8F38
8F39
8F3A

CD
D0
A5
CD
D0

4A A6
25
FF
4B A6
1E

CMP
BNE
LDA
CMP
BNE

EAL
DUMPT4
BUFADH
EAH
DUMPT4

A9
20
AD
20
AD
20

2F
0A
36
3F
37
3F

LDA
JSR
LDA
JSR
LDA
JSR

#'/'
OUTCTX
SCR6
OUTBTX
SCR7
OUTBTX

;LAST, WRITE "/"

8F
A6
8F
A6
8F

A9
20
A9
20

04
3F 8F
04
3F 8F

LDA
JSR
LDA
JSR

#EOT
OUTBTX
#EOT
OUTBTX

;WRITE TWO EOT'S

=*
JMP OKEXIT

;(SET "OK" MARK)

DT3E
4C 41 8D
A0
B1
20
E6
D0
E6
4C
24
10

00
FE
3C 8F
FE
C9
FF
CE 8E
FD
48

A2
8C
85
AD
46
49
8D

09
39 A6
FC
02 A4
FC
08
02 A4

AC
88
D0
90
49
8D

35 A6

AC
88
D0
CA
D0
AC
60
EA
90

3C A6

FD
12
08
02 A4

FD
E3
39 A6
F0

DUMPT4 LDY
LDA
JSR
INC
BNE
INC
JMP
OUTCTX BIT
BPL

#0
(BUFADL),Y
OUTBCX
BUFADL
DUMPT2
BUFADH
DUMPT2
MODE
OUTCHT

;WRITE CHECK SUM

;GET BYTE
;WRITE IT W/CHK SUM
;BUMP BUFFER ADDR
;CARRY
;HS OR KIM?
;KIM

; OUTBTH - NO CLOCK
; A,X DESTROYED
; MUST RESIDE ON ONE PAGE - TIMING CRITICAL
OUTBTH LDX #9
;8 BITS + START BIT
STY SCR9
STA CHAR
LDA TAPOUT
;GET PREV LEVEL
GETBIT LSR CHAR
EOR #TPBIT
STA TAPOUT
;INVERT LEVEL
; *** HERE STARTS FIRST HALF CYCLE
LDY TAPET1
A416
DEY
;TIME FOR THIS LOOP IS 5Y-1
BNE A416
BCC NOFLIP
;NOFLIP IF BIT ZERO
EOR #TPBIT
;BIT IS ONE - INVERT OUTPUT
STA TAPOUT
; *** END OF FIRST HALF CYCLE
B416
LDY TAPET2
B416B DEY
;LENGTH OF LOOP IS 5Y-1
BNE B416B
DEX
BNE GETBIT
;GET NEXT BIT (LAST IS 0 START BIT)
LDY SCR9
; (BY 9 BIT LSR)
RTS
NOFLIP NOP
;TIMING
BCC B416
;(ALWAYS)

2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254

8F3C
8F3C
8F3F
8F41
8F43
8F43
8F43
8F43
8F43
8F44
8F45
8F46
8F47
8F48
8F4B
8F4B
8F4B
8F4D
8F4F
8F50
8F52
8F54
8F56
8F56
8F56
8F56
8F56
8F56
8F56
8F59
8F5C
8F5E
8F60
8F61
8F64
8F66
8F68
8F6A
8F6C
8F6E
8F70
8F73
8F74
8F76
8F77
8F79
8F7B
8F7D
8F7F
8F81
8F83
8F86
8F87
8F89
8F8A
8F8C
8F8D
8F8E

20 77 8E
24 FD
30 CB

;
OUTBCX JSR CHKT
OUTBTX BIT MODE
BMI OUTBTH

;WRITE HS OR KIM BYTE & CKSUM
;WRITE HS OR KIM BYTE
;HS

;OUTBTC - OUTPUT ONE KIM BYTE
A8
4A
4A
4A
4A
20 4B 8F

OUTBTC =*
OUTBT TAY
LSR A
LSR A
LSR A
LSR A
JSR HEXOUT
; FALL INTO HEXOUT

29
C9
18
30
69
69

HEXOUT AND
CMP
CLC
BMI
ADC
HEX1
ADC

0F
0A
02
07
30

;
;
;
;
8E
8C
85
A9
48
AD
46
A2
B0
A2
A0
49
8D
88
D0
CA
D0
A2
B0
A2
A0
49
8D
88
D0
CA
D0
68
0A
D0

38 A6
39 A6
FC
FF
02 A4
FC
12
02
24
19
08
02 A4
FD
F3
18
02
0C
27
08
02 A4
FD
F3
D0

#$0F
#$0A

;SAVE DATA BYTE

;MORE SIG DIGIT
;CVT LSD OF [A] TO ASCII, OUTPUT

HEX1
#$07
#$30

OUTCHT - OUTPUT ASCII CHAR (KIM)
CLOCK NOT USED
X,Y PRESERVED
MUST RESIDE ON ONE PAGE - TIMING CRITICAL

OUTCHT STX
STY
STA
LDA
KIMBIT PHA
LDA
LSR
LDX
BCS
LDX
HF
LDY
EOR
STA
HFP1
DEY
BNE
DEX
BNE
LDX
BCS
LDX
LF20
LDY
EOR
STA
LFP1
DEY
BNE
DEX
BNE
PLA
ASL
BNE

SCR8
SCR9
CHAR
#$FF
TPOUT
CHAR
#18
HF
#36
#25
#TPBIT
TPOUT
HFP1
HF
#24
LF20
#12
#39
#TPBIT
TPOUT
LFP1
LF20
A
KIMBIT

;PRESERVE X
;DITTO Y
;USE FF W/SHIFTS TO COUNT BITS
;SAVE BIT CTR
;GET CURRENT OUTPUT LEVEL
;GET DATA BIT IN CARRY
;ASSUME 'ONE'
;BIT IS ZERO
;INVERT OUTPUT
;PAUSE FOR 138 USEC
;COUNT HALF CYCS OF HF
;ASSUME BIT IS ONE
;BIT IS ZERO
;INVERT OUTPUT
;PAUSE FOR 208 USEC
;COUNT HALF CYCS
;RESTORE BIT CTR
;DECREMENT IT
;FF SHIFTED 8X = 0

2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312

8F90
8F93
8F96
8F97
8F98
8F98
8F9A
8F9A
8F9A
8F9A
8F9B
8F9C
8F9D
8F9E
8F9F
8FA0
8FA0
8FA0
8FA0
8FA0
8FA0
8FA0
8FA0
8FA2
8FA4
8FA6
8FA8
8FAA
8FAC
8FAE
8FB0
8FB1
8FB2
8FB3
8FB5
8FB6
8FB8
8FBC
8FBD
8FC0
8FC6
8FC9
8FCA
8FD0
8FD1
8FD2
8FD3
8FD4
8FD5
8FD6
8FD7
8FD8
8FD9
8FDB
8FDC
8FDD
8FDE
8FDF

AE 38 A6
AC 39 A6
98
60

LDX SCR8
LDY SCR9
TYA
RTS

FF FF

.DB $FF,$FF

;RESTORE DATA BYTE
;NOT USED

; REGISTER NAME PATCH
*=$8F9A
53
.DB "S"
46
.DB "F"
41
.DB "A"
58
.DB 'X'
59
.DB "Y"
01
.DB $01
;
;
;***
;*** DEFAULT TABLE
;***
*=$8FA0
DFTBLK =*
00 C0
.DW $C000
;BASIC *** JUMP TABLE
A7 8B
.DW TTY
64 8B
.DW NEWDEV
00 00
.DW $0000
;PAGE ZERO
00 02
.DW $0200
00 03
.DW $0300
00 C8
.DW $C800
00 D0
.DW $D000
04
.DB $04
;TAPE DELAY (9.0 SEC)
2C
.DB $2C
;KIM TAPE BOUNDARY
46
.DB $46
;HS TAPE BOUNDARY
00 00
.DB $00,$00
;SCR3,SCR4
33
.DB $33
;HS TAPE FIRST 1/2 BIT
00 00
.DB $00,$00
;SCR6,SCR7
00 00 00 00
.DB $00,$00,$00,$00 ;SCR8-SCRB
5A
.DB $5A
;HS TAPE SECOND 1/2 BIT
00 00 00
.DB $00,$00,$00 ;SCRD-SCRF
00006D6E8606
.DB $00,$00,$6D,$6E,$86,$06 ;DISP BUFFER (SY1.1)
00 00 00
.DB $00,$00,$00 ;NOT USED
00
.DB $00
;PARNR
000000000000
.DW $0000,$0000,$0000 ;PARMS
01
.DB $01
;PADBIT
4C
.DB $4C
;SDBYT
00
.DB $00
;ERCNT
80
.DB $80
;TECHO
B0
.DB $B0
;TOUTFL
00
.DB $00
;KSHFL
00
.DB $00
;TV
00
.DB $00
;LSTCOM
10
.DB $10
;MAXRC
4A 8B
.DW RESET
;USER REG'S
FF
.DB $FF
;STACK
00
.DB $00
;FLAGS
00
.DB $00
;A
00
.DB $00
;X
00
.DB $00
;Y

2313
8FE0
;VECTORS
2314
8FE0 4C BE 89
JMP HKEY
2315
8FE3 4C 00 89
JMP HDOUT
2316
8FE6 4C 6A 89
JMP KYSTAT
2317
8FE9 4C D1 81
JMP M1
2318
8FEC 4C D1 81
JMP M1
2319
8FEF 4C 06 89
JMP SCAND
2320
8FF2 7E 88
.DW RIN
2321
8FF4 C0 80
.DW TRCOFF
2322
8FF6 4A 80
.DW SVBRK
2323
8FF8 29 80
.DW SVIRQ
2324
8FFA 9B 80
.DW SVNMI
2325
8FFC 4A 8B
.DW RESET
2326
8FFE 0F 80
.DW IRQBRK
2327
9000
2328
9000
LENTRY =$8C78
2329
9000
SENTRY =$8C78+$20F
2330
9000
RGNAM =$8F9A
2331
9000
2332
9000
.END
tasm: Number of errors = 0

;INVEC
;OUTVEC
;INSVEC
;UNRECOGNIZED SYNTAX (ERROR)
;UNRECOGNIZED COMMAND (ERROR)
;SCNVEC
;IN PTR FOR EXEC FROM RAM
;USER TRACE VECTOR
;BRK
;USER IRQ
;NMI
;RESET
;IRQ

;REGISTER NAME PATCH

Sign up to vote on this title
UsefulNot useful