; -----------------------------------------------------------------------------
; TFS 2.50 (c) BBC 1986
; reverse engineered by Eelco Huininga
; Load address : 00008000
; Exec address : 0000D9CD
; Length       : 00004000
; -----------------------------------------------------------------------------

fsnumber           = &06                          ; TFS Filing system number (file handles = &0E and &0F)

; -----------------------------------------------------------------------------
; Teletext registers
; -----------------------------------------------------------------------------
ttxcontrol         = &FC10                        ; (Write) TTX Control Register
                                                  ;         bit 7: probably unused (see schematics)
                                                  ;         bit 6: probably unused (see schematics)
                                                  ;         bit 5:
                                                  ;         bit 4: AFC switch
                                                  ;         bit 3: Teletext interrupt enable (0=disabled, 1=enabled)
                                                  ;         bit 2: Teletext interrupt enable???
                                                  ;         bit 1: Channel select
                                                  ;         bit 0: Channel select
ttxstatus          = &FC10                        ; (Read)  TTX Status Register
                                                            bit 7: 0=No TTX interrupt, 1=TTX interrupt
rowreg             = &FC11                        ; (Write) TTX Row Register
datareg            = &FC12                        ; (Read)  TTX Data Register
                                                  ; (Write) ???
statclr            = &FC13                        ; (Rd/Wr) TTX Clear Status Register


; -----------------------------------------------------------------------------
; Teletext control codes
; -----------------------------------------------------------------------------
up                 = &
down               = &0A
left               = &08
right              = &
black              = &80                          ; Alphanumeric black (128)
red                = &81                          ; Alphanumeric red (129)
green              = &82                          ; Alphanumeric green (130)
yellow             = &83                          ; Alphanumeric yellow (131)
blue               = &84                          ; Alphanumeric blue (132)
magnenta           = &85                          ; Alphanumeric magnenta (133)
cyan               = &86                          ; Alphanumeric cyan (134)
white              = &87                          ; Alphanumeric white (135)
flash              = &88                          ; Flashing (136)
dblheightoff       = &8C                          ; Turn off double height (140)
dblheighton        = &8D                          ; Turn on double height (141)
gblack             = &90                          ; Graphics black (144)
gred               = &91                          ; Graphics red (145)
ggreen             = &92                          ; Graphics green (146)
gyellow            = &93                          ; Graphics yellow (147)
gblue              = &94                          ; Graphics blue (148)
gmagnenta          = &95                          ; Graphics magnenta (149)
gcyan              = &96                          ; Graphics cyan (150)
gwhite             = &97                          ; Graphics white (151)
setbackground      = &9D                          ; Set new background color (157)

; -----------------------------------------------------------------------------
; TUBE ULA registers
; -----------------------------------------------------------------------------
tubedat            = &FEE5

tubeid             = &5                           ; When claiming the TUBE, we'll use ID &5

; -----------------------------------------------------------------------------
; OS call addresses
; -----------------------------------------------------------------------------
brkv               = &0202                        ; The BRK vector
tubecontrol        = &0406                        ; TUBE control (claim/data transfer/release)
osfind             = &FFCE                        ; OSFIND Open or close a file
osgbpb             = &FFD1                        ; OSGBPB Load or save a block of memory to a file
osargs             = &FFDA                        ; OSARGS Load or save file parameters
osfile             = &FFDD                        ; OSFILE Load or save a complete file
osrdch             = &FFE0                        ; OSRDCH Read a character
osasci             = &FFE3                        ; OSASCI Write a character, with CR converted to LF
osnewl             = &FFE7                        ; OSNEWL Write a new-line routine
oswrch             = &FFEE                        ; OSWRCH Write a character
osword             = &FFF1                        ; OSWORD Various OS routines
osbyte             = &FFF4                        ; OSBYTE Various OS routines
oscli              = &FFF7                        ; OSCLI Operating System Command Line Interface


; -----------------------------------------------------------------------------
; Start of code
; -----------------------------------------------------------------------------

8000  4C 10 98     L..   JMP language             ; Language entry
8003  4C 24 80     L$.   JMP service              ; Service entry
8006  C2           .     EQUB %11000010           ; ROM type; bit 7   = 1    : Has a service entry
                                                  ;           bit 6   = 1    : Has a language entry
                                                  ;           bit 5   = 0    : Isn't relocatable to the second processor
                                                  ;           bit 4   = 0    : No Electron firm key expansions availabe
                                                  ;           bit 3-0 = 0010 : 6502 code (not BASIC)
8007  17           .     EQUB &17                 ; Copyright offset
8008  02           .     EQUB &02                 ; Version
.title
8009  54 45 4C 45  TELE  EQUS "TELETEXT"          ; ROM Title
      54 45 58 54
8011  00           .     EQUB &00                 ; Title termination byte
.version
8012  32 2E 35 30  2.50  EQUS "2.50"              ; Version string
8016  0D           .     EQUB &0D
8017  00           .     EQUB &00                 ; Version termination byte
.copyright
8018  28 43 29 42  (C)B  EQUS "(C)BBC 1986"       ; Copyright string
      42 43 20 31
      39 38 36
8023  00           .     EQUB &00                 ; Copyright termination byte

; -----------------------------------------------------------------------------
; Service entry
; -----------------------------------------------------------------------------
.service
8024  08           .     PHP
8025  48           H     PHA
8026  C9 FF        ..    CMP #&FF                 ; Is it service call &FF : Tube system main initialisation?
8028  D0 2C        .,    BNE &8056
.
802A  98           .     TYA                      ; Service call &FF : Tube system main initialisation / &03 : Auto-boot call
802B  48           H     PHA
802C  8A           .     TXA
802D  48           H     PHA
802E  A5 84        ..    LDA &84
8030  48           H     PHA
8031  A5 85        ..    LDA &85
8033  48           H     PHA
8034  A9 AA        ..    LDA #&AA
8036  A2 00        ..    LDX #&00
8038  A0 FF        ..    LDY #&FF
803A  20 F4 FF      ..   JSR osbyte               ; Read address of ROM info table
803D  86 84        ..    STX &84
803F  84 85        ..    STY &85
8041  A4 F4        ..    LDY &F4
8043  B1 84        ..    LDA (&84),Y
8045  29 BF        ).    AND #&BF
8047  91 84        ..    STA (&84),Y
8049  68           h     PLA
804A  85 85        ..    STA &85
804C  68           h     PLA
804D  85 84        ..    STA &84
804F  68           h     PLA
8050  AA           .     TAX
8051  68           h     PLA
8052  A8           .     TAY
8053  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
8056  BD F0 0D     ...   LDA &0DF0,X
8059  10 09        ..    BPL &8064
805B  68           h     PLA
805C  48           H     PHA
805D  C9 03        ..    CMP #&03
805F  F0 C9        ..    BEQ &802A                ; Jump to service call &03 : Auto-boot call
8061  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
8064  68           h     PLA
8065  48           H     PHA
8066  C9 04        ..    CMP #&04
8068  D0 03        ..    BNE &806D
806A  4C 82 81     L..   JMP &8182                ; Jump to service call &04 : Unrecognised * command
.
806D  C9 09        ..    CMP #&09
806F  D0 03        ..    BNE &8074
8071  4C E2 81     L..   JMP &81E2                ; Jump to service call &09 : *HELP command interception
.
8074  C9 08        ..    CMP #&08
8076  D0 03        ..    BNE &807B
8078  4C 74 82     Lt.   JMP &8274                ; Jump to service call &08 : Unrecognised OSWORD call
.
807B  C9 05        ..    CMP #&05
807D  D0 03        ..    BNE &8082
807F  4C 8F 8B     L..   JMP &8B8F                ; Jump to service call &05 : Unknown interrupt
.
8082  C9 02        ..    CMP #&02
8084  D0 30        .0    BNE &80B6
8086  98           .     TYA                      ; Service call &02 : Relative space claim (? page)
8087  48           H     PHA
8088  8A           .     TXA
8089  48           H     PHA
808A  A9 00        ..    LDA #&00                 ; OS version number report
808C  A2 01        ..    LDX #&01                 ; Return OS version in X
808E  A0 00        ..    LDY #&00
8090  20 F4 FF      ..   JSR osbyte
8093  E0 03        ..    CPX #&03                 ; Is this machine a Master 128, Master ET, Master Compact or ARM based machine?
8095  B0 18        ..    BCS &80AF                ; Yes? Then exit (space will be claimed by service call &22)
8097  68           h     PLA
8098  AA           .     TAX
8099  68           h     PLA
809A  48           H     PHA
809B  9D F0 0D     ...   STA &0DF0,X
809E  20 F4 80      ..   JSR &80F4
80A1  68           h     PLA
80A2  A8           .     TAY
80A3  A6 F4        ..    LDX &F4
80A5  BD F0 0D     ...   LDA &0DF0,X
80A8  F0 02        ..    BEQ &80AC
80AA  A8           .     TAY
80AB  C8           .     INY
.
80AC  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
80AF  68           h     PLA
80B0  AA           .     TAX
80B1  68           h     PLA
80B2  A8           .     TAY
80B3  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
80B6  C9 27        .'    CMP #&27
80B8  D0 0E        ..    BNE &80C8
80BA  98           .     TYA                      ; Service call &27 : Hard reset call
80BB  48           H     PHA
80BC  8A           .     TXA
80BD  48           H     PHA
80BE  20 F4 80      ..   JSR &80F4
80C1  68           h     PLA
80C2  AA           .     TAX
80C3  68           h     PLA
80C4  A8           .     TAY
80C5  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
80C8  C9 24        .$    CMP #&24
80CA  D0 04        ..    BNE &80D0
80CC  88           .     DEY                      ; Service call &24 : Absolute workspace in Hazel count
80CD  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
80D0  C9 22        ."    CMP #&22
80D2  D0 1D        ..    BNE &80F1
80D4  98           .     TYA                      ; Service call &22 : Claim absolute workspace in Hazel
80D5  9D F0 0D     ...   STA &0DF0,X
80D8  48           H     PHA
80D9  20 F4 80      ..   JSR &80F4
80DC  68           h     PLA
80DD  A8           .     TAY
80DE  A6 F4        ..    LDX &F4
80E0  BD F0 0D     ...   LDA &0DF0,X
80E3  F0 09        ..    BEQ &80EE
80E5  29 7F        )    AND #&7F
80E7  9D F0 0D     ...   STA &0DF0,X
80EA  09 80        ..    ORA #&80
80EC  A8           .     TAY
80ED  C8           .     INY
.
80EE  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
80F1  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit

; -----------------------------------------------------------------------------
; Service call &27 : Hard reset call
; -----------------------------------------------------------------------------
.
80F4  20 38 90      8.   JSR &9038                ; Read adapter status
80F7  C9 02        ..    CMP #&02
80F9  90 2D        .-    BCC &8128
80FB  A5 84        ..    LDA &84
80FD  48           H     PHA
80FE  A5 85        ..    LDA &85
8100  48           H     PHA
8101  A9 AA        ..    LDA #&AA
8103  A2 00        ..    LDX #&00
8105  A0 FF        ..    LDY #&FF
8107  20 F4 FF      ..   JSR osbyte               ; Read address of ROM info table
810A  86 84        ..    STX &84
810C  84 85        ..    STY &85
810E  A4 F4        ..    LDY &F4
8110  B1 84        ..    LDA (&84),Y
8112  29 BF        ).    AND #&BF
8114  91 84        ..    STA (&84),Y
8116  68           h     PLA
8117  85 85        ..    STA &85
8119  68           h     PLA
811A  85 84        ..    STA &84
811C  A6 F4        ..    LDX &F4
811E  BD F0 0D     ...   LDA &0DF0,X
8121  A8           .     TAY
8122  A9 00        ..    LDA #&00
8124  9D F0 0D     ...   STA &0DF0,X
8127  60           `     RTS
.
8128  A5 84        ..    LDA &84
812A  48           H     PHA
812B  A5 85        ..    LDA &85
812D  48           H     PHA
812E  A6 F4        ..    LDX &F4
8130  BD F0 0D     ...   LDA &0DF0,X
8133  85 85        ..    STA &85                  ; MSB of pointer to workspace
8135  A9 00        ..    LDA #&00
8137  85 84        ..    STA &84                  ; LSB of pointer to workspace
8139  A9 00        ..    LDA #&00
813B  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
813E  E0 03        ..    CPX #&03
8140  90 06        ..    BCC &8148
8142  A5 85        ..    LDA &85
8144  09 80        ..    ORA #&80
8146  85 85        ..    STA &85
.
8148  A0 00        ..    LDY #&00
814A  A9 FF        ..    LDA #&FF
.
814C  91 84        ..    STA (&84),Y
814E  C8           .     INY
814F  D0 FB        ..    BNE &814C
8151  A0 A0        ..    LDY #&A0
8153  A9 00        ..    LDA #&00
.
8155  91 84        ..    STA (&84),Y
8157  C8           .     INY
8158  C0 B4        ..    CPY #&B4
815A  D0 F9        ..    BNE &8155
815C  A9 00        ..    LDA #&00
815E  91 84        ..    STA (&84),Y
8160  A0 B7        ..    LDY #&B7
8162  91 84        ..    STA (&84),Y
8164  A0 F0        ..    LDY #&F0
8166  91 84        ..    STA (&84),Y
8168  A0 E9        ..    LDY #&E9
816A  91 84        ..    STA (&84),Y
816C  A0 F1        ..    LDY #&F1
816E  A9 2A        .*    LDA #&2A
8170  91 84        ..    STA (&84),Y
8172  A0 BD        ..    LDY #&BD
8174  A9 10        ..    LDA #%00010000                     ; AFC = on
8176  91 84        ..    STA (&84),Y
8178  8D 10 FC     ...   STA ttxcontrol
817B  68           h     PLA
817C  85 85        ..    STA &85
817E  68           h     PLA
817F  85 84        ..    STA &84
8181  60           `     RTS

; -----------------------------------------------------------------------------
; Service call &04 : Unrecognised * command
; -----------------------------------------------------------------------------
.
8182  98           .     TYA
8183  48           H     PHA
8184  8A           .     TXA
8185  48           H     PHA
8186  A6 F4        ..    LDX &F4
8188  BD F0 0D     ...   LDA &0DF0,X              ; Check if the workspace has been initialised yet
818B  F0 4E        .N    BEQ &81DB                ; No, it hasn't
818D  A2 00        ..    LDX #&00
.
818F  B1 F2        ..    LDA (&F2),Y
8191  29 DF        ).    AND #&DF                 ; Transform character to upper-case
8193  C9 54        .T    CMP #&54                 ; Is the character a 'T'?
8195  D0 03        ..    BNE &819A
8197  C8           .     INY
8198  D0 F5        ..    BNE &818F
.
819A  84 A8        ..    STY &A8
.
819C  B1 F2        ..    LDA (&F2),Y
819E  29 DF        ).    AND #&DF                 ; Transform character to upper-case
81A0  DD BD 84     ...   CMP &84BD,X
81A3  D0 16        ..    BNE &81BB
81A5  C8           .     INY
81A6  E8           .     INX
81A7  BD BD 84     ...   LDA &84BD,X
81AA  D0 F0        ..    BNE &819C
.
81AC  E8           .     INX
81AD  BD BD 84     ...   LDA &84BD,X
81B0  85 A9        ..    STA &A9
81B2  E8           .     INX
81B3  BD BD 84     ...   LDA &84BD,X
81B6  85 AA        ..    STA &AA
81B8  6C A9 00     l..   JMP (&00A9)              ; Jump to the specified subroutine
.
81BB  C9 0E        ..    CMP #&0E                 ; Is the character a '.'?
81BD  D0 09        ..    BNE &81C8
81BF  C8           .     INY
.
81C0  E8           .     INX
81C1  BD BD 84     ...   LDA &84BD,X
81C4  D0 FA        ..    BNE &81C0
81C6  F0 E4        ..    BEQ &81AC
.
81C8  E8           .     INX
81C9  BD BD 84     ...   LDA &84BD,X
81CC  D0 FA        ..    BNE &81C8
81CE  E8           .     INX
81CF  E8           .     INX
81D0  E8           .     INX
81D1  BD BD 84     ...   LDA &84BD,X
81D4  30 05        0.    BMI &81DB
81D6  A4 A8        ..    LDY &A8
81D8  4C 9C 81     L..   JMP &819C
.                                                 ; Restore A, X, Y and P registers and exit
81DB  68           h     PLA
81DC  AA           .     TAX
81DD  68           h     PLA
81DE  A8           .     TAY
.                                                 ; Restore A and P registers and exit
81DF  68           h     PLA
81E0  28           (     PLP
81E1  60           `     RTS

; -----------------------------------------------------------------------------
; Service call &09 : *HELP command interception
; -----------------------------------------------------------------------------
.
81E2  B1 F2        ..    LDA (&F2),Y              ; Only handle *HELP's without parameters
81E4  C9 0D        ..    CMP #&0D                 ; So check if it ends with a CR (&0D)
81E6  F0 03        ..    BEQ &81EB                ; And if it does, jump to &81EB
81E8  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
81EB  98           .     TYA
81EC  48           H     PHA
81ED  8A           .     TXA
81EE  48           H     PHA
81EF  20 E7 FF      ..   JSR osnewl
81F2  A2 00        ..    LDX #&00
81F4  BD 09 80     ...   LDA &title,X             ; Get a character from the ROM title
81F7  D0 02        ..    BNE &81FB                ; Check if it is the ROM title termination byte (&00)
81F9  A9 20        .     LDA #&20                 ; If it is, replace it with ' ' (&20)
.
81FB  C9 0D        ..    CMP #&0D
81FD  F0 06        ..    BEQ &8205
81FF  20 E3 FF      ..   JSR osasci               ; Print the character
8202  E8           .     INX
8203  D0 EF        ..    BNE &81F4
.
8205  20 38 90      8.   JSR &9038                ; Read adapter status
8208  F0 33        .3    BEQ &823D
820A  30 22        0"    BMI &822E
820C  C9 02        ..    CMP #&02
820E  D0 0F        ..    BNE &821F
8210  A2 00        ..    LDX #&00
.
8212  BD 55 82     .U.   LDA &8255,X
8215  20 EE FF      ..   JSR oswrch               ; Print ' No Power'
8218  E8           .     INX
8219  E0 09        ..    CPX #&09
821B  D0 F5        ..    BNE &8212
821D  F0 30        .0    BEQ &824F
.
821F  A2 00        ..    LDX #&00
8221  BD 5E 82     .^.   LDA &825E,X
8224  20 EE FF      ..   JSR oswrch               ; Print ' No Signal'
8227  E8           .     INX
8228  E0 0A        ..    CPX #&0A
822A  D0 F5        ..    BNE &8221
822C  F0 0F        ..    BEQ &823D
.
822E  A2 00        ..    LDX #&00
8230  BD 68 82     .h.   LDA &8268,X
8233  20 EE FF      ..   JSR oswrch               ; Print ' No TTX Unit'
8236  E8           .     INX
8237  E0 0C        ..    CPX #&0C
8239  D0 F5        ..    BNE &8230
823B  F0 12        ..    BEQ &824F
.
823D  A9 20        .     LDA #&20
823F  20 EE FF      ..   JSR oswrch
8242  A9 28        .(    LDA #&28
8244  20 EE FF      ..   JSR oswrch
8247  20 D0 9D      ..   JSR &9DD0
824A  A9 29        .)    LDA #&29
824C  20 EE FF      ..   JSR oswrch
.
824F  20 E7 FF      ..   JSR osnewl
8252  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
.
8255  20 4E 6F 20   No   EQUS " No Power"
      50 6F 77 65  Powe
      72           r
.
825E  20 4E 6F 20   No   EQUS " No Signal"
      53 69 67 6E  Sign
      61 6C        al
.
8268  20 4E 6F 20   No   EQUS " No TTX Unit"
      54 54 58 20  TTX 
      55 6E 69 74  Unit

; -----------------------------------------------------------------------------
; Service call &08 : Unrecognised OSWORD call
; -----------------------------------------------------------------------------
.
8274  A5 EF        ..    LDA &EF
8276  C9 7A        .z    CMP #&7A                 ; Is it OSWORD &7A?
8278  F0 03        ..    BEQ &827D                ; Yes, it is
827A  4C DF 81     L..   JMP &81DF                ; Restore A and P registers and exit
.
827D  98           .     TYA
827E  48           H     PHA
827F  8A           .     TXA
8280  48           H     PHA
8281  A0 00        ..    LDY #&00
8283  B1 F0        ..    LDA (&F0),Y
8285  C9 11        ..    CMP #&11                 ; Command &11 doesn't need TFS to be initialised
8287  F0 0A        ..    BEQ &8293                ; So jump straight to the handler
8289  A6 F4        ..    LDX &F4
828B  BD F0 0D     ...   LDA &0DF0,X              ; Check if TFS has been initialised
828E  D0 03        ..    BNE &8293
.
8290  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
.
8293  A0 00        ..    LDY #&00
8295  B1 F0        ..    LDA (&F0),Y
8297  C9 1C        ..    CMP #&1C                 ; Is parameter 0 >= &1C?
8299  B0 F5        ..    BCS &8290                ; Yes, then exit
829B  A9 00        ..    LDA #&00
829D  85 A8        ..    STA &A8                  ; LSB Pointer to workspace
829F  A6 F4        ..    LDX &F4
82A1  BD F0 0D     ...   LDA &0DF0,X
82A4  29 7F        )    AND #&7F
82A6  85 A9        ..    STA &A9                  ; MSB Pointer to workspace
82A8  A5 EF        ..    LDA &EF
82AA  48           H     PHA
82AB  A5 F0        ..    LDA &F0
82AD  48           H     PHA
82AE  A5 F1        ..    LDA &F1
82B0  48           H     PHA
82B1  A9 00        ..    LDA #&00                 ; OS version number report
82B3  A2 01        ..    LDX #&01                 ; Return OS version in X
82B5  A0 00        ..    LDY #&00
82B7  20 F4 FF      ..   JSR osbyte
82BA  E0 03        ..    CPX #&03                 ; Is this machine an Electron, BBC or BBC+?
82BC  90 06        ..    BCC &82C4                ; Then jump to &82C4
82BE  A5 A9        ..    LDA &A9                  ; Master or above can use Hazel workspace (&C000-&DBFF)
82C0  09 80        ..    ORA #&80                 ; Set bit 7 of MSB Pointer to workspace
82C2  85 A9        ..    STA &A9
.
82C4  68           h     PLA
82C5  85 F1        ..    STA &F1
82C7  68           h     PLA
82C8  85 F0        ..    STA &F0
82CA  68           h     PLA
82CB  85 EF        ..    STA &EF
82CD  A0 00        ..    LDY #&00
82CF  B1 F0        ..    LDA (&F0),Y              ; Get parameter 0
82D1  0A           .     ASL A                    ; Multiply by 2
82D2  A8           .     TAY
82D3  B9 EA 82     ...   LDA &82EA,Y              ; Get the LSB of the subroutine
82D6  85 AA        ..    STA &AA
82D8  C8           .     INY
82D9  B9 EA 82     ...   LDA &82EA,Y              ; Get the MSB of the subroutine
82DC  85 AB        ..    STA &AB
82DE  6C AA 00     l..   JMP (&00AA)              ; And jump to the subroutine
.
82E1  68           h     PLA
82E2  AA           .     TAX
82E3  68           h     PLA
82E4  A8           .     TAY
82E5  68           h     PLA
82E6  A9 00        ..    LDA #&00
82E8  28           (     PLP
82E9  60           `     RTS

; -----------------------------------------------------------------------------
; OSWORD commands lookup table
; -----------------------------------------------------------------------------
.
82EA  38 83        8.    EQUW &8338               ; Command &00 Read channel
82EC  22 83        ".    EQUW &8322               ; Command &01 Set channel
82EE  45 83        E.    EQUW &8345               ; Command &02 Read record flag
82F0  55 83        U.    EQUW &8355               ; Command &03 Set record flag
82F2  68 83        h.    EQUW &8368               ; Command &04 Read a Page Grabber record
82F4  79 83        y.    EQUW &8379               ; Command &05 Set a Page Grabber record
82F6  B1 83        ..    EQUW &83B1               ; Command &06 Read number of rows to be captured
82F8  B6 83        ..    EQUW &83B6               ; Command &07 Set number of rows to be captured
82FA  C0 83        ..    EQUW &83C0               ; Command &08 Read header line status
82FC  C5 83        ..    EQUW &83C5               ; Command &09 Set header line status
82FE  DA 83        ..    EQUW &83DA               ; Command &0A Read magazine for header display
8300  E5 83        ..    EQUW &83E5               ; Command &0B Set magazine for header display
8302  EF 83        .     EQUW &83EF               ; Command &0C Switch off teletext interrupts
8304  03 84        ..    EQUW &8403               ; Command &0D Switch on teletext interrupts
8306  19 84        ..    EQUW &8419               ; Command &0E Clear all Page Grabber records
8308  4E 84        .N    EQUW &844E               ; Command &0F Read Television Service Data Packet
830A  6B 84        .k    EQUW &846B               ; Command &10 Set a Page Grabber record
830C  79 84        .y    EQUW &8479               ; Command &11 Read Adapter status
830E  8B 84        ..    EQUW &848B               ; Command &12 Set Subtitle Enable flag
8310  A2 84        ..    EQUW &84A2               ; Command &13 Set interrupt handling flag
8312  AF 92        ..    EQUW &92AF               ; Command &14 Enter tuning routine
8314  4D 94        M.    EQUW &944D               ; Command &15 Return time from TSDP
8316  46 95        F.    EQUW &9546               ; Command &16 Return date from TSDP
8318  DF 96        ..    EQUW &96DF               ; Command &17 Check CRC
831A  B6 97        ..    EQUW &97B6               ; Command &18 Download a file from teletext
831C  F7 97        ..    EQUW &97F7               ; Command &19 De-ham a byte
831E  AC 84        ..    EQUW &84AC               ; Command &1A Set emulation mode
8320  B3 84        ..    EQUW &84B3               ; Command &1B Read emulation mode

; -----------------------------------------------------------------------------
; OSWORD &7A Command &01 : Set channel
; -----------------------------------------------------------------------------
.
8322  A9 10        ..    LDA #%00010000                     ; AFC = on
8324  A0 BD        ..    LDY #&BD
8326  91 A8        ..    STA (&A8),Y
8328  8D 10 FC     ...   STA ttxcontrol
832B  A0 01        ..    LDY #&01
832D  11 F0        ..    ORA (&F0),Y                                  ; A = A OR channel number
832F  A0 BD        ..    LDY #&BD
8331  09 0C        ..    ORA #%00001100
8333  91 A8        ..    STA (&A8),Y
8335  4C 19 84     L..   JMP &8419

; -----------------------------------------------------------------------------
; OSWORD &7A Command &00 : Read channel
; -----------------------------------------------------------------------------
.
8338  A0 BD        ..    LDY #&BD
833A  B1 A8        ..    LDA (&A8),Y
833C  29 03        ).    AND #%00000011
833E  A0 01        ..    LDY #&01
8340  91 F0        ..    STA (&F0),Y
8342  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &02 : Read record flag
; -----------------------------------------------------------------------------
.
8345  20 B8 84      ..   JSR &84B8                                    ; Return parameter 1 in A
8348  18           .     CLC
8349  69 A0        i.    ADC #&A0
834B  A8           .     TAY
834C  B1 A8        ..    LDA (&A8),Y
834E  A0 02        ..    LDY #&02
8350  91 F0        ..    STA (&F0),Y
8352  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &03 : Set record flag
; -----------------------------------------------------------------------------
.
8355  20 B8 84      ..   JSR &84B8                                    ; Return parameter 1 in A
8358  18           .     CLC
8359  69 A0        i.    ADC #&A0
835B  AA           .     TAX
835C  C8           .     INY
835D  B1 F0        ..    LDA (&F0),Y
835F  48           H     PHA
8360  8A           .     TXA
8361  A8           .     TAY
8362  68           h     PLA
8363  91 A8        ..    STA (&A8),Y
8365  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &04 : Read a Page Grabber record
; -----------------------------------------------------------------------------
.
8368  20 94 83      ..   JSR &8394
836B  A0 02        ..    LDY #&02
836D  B1 AA        ..    LDA (&AA),Y
836F  91 F0        ..    STA (&F0),Y
8371  C8           .     INY
8372  C0 0A        ..    CPY #&0A
8374  D0 F7        ..    BNE &836D
8376  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &05 : Set a Page Grabber record
; -----------------------------------------------------------------------------
.
8379  78           x     SEI
837A  A9 10        ..    LDA #%00010000                     ; AFC = on
837C  8D 10 FC     ...   STA ttxcontrol
837F  20 94 83      ..   JSR &8394
8382  A0 02        ..    LDY #&02
8384  B1 F0        ..    LDA (&F0),Y
8386  91 AA        ..    STA (&AA),Y
8388  C8           .     INY
8389  C0 0A        ..    CPY #&0A
838B  D0 F7        ..    BNE &8384
838D  20 E2 90      ..   JSR &90E2
8390  58           X     CLI
8391  4C 03 84     L..   JMP &8403

.
8394  20 B8 84      ..   JSR &84B8                ; Return parameter 1 in A
8397  0A           .     ASL A
8398  0A           .     ASL A
8399  0A           .     ASL A
839A  18           .     CLC
839B  65 A8        e.    ADC &A8
839D  85 AA        ..    STA &AA
839F  A5 A9        ..    LDA &A9
83A1  85 AB        ..    STA &AB
83A3  38           8     SEC
83A4  A5 AA        ..    LDA &AA
83A6  E9 02        ..    SBC #&02
83A8  85 AA        ..    STA &AA
83AA  A5 AB        ..    LDA &AB
83AC  E9 00        ..    SBC #&00
83AE  85 AB        ..    STA &AB
83B0  60           `     RTS

; -----------------------------------------------------------------------------
; OSWORD &7A Command &06 : Read number of rows to be captured
; -----------------------------------------------------------------------------
.
83B1  A0 B4        ..    LDY #&B4
83B3  4C DC 83     L..   JMP &83DC

; -----------------------------------------------------------------------------
; OSWORD &7A Command &07 : Set number of rows to be captured
; -----------------------------------------------------------------------------
.
83B6  20 B8 84      ..   JSR &84B8                          ; Return parameter 1 in A
83B9  A0 B4        ..    LDY #&B4
83BB  91 A8        ..    STA (&A8),Y
83BD  4C E1 82     L..   JMP &82E1                          ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &08 : Read header line status
; -----------------------------------------------------------------------------
.
83C0  A0 B7        ..    LDY #&B7
83C2  4C DC 83     L..   JMP &83DC

; -----------------------------------------------------------------------------
; OSWORD &7A Command &09 : Set header line status
; -----------------------------------------------------------------------------
.
83C5  20 B8 84      ..   JSR &84B8                          ; Return parameter 1 in A
83C8  A0 B7        ..    LDY #&B7
83CA  91 A8        ..    STA (&A8),Y
83CC  A0 BD        ..    LDY #&BD
83CE  B1 A8        ..    LDA (&A8),Y
83D0  09 1C        ..    ORA #%00011100                     ; AFC = on
83D2  91 A8        ..    STA (&A8),Y
83D4  8D 10 FC     ...   STA ttxcontrol
83D7  4C E1 82     L..   JMP &82E1                          ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &0A : Read magazine for header display
; -----------------------------------------------------------------------------
.
83DA  A0 B8        ..    LDY #&B8
.
83DC  B1 A8        ..    LDA (&A8),Y
83DE  A0 01        ..    LDY #&01
83E0  91 F0        ..    STA (&F0),Y
83E2  4C E1 82     L..   JMP &82E1                          ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &0B : Set magazine for header display
; -----------------------------------------------------------------------------
.
83E5  20 B8 84      ..   JSR &84B8                          ; Return parameter 1 in A
83E8  A0 B8        ..    LDY #&B8
83EA  91 A8        ..    STA (&A8),Y
83EC  4C E1 82     L..   JMP &82E1                          ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &0C : Switch off teletext interrupts
; -----------------------------------------------------------------------------
.
83EF  A0 BD        ..    LDY #&BD
83F1  B1 A8        ..    LDA (&A8),Y
83F3  29 F3        ).    AND #%11110011
83F5  91 A8        ..    STA (&A8),Y
83F7  8D 10 FC     ...   STA ttxcontrol
83FA  A0 E9        ..    LDY #&E9
83FC  A9 00        ..    LDA #&00
83FE  91 A8        ..    STA (&A8),Y
8400  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &0D : Switch on teletext interrupts
; -----------------------------------------------------------------------------
.
8403  78           x     SEI
8404  A0 E9        ..    LDY #&E9
8406  A9 FF        ..    LDA #&FF
8408  91 A8        ..    STA (&A8),Y
840A  A0 BD        ..    LDY #&BD
840C  B1 A8        ..    LDA (&A8),Y
840E  09 0C        ..    ORA #%00001100
8410  91 A8        ..    STA (&A8),Y
8412  8D 10 FC     ...   STA ttxcontrol
8415  58           X     CLI
8416  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &0E : Clear all Page Grabber records
; -----------------------------------------------------------------------------
.
8419  A9 10        ..    LDA #%00010000                     ; AFC = on
841B  8D 10 FC     ...   STA ttxcontrol
841E  A0 00        ..    LDY #&00
8420  A9 FF        ..    LDA #&FF
8422  91 A8        ..    STA (&A8),Y
8424  C8           .     INY
8425  C0 A0        ..    CPY #&A0
8427  D0 F9        ..    BNE &8422
8429  A9 00        ..    LDA #&00
842B  91 A8        ..    STA (&A8),Y
842D  C8           .     INY
842E  C0 B4        ..    CPY #&B4
8430  D0 F9        ..    BNE &842B
8432  C8           .     INY
8433  A9 FF        ..    LDA #&FF
8435  91 A8        ..    STA (&A8),Y
8437  C8           .     INY
8438  91 A8        ..    STA (&A8),Y
843A  A0 D4        ..    LDY #&D4
843C  91 A8        ..    STA (&A8),Y
843E  A9 00        ..    LDA #&00
8440  A0 F0        ..    LDY #&F0
8442  91 A8        ..    STA (&A8),Y
8444  A0 BD        ..    LDY #&BD
8446  B1 A8        ..    LDA (&A8),Y
8448  8D 10 FC     ...   STA ttxcontrol
844B  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &0F : Read Television Service Data Packet
; -----------------------------------------------------------------------------
.
844E  A9 01        ..    LDA #&01
8450  85 AA        ..    STA &AA
8452  A9 D4        ..    LDA #&D4
8454  85 AB        ..    STA &AB
8456  A4 AB        ..    LDY &AB
8458  B1 A8        ..    LDA (&A8),Y
845A  A4 AA        ..    LDY &AA
845C  91 F0        ..    STA (&F0),Y
845E  E6 AA        ..    INC &AA
8460  E6 AB        ..    INC &AB
8462  A5 AA        ..    LDA &AA
8464  C9 0E        ..    CMP #&0E
8466  D0 EE        ..    BNE &8456
8468  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &10 : Clear Page Grabber record
; -----------------------------------------------------------------------------
.
846B  78           x     SEI
846C  A0 B5        ..    LDY #&B5
846E  A9 FF        ..    LDA #&FF
8470  91 A8        ..    STA (&A8),Y
8472  C8           .     INY
8473  91 A8        ..    STA (&A8),Y
8475  58           X     CLI
8476  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &11 : Read Adapter status
; -----------------------------------------------------------------------------
.
8479  20 38 90      8.   JSR &9038                ; Read adapter status
847C  A0 01        ..    LDY #&01
847E  91 F0        ..    STA (&F0),Y
8480  A0 E9        ..    LDY #&E9
8482  B1 A8        ..    LDA (&A8),Y
8484  A0 02        ..    LDY #&02
8486  91 F0        ..    STA (&F0),Y
8488  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &12 : Set Subtitle Enable flag
; -----------------------------------------------------------------------------
.
848B  20 B8 84      ..   JSR &84B8                ; Return parameter 1 in A
848E  A0 E7        ..    LDY #&E7
8490  91 A8        ..    STA (&A8),Y
8492  A0 02        ..    LDY #&02
8494  B1 F0        ..    LDA (&F0),Y
8496  48           H     PHA
8497  C8           .     INY
8498  B1 F0        ..    LDA (&F0),Y
849A  A0 EF        ..    LDY #&EF
849C  91 A8        ..    STA (&A8),Y
849E  68           h     PLA
849F  88           .     DEY
84A0  D0 05        ..    BNE &84A7

; -----------------------------------------------------------------------------
; OSWORD &7A Command &13 : Set interrupt handling flag
; -----------------------------------------------------------------------------
.
84A2  20 B8 84      ..   JSR &84B8                ; Return parameter 1 in A
84A5  A0 E9        ..    LDY #&E9
.
84A7  91 A8        ..    STA (&A8),Y
84A9  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &1A :  Set emulation mode
; -----------------------------------------------------------------------------
.
84AC  20 B8 84      ..   JSR &84B8                ; Return parameter 1 in A
84AF  A0 F1        ..    LDY #&F1
84B1  D0 F4        ..    BNE &84A7

; -----------------------------------------------------------------------------
; OSWORD &7A Command &1B : Read emulation mode
; -----------------------------------------------------------------------------
.
84B3  A0 F1        ..    LDY #&F1
84B5  4C DC 83     L..   JMP &83DC

; -----------------------------------------------------------------------------
; Return parameter 1 in A
; -----------------------------------------------------------------------------
.
84B8  A0 01        ..    LDY #&01
84BA  B1 F0        ..    LDA (&F0),Y
84BC  60           `     RTS

; -----------------------------------------------------------------------------
; * Commands lookup table
; -----------------------------------------------------------------------------
.                                                 ; *TELETEXT
84BD  45 4C 45 54  ELET  EQUS "ELETEXT"
      45 58 54     EXT
84C4  00           .     EQUB &00
84C5  42 85        B.    EQUW &8542

.                                                 ; *HON
84C7  48 4F 4E     HON   EQUS "HON"
84CA  00           .     EQUB &00
84CB  92 85        ..    EQUW &8592

.                                                 ; *HOFF
84CD  48 4F 46 46  HOFF  EQUS "HOFF"
84D1  00           .     EQUB &00
84D2  F4 85        .     EQUW &85F4

.                                                 ; *BBC
84D4  42 42 43     BBC   EQUS "BBC"
84D7  00           .     EQUB &00
84D8  45 86        E.    EQUW &8645

.                                                 ; *ITV
84DA  49 54 56     ITV   EQUS "ITV"
84DD  00           .     EQUB &00
84DE  73 86        s.    EQUW &8673

.                                                 ; *CH
84E0  43 48        CH    EQUS "CH"
84E2  00           .     EQUB &00
84E3  45 86        E.    EQUW &8645

.                           
84E5  53           S     ...
84E6  14           .     ...
84E7  43           C     ...
84E8  00           .     EQUB &00
84E9  8B           .     ...
84EA  86

.
84EB  4E        .N    STX &4E
84EC  4F           O     ...
84ED  54           T     ...
84EE  54           T     ...
84EF  58           X     CLI
84F0  00           .     EQUB &00
84F1  68           h     PLA
84F2  85

.
84F3  58        .X    STA &58
84F4  00           .     EQUB &00
84F5  98           .     TYA
84F6  86

.
84F7  55        .U    STX &55
84F8  4E 45 00     NE.   LSR &0045
84FA  00           .     EQUB &00
84FB  F4           .     ...
84FC  86

.
84FD  49        .I    STX &49
84FE  4D 45 00     ME.   EOR &0045
8500  00           .     EQUB &00
8501  14           .     ...
8502  87           .     ...

.
8503  44           D     ...
8504  41 54        AT    EOR (&54,X)
8506  45 00        E.    EOR &00
8507  00           .     EQUB &00
8508  5B           [     ...
8509  87           .     ...

.
850A  4D 41 47     MAG   EOR &4741
850D  41 5A        AZ    EOR (&5A,X)
850F  49 4E        IN    EOR #&4E
8511  45 00        E.    EOR &00
8512  00           .     EQUB &00
8513  0B           .     ...
8514  86

.
8515 50        .P    STX &50
8516  41 47        AG    EOR (&47,X)
8518  45 00        E.    EOR &00
8519  00           .     EQUB &00
851A  95 87        ..    STA &87,X

.
851C  52           R     ...
851D  41 4E        AN    EOR (&4E,X)
851F  53           S     ...
8520  46 45        FE    LSR &45
8522  52           R     ...
8523  00           .     EQUB &00
8524  3E 88

.
8526  44     >.D   ASL &4488,X
8527  41 54        AT    EOR (&54,X)
8529  41
852A  00           .     EQUB &00
852B  35 88        5.    AND &88,X

.
852D  44           D     ...
852E  49 53        IS    EOR #&53
8530  50 4C        PL    BVC &857E
8532  41 59        AY    EOR (&59,X)
8534  00           .     EQUB &00
8535  96 89        ..    STX &89,Y

.
8537  45 4C        EL    EOR &4C
8539  45 53        ES    EOR &53
853B  4F           O     ...
853C  46 54        FT    LSR &54
853E  00           .     EQUB &00
853F  F0 86        ..    BEQ &84C7

8541  FF           .     ...

; -----------------------------------------------------------------------------
; *TELETEXT
; -----------------------------------------------------------------------------
.
8542  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
8545  C9 0D        ..    CMP #&0D                 ; Were any parameters given with *TELETEXT?
8547  D0 1C        ..    BNE &8565                ; Yes, there were, so exit
8549  A9 1A        ..    LDA #&1A                 ; Parameter 0 is &1A : Set emulation mode
854B  8D 00 01     ...   STA &0100
854E  A9 2A        .*    LDA #&2A                 ; Parameter 1 is &2A : Characters per line to receive
8550  8D 01 01     ...   STA &0101
8553  20 20 8B       .   JSR &8B20                ; Set emulation mode to TTX (OSWORD &7A command &1A)
8556  20 8A 89      ..   JSR &898A                ; Check if the TUBE is active
8559  F0 03        ..    BEQ &855E                ; If it's not, then jump to &855E
855B  4C 1A 98     L..   JMP &981A
.
855E  A6 F4        ..    LDX &F4
8560  A9 8E        ..    LDA #&8E
8562  4C F4 FF     L..   JMP osbyte               ; Enter Langauge ROM (If the Tube is active the ROM will be copied across to the coprocessor)
.
8565  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit

8568  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
856B  C9 0D        ..    CMP #&0D
856D  D0 F6        ..    BNE &8565
856F  A6 F4        ..    LDX &F4
8571  A9 80        ..    LDA #&80
8573  9D F0 0D     ...   STA &0DF0,X
8576  A9 13        ..    LDA #&13
8578  78           x     SEI
8579  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

857C  0D           .     EQUB &0D
857D  0A           .     EQUB &0A
857E  0A           .     EQUB &0A
857F  50 72 65 73  Pres  EQUS "Press CTRL-BREAK"
      73 20 43 54  s CT
      52 4C 2D 42  RL-B
      52 45 41 4B  REAK

.
858F  4C 8F 85     L..   JMP &858F                ; Halt the system

; -----------------------------------------------------------------------------
; *HON
; -----------------------------------------------------------------------------
.
8592  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
8595  C9 0D        ..    CMP #&0D
8597  F0 13        ..    BEQ &85AC
8599  C9 30        .0    CMP #&30
859B  F0 07        ..    BEQ &85A4
859D  C9 31        .1    CMP #&31
859F  F0 33        .3    BEQ &85D4
85A1  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
85A4  C8           .     INY
85A5  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
85A8  C9 0D        ..    CMP #&0D
85AA  D0 F5        ..    BNE &85A1
85AC  20 E7 85      ..   JSR &85E7                ; Switch on teletext interrupts (OSWORD &7A command &0D)
85AF  A9 01        ..    LDA #&01
85B1  8D 01 01     ...   STA &0101

.
85B4  A9 09        ..    LDA #&09
85B6  8D 00 01     ...   STA &0100
85B9  20 20 8B       .   JSR &8B20                ; Set the header line status (OSWORD &7A command &09)
85BC  A9 0B        ..    LDA #&0B
85BE  8D 00 01     ...   STA &0100                ; Parameter &00 is &0B : Set the magazine for header display
85C1  A9 FF        ..    LDA #&FF
85C3  8D 01 01     ...   STA &0101                ; Parameter &01 is &FF : Display all headers
85C6  20 20 8B       .   JSR &8B20                ; Set the magazine for header display (OSWORD &7A command &0B)
85C9  A9 10        ..    LDA #&10                 ; Parameter &00 is &10 : Clear page grabber status
85CB  8D 00 01     ...   STA &0100
85CE  20 20 8B       .   JSR &8B20                ; Clear page grabber status (OSWORD &7A command &10)
85D1  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)

.
85D4  C8           .     INY
85D5  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
85D8  C9 0D        ..    CMP #&0D
85DA  D0 C5        ..    BNE &85A1
85DC  20 E7 85      ..   JSR &85E7                ; Switch on teletext interrupts (OSWORD &7A command &0D)
85DF  A9 FF        ..    LDA #&FF
85E1  8D 01 01     ...   STA &0101
85E4  4C B4 85     L..   JMP &85B4

; -----------------------------------------------------------------------------
; Perform OSWORD &7A command &0D (Switch on teletext interrupts)
; -----------------------------------------------------------------------------
.
85E7  98           .     TYA
85E8  48           H     PHA
85E9  A9 0D        ..    LDA #&0D                           ; Parameter &00 is &0D : Switch on teletext interrupts
85EB  8D 00 01     ...   STA &0100
85EE  20 20 8B       .   JSR &8B20                          ; Switch on teletext interrupts (OSWORD &7A command &0D)
85F1  68           h     PLA
85F2  A8           .     TAY
85F3  60           `     RTS

.
85F4  20 29 8B      ).   JSR &8B29                          ; Get first character from (&F2),Y which is not &20
85F7  C9 0D        ..    CMP #&0D
85F9  D0 A6        ..    BNE &85A1
85FB  A9 09        ..    LDA #&09                           ; Parameter &00 is &09 : Set the header line status
85FD  8D 00 01     ...   STA &0100
8600  A9 00        ..    LDA #&00                           ; Parameter &01 is &00 : Header off
8602  8D 01 01     ...   STA &0101
8605  20 20 8B       .   JSR &8B20                          ; Set the header line status to off (OSWORD &7A command &09)
8608  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
860B  20 29 8B      ).   JSR &8B29                          ; Get first character from (&F2),Y which is not &20
860E  C9 0D        ..    CMP #&0D
8610  D0 03        ..    BNE &8615
8612  A9 31        .1    LDA #&31
8614  88           .     DEY
8615  C9 31        .1    CMP #&31
8617  90 29        .)    BCC &8642
8619  C9 39        .9    CMP #&39
861B  B0 25        .%    BCS &8642
861D  38           8     SEC
861E  E9 30        .0    SBC #&30
8620  8D 01 01     ...   STA &0101
8623  C9 08        ..    CMP #&08
8625  D0 05        ..    BNE &862C
8627  A9 00        ..    LDA #&00
8629  8D 01 01     ...   STA &0101
862C  C8           .     INY
862D  20 29 8B      ).   JSR &8B29                          ; Get first character from (&F2),Y which is not &20
8630  C9 0D        ..    CMP #&0D
8632  D0 0E        ..    BNE &8642
8634  A9 0B        ..    LDA #&0B                           ; Parameter &00 is &0B : Set the magazine for header display
8636  8D 00 01     ...   STA &0100
8639  20 20 8B       .   JSR &8B20                          ; Set the magazine for header display (OSWORD &7A command &0B)
863C  20 E7 85      ..   JSR &85E7                          ; Switch on teletext interrupts (OSWORD &7A command &0D)
863F  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)

.
8642  4C DB 81     L..   JMP &81DB                          ; Restore A, X, Y and P registers and exit

; -----------------------------------------------------------------------------
; *BBC / *CH
; -----------------------------------------------------------------------------
.
8645  20 29 8B      ).   JSR &8B29                          ; Get first character from (&F2),Y which is not &20
8648  C9 0D        ..    CMP #&0D
864A  D0 03        ..    BNE &864F
864C  A9 31        .1    LDA #&31                           ; Default channel is 1
864E  88           .     DEY

.
864F  C9 31        .1    CMP #'1'                           ; Check if channel is between 1 and 4
8651  90 EF        ..    BCC &8642
8653  C9 35        .5    CMP #'5'
8655  B0 EB        ..    BCS &8642

.
8657  38           8     SEC
8658  E9 31        .1    SBC #'1'                           ; Substract ASCII &31 to get the binary value
865A  8D 01 01     ...   STA &0101
865D  C8           .     INY
865E  20 29 8B      ).   JSR &8B29                          ; Get first character from (&F2),Y which is not &20
8661  C9 0D        ..    CMP #&0D
8663  D0 DD        ..    BNE &8642                          ; Exit if there are more parameters
8665  20 E7 85      ..   JSR &85E7                          ; Switch on teletext interrupts (OSWORD &7A command &0D)
8668  A9 01        ..    LDA #&01                           ; Parameter &00 is &01 : Set channel
866A  8D 00 01     ...   STA &0100
866D  20 20 8B       .   JSR &8B20                          ; Set channel (OSWORD &7A command &01)
8670  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)

; -----------------------------------------------------------------------------
; &ITV (select channels 3 and 4)
; -----------------------------------------------------------------------------
.
8673  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
8676  C9 0D        ..    CMP #&0D
8678  D0 03        ..    BNE &867D
867A  A9 31        .1    LDA #&31                           ; Default channel is 1
867C  88           .     DEY

.
867D  C9 31        .1    CMP #&31
867F  90 C1        ..    BCC &8642
8681  C9 33        .3    CMP #&33
8683  B0 BD        ..    BCS &8642
8685  18           .     CLC
8686  69 02        i.    ADC #&02                           ; Add 2
8688  4C 57 86     LW.   JMP &8657

.
868B  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
868E  C9 0D        ..    CMP #&0D
8690  D0 B0        ..    BNE &8642
8692  A9 34        .4    LDA #&34
8694  88           .     DEY
8695  4C 57 86     LW.   JMP &8657

.
8698  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
869B  29 DF        ).    AND #&DF
869D  C9 4F        .O    CMP #&4F
869F  D0 0D        ..    BNE &86AE
86A1  C8           .     INY
86A2  B1 F2        ..    LDA (&F2),Y
86A4  29 DF        ).    AND #&DF
86A6  C9 4E        .N    CMP #&4E
86A8  F0 07        ..    BEQ &86B1
86AA  C9 46        .F    CMP #&46
86AC  F0 1E        ..    BEQ &86CC
86AE  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
86B1  C8           .     INY
86B2  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
86B5  C9 0D        ..    CMP #&0D
86B7  D0 F5        ..    BNE &86AE
86B9  A9 2A        .*    LDA #&2A
86BB  8D 01 01     ...   STA &0101
86BE  A9 1A        ..    LDA #&1A
86C0  8D 00 01     ...   STA &0100
86C3  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
86C6  20 E7 85      ..   JSR &85E7                ; Switch on teletext interrupts (OSWORD &7A command &0D)
86C9  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
86CC  C8           .     INY
86CD  B1 F2        ..    LDA (&F2),Y
86CF  29 DF        ).    AND #&DF
86D1  C9 46        .F    CMP #&46
86D3  D0 D9        ..    BNE &86AE
86D5  C8           .     INY
86D6  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
86D9  C9 0D        ..    CMP #&0D
86DB  D0 D1        ..    BNE &86AE
86DD  A9 0C        ..    LDA #&0C
86DF  8D 00 01     ...   STA &0100
86E2  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
86E5  A9 0E        ..    LDA #&0E
86E7  8D 00 01     ...   STA &0100
86EA  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
86ED  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
86F0  A9 28        .(    LDA #&28
86F2  D0 C7        ..    BNE &86BB
86F4  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
86F7  C9 0D        ..    CMP #&0D
86F9  D0 16        ..    BNE &8711
86FB  20 E7 85      ..   JSR &85E7                ; Switch on teletext interrupts (OSWORD &7A command &0D)
86FE  A9 14        ..    LDA #&14
8700  8D 00 01     ...   STA &0100
8703  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
8706  A9 0C        ..    LDA #&0C                 ; Clear text window and move text cursor home
8708  20 EE FF      ..   JSR oswrch
870B  20 26 A8      &.   JSR &A826
870E  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
8711  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
8714  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
8717  C9 0D        ..    CMP #&0D
8719  D0 33        .3    BNE &874E
871B  A9 15        ..    LDA #&15
871D  8D 00 01     ...   STA &0100
8720  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
8723  AD 0A 01     ...   LDA &010A
8726  30 13        0.    BMI &873B
8728  A0 00        ..    LDY #&00
872A  B9 01 01     ...   LDA &0101,Y
872D  20 EE FF      ..   JSR oswrch
8730  C8           .     INY
8731  C0 08        ..    CPY #&08
8733  D0 F5        ..    BNE &872A
8735  20 E7 FF      ..   JSR osnewl
8738  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
873B  A0 00        ..    LDY #&00
873D  B9 51 87     .Q.   LDA &8751,Y
8740  20 EE FF      ..   JSR oswrch
8743  C8           .     INY
8744  C0 08        ..    CPY #&08
8746  D0 F5        ..    BNE &873D
8748  20 E7 FF      ..   JSR osnewl
874B  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
874E  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
8751  4E 6F 20     No    LSR &206F
8754  54           T     ...
8755  53           S     ...
8756  44           D     ...
8757  50 20        P     BVC &8779
8759  20 20 20           JSR &2020
875C  29 8B        ).    AND #&8B
875E  C9 0D        ..    CMP #&0D
8760  D0 EC        ..    BNE &874E
8762  A9 16        ..    LDA #&16
8764  8D 00 01     ...   STA &0100
8767  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
876A  AD 0C 01     ...   LDA &010C
876D  30 13        0.    BMI &8782
876F  A0 00        ..    LDY #&00
8771  B9 01 01     ...   LDA &0101,Y
8774  20 EE FF      ..   JSR oswrch
8777  C8           .     INY
8778  C0 0A        ..    CPY #&0A
877A  D0 F5        ..    BNE &8771
877C  20 E7 FF      ..   JSR osnewl
877F  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
8782  A0 00        ..    LDY #&00
8784  B9 51 87     .Q.   LDA &8751,Y
8787  20 EE FF      ..   JSR oswrch
878A  C8           .     INY
878B  C0 0A        ..    CPY #&0A
878D  D0 F5        ..    BNE &8784
878F  20 E7 FF      ..   JSR osnewl
8792  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
8795  20 13 88      ..   JSR &8813
8798  B0 5E        .^    BCS &87F8
879A  29 07        ).    AND #&07
879C  8D 02 01     ...   STA &0102
879F  20 FB 87      ..   JSR &87FB
87A2  B0 54        .T    BCS &87F8
87A4  8D 03 01     ...   STA &0103
87A7  A9 3F        .?    LDA #&3F
87A9  8D 04 01     ...   STA &0104
87AC  A9 7F        .    LDA #&7F
87AE  8D 05 01     ...   STA &0105
87B1  A9 FF        ..    LDA #&FF
87B3  8D 06 01     ...   STA &0106
87B6  8D 07 01     ...   STA &0107
87B9  8D 08 01     ...   STA &0108
87BC  8D 09 01     ...   STA &0109
87BF  20 13 88      ..   JSR &8813
87C2  90 11        ..    BCC &87D5
87C4  08           .     PHP
87C5  C9 0D        ..    CMP #&0D
87C7  F0 1E        ..    BEQ &87E7
87C9  29 DF        ).    AND #&DF
87CB  C9 53        .S    CMP #&53
87CD  F0 04        ..    BEQ &87D3
87CF  28           (     PLP
87D0  4C F8 87     L..   JMP &87F8
87D3  C8           .     INY
87D4  28           (     PLP
87D5  88           .     DEY
87D6  20 FB 87      ..   JSR &87FB
87D9  B0 1D        ..    BCS &87F8
87DB  8D 04 01     ...   STA &0104
87DE  20 FB 87      ..   JSR &87FB
87E1  B0 15        ..    BCS &87F8
87E3  8D 05 01     ...   STA &0105
87E6  08           .     PHP
87E7  28           (     PLP
87E8  A9 05        ..    LDA #&05
87EA  8D 00 01     ...   STA &0100
87ED  A9 00        ..    LDA #&00
87EF  8D 01 01     ...   STA &0101
87F2  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
87F5  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
87F8  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
87FB  20 13 88      ..   JSR &8813
87FE  B0 11        ..    BCS &8811
8800  0A           .     ASL A
8801  0A           .     ASL A
8802  0A           .     ASL A
8803  0A           .     ASL A
8804  8D 00 01     ...   STA &0100
8807  20 13 88      ..   JSR &8813
880A  B0 05        ..    BCS &8811
880C  0D 00 01     ...   ORA &0100
880F  18           .     CLC
8810  60           `     RTS
8811  38           8     SEC
8812  60           `     RTS
8813  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
8816  C8           .     INY
8817  C9 30        .0    CMP #&30
8819  90 09        ..    BCC &8824
881B  C9 3A        .:    CMP #&3A
881D  B0 07        ..    BCS &8826
881F  38           8     SEC
8820  E9 30        .0    SBC #&30
8822  18           .     CLC
8823  60           `     RTS
8824  38           8     SEC
8825  60           `     RTS
8826  29 DF        ).    AND #&DF
8828  C9 41        .A    CMP #&41
882A  90 F8        ..    BCC &8824
882C  C9 47        .G    CMP #&47
882E  B0 F4        ..    BCS &8824
8830  38           8     SEC
8831  E9 37        .7    SBC #&37
8833  18           .     CLC
8834  60           `     RTS
8835  98           .     TYA
8836  48           H     PHA
8837  20 E7 85      ..   JSR &85E7                ; Switch on teletext interrupts (OSWORD &7A command &0D)
883A  A9 30        .0    LDA #&30
883C  D0 07        ..    BNE &8845
883E  98           .     TYA
883F  48           H     PHA
8840  20 E7 85      ..   JSR &85E7                ; Switch on teletext interrupts (OSWORD &7A command &0D)
8843  A9 18        ..    LDA #&18
8845  8D 01 01     ...   STA &0101
8848  A9 07        ..    LDA #&07
884A  8D 00 01     ...   STA &0100
884D  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
8850  A9 04        ..    LDA #&04
8852  8D 00 01     ...   STA &0100
8855  A9 00        ..    LDA #&00
8857  8D 01 01     ...   STA &0101
885A  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
885D  68           h     PLA
885E  A8           .     TAY
885F  20 D9 8A      ..   JSR &8AD9
8862  AD 06 01     ...   LDA &0106
8865  0D 07 01     ...   ORA &0107
8868  D0 03        ..    BNE &886D
886A  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
886D  20 8A 89      ..   JSR &898A                ; Check if the TUBE is active
8870  F0 25        .%    BEQ &8897
8872  AD 06 01     ...   LDA &0106
8875  8D 0A 01     ...   STA &010A
8878  AD 07 01     ...   LDA &0107
887B  8D 0B 01     ...   STA &010B
887E  AD 08 01     ...   LDA &0108
8881  C9 FF        ..    CMP #&FF
8883  D0 07        ..    BNE &888C
8885  AD 09 01     ...   LDA &0109
8888  C9 FF        ..    CMP #&FF
888A  F0 0B        ..    BEQ &8897
888C  A9 83        ..    LDA #&83
888E  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
8891  8E 06 01     ...   STX &0106                ; LSB of OSHWM
8894  8C 07 01     ...   STY &0107                ; MSB of OSHWM
8897  A9 05        ..    LDA #&05
8899  8D 00 01     ...   STA &0100
889C  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
889F  A9 03        ..    LDA #&03
88A1  8D 00 01     ...   STA &0100
88A4  A9 00        ..    LDA #&00
88A6  8D 02 01     ...   STA &0102
88A9  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
88AC  A9 02        ..    LDA #&02
88AE  8D 00 01     ...   STA &0100
88B1  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
88B4  AD 02 01     ...   LDA &0102
88B7  29 02        ).    AND #&02
88B9  D0 1C        ..    BNE &88D7
88BB  A5 FF        ..    LDA &FF
88BD  29 80        ).    AND #&80
88BF  D0 03        ..    BNE &88C4
88C1  4C AC 88     L..   JMP &88AC
88C4  20 5F 89      _.   JSR &895F
88C7  A0 00        ..    LDY #&00
88C9  B9 81 89     ...   LDA &8981,Y
88CC  99 00 01     ...   STA &0100,Y
88CF  C8           .     INY
88D0  C0 09        ..    CPY #&09
88D2  D0 F5        ..    BNE &88C9
88D4  4C 00 01     L..   JMP &0100
88D7  20 8A 89      ..   JSR &898A                ; Check if the TUBE is active
88DA  F0 70        .p    BEQ &894C
88DC  AD 08 01     ...   LDA &0108
88DF  C9 FF        ..    CMP #&FF
88E1  D0 07        ..    BNE &88EA
88E3  AD 09 01     ...   LDA &0109
88E6  C9 FF        ..    CMP #&FF
88E8  F0 62        .b    BEQ &894C
88EA  A5 77        .w    LDA &77
88EC  48           H     PHA
88ED  A5 78        .x    LDA &78
88EF  48           H     PHA
88F0  AD 06 01     ...   LDA &0106
88F3  85 77        .w    STA &77
88F5  AD 07 01     ...   LDA &0107
88F8  85 78        .x    STA &78
88FA  AD 0A 01     ...   LDA &010A
88FD  8D 06 01     ...   STA &0106
8900  AD 0B 01     ...   LDA &010B
8903  8D 07 01     ...   STA &0107
8906  20 3C 8B      <.   JSR &8B3C
8909  A9 06        ..    LDA #&06
890B  8D 00 01     ...   STA &0100
890E  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
8911  AD 01 01     ...   LDA &0101
8914  C9 18        ..    CMP #&18
8916  F0 04        ..    BEQ &891C
8918  A2 08        ..    LDX #&08
891A  D0 02        ..    BNE &891E
891C  A2 04        ..    LDX #&04
891E  8A           .     TXA
891F  48           H     PHA
8920  20 4F 8B      O.   JSR &8B4F
8923  18           .     CLC
8924  AD 07 01     ...   LDA &0107
8927  69 01        i.    ADC #&01
8929  8D 07 01     ...   STA &0107
892C  AD 08 01     ...   LDA &0108
892F  69 00        i.    ADC #&00
8931  8D 08 01     ...   STA &0108
8934  AD 09 01     ...   LDA &0109
8937  69 00        i.    ADC #&00
8939  8D 09 01     ...   STA &0109
893C  E6 78        .x    INC &78
893E  68           h     PLA
893F  AA           .     TAX
8940  CA           .     DEX
8941  D0 DB        ..    BNE &891E
8943  68           h     PLA
8944  85 78        .x    STA &78
8946  68           h     PLA
8947  85 77        .w    STA &77
8949  20 46 8B      F.   JSR &8B46
894C  20 5F 89      _.   JSR &895F
894F  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
8952  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
8955  A9 FF        ..    LDA #&FF
8957  8D 02 01     ...   STA &0102
895A  8D 03 01     ...   STA &0103
895D  D0 0D        ..    BNE &896C
895F  A9 04        ..    LDA #&04
8961  8D 00 01     ...   STA &0100
8964  A9 00        ..    LDA #&00
8966  8D 01 01     ...   STA &0101
8969  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
896C  A9 FF        ..    LDA #&FF
896E  8D 06 01     ...   STA &0106
8971  8D 07 01     ...   STA &0107
8974  A9 05        ..    LDA #&05
8976  8D 00 01     ...   STA &0100
8979  A9 00        ..    LDA #&00
897B  8D 01 01     ...   STA &0101
897E  4C 20 8B     L .   JMP &8B20
8981  00           .     BRK
8982  1B           .     ...
8983  45 73        Es    EOR &73
8985  63           c     ...
8986  61 70        ap    ADC (&70,X)
8988  65 00        e.    ADC &00

; -----------------------------------------------------------------------------
; Check if the TUBE is active
; -----------------------------------------------------------------------------
.
898A  A9 EA        ..    LDA #&EA
898C  A2 00        ..    LDX #&00
898E  A0 FF        ..    LDY #&FF
8990  20 F4 FF      ..   JSR osbyte               ; Check if the TUBE is active
8993  E0 00        ..    CPX #&00                 ; X=&00: No TUBE is active, X<>&00: TUBE is active
8995  60           `     RTS

8996  20 D9 8A      ..   JSR &8AD9
8999  AD 06 01     ...   LDA &0106
899C  0D 07 01     ...   ORA &0107
899F  F0 B1        ..    BEQ &8952
89A1  20 8A 89      ..   JSR &898A                ; Check if the TUBE is active
89A4  F0 5D        .]    BEQ &8A03
89A6  AD 08 01     ...   LDA &0108
89A9  C9 FF        ..    CMP #&FF
89AB  D0 07        ..    BNE &89B4
89AD  AD 09 01     ...   LDA &0109
89B0  C9 FF        ..    CMP #&FF
89B2  F0 4F        .O    BEQ &8A03
89B4  20 3C 8B      <.   JSR &8B3C
89B7  A5 77        .w    LDA &77
89B9  48           H     PHA
89BA  A5 78        .x    LDA &78
89BC  48           H     PHA
89BD  A9 83        ..    LDA #&83
89BF  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
89C2  86 77        .w    STX &77                  ; LSB of OSHWM
89C4  84 78        .x    STY &78                  ; MSB of OSHWM
89C6  A2 00        ..    LDX #&00
89C8  8A           .     TXA
89C9  48           H     PHA
89CA  20 6F 8B      o.   JSR &8B6F
89CD  68           h     PLA
89CE  AA           .     TAX
89CF  18           .     CLC
89D0  AD 07 01     ...   LDA &0107
89D3  69 01        i.    ADC #&01
89D5  8D 07 01     ...   STA &0107
89D8  AD 08 01     ...   LDA &0108
89DB  69 00        i.    ADC #&00
89DD  8D 08 01     ...   STA &0108
89E0  AD 09 01     ...   LDA &0109
89E3  69 00        i.    ADC #&00
89E5  8D 09 01     ...   STA &0109
89E8  E6 78        .x    INC &78
89EA  E8           .     INX
89EB  E0 04        ..    CPX #&04
89ED  D0 D9        ..    BNE &89C8
89EF  20 46 8B      F.   JSR &8B46
89F2  68           h     PLA
89F3  85 78        .x    STA &78
89F5  68           h     PLA
89F6  85 77        .w    STA &77
89F8  A9 83        ..    LDA #&83
89FA  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
89FD  8E 06 01     ...   STX &0106                ; LSB of OSHWM
8A00  8C 07 01     ...   STY &0107                ; MSB of OSHWM
8A03  A5 77        .w    LDA &77
8A05  48           H     PHA
8A06  A5 78        .x    LDA &78
8A08  48           H     PHA
8A09  AD 06 01     ...   LDA &0106
8A0C  85 77        .w    STA &77
8A0E  AD 07 01     ...   LDA &0107
8A11  85 78        .x    STA &78
8A13  A9 16        ..    LDA #&16                 ; Set screen mode
8A15  20 EE FF      ..   JSR oswrch
8A18  A9 07        ..    LDA #&07                 ; Mode 7
8A1A  20 EE FF      ..   JSR oswrch
8A1D  A9 1B        ..    LDA #&1B
8A1F  8D 00 01     ...   STA &0100
8A22  20 20 8B       .   JSR &8B20                ; Perform OSWORD &7A with parameterblock at &0100
8A25  AD 01 01     ...   LDA &0101
8A28  C9 28        .(    CMP #&28
8A2A  D0 03        ..    BNE &8A2F
8A2C  4C B7 8A     L..   JMP &8AB7
8A2F  A2 08        ..    LDX #&08
8A31  A9 A0        ..    LDA #&A0
8A33  20 EE FF      ..   JSR oswrch
8A36  CA           .     DEX
8A37  D0 FA        ..    BNE &8A33
8A39  A9 00        ..    LDA #&00
8A3B  8D 09 01     ...   STA &0109
8A3E  8D 08 01     ...   STA &0108
8A41  A0 0A        ..    LDY #&0A
8A43  B1 77        .w    LDA (&77),Y
8A45  09 80        ..    ORA #&80
8A47  C9 8D        ..    CMP #&8D
8A49  D0 03        ..    BNE &8A4E
8A4B  8D 09 01     ...   STA &0109
8A4E  20 EE FF      ..   JSR oswrch
8A51  C8           .     INY
8A52  C0 2A        .*    CPY #&2A
8A54  D0 ED        ..    BNE &8A43
8A56  AD 09 01     ...   LDA &0109
8A59  F0 16        ..    BEQ &8A71
8A5B  A0 02        ..    LDY #&02
8A5D  B1 77        .w    LDA (&77),Y
8A5F  09 80        ..    ORA #&80
8A61  20 EE FF      ..   JSR oswrch
8A64  C8           .     INY
8A65  C0 2A        .*    CPY #&2A
8A67  D0 F4        ..    BNE &8A5D
8A69  A9 00        ..    LDA #&00
8A6B  8D 09 01     ...   STA &0109
8A6E  EE 08 01     ...   INC &0108
8A71  18           .     CLC
8A72  A5 77        .w    LDA &77
8A74  69 2A        i*    ADC #&2A
8A76  85 77        .w    STA &77
8A78  A5 78        .x    LDA &78
8A7A  69 00        i.    ADC #&00
8A7C  85 78        .x    STA &78
8A7E  EE 08 01     ...   INC &0108
8A81  AD 08 01     ...   LDA &0108
8A84  C9 18        ..    CMP #&18
8A86  B0 44        .D    BCS &8ACC
8A88  A0 01        ..    LDY #&01
8A8A  B1 77        .w    LDA (&77),Y
8A8C  CD 08 01     ...   CMP &0108
8A8F  F0 21        .!    BEQ &8AB2
8A91  B0 10        ..    BCS &8AA3
8A93  18           .     CLC
8A94  A5 77        .w    LDA &77
8A96  69 2A        i*    ADC #&2A
8A98  85 77        .w    STA &77
8A9A  A5 78        .x    LDA &78
8A9C  69 00        i.    ADC #&00
8A9E  85 78        .x    STA &78
8AA0  4C 88 8A     L..   JMP &8A88
8AA3  A0 00        ..    LDY #&00
8AA5  A9 A0        ..    LDA #&A0
8AA7  20 EE FF      ..   JSR oswrch
8AAA  C8           .     INY
8AAB  C0 28        .(    CPY #&28
8AAD  D0 F8        ..    BNE &8AA7
8AAF  4C 7E 8A     L~.   JMP &8A7E
8AB2  A0 02        ..    LDY #&02
8AB4  4C 43 8A     LC.   JMP &8A43
8AB7  A2 03        ..    LDX #&03
8AB9  A0 00        ..    LDY #&00
8ABB  B1 77        .w    LDA (&77),Y
8ABD  20 EE FF      ..   JSR oswrch
8AC0  C8           .     INY
8AC1  98           .     TYA
8AC2  DD D5 8A     ...   CMP &8AD5,X
8AC5  D0 F4        ..    BNE &8ABB
8AC7  E6 78        .x    INC &78
8AC9  CA           .     DEX
8ACA  10 ED        ..    BPL &8AB9
8ACC  68           h     PLA
8ACD  85 78        .x    STA &78
8ACF  68           h     PLA
8AD0  85 77        .w    STA &77
8AD2  4C 33 8B     L3.   JMP &8B33                          ; Exit the OSWORD routine with exit code &00 (success)
8AD5  C0 00        ..    CPY #&00
8AD7  00           .     BRK
8AD8  00           .     BRK
8AD9  A9 00        ..    LDA #&00
8ADB  8D 06 01     ...   STA &0106
8ADE  8D 07 01     ...   STA &0107
8AE1  8D 08 01     ...   STA &0108
8AE4  8D 09 01     ...   STA &0109
8AE7  20 29 8B      ).   JSR &8B29                ; Get first character from (&F2),Y which is not &20
8AEA  C8           .     INY
8AEB  C9 0D        ..    CMP #&0D
8AED  F0 30        .0    BEQ &8B1F
8AEF  A2 00        ..    LDX #&00
8AF1  DD C0 B7     ...   CMP &B7C0,X
8AF4  F0 0A        ..    BEQ &8B00
8AF6  E8           .     INX
8AF7  E0 10        ..    CPX #&10
8AF9  D0 F6        ..    BNE &8AF1
8AFB  68           h     PLA
8AFC  68           h     PLA
8AFD  4C DB 81     L..   JMP &81DB                ; Restore A, X, Y and P registers and exit
8B00  8A           .     TXA
8B01  A2 00        ..    LDX #&00
8B03  0E 06 01     ...   ASL &0106
8B06  2E 07 01     ...   ROL &0107
8B09  2E 08 01     ...   ROL &0108
8B0C  2E 09 01     ...   ROL &0109
8B0F  B0 EA        ..    BCS &8AFB
8B11  E8           .     INX
8B12  E0 04        ..    CPX #&04
8B14  D0 ED        ..    BNE &8B03
8B16  0D 06 01     ...   ORA &0106
8B19  8D 06 01     ...   STA &0106
8B1C  4C E7 8A     L..   JMP &8AE7
8B1F  60           `     RTS

; -----------------------------------------------------------------------------
; Perform OSWORD &7A with parameterblock at &0100
; -----------------------------------------------------------------------------
.
8B20  A2 00        ..    LDX #&00
8B22  A0 01        ..    LDY #&01
8B24  A9 7A        .z    LDA #&7A
8B26  4C F1 FF     L..   JMP osword

; -----------------------------------------------------------------------------
; Get first character from (&F2),Y which is not &20
; -----------------------------------------------------------------------------
.
8B29  B1 F2        ..    LDA (&F2),Y
8B2B  C9 20        .     CMP #&20
8B2D  D0 03        ..    BNE &8B32
8B2F  C8           .     INY
8B30  D0 F7        ..    BNE &8B29
.
8B32  60           `     RTS

; -----------------------------------------------------------------------------
; 
; -----------------------------------------------------------------------------
.
8B33  68           h     PLA
8B34  AA           .     TAX
8B35  68           h     PLA
8B36  A8           .     TAY
8B37  68           h     PLA
8B38  28           (     PLP
8B39  A9 00        ..    LDA #&00
8B3B  60           `     RTS

; -----------------------------------------------------------------------------
; Claim the TUBE
; -----------------------------------------------------------------------------
.claimtube
8B3C  48           H     PHA
.claimtube01
8B3D  A9 C5        ..    LDA #&C0+tubeid
8B3F  20 06 04      ..   JSR tubecontrol
8B42  90 F9        ..    BCC claimtube01
8B44  68           h     PLA
8B45  60           `     RTS

; -----------------------------------------------------------------------------
; Release the TUBE
; -----------------------------------------------------------------------------
.reltube
8B46  48           H     PHA
8B47  A9 85        ..    LDA #&80+tubeid
8B49  20 06 04      ..   JSR tubecontrol
8B4C  68           h     PLA
8B4D  60           `     RTS
8B4E  60           `     RTS

8B4F  A2 06        ..    LDX #&06
8B51  A0 01        ..    LDY #&01
8B53  A9 07        ..    LDA #&07
8B55  20 06 04      ..   JSR tubecontrol
8B58  20 4E 8B      N.   JSR &8B4E
8B5B  20 4E 8B      N.   JSR &8B4E
8B5E  20 4E 8B      N.   JSR &8B4E
8B61  A0 00        ..    LDY #&00
8B63  B1 77        .w    LDA (&77),Y
8B65  8D E5 FE     ...   STA tubedat
8B68  EA           .     NOP
8B69  EA           .     NOP
8B6A  EA           .     NOP
8B6B  C8           .     INY
8B6C  D0 F5        ..    BNE &8B63
8B6E  60           `     RTS
8B6F  A2 06        ..    LDX #&06
8B71  A0 01        ..    LDY #&01
8B73  A9 06        ..    LDA #&06
8B75  20 06 04      ..   JSR tubecontrol
8B78  20 4E 8B      N.   JSR &8B4E
8B7B  20 4E 8B      N.   JSR &8B4E
8B7E  20 4E 8B      N.   JSR &8B4E
8B81  A0 00        ..    LDY #&00
8B83  AD E5 FE     ...   LDA tubedat
8B86  91 77        .w    STA (&77),Y
8B88  EA           .     NOP
8B89  EA           .     NOP
8B8A  EA           .     NOP
8B8B  C8           .     INY
8B8C  D0 F5        ..    BNE &8B83
8B8E  60           `     RTS

; -----------------------------------------------------------------------------
; Service call &05 : Unknown interrupt
; -----------------------------------------------------------------------------
.
8B8F  A5 FC        ..    LDA &FC
8B91  48           H     PHA
8B92  8A           .     TXA
8B93  48           H     PHA
8B94  98           .     TYA
8B95  48           H     PHA
8B96  2C 10 FC     ,..   BIT ttxstatus            ; Poll TTX hardware
8B99  10 03        ..    BPL &8B9E                ; Branch if no TTX interrupt
8B9B  4C A1 8B     L..   JMP &8BA1                ; Jump to TTX interrupt routine
.
8B9E  4C A1 8F     L..   JMP &8FA1                ; No TTX interrupt, so exit
.
8BA1  A5 84        ..    LDA &84
8BA3  48           H     PHA
8BA4  A5 85        ..    LDA &85
8BA6  48           H     PHA
8BA7  A9 00        ..    LDA #&00
8BA9  85 84        ..    STA &84                  ; LSB of pointer to workspace
8BAB  A6 F4        ..    LDX &F4
8BAD  BD F0 0D     ...   LDA &0DF0,X
8BB0  85 85        ..    STA &85                  ; MSB of pointer to workspace
8BB2  A5 EF        ..    LDA &EF
8BB4  48           H     PHA
8BB5  A5 F0        ..    LDA &F0
8BB7  48           H     PHA
8BB8  A5 F1        ..    LDA &F1
8BBA  48           H     PHA
8BBB  20 94 91      ..   JSR &9194                ; Check if OS version is < &03
8BBE  90 06        ..    BCC &8BC6                ; Jump if machine is an Electron, BBC or BBC+
8BC0  A5 85        ..    LDA &85
8BC2  09 80        ..    ORA #&80
8BC4  85 85        ..    STA &85
.
8BC6  68           h     PLA
8BC7  85 F1        ..    STA &F1
8BC9  68           h     PLA
8BCA  85 F0        ..    STA &F0
8BCC  68           h     PLA
8BCD  85 EF        ..    STA &EF
8BCF  A0 BD        ..    LDY #&BD
8BD1  B1 84        ..    LDA (&84),Y
8BD3  29 08        ).    AND #&08
8BD5  F0 0C        ..    BEQ &8BE3
8BD7  A0 E9        ..    LDY #&E9
8BD9  B1 84        ..    LDA (&84),Y
8BDB  C9 FF        ..    CMP #&FF
8BDD  F0 0D        ..    BEQ &8BEC
8BDF  C9 FE        ..    CMP #&FE
8BE1  F0 09        ..    BEQ &8BEC
.
8BE3  68           h     PLA
8BE4  85 85        ..    STA &85
8BE6  68           h     PLA
8BE7  85 84        ..    STA &84
8BE9  4C A1 8F     L..   JMP &8FA1
.
8BEC  48           H     PHA
8BED  20 18 90      ..   JSR &9018
8BF0  58           X     CLI
8BF1  A0 BE        ..    LDY #&BE
8BF3  A9 00        ..    LDA #&00
8BF5  91 84        ..    STA (&84),Y
8BF7  A2 00        ..    LDX #&00
8BF9  B5 70        .p    LDA &70,X
8BFB  C8           .     INY
8BFC  91 84        ..    STA (&84),Y
8BFE  E8           .     INX
8BFF  E0 14        ..    CPX #&14
8C01  D0 F6        ..    BNE &8BF9
8C03  68           h     PLA
8C04  85 82        ..    STA &82
8C06  A0 E7        ..    LDY #&E7
8C08  B1 84        ..    LDA (&84),Y
8C0A  85 81        ..    STA &81
.
8C0C  A0 BE        ..    LDY #&BE
8C0E  B1 84        ..    LDA (&84),Y
8C10  A8           .     TAY
8C11  8C 11 FC     ...   STY rowreg
8C14  AD 12 FC     ...   LDA datareg              ; Load framing code (#&27)
8C17  D0 03        ..    BNE &8C1C
8C19  4C 36 8F     L6.   JMP &8F36                ; If zero try next row
.
8C1C  A5 82        ..    LDA &82
8C1E  C9 FE        ..    CMP #&FE
8C20  F0 11        ..    BEQ &8C33
8C22  20 F0 90      ..   JSR &90F0
8C25  A5 70        .p    LDA &70
8C27  10 03        ..    BPL &8C2C
8C29  4C 43 8F     LC.   JMP &8F43
8C2C  A5 71        .q    LDA &71
8C2E  F0 42        .B    BEQ &8C72
8C30  4C DD 8D     L..   JMP &8DDD
.
8C33  A0 EC        ..    LDY #&EC
8C35  18           .     CLC
8C36  B1 84        ..    LDA (&84),Y
8C38  69 02        i.    ADC #&02
8C3A  91 84        ..    STA (&84),Y
8C3C  C8           .     INY
8C3D  B1 84        ..    LDA (&84),Y
8C3F  69 00        i.    ADC #&00
8C41  91 84        ..    STA (&84),Y
8C43  AE 12 FC     ...   LDX datareg
8C46  BD AF 91     ...   LDA hamtable,X
8C49  10 03        ..    BPL &8C4E
8C4B  20 61 8C      a.   JSR &8C61
8C4E  AE 12 FC     ...   LDX datareg
8C51  BD AF 91     ...   LDA hamtable,X
8C54  10 03        ..    BPL &8C59                ; Jump if no loading error
8C56  20 61 8C      a.   JSR &8C61
.
8C59  A0 BE        ..    LDY #&BE
8C5B  B1 84        ..    LDA (&84),Y
8C5D  A8           .     TAY
8C5E  4C 22 8C     L".   JMP &8C22

; -----------------------------------------------------------------------------
; 
; -----------------------------------------------------------------------------
.
8C61  A0 EA        ..    LDY #&EA
8C63  18           .     CLC
8C64  B1 84        ..    LDA (&84),Y
8C66  69 01        i.    ADC #&01
8C68  91 84        ..    STA (&84),Y
8C6A  C8           .     INY
8C6B  B1 84        ..    LDA (&84),Y
8C6D  69 00        i.    ADC #&00
8C6F  91 84        ..    STA (&84),Y
8C71  60           `     RTS

.
8C72  20 26 91      &.   JSR &9126
8C75  A5 73        .s    LDA &73
8C77  10 03        ..    BPL &8C7C
8C79  4C 43 8F     LC.   JMP &8F43
8C7C  A5 72        .r    LDA &72
8C7E  C9 FF        ..    CMP #&FF
8C80  D0 0E        ..    BNE &8C90
8C82  A4 70        .p    LDY &70
8C84  C8           .     INY
8C85  98           .     TYA
8C86  0A           .     ASL A
8C87  A0 F0        ..    LDY #&F0
8C89  11 84        ..    ORA (&84),Y
8C8B  91 84        ..    STA (&84),Y
8C8D  4C 36 8F     L6.   JMP &8F36
8C90  A5 81        ..    LDA &81
8C92  10 36        .6    BPL &8CCA
8C94  A0 B7        ..    LDY #&B7
8C96  B1 84        ..    LDA (&84),Y
8C98  F0 2D        .-    BEQ &8CC7
8C9A  30 05        0.    BMI &8CA1
8C9C  A2 20        .     LDX #&20
8C9E  4C A3 8C     L..   JMP &8CA3
8CA1  A2 18        ..    LDX #&18
8CA3  A5 76        .v    LDA &76
8CA5  29 0C        ).    AND #&0C
8CA7  D0 1E        ..    BNE &8CC7
8CA9  A5 76        .v    LDA &76
8CAB  29 10        ).    AND #&10
8CAD  D0 0A        ..    BNE &8CB9
8CAF  A0 B8        ..    LDY #&B8
8CB1  B1 84        ..    LDA (&84),Y
8CB3  30 04        0.    BMI &8CB9
8CB5  C5 70        .p    CMP &70
8CB7  D0 0E        ..    BNE &8CC7
8CB9  A0 00        ..    LDY #&00
8CBB  AD 12 FC     ...   LDA datareg
8CBE  09 80        ..    ORA #&80
8CC0  99 08 7C     ..|   STA &7C08,Y
8CC3  C8           .     INY
8CC4  CA           .     DEX
8CC5  D0 F4        ..    BNE &8CBB
8CC7  4C F6 8C     L..   JMP &8CF6
8CCA  A5 70        .p    LDA &70
8CCC  A0 EE        ..    LDY #&EE
8CCE  D1 84        ..    CMP (&84),Y
8CD0  D0 34        .4    BNE &8D06
8CD2  A5 72        .r    LDA &72
8CD4  C8           .     INY
8CD5  D1 84        ..    CMP (&84),Y
8CD7  F0 09        ..    BEQ &8CE2
8CD9  A9 FF        ..    LDA #&FF
8CDB  A0 B5        ..    LDY #&B5
8CDD  91 84        ..    STA (&84),Y
8CDF  4C 06 8D     L..   JMP &8D06
8CE2  A9 00        ..    LDA #&00
8CE4  A0 B5        ..    LDY #&B5
8CE6  91 84        ..    STA (&84),Y
8CE8  A5 75        .u    LDA &75
8CEA  29 08        ).    AND #&08
8CEC  F0 18        ..    BEQ &8D06
8CEE  A9 0C        ..    LDA #&0C                 ; Clear text window and move text cursor home
8CF0  20 EE FF      ..   JSR oswrch
8CF3  4C 06 8D     L..   JMP &8D06
8CF6  A0 B5        ..    LDY #&B5
8CF8  B1 84        ..    LDA (&84),Y
8CFA  30 33        03    BMI &8D2F
8CFC  0A           .     ASL A
8CFD  0A           .     ASL A
8CFE  0A           .     ASL A
8CFF  A8           .     TAY
8D00  B1 84        ..    LDA (&84),Y
8D02  C5 70        .p    CMP &70
8D04  F0 03        ..    BEQ &8D09
8D06  4C 36 8F     L6.   JMP &8F36
8D09  C8           .     INY
8D0A  B1 84        ..    LDA (&84),Y
8D0C  C5 72        .r    CMP &72
8D0E  D0 06        ..    BNE &8D16
8D10  A5 75        .u    LDA &75
8D12  29 08        ).    AND #&08
8D14  F0 F0        ..    BEQ &8D06
8D16  A0 B5        ..    LDY #&B5
8D18  B1 84        ..    LDA (&84),Y
8D1A  18           .     CLC
8D1B  69 A0        i.    ADC #&A0
8D1D  A8           .     TAY
8D1E  B1 84        ..    LDA (&84),Y
8D20  29 FB        ).    AND #&FB
8D22  09 02        ..    ORA #&02
8D24  91 84        ..    STA (&84),Y
8D26  A0 B5        ..    LDY #&B5
8D28  A9 FF        ..    LDA #&FF
8D2A  91 84        ..    STA (&84),Y
8D2C  C8           .     INY
8D2D  91 84        ..    STA (&84),Y
8D2F  A5 72        .r    LDA &72
8D31  C9 FF        ..    CMP #&FF
8D33  F0 D1        ..    BEQ &8D06
8D35  A2 A0        ..    LDX #&A0
8D37  8A           .     TXA
8D38  A8           .     TAY
8D39  B1 84        ..    LDA (&84),Y
8D3B  29 01        ).    AND #&01
8D3D  D0 29        .)    BNE &8D68
8D3F  8A           .     TXA
8D40  38           8     SEC
8D41  E9 A0        ..    SBC #&A0
8D43  0A           .     ASL A
8D44  0A           .     ASL A
8D45  0A           .     ASL A
8D46  A8           .     TAY
8D47  B1 84        ..    LDA (&84),Y
8D49  C5 70        .p    CMP &70
8D4B  D0 1B        ..    BNE &8D68
8D4D  C8           .     INY
8D4E  B1 84        ..    LDA (&84),Y
8D50  C5 72        .r    CMP &72
8D52  D0 14        ..    BNE &8D68
8D54  C8           .     INY
8D55  B1 84        ..    LDA (&84),Y
8D57  C9 3F        .?    CMP #&3F
8D59  F0 18        ..    BEQ &8D73
8D5B  C5 73        .s    CMP &73
8D5D  D0 09        ..    BNE &8D68
8D5F  C8           .     INY
8D60  B1 84        ..    LDA (&84),Y
8D62  C5 74        .t    CMP &74
8D64  D0 02        ..    BNE &8D68
8D66  F0 0C        ..    BEQ &8D74
8D68  E8           .     INX
8D69  E0 B4        ..    CPX #&B4
8D6B  F0 03        ..    BEQ &8D70
8D6D  4C 37 8D     L7.   JMP &8D37
8D70  4C 36 8F     L6.   JMP &8F36
8D73  C8           .     INY
8D74  C8           .     INY
8D75  B1 84        ..    LDA (&84),Y
8D77  48           H     PHA
8D78  C8           .     INY
8D79  B1 84        ..    LDA (&84),Y
8D7B  A0 BA        ..    LDY #&BA
8D7D  91 84        ..    STA (&84),Y
8D7F  85 80        ..    STA &80
8D81  88           .     DEY
8D82  68           h     PLA
8D83  91 84        ..    STA (&84),Y
8D85  85 7F        .    STA &7F
8D87  A5 80        ..    LDA &80
8D89  30 DD        0.    BMI &8D68
8D8B  A0 B5        ..    LDY #&B5
8D8D  8A           .     TXA
8D8E  38           8     SEC
8D8F  E9 A0        ..    SBC #&A0
8D91  91 84        ..    STA (&84),Y
8D93  A5 70        .p    LDA &70
8D95  C8           .     INY
8D96  91 84        ..    STA (&84),Y
8D98  8A           .     TXA
8D99  A8           .     TAY
8D9A  B1 84        ..    LDA (&84),Y
8D9C  29 DD        ).    AND #&DD
8D9E  09 04        ..    ORA #&04
8DA0  91 84        ..    STA (&84),Y
8DA2  A0 E8        ..    LDY #&E8
8DA4  A9 00        ..    LDA #&00
8DA6  91 84        ..    STA (&84),Y
8DA8  A0 B4        ..    LDY #&B4
8DAA  B1 84        ..    LDA (&84),Y
8DAC  AA           .     TAX
8DAD  F0 25        .%    BEQ &8DD4
8DAF  A0 F1        ..    LDY #&F1
8DB1  B1 84        ..    LDA (&84),Y
8DB3  C9 28        .(    CMP #&28
8DB5  D0 04        ..    BNE &8DBB
8DB7  A9 A0        ..    LDA #&A0
8DB9  D0 02        ..    BNE &8DBD
8DBB  A9 00        ..    LDA #&00
8DBD  A0 29        .)    LDY #&29
8DBF  91 7F        .    STA (&7F),Y
8DC1  88           .     DEY
8DC2  10 FB        ..    BPL &8DBF
8DC4  18           .     CLC
8DC5  A5 7F        .    LDA &7F
8DC7  69 2A        i*    ADC #&2A
8DC9  85 7F        .    STA &7F
8DCB  A5 80        ..    LDA &80
8DCD  69 00        i.    ADC #&00
8DCF  85 80        ..    STA &80
8DD1  CA           .     DEX
8DD2  D0 DB        ..    BNE &8DAF
8DD4  A0 F2        ..    LDY #&F2
8DD6  A9 FF        ..    LDA #&FF
8DD8  91 84        ..    STA (&84),Y
8DDA  20 E2 90      ..   JSR &90E2
8DDD  A5 81        ..    LDA &81
8DDF  30 11        0.    BMI &8DF2
8DE1  A0 B5        ..    LDY #&B5
8DE3  B1 84        ..    LDA (&84),Y
8DE5  D0 89        ..    BNE &8D70
8DE7  A0 EE        ..    LDY #&EE
8DE9  B1 84        ..    LDA (&84),Y
8DEB  C5 70        .p    CMP &70
8DED  D0 81        ..    BNE &8D70
8DEF  4C D4 8E     L..   JMP &8ED4
8DF2  A0 B5        ..    LDY #&B5
8DF4  B1 84        ..    LDA (&84),Y
8DF6  30 17        0.    BMI &8E0F
8DF8  C8           .     INY
8DF9  B1 84        ..    LDA (&84),Y
8DFB  C5 70        .p    CMP &70
8DFD  D0 10        ..    BNE &8E0F
8DFF  A5 71        .q    LDA &71
8E01  C9 18        ..    CMP #&18
8E03  90 0D        ..    BCC &8E12
8E05  A0 B4        ..    LDY #&B4
8E07  B1 84        ..    LDA (&84),Y
8E09  C9 18        ..    CMP #&18
8E0B  F0 02        ..    BEQ &8E0F
8E0D  D0 03        ..    BNE &8E12
8E0F  4C 36 8F     L6.   JMP &8F36
8E12  A0 E8        ..    LDY #&E8
8E14  B1 84        ..    LDA (&84),Y
8E16  A0 B4        ..    LDY #&B4
8E18  D1 84        ..    CMP (&84),Y
8E1A  B0 F3        ..    BCS &8E0F
8E1C  18           .     CLC
8E1D  69 01        i.    ADC #&01
8E1F  A0 E8        ..    LDY #&E8
8E21  91 84        ..    STA (&84),Y
8E23  A0 B9        ..    LDY #&B9
8E25  B1 84        ..    LDA (&84),Y
8E27  85 7F        .    STA &7F
8E29  C8           .     INY
8E2A  B1 84        ..    LDA (&84),Y
8E2C  85 80        ..    STA &80
8E2E  30 DF        0.    BMI &8E0F
8E30  20 9C 91      ..   JSR &919C
8E33  A0 F1        ..    LDY #&F1
8E35  B1 84        ..    LDA (&84),Y
8E37  85 82        ..    STA &82
8E39  C9 28        .(    CMP #&28
8E3B  D0 16        ..    BNE &8E53
8E3D  20 7E 8F      ~.   JSR &8F7E
8E40  18           .     CLC
8E41  A5 7F        .    LDA &7F
8E43  65 77        ew    ADC &77
8E45  85 77        .w    STA &77
8E47  A5 80        ..    LDA &80
8E49  65 78        ex    ADC &78
8E4B  85 78        .x    STA &78
8E4D  20 ED 8E      ..   JSR &8EED
8E50  4C 36 8F     L6.   JMP &8F36
8E53  A0 00        ..    LDY #&00
8E55  A5 70        .p    LDA &70
8E57  91 7F        .    STA (&7F),Y
8E59  C8           .     INY
8E5A  A5 71        .q    LDA &71
8E5C  91 7F        .    STA (&7F),Y
8E5E  C8           .     INY
8E5F  A5 71        .q    LDA &71
8E61  D0 03        ..    BNE &8E66
8E63  20 A7 8E      ..   JSR &8EA7
8E66  C9 1B        ..    CMP #&1B
8E68  D0 20        .     BNE &8E8A
8E6A  AE 12 FC     ...   LDX datareg
8E6D  BD AF 91     ...   LDA hamtable,X
8E70  29 0F        ).    AND #&0F
8E72  D0 12        ..    BNE &8E86
8E74  98           .     TYA
8E75  48           H     PHA
8E76  A0 B5        ..    LDY #&B5
8E78  B1 84        ..    LDA (&84),Y
8E7A  18           .     CLC
8E7B  69 A0        i.    ADC #&A0
8E7D  A8           .     TAY
8E7E  B1 84        ..    LDA (&84),Y
8E80  09 28        .(    ORA #&28
8E82  91 84        ..    STA (&84),Y
8E84  68           h     PLA
8E85  A8           .     TAY
8E86  8A           .     TXA
8E87  4C 8D 8E     L..   JMP &8E8D
.
8E8A  AD 12 FC     ...   LDA datareg
8E8D  91 7F        .    STA (&7F),Y
8E8F  C8           .     INY
8E90  C4 82        ..    CPY &82
8E92  D0 F6        ..    BNE &8E8A
8E94  A0 B9        ..    LDY #&B9
8E96  18           .     CLC
8E97  A5 7F        .    LDA &7F
8E99  65 82        e.    ADC &82
8E9B  91 84        ..    STA (&84),Y
8E9D  C8           .     INY
8E9E  A5 80        ..    LDA &80
8EA0  69 00        i.    ADC #&00
8EA2  91 84        ..    STA (&84),Y
8EA4  4C 36 8F     L6.   JMP &8F36
8EA7  A2 08        ..    LDX #&08
8EA9  AD 12 FC     ...   LDA datareg
8EAC  CA           .     DEX
8EAD  D0 FA        ..    BNE &8EA9
8EAF  A5 72        .r    LDA &72
8EB1  91 7F        .    STA (&7F),Y
8EB3  C8           .     INY
8EB4  A5 73        .s    LDA &73
8EB6  91 7F        .    STA (&7F),Y
8EB8  C8           .     INY
8EB9  A5 74        .t    LDA &74
8EBB  91 7F        .    STA (&7F),Y
8EBD  C8           .     INY
8EBE  A5 75        .u    LDA &75
8EC0  91 7F        .    STA (&7F),Y
8EC2  C8           .     INY
8EC3  A5 76        .v    LDA &76
8EC5  91 7F        .    STA (&7F),Y
8EC7  C8           .     INY
8EC8  A9 00        ..    LDA #&00
8ECA  91 7F        .    STA (&7F),Y
8ECC  C8           .     INY
8ECD  91 7F        .    STA (&7F),Y
8ECF  C8           .     INY
8ED0  91 7F        .    STA (&7F),Y
8ED2  C8           .     INY
8ED3  60           `     RTS
8ED4  A5 71        .q    LDA &71
8ED6  C9 18        ..    CMP #&18
8ED8  90 03        ..    BCC &8EDD
8EDA  4C 36 8F     L6.   JMP &8F36
8EDD  20 7E 8F      ~.   JSR &8F7E
8EE0  18           .     CLC
8EE1  A5 78        .x    LDA &78
8EE3  69 7C        i|    ADC #&7C
8EE5  85 78        .x    STA &78
8EE7  20 ED 8E      ..   JSR &8EED
8EEA  4C 36 8F     L6.   JMP &8F36
8EED  A5 71        .q    LDA &71
8EEF  A0 F2        ..    LDY #&F2
8EF1  D1 84        ..    CMP (&84),Y
8EF3  F0 40        .@    BEQ &8F35
8EF5  20 9C 91      ..   JSR &919C
8EF8  A9 00        ..    LDA #&00
8EFA  85 7B        .{    STA &7B
8EFC  A0 00        ..    LDY #&00
8EFE  AD 12 FC     ...   LDA datareg
8F01  09 80        ..    ORA #&80
8F03  C9 8D        ..    CMP #&8D
8F05  D0 02        ..    BNE &8F09
8F07  E6 7B        .{    INC &7B
8F09  91 77        .w    STA (&77),Y
8F0B  C8           .     INY
8F0C  C0 28        .(    CPY #&28
8F0E  D0 EE        ..    BNE &8EFE
8F10  A5 7B        .{    LDA &7B
8F12  F0 21        .!    BEQ &8F35
8F14  A0 F2        ..    LDY #&F2
8F16  A5 71        .q    LDA &71
8F18  18           .     CLC
8F19  69 01        i.    ADC #&01
8F1B  91 84        ..    STA (&84),Y
8F1D  18           .     CLC
8F1E  A5 77        .w    LDA &77
8F20  69 28        i(    ADC #&28
8F22  85 79        .y    STA &79
8F24  A5 78        .x    LDA &78
8F26  69 00        i.    ADC #&00
8F28  85 7A        .z    STA &7A
8F2A  A0 00        ..    LDY #&00
8F2C  B1 77        .w    LDA (&77),Y
8F2E  91 79        .y    STA (&79),Y
8F30  C8           .     INY
8F31  C0 28        .(    CPY #&28
8F33  D0 F7        ..    BNE &8F2C
8F35  60           `     RTS
.
8F36  A5 70        .p    LDA &70
8F38  D0 09        ..    BNE &8F43
8F3A  A5 71        .q    LDA &71
8F3C  C9 1E        ..    CMP #&1E
8F3E  D0 03        ..    BNE &8F43
8F40  20 AC 8F      ..   JSR &8FAC
.
8F43  A0 BE        ..    LDY #&BE
8F45  B1 84        ..    LDA (&84),Y
8F47  18           .     CLC
8F48  69 01        i.    ADC #&01
8F4A  91 84        ..    STA (&84),Y
8F4C  C9 10        ..    CMP #&10
8F4E  F0 03        ..    BEQ &8F53
8F50  4C 0C 8C     L..   JMP &8C0C
.
8F53  A9 00        ..    LDA #&00
8F55  8D 13 FC     ...   STA statclr
8F58  8D 11 FC     ...   STA rowreg
8F5B  A2 00        ..    LDX #&00
8F5D  A0 BE        ..    LDY #&BE
8F5F  C8           .     INY
8F60  B1 84        ..    LDA (&84),Y
8F62  95 70        .p    STA &70,X
8F64  E8           .     INX
8F65  E0 14        ..    CPX #&14
8F67  D0 F6        ..    BNE &8F5F
8F69  20 28 90      (.   JSR &9028
8F6C  68           h     PLA
8F6D  85 85        ..    STA &85
8F6F  68           h     PLA
8F70  85 84        ..    STA &84
8F72  68           h     PLA
8F73  A8           .     TAY
8F74  68           h     PLA
8F75  AA           .     TAX
8F76  68           h     PLA
8F77  85 FC        ..    STA &FC
8F79  68           h     PLA
8F7A  28           (     PLP
8F7B  A9 00        ..    LDA #&00
8F7D  60           `     RTS
8F7E  A5 71        .q    LDA &71
8F80  0A           .     ASL A
8F81  0A           .     ASL A
8F82  0A           .     ASL A
8F83  85 77        .w    STA &77
8F85  85 79        .y    STA &79
8F87  A9 00        ..    LDA #&00
8F89  85 7A        .z    STA &7A
8F8B  06 79        .y    ASL &79
8F8D  26 7A        &z    ROL &7A
8F8F  06 79        .y    ASL &79
8F91  26 7A        &z    ROL &7A
8F93  18           .     CLC
8F94  A5 77        .w    LDA &77
8F96  65 79        ey    ADC &79
8F98  85 77        .w    STA &77
8F9A  A9 00        ..    LDA #&00
8F9C  65 7A        ez    ADC &7A
8F9E  85 78        .x    STA &78
8FA0  60           `     RTS
.
8FA1  68           h     PLA
8FA2  A8           .     TAY
8FA3  68           h     PLA
8FA4  AA           .     TAX
8FA5  68           h     PLA
8FA6  85 FC        ..    STA &FC
8FA8  68           h     PLA
8FA9  28           (     PLP
8FAA  60           `     RTS

8FAB  60           `     RTS
8FAC  20 9C 91      ..   JSR &919C
8FAF  AE 12 FC     ...   LDX datareg
8FB2  BD AF 91     ...   LDA hamtable,X
8FB5  29 0F        ).    AND #&0F
8FB7  D0 F2        ..    BNE &8FAB
8FB9  A0 00        ..    LDY #&00
8FBB  AE 12 FC     ...   LDX datareg
8FBE  BD AF 91     ...   LDA hamtable,X
8FC1  30 E8        0.    BMI &8FAB
8FC3  29 0F        ).    AND #&0F
8FC5  99 77 00     .w.   STA &0077,Y
8FC8  C8           .     INY
8FC9  C0 06        ..    CPY #&06
8FCB  D0 EE        ..    BNE &8FBB
8FCD  20 55 91      U.   JSR &9155
8FD0  A5 75        .u    LDA &75
8FD2  4A           J     LSR A
8FD3  4A           J     LSR A
8FD4  4A           J     LSR A
8FD5  45 70        Ep    EOR &70
8FD7  A0 D4        ..    LDY #&D4
8FD9  91 84        ..    STA (&84),Y
8FDB  C8           .     INY
8FDC  A5 72        .r    LDA &72
8FDE  91 84        ..    STA (&84),Y
8FE0  C8           .     INY
8FE1  A5 73        .s    LDA &73
8FE3  91 84        ..    STA (&84),Y
8FE5  C8           .     INY
8FE6  A5 74        .t    LDA &74
8FE8  91 84        ..    STA (&84),Y
8FEA  AD 12 FC     ...   LDA datareg
8FED  C8           .     INY
8FEE  91 84        ..    STA (&84),Y
8FF0  AD 12 FC     ...   LDA datareg
8FF3  C8           .     INY
8FF4  91 84        ..    STA (&84),Y
8FF6  AD 12 FC     ...   LDA datareg
8FF9  C8           .     INY
8FFA  91 84        ..    STA (&84),Y
8FFC  AD 12 FC     ...   LDA datareg
8FFF  29 0F        ).    AND #&0F
9001  38           8     SEC
9002  E9 01        ..    SBC #&01
9004  C8           .     INY
9005  91 84        ..    STA (&84),Y
9007  A2 00        ..    LDX #&00
9009  AD 12 FC     ...   LDA datareg
900C  38           8     SEC
900D  E9 11        ..    SBC #&11
900F  C8           .     INY
9010  91 84        ..    STA (&84),Y
9012  E8           .     INX
9013  E0 05        ..    CPX #&05
9015  D0 F2        ..    BNE &9009
9017  60           `     RTS

.
9018  98           .     TYA
9019  48           H     PHA
901A  A0 BD        ..    LDY #&BD
901C  B1 84        ..    LDA (&84),Y
901E  29 F3        ).    AND #%11110011
9020  8D 10 FC     ...   STA ttxcontrol
9023  91 84        ..    STA (&84),Y
9025  68           h     PLA
9026  A8           .     TAY
9027  60           `     RTS

.
9028  98           .     TYA
9029  48           H     PHA
902A  A0 BD        ..    LDY #&BD
902C  B1 84        ..    LDA (&84),Y
902E  09 0C        ..    ORA #%00001100
9030  91 84        ..    STA (&84),Y
9032  8D 10 FC     ...   STA ttxcontrol
9035  68           h     PLA
9036  A8           .     TAY
9037  60           `     RTS

; -----------------------------------------------------------------------------
; Read adapter status
; -----------------------------------------------------------------------------
.
9038  98           .     TYA
9039  48           H     PHA
903A  A5 77        .w    LDA &77
903C  48           H     PHA
903D  A5 78        .x    LDA &78
903F  48           H     PHA
9040  A5 EF        ..    LDA &EF
9042  48           H     PHA
9043  A5 F0        ..    LDA &F0
9045  48           H     PHA
9046  A5 F1        ..    LDA &F1
9048  48           H     PHA
9049  A9 00        ..    LDA #&00
904B  85 77        .w    STA &77                  ; LSB of pointer to workspace
904D  A6 F4        ..    LDX &F4
904F  BD F0 0D     ...   LDA &0DF0,X
9052  85 78        .x    STA &78                  ; MSB of pointer to workspace
9054  20 94 91      ..   JSR &9194                ; Check if OS version is < &03
9057  90 06        ..    BCC &905F
9059  A5 78        .x    LDA &78
905B  09 80        ..    ORA #&80
905D  85 78        .x    STA &78
.
905F  A0 BD        ..    LDY #&BD
9061  B1 77        .w    LDA (&77),Y
9063  29 F3        ).    AND #%11110011
9065  8D 10 FC     ...   STA ttxcontrol
9068  A9 00        ..    LDA #&00
906A  8D 13 FC     ...   STA statclr
906D  A9 13        ..    LDA #&13
906F  20 F4 FF      ..   JSR osbyte               ; Wait for Vertical Retrace
9072  20 F4 FF      ..   JSR osbyte               ; Wait for Vertical Retrace
9075  20 F4 FF      ..   JSR osbyte               ; Wait for Vertical Retrace
9078  AD 10 FC     ...   LDA ttxstatus
907B  29 10        ).    AND #%00010000
907D  85 77        .w    STA &77
907F  A2 02        ..    LDX #&02
.
9081  A9 00        ..    LDA #&00
9083  8D 13 FC     ...   STA statclr
9086  AD 10 FC     ...   LDA ttxstatus
9089  29 10        ).    AND #%00010000
908B  F0 03        ..    BEQ &9090
908D  CA           .     DEX
908E  D0 F1        ..    BNE &9081
.
9090  85 78        .x    STA &78
9092  05 77        .w    ORA &77
9094  D0 0F        ..    BNE &90A5
9096  AD 10 FC     ...   LDA ttxstatus
9099  29 0F        ).    AND #%00001111
909B  F0 04        ..    BEQ &90A1
909D  A9 01        ..    LDA #&01                 ; Adapter is on, no TV signal
909F  D0 0E        ..    BNE &90AF
.
90A1  A9 02        ..    LDA #&02                 ; Adapter is off, but connected
90A3  D0 0A        ..    BNE &90AF
.
90A5  A5 78        .x    LDA &78
90A7  F0 04        ..    BEQ &90AD
90A9  A9 FF        ..    LDA #&FF                 ; No adapter connected
90AB  30 02        0.    BMI &90AF
.
90AD  A9 00        ..    LDA #&00                 ; Adapter is on and connected
.
90AF  48           H     PHA
90B0  A9 00        ..    LDA #&00
90B2  85 77        .w    STA &77                  ; LSB of pointer to workspace
90B4  A6 F4        ..    LDX &F4
90B6  BD F0 0D     ...   LDA &0DF0,X
90B9  85 78        .x    STA &78                  ; MSB of pointer to workspace
90BB  20 94 91      ..   JSR &9194                ; Check if OS version is < &03
90BE  90 06        ..    BCC &90C6
90C0  A5 78        .x    LDA &78
90C2  09 80        ..    ORA #&80
90C4  85 78        .x    STA &78
.
90C6  A0 BD        ..    LDY #&BD
90C8  B1 77        .w    LDA (&77),Y
90CA  8D 10 FC     ...   STA ttxcontrol
90CD  68           h     PLA
90CE  AA           .     TAX
90CF  68           h     PLA
90D0  85 F1        ..    STA &F1
90D2  68           h     PLA
90D3  85 F0        ..    STA &F0
90D5  68           h     PLA
90D6  85 EF        ..    STA &EF
90D8  68           h     PLA
90D9  85 78        .x    STA &78
90DB  68           h     PLA
90DC  85 77        .w    STA &77
90DE  68           h     PLA
90DF  A8           .     TAY
90E0  8A           .     TXA
90E1  60           `     RTS

; -----------------------------------------------------------------------------
; 
; -----------------------------------------------------------------------------
.
90E2  A0 0F        ..    LDY #&0F
90E4  A9 00        ..    LDA #&00
.
90E6  8C 11 FC     ...   STY rowreg
90E9  8D 12 FC     ...   STA datareg
90EC  88           .     DEY
90ED  10 F7        ..    BPL &90E6
90EF  60           `     RTS

; -----------------------------------------------------------------------------
; 
; -----------------------------------------------------------------------------
.
90F0  8C 11 FC     ...   STY rowreg
90F3  A9 00        ..    LDA #&00
90F5  8D 12 FC     ...   STA datareg
90F8  AE 12 FC     ...   LDX datareg
90FB  BD AF 91     ...   LDA hamtable,X
90FE  30 1F        0.    BMI &911F
9100  29 07        ).    AND #&07
9102  85 70        .p    STA &70
9104  BD AF 91     ...   LDA hamtable,X
9107  29 08        ).    AND #&08
9109  4A           J     LSR A
910A  4A           J     LSR A
910B  4A           J     LSR A
910C  85 71        .q    STA &71
910E  AE 12 FC     ...   LDX datareg
9111  BD AF 91     ...   LDA hamtable,X
9114  30 09        0.    BMI &911F
9116  29 0F        ).    AND #&0F
9118  0A           .     ASL A
9119  18           .     CLC
911A  65 71        eq    ADC &71
911C  85 71        .q    STA &71
911E  60           `     RTS
911F  A9 FF        ..    LDA #&FF
9121  85 70        .p    STA &70
9123  85 71        .q    STA &71
9125  60           `     RTS
9126  A0 00        ..    LDY #&00
9128  AE 12 FC     ...   LDX datareg
912B  BD AF 91     ...   LDA hamtable,X
912E  30 1C        0.    BMI &914C
9130  29 0F        ).    AND #&0F
9132  99 77 00     .w.   STA &0077,Y
9135  C8           .     INY
9136  C0 08        ..    CPY #&08
9138  D0 EE        ..    BNE &9128
913A  20 55 91      U.   JSR &9155
913D  A5 7D        .}    LDA &7D
913F  85 76        .v    STA &76
9141  A5 7E        .~    LDA &7E
9143  0A           .     ASL A
9144  0A           .     ASL A
9145  0A           .     ASL A
9146  0A           .     ASL A
9147  05 76        .v    ORA &76
9149  85 76        .v    STA &76
914B  60           `     RTS
914C  A9 FF        ..    LDA #&FF
914E  85 72        .r    STA &72
9150  85 73        .s    STA &73
9152  85 74        .t    STA &74
9154  60           `     RTS
9155  A5 77        .w    LDA &77
9157  85 72        .r    STA &72
9159  A5 78        .x    LDA &78
915B  0A           .     ASL A
915C  0A           .     ASL A
915D  0A           .     ASL A
915E  0A           .     ASL A
915F  05 72        .r    ORA &72
9161  85 72        .r    STA &72
9163  A5 79        .y    LDA &79
9165  85 74        .t    STA &74
9167  A5 7A        .z    LDA &7A
9169  29 07        ).    AND #&07
916B  0A           .     ASL A
916C  0A           .     ASL A
916D  0A           .     ASL A
916E  0A           .     ASL A
916F  05 74        .t    ORA &74
9171  85 74        .t    STA &74
9173  A5 7B        .{    LDA &7B
9175  85 73        .s    STA &73
9177  A5 7C        .|    LDA &7C
9179  29 03        ).    AND #&03
917B  0A           .     ASL A
917C  0A           .     ASL A
917D  0A           .     ASL A
917E  0A           .     ASL A
917F  05 73        .s    ORA &73
9181  85 73        .s    STA &73
9183  A5 7A        .z    LDA &7A
9185  29 08        ).    AND #&08
9187  85 75        .u    STA &75
9189  A5 7C        .|    LDA &7C
918B  29 0C        ).    AND #&0C
918D  0A           .     ASL A
918E  0A           .     ASL A
918F  05 75        .u    ORA &75
9191  85 75        .u    STA &75
9193  60           `     RTS

; -----------------------------------------------------------------------------
; Check if OS version is < &03
; -----------------------------------------------------------------------------
.
9194  A9 00        ..    LDA #&00
9196  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
9199  E0 03        ..    CPX #&03
919B  60           `     RTS

919C  48           H     PHA
919D  A0 BE        ..    LDY #&BE
919F  B1 84        ..    LDA (&84),Y
91A1  8D 11 FC     ...   STA rowreg
91A4  AD 12 FC     ...   LDA datareg
91A7  AD 12 FC     ...   LDA datareg
91AA  AD 12 FC     ...   LDA datareg
91AD  68           h     PLA
91AE  60           `     RTS

; -----------------------------------------------------------------------------
; De-hamming table
; -----------------------------------------------------------------------------
.hamtable
91AF  41 FF 01 41  A..A  EQUD &41FF0141
91B3  FF 40 41 FF  .@A.  EQUD &FF4041FF
91B7  FF           .     ...
91B8  42           B     ...
91B9  41 FF        A.    EOR (&FF,X)
91BB  4A           J     LSR A
91BC  FF           .     ...
91BD  FF           .     ...
91BE  47           G     ...
91BF  FF           .     ...
91C0  40           @     RTI
91C1  41 FF        A.    EOR (&FF,X)
91C3  40           @     RTI
91C4  00           .     BRK
91C5  FF           .     ...
91C6  40           @     RTI
91C7  46 FF        F.    LSR &FF
91C9  FF           .     ...
91CA  4B           K     ...
91CB  FF           .     ...
91CC  40           @     RTI
91CD  43           C     ...
91CE  FF           .     ...
91CF  FF           .     ...
91D0  4C 41 FF     LA.   JMP &FF41
91D3  44           D     ...
91D4  FF           .     ...
91D5  FF           .     ...
91D6  47           G     ...
91D7  46 FF        F.    LSR &FF
91D9  FF           .     ...
91DA  47           G     ...
91DB  FF           .     ...
91DC  47           G     ...
91DD  47           G     ...
91DE  07           .     ...
91DF  46 FF        F.    LSR &FF
91E1  FF           .     ...
91E2  45 FF        E.    EOR &FF
91E4  40           @     RTI
91E5  4D FF 06     M..   EOR &06FF
91E8  46 46        FF    LSR &46
91EA  FF           .     ...
91EB  46 FF        F.    LSR &FF
91ED  FF           .     ...
91EE  47           G     ...
91EF  FF           .     ...
91F0  42           B     ...
91F1  41 FF        A.    EOR (&FF,X)
91F3  44           D     ...
91F4  FF           .     ...
91F5  FF           .     ...
91F6  49 42        IB    EOR #&42
91F8  02           .     ...
91F9  FF           .     ...
91FA  42           B     ...
91FB  FF           .     ...
91FC  42           B     ...
91FD  43           C     ...
91FE  FF           .     ...
91FF  48           H     PHA
9200  FF           .     ...
9201  FF           .     ...
9202  45 FF        E.    EOR &FF
9204  40           @     RTI
9205  43           C     ...
9206  FF           .     ...
9207  FF           .     ...
9208  42           B     ...
9209  43           C     ...
920A  FF           .     ...
920B  43           C     ...
920C  FF           .     ...
920D  03           .     ...
920E  43           C     ...
920F  44           D     ...
9210  FF           .     ...
9211  FF           .     ...
9212  45 04        E.    EOR &04
9214  44           D     ...
9215  44           D     ...
9216  FF           .     ...
9217  FF           .     ...
9218  42           B     ...
9219  4F           O     ...
921A  FF           .     ...
921B  44           D     ...
921C  FF           .     ...
921D  FF           .     ...
921E  47           G     ...
921F  FF           .     ...
9220  45 45        EE    EOR &45
9222  05 44        .D    ORA &44
9224  FF           .     ...
9225  FF           .     ...
9226  45 46        EF    EOR &46
9228  FF           .     ...
9229  FF           .     ...
922A  45 FF        E.    EOR &FF
922C  4E 43 FF     NC.   LSR &FF43
922F  FF           .     ...
9230  4C 41 FF     LA.   JMP &FF41
9233  4A           J     LSR A
9234  FF           .     ...
9235  FF           .     ...
9236  49 4A        IJ    EOR #&4A
9238  FF           .     ...
9239  FF           .     ...
923A  4B           K     ...
923B  0A           .     ASL A
923C  4A           J     LSR A
923D  4A           J     LSR A
923E  FF           .     ...
923F  48           H     PHA
9240  FF           .     ...
9241  FF           .     ...
9242  4B           K     ...
9243  FF           .     ...
9244  40           @     RTI
9245  4D FF FF     M..   EOR &FFFF
9248  4B           K     ...
9249  4B           K     ...
924A  0B           .     ...
924B  4A           J     LSR A
924C  FF           .     ...
924D  FF           .     ...
924E  4B           K     ...
924F  4C 0C FF     L..   JMP &FF0C
9252  4C FF 4C     L.L   JMP &4CFF
9255  4D FF FF     M..   EOR &FFFF
9258  4C 4F FF     LO.   JMP &FF4F
925B  4A           J     LSR A
925C  FF           .     ...
925D  FF           .     ...
925E  47           G     ...
925F  FF           .     ...
9260  4C 4D FF     LM.   JMP &FF4D
9263  4D FF 0D     M..   EOR &0DFF
9266  4D 46 FF     MF.   EOR &FF46
9269  FF           .     ...
926A  4B           K     ...
926B  FF           .     ...
926C  4E 4D FF     NM.   LSR &FF4D
926F  48           H     PHA
9270  FF           .     ...
9271  FF           .     ...
9272  49 FF        I.    EOR #&FF
9274  49 49        II    EOR #&49
9276  09 FF        ..    ORA #&FF
9278  42           B     ...
9279  4F           O     ...
927A  FF           .     ...
927B  4A           J     LSR A
927C  FF           .     ...
927D  FF           .     ...
927E  49 08        I.    EOR #&08
9280  48           H     PHA
9281  48           H     PHA
9282  FF           .     ...
9283  48           H     PHA
9284  FF           .     ...
9285  FF           .     ...
9286  49 48        IH    EOR #&48
9288  FF           .     ...
9289  FF           .     ...
928A  4B           K     ...
928B  FF           .     ...
928C  4E 43 FF     NC.   LSR &FF43
928F  FF           .     ...
9290  4C 4F FF     LO.   JMP &FF4F
9293  44           D     ...
9294  FF           .     ...
9295  FF           .     ...
9296  49 4F        IO    EOR #&4F
9298  FF           .     ...
9299  0F           .     ...
929A  4F           O     ...
929B  FF           .     ...
929C  4E 4F FF     NO.   LSR &FF4F
929F  48           H     PHA
92A0  FF           .     ...
92A1  FF           .     ...
92A2  45 FF        E.    EOR &FF
92A4  4E 4D FF     NM.   LSR &FF4D
92A7  FF           .     ...
92A8  4E 4F FF     NO.   LSR &FF4F
92AB  4E 0E FF     N..   LSR &FF0E
92AE  4E A0 E9     N..   LSR &E9A0

; -----------------------------------------------------------------------------
; OSWORD &7A Command &14 : Enter tuning routine
; -----------------------------------------------------------------------------
.
92AF  A0 E9        ..    LDY #&E9
92B1  B1 A8        ..    LDA (&A8),Y
92B3  48           H     PHA
92B4  A9 FF        ..    LDA #&FF
92B6  91 A8        ..    STA (&A8),Y
92B8  A0 BD        ..    LDY #&BD
92BA  B1 A8        ..    LDA (&A8),Y
92BC  48           H     PHA
92BD  29 EF        ).    AND #%11101111                     ; AFC = off
92BF  09 0C        ..    ORA #%00001100
92C1  91 A8        ..    STA (&A8),Y
92C3  8D 10 FC     ...   STA ttxcontrol
92C6  A9 72        .r    LDA #&72
92C8  A2 01        ..    LDX #&01                           ; Only use shadow memory if mode number is > 127
92CA  A0 00        ..    LDY #&00
92CC  20 F4 FF      ..   JSR osbyte                         ; Write to Shadow/Main toggle
92CF  A9 16        ..    LDA #&16                           ; Set screen mode
92D1  20 EE FF      ..   JSR oswrch
92D4  A9 07        ..    LDA #&07                           ; Mode 7
92D6  20 EE FF      ..   JSR oswrch
92D9  20 2A A8      *.   JSR &A82A                          ; VDU 23, 0, 0, 0, 0, 0, 0, 0, 0, 0
92DC  20 BC 9D      ..   JSR &9DBC                          ; Display user friendly channel number (BBC1 / BBC2 / ITV / Ch4/S4C) in top left corner
92DF  A0 00        ..    LDY #&00

.
92E1  B9 22 94     .".   LDA &9422,Y
92E4  C9 FF        ..    CMP #&FF
92E6  F0 0B        ..    BEQ &92F3
92E8  20 EE FF      ..   JSR oswrch

.
92EB  C8           .     INY
92EC  C9 00        ..    CMP #&00
92EE  D0 F1        ..    BNE &92E1
92F0  4C FF 92     L..   JMP &92FF

.
92F3  A2 0D        ..    LDX #&0D
92F5  A9 A3        ..    LDA #&A3                           ; Tuning bar character
92F7  20 EE FF      ..   JSR oswrch
92FA  CA           .     DEX
92FB  10 FA        ..    BPL &92F7
92FD  30 EC        0.    BMI &92EB                          ; Display end character of tuning bar

.
92FF  A0 00        ..    LDY #&00                           ; Display 'Press SPACE to continue'
9301  B9 5E A0     .^.   LDA &A05E,Y
9304  99 C0 7F     ..   STA &7FC0,Y
9307  C8           .     INY
9308  C0 28        .(    CPY #&28
930A  D0 F5        ..    BNE &9301
930C  A0 B7        ..    LDY #&B7
930E  B1 A8        ..    LDA (&A8),Y
9310  48           H     PHA
9311  A9 01        ..    LDA #&01
9313  91 A8        ..    STA (&A8),Y
9315  C8           .     INY
9316  B1 A8        ..    LDA (&A8),Y
9318  48           H     PHA
9319  A9 FF        ..    LDA #&FF
931B  91 A8        ..    STA (&A8),Y

.
931D  78           x     SEI
931E  A0 E9        ..    LDY #&E9
9320  A9 FE        ..    LDA #&FE
9322  91 A8        ..    STA (&A8),Y
9324  C8           .     INY
9325  A9 00        ..    LDA #&00
9327  91 A8        ..    STA (&A8),Y
9329  C8           .     INY
932A  91 A8        ..    STA (&A8),Y
932C  C8           .     INY
932D  91 A8        ..    STA (&A8),Y
932F  C8           .     INY
9330  91 A8        ..    STA (&A8),Y
9332  58           X     CLI
9333  A9 0D        ..    LDA #&0D
9335  8D 13 FC     ...   STA statclr
9338  85 AA        ..    STA &AA

.
933A  A9 13        ..    LDA #&13
933C  20 F4 FF      ..   JSR osbyte               ; Wait for Vertical Retrace
933F  C6 AA        ..    DEC &AA
9341  A5 AA        ..    LDA &AA
9343  D0 F5        ..    BNE &933A
9345  78           x     SEI
9346  A0 EA        ..    LDY #&EA
9348  B1 A8        ..    LDA (&A8),Y
934A  99 C0 FF     ...   STA &FFC0,Y
934D  C8           .     INY
934E  C0 EE        ..    CPY #&EE
9350  D0 F6        ..    BNE &9348
9352  58           X     CLI
9353  A9 1F        ..    LDA #&1F                           ; Move text cursor to &0D, &11
9355  20 EE FF      ..   JSR oswrch
9358  A9 0D        ..    LDA #&0D
935A  20 EE FF      ..   JSR oswrch
935D  A9 11        ..    LDA #&11
935F  20 EE FF      ..   JSR oswrch
9362  A5 AC        ..    LDA &AC
9364  05 AD        ..    ORA &AD
9366  F0 12        ..    BEQ &937A
9368  A9 82        ..    LDA #&82
936A  20 EE FF      ..   JSR oswrch
936D  A9 20        .     LDA #&20
936F  20 EE FF      ..   JSR oswrch
9372  20 EE FF      ..   JSR oswrch
9375  A2 03        ..    LDX #&03
9377  4C 81 93     L..   JMP &9381
.
937A  A9 81        ..    LDA #&81
937C  20 EE FF      ..   JSR oswrch
937F  A2 00        ..    LDX #&00                           ; Display 'No teletext'
9381  BD 3F 94     .?.   LDA &943F,X
9384  20 EE FF      ..   JSR oswrch
9387  E8           .     INX
9388  C9 00        ..    CMP #&00
938A  D0 F5        ..    BNE &9381
938C  A5 AC        ..    LDA &AC
938E  05 AD        ..    ORA &AD
9390  F0 15        ..    BEQ &93A7
9392  A2 00        ..    LDX #&00
9394  38           8     SEC
9395  A5 AC        ..    LDA &AC
9397  E5 AA        ..    SBC &AA
9399  85 AC        ..    STA &AC
939B  A5 AD        ..    LDA &AD
939D  E5 AB        ..    SBC &AB
939F  85 AD        ..    STA &AD
93A1  30 04        0.    BMI &93A7
93A3  E8           .     INX
93A4  D0 EE        ..    BNE &9394
93A6  CA           .     DEX

.
93A7  8A           .     TXA
93A8  4A           J     LSR A
93A9  4A           J     LSR A
93AA  85 AA        ..    STA &AA
93AC  4A           J     LSR A
93AD  85 AB        ..    STA &AB
93AF  A9 1F        ..    LDA #&1F                           ; Move text cursor to &03, &0C
93B1  20 EE FF      ..   JSR oswrch
93B4  A9 03        ..    LDA #&03
93B6  20 EE FF      ..   JSR oswrch
93B9  A9 0C        ..    LDA #&0C
93BB  20 EE FF      ..   JSR oswrch
93BE  A9 96        ..    LDA #gcyan                         ; Use graphics cyan for the reception indicator
93C0  20 EE FF      ..   JSR oswrch
93C3  A6 AB        ..    LDX &AB
93C5  F0 08        ..    BEQ &93CF
93C7  A9 FF        ..    LDA #&FF
93C9  20 EE FF      ..   JSR oswrch                         ; Fill the reception indicator
93CC  CA           .     DEX
93CD  D0 FA        ..    BNE &93C9
.
93CF  A5 AA        ..    LDA &AA
93D1  29 01        ).    AND #&01
93D3  F0 05        ..    BEQ &93DA
93D5  A9 B5        ..    LDA #&B5
93D7  20 EE FF      ..   JSR oswrch
93DA  20 10 94      ..   JSR &9410
93DD  A9 80        ..    LDA #&80
93DF  A2 FF        ..    LDX #&FF
93E1  A0 FF        ..    LDY #&FF
93E3  20 F4 FF      ..   JSR osbyte                         ; Read keyboard buffer level
93E6  E0 00        ..    CPX #&00
93E8  D0 03        ..    BNE &93ED
93EA  4C 1D 93     L..   JMP &931D
93ED  20 E0 FF      ..   JSR osrdch
93F0  C9 20        .     CMP #&20
93F2  F0 03        ..    BEQ &93F7                          ; Exit if SPACE has been pressed
93F4  4C 1D 93     L..   JMP &931D

.
93F7  68           h     PLA
93F8  A0 B8        ..    LDY #&B8
93FA  91 A8        ..    STA (&A8),Y
93FC  88           .     DEY
93FD  68           h     PLA
93FE  91 A8        ..    STA (&A8),Y
9400  68           h     PLA
9401  A0 BD        ..    LDY #&BD
9403  91 A8        ..    STA (&A8),Y
9405  8D 10 FC     ...   STA ttxcontrol
9408  68           h     PLA
9409  A0 E9        ..    LDY #&E9
940B  91 A8        ..    STA (&A8),Y
940D  4C E1 82     L..   JMP &82E1                          ; Restore registers and exit OSWORD call

.
9410  A9 86        ..    LDA #&86
9412  20 F4 FF      ..   JSR osbyte                         ; Read text cursor position
9415  E0 26        .&    CPX #&26
9417  F0 08        ..    BEQ &9421
9419  A9 20        .     LDA #&20
941B  20 EE FF      ..   JSR oswrch
941E  4C 10 94     L..   JMP &9410
9421  60           `     RTS

.
9422  1F           .     ...                                ; Put text cursor at &03, &0D
9423  03           .     ...
9424  0D           ,     EQU &0D
9425  97           .     EQU gwhite
9426  B7           .     EQU &B7                            ; Begin character of tuning bar
9427  FF           .     ...                                ; Terminator byte

.
9428  EB           .     ...                                ; End character of tuning bar
9429  FF           .     ...                                ; Terminator byte

.
942A  A3           .     ...
942B  B5 1F        ..    LDA &1F,X
942D  03           .     ...
942E  0E 30 25     .0%   ASL &2530
9431  1F           .     ...
9432  12           .     ...
9433  0E 35 30     .50   ASL &3035
9436  25 1F        %.    AND &1F
9438  21 0E        !.    AND (&0E,X)
943A  31 30        10    AND (&30),Y
943C  30 25        0%    BMI &9463
943E  00           .     BRK
943F  4E 6F 20     No    LSR &206F
9442  54           T     ...
9443  65 6C        el    ADC &6C
9445  65 74        et    ADC &74
9447  65 78        ex    ADC &78
9449  74           t     ...
944A  20 20 00       .   JSR &0020

; -----------------------------------------------------------------------------
; OSWORD &7A Command &15 : Return time from TSDP
; -----------------------------------------------------------------------------
.
944D  20 53 94      S.   JSR &9453
9450  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; 
; -----------------------------------------------------------------------------
.
9453  A0 0A        ..    LDY #&0A
9455  A9 00        ..    LDA #&00
9457  91 F0        ..    STA (&F0),Y
9459  A0 D4        ..    LDY #&D4
945B  B1 A8        ..    LDA (&A8),Y
945D  10 03        ..    BPL &9462
945F  4C 3F 95     L?.   JMP &953F
9462  08           .     PHP
9463  78           x     SEI
9464  F8           .     SED
9465  A0 DE        ..    LDY #&DE
9467  B1 A8        ..    LDA (&A8),Y
9469  85 AA        ..    STA &AA
946B  C8           .     INY
946C  B1 A8        ..    LDA (&A8),Y
946E  85 AB        ..    STA &AB
9470  C8           .     INY
9471  B1 A8        ..    LDA (&A8),Y
9473  85 AC        ..    STA &AC
9475  A9 00        ..    LDA #&00
9477  85 AD        ..    STA &AD
9479  85 AE        ..    STA &AE
947B  A0 DA        ..    LDY #&DA
947D  B1 A8        ..    LDA (&A8),Y
947F  0A           .     ASL A
9480  0A           .     ASL A
9481  90 02        ..    BCC &9485
9483  E6 AD        ..    INC &AD
9485  4A           J     LSR A
9486  4A           J     LSR A
9487  4A           J     LSR A
9488  4A           J     LSR A
9489  90 02        ..    BCC &948D
948B  E6 AE        ..    INC &AE
948D  85 AF        ..    STA &AF
948F  F0 0B        ..    BEQ &949C
9491  C9 0A        ..    CMP #&0A
9493  90 07        ..    BCC &949C
9495  38           8     SEC
9496  D8           .     CLD
9497  E9 0A        ..    SBC #&0A
9499  09 10        ..    ORA #&10
949B  F8           .     SED
949C  85 AF        ..    STA &AF
949E  A5 AE        ..    LDA &AE
94A0  F0 37        .7    BEQ &94D9
94A2  A5 AD        ..    LDA &AD
94A4  D0 1C        ..    BNE &94C2
94A6  18           .     CLC
94A7  A5 AB        ..    LDA &AB
94A9  69 30        i0    ADC #&30
94AB  85 AB        ..    STA &AB
94AD  C9 60        .`    CMP #&60
94AF  90 0E        ..    BCC &94BF
94B1  38           8     SEC
94B2  E9 60        .`    SBC #&60
94B4  85 AB        ..    STA &AB
94B6  18           .     CLC
94B7  D8           .     CLD
94B8  A5 AF        ..    LDA &AF
94BA  69 01        i.    ADC #&01
94BC  85 AF        ..    STA &AF
94BE  F8           .     SED
94BF  4C D9 94     L..   JMP &94D9
94C2  38           8     SEC
94C3  A5 AB        ..    LDA &AB
94C5  E9 30        .0    SBC #&30
94C7  85 AB        ..    STA &AB
94C9  B0 0E        ..    BCS &94D9
94CB  18           .     CLC
94CC  69 60        i`    ADC #&60
94CE  85 AB        ..    STA &AB
94D0  18           .     CLC
94D1  D8           .     CLD
94D2  A5 AF        ..    LDA &AF
94D4  69 01        i.    ADC #&01
94D6  85 AF        ..    STA &AF
94D8  F8           .     SED
94D9  A5 AD        ..    LDA &AD
94DB  D0 18        ..    BNE &94F5
94DD  18           .     CLC
94DE  A5 AA        ..    LDA &AA
94E0  65 AF        e.    ADC &AF
94E2  85 AA        ..    STA &AA
94E4  C9 24        .$    CMP #&24
94E6  90 0A        ..    BCC &94F2
94E8  E9 24        .$    SBC #&24
94EA  85 AA        ..    STA &AA
94EC  A0 0A        ..    LDY #&0A
94EE  A9 01        ..    LDA #&01
94F0  91 F0        ..    STA (&F0),Y
94F2  4C 0A 95     L..   JMP &950A
94F5  38           8     SEC
94F6  A5 AA        ..    LDA &AA
94F8  E5 AF        ..    SBC &AF
94FA  85 AA        ..    STA &AA
94FC  B0 F4        ..    BCS &94F2
94FE  69 24        i$    ADC #&24
9500  85 AA        ..    STA &AA
9502  A0 0A        ..    LDY #&0A
9504  A9 02        ..    LDA #&02
9506  91 F0        ..    STA (&F0),Y
9508  D0 E8        ..    BNE &94F2
950A  A0 01        ..    LDY #&01
950C  A5 AA        ..    LDA &AA
950E  20 27 95      '.   JSR &9527
9511  A9 3A        .:    LDA #&3A
9513  91 F0        ..    STA (&F0),Y
9515  C8           .     INY
9516  A5 AB        ..    LDA &AB
9518  20 27 95      '.   JSR &9527
951B  A9 3A        .:    LDA #&3A
951D  91 F0        ..    STA (&F0),Y
951F  C8           .     INY
9520  A5 AC        ..    LDA &AC
9522  20 27 95      '.   JSR &9527
9525  28           (     PLP
9526  60           `     RTS
9527  D8           .     CLD
9528  48           H     PHA
9529  29 F0        ).    AND #&F0
952B  4A           J     LSR A
952C  4A           J     LSR A
952D  4A           J     LSR A
952E  4A           J     LSR A
952F  18           .     CLC
9530  69 30        i0    ADC #&30
9532  91 F0        ..    STA (&F0),Y
9534  C8           .     INY
9535  68           h     PLA
9536  29 0F        ).    AND #&0F
9538  18           .     CLC
9539  69 30        i0    ADC #&30
953B  91 F0        ..    STA (&F0),Y
953D  C8           .     INY
953E  60           `     RTS
953F  A0 0A        ..    LDY #&0A
9541  A9 FF        ..    LDA #&FF
9543  91 F0        ..    STA (&F0),Y
9545  60           `     RTS

; -----------------------------------------------------------------------------
; OSWORD &7A Command &16 : Return date from TSDP
; -----------------------------------------------------------------------------
.
9546  20 53 94      S.   JSR &9453
9549  78           x     SEI
954A  F8           .     SED
954B  A0 0A        ..    LDY #&0A
954D  B1 F0        ..    LDA (&F0),Y
954F  10 0A        ..    BPL &955B
9551  A0 0C        ..    LDY #&0C
9553  A9 FF        ..    LDA #&FF
9555  91 F0        ..    STA (&F0),Y
9557  D8           .     CLD
9558  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call
.
955B  48           H     PHA
955C  A9 69        .i    LDA #&69
955E  85 AC        ..    STA &AC
9560  68           h     PLA
9561  F0 0B        ..    BEQ &956E
9563  C9 01        ..    CMP #&01
9565  F0 05        ..    BEQ &956C
9567  E6 AC        ..    INC &AC
9569  4C 6E 95     Ln.   JMP &956E
956C  C6 AC        ..    DEC &AC
956E  A0 DD        ..    LDY #&DD
9570  B1 A8        ..    LDA (&A8),Y
9572  38           8     SEC
9573  E5 AC        ..    SBC &AC
9575  85 AC        ..    STA &AC
9577  88           .     DEY
9578  B1 A8        ..    LDA (&A8),Y
957A  E9 49        .I    SBC #&49
957C  85 AB        ..    STA &AB
957E  88           .     DEY
957F  B1 A8        ..    LDA (&A8),Y
9581  E9 04        ..    SBC #&04
9583  85 AA        ..    STA &AA
9585  A5 B0        ..    LDA &B0
9587  48           H     PHA
9588  A9 BE        ..    LDA #&BE
958A  85 AD        ..    STA &AD
958C  A9 07        ..    LDA #&07
958E  85 AE        ..    STA &AE
9590  A9 19        ..    LDA #&19
9592  85 AF        ..    STA &AF
9594  A9 82        ..    LDA #&82
9596  85 B0        ..    STA &B0
9598  A5 AA        ..    LDA &AA
959A  D0 32        .2    BNE &95CE
959C  A5 AB        ..    LDA &AB
959E  C9 03        ..    CMP #&03
95A0  F0 12        ..    BEQ &95B4
95A2  C9 02        ..    CMP #&02
95A4  F0 0B        ..    BEQ &95B1
95A6  C9 01        ..    CMP #&01
95A8  F0 07        ..    BEQ &95B1
95AA  C9 00        ..    CMP #&00
95AC  F0 03        ..    BEQ &95B1
95AE  4C CE 95     L..   JMP &95CE
95B1  4C 0F 96     L..   JMP &960F
95B4  20 AB 96      ..   JSR &96AB
95B7  F0 0C        ..    BEQ &95C5
95B9  38           8     SEC
95BA  A5 AC        ..    LDA &AC
95BC  E9 66        .f    SBC #&66
95BE  90 F1        ..    BCC &95B1
95C0  F0 EF        ..    BEQ &95B1
95C2  4C CE 95     L..   JMP &95CE
95C5  38           8     SEC
95C6  A5 AC        ..    LDA &AC
95C8  E9 65        .e    SBC #&65
95CA  90 E5        ..    BCC &95B1
95CC  F0 E3        ..    BEQ &95B1
95CE  20 AB 96      ..   JSR &96AB
95D1  F0 0A        ..    BEQ &95DD
95D3  38           8     SEC
95D4  A5 AC        ..    LDA &AC
95D6  E9 66        .f    SBC #&66
95D8  85 AC        ..    STA &AC
95DA  4C E4 95     L..   JMP &95E4
95DD  38           8     SEC
95DE  A5 AC        ..    LDA &AC
95E0  E9 65        .e    SBC #&65
95E2  85 AC        ..    STA &AC
95E4  A5 AB        ..    LDA &AB
95E6  E9 03        ..    SBC #&03
95E8  85 AB        ..    STA &AB
95EA  A5 AA        ..    LDA &AA
95EC  E9 00        ..    SBC #&00
95EE  85 AA        ..    STA &AA
95F0  18           .     CLC
95F1  A5 B0        ..    LDA &B0
95F3  69 01        i.    ADC #&01
95F5  85 B0        ..    STA &B0
95F7  A5 AF        ..    LDA &AF
95F9  69 00        i.    ADC #&00
95FB  85 AF        ..    STA &AF
95FD  D8           .     CLD
95FE  18           .     CLC
95FF  A5 AD        ..    LDA &AD
9601  69 01        i.    ADC #&01
9603  85 AD        ..    STA &AD
9605  A5 AE        ..    LDA &AE
9607  69 00        i.    ADC #&00
9609  85 AE        ..    STA &AE
960B  F8           .     SED
960C  4C 98 95     L..   JMP &9598
960F  A2 00        ..    LDX #&00
9611  A9 01        ..    LDA #&01
9613  85 AD        ..    STA &AD
9615  A5 AD        ..    LDA &AD
9617  C9 02        ..    CMP #&02
9619  D0 20        .     BNE &963B
961B  20 AB 96      ..   JSR &96AB
961E  F0 07        ..    BEQ &9627
9620  A9 29        .)    LDA #&29
9622  85 AE        ..    STA &AE
9624  4C 2B 96     L+.   JMP &962B
9627  A9 28        .(    LDA #&28
9629  85 AE        ..    STA &AE
962B  A5 AB        ..    LDA &AB
962D  D0 22        ."    BNE &9651
962F  A5 AC        ..    LDA &AC
9631  38           8     SEC
9632  E5 AE        ..    SBC &AE
9634  90 3C        .<    BCC &9672
9636  F0 3A        .:    BEQ &9672
9638  4C 51 96     LQ.   JMP &9651
963B  BD 9F 96     ...   LDA &969F,X
963E  85 AE        ..    STA &AE
9640  A5 AB        ..    LDA &AB
9642  D0 0D        ..    BNE &9651
9644  A5 AC        ..    LDA &AC
9646  38           8     SEC
9647  FD 9F 96     ...   SBC &969F,X
964A  90 26        .&    BCC &9672
964C  F0 24        .$    BEQ &9672
964E  4C 51 96     LQ.   JMP &9651
9651  E0 0B        ..    CPX #&0B
9653  D0 05        ..    BNE &965A
9655  A9 07        ..    LDA #&07
9657  20 EE FF      ..   JSR oswrch
965A  A5 AC        ..    LDA &AC
965C  38           8     SEC
965D  E5 AE        ..    SBC &AE
965F  85 AC        ..    STA &AC
9661  A5 AB        ..    LDA &AB
9663  E9 00        ..    SBC #&00
9665  85 AB        ..    STA &AB
9667  E8           .     INX
9668  18           .     CLC
9669  A5 AD        ..    LDA &AD
966B  69 01        i.    ADC #&01
966D  85 AD        ..    STA &AD
966F  4C 15 96     L..   JMP &9615
9672  A0 01        ..    LDY #&01
9674  A5 AC        ..    LDA &AC
9676  20 27 95      '.   JSR &9527
9679  A9 2F        ./    LDA #&2F
967B  91 F0        ..    STA (&F0),Y
967D  C8           .     INY
967E  A5 AD        ..    LDA &AD
9680  20 27 95      '.   JSR &9527
9683  A9 2F        ./    LDA #&2F
9685  91 F0        ..    STA (&F0),Y
9687  C8           .     INY
9688  A5 AF        ..    LDA &AF
968A  20 27 95      '.   JSR &9527
968D  A5 B0        ..    LDA &B0
968F  20 27 95      '.   JSR &9527
9692  A0 0C        ..    LDY #&0C
9694  A9 00        ..    LDA #&00
9696  91 F0        ..    STA (&F0),Y
9698  D8           .     CLD
9699  68           h     PLA
969A  85 B0        ..    STA &B0
969C  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call
969F  31 28        1(    AND (&28),Y
96A1  31 30        10    AND (&30),Y
96A3  31 30        10    AND (&30),Y
96A5  31 31        11    AND (&31),Y
96A7  30 31        01    BMI &96DA
96A9  30 31        01    BMI &96DC
96AB  A5 AB        ..    LDA &AB
96AD  48           H     PHA
96AE  A5 AD        ..    LDA &AD
96B0  29 03        ).    AND #&03
96B2  D0 25        .%    BNE &96D9
96B4  A5 B0        ..    LDA &B0
96B6  D0 1B        ..    BNE &96D3
96B8  D8           .     CLD
96B9  A5 AF        ..    LDA &AF
96BB  29 F0        ).    AND #&F0
96BD  4A           J     LSR A
96BE  85 AB        ..    STA &AB
96C0  4A           J     LSR A
96C1  4A           J     LSR A
96C2  18           .     CLC
96C3  65 AB        e.    ADC &AB
96C5  85 AB        ..    STA &AB
96C7  A5 AF        ..    LDA &AF
96C9  29 0F        ).    AND #&0F
96CB  18           .     CLC
96CC  65 AB        e.    ADC &AB
96CE  F8           .     SED
96CF  29 03        ).    AND #&03
96D1  D0 06        ..    BNE &96D9
96D3  68           h     PLA
96D4  85 AB        ..    STA &AB
96D6  A9 01        ..    LDA #&01
96D8  60           `     RTS
96D9  68           h     PLA
96DA  85 AB        ..    STA &AB
96DC  A9 00        ..    LDA #&00
96DE  60           `     RTS

; -----------------------------------------------------------------------------
; OSWORD &7A Command &17 : Check CRC
; -----------------------------------------------------------------------------
.
96DF  A5 82        ..    LDA &82
96E1  48           H     PHA
96E2  A5 83        ..    LDA &83
96E4  48           H     PHA
96E5  A5 84        ..    LDA &84
96E7  48           H     PHA
96E8  A5 85        ..    LDA &85
96EA  48           H     PHA
96EB  A0 01        ..    LDY #&01
96ED  B1 F0        ..    LDA (&F0),Y
96EF  85 82        ..    STA &82
96F1  C8           .     INY
96F2  B1 F0        ..    LDA (&F0),Y
96F4  85 83        ..    STA &83
96F6  20 90 A4      ..   JSR &A490
96F9  B0 4B        .K    BCS &9746
96FB  A9 00        ..    LDA #&00
96FD  8D 4D 7A     .Mz   STA &7A4D
9700  8D 4E 7A     .Nz   STA &7A4E
9703  A2 00        ..    LDX #&00
9705  20 45 A2      E.   JSR &A245
9708  A0 08        ..    LDY #&08
970A  B1 84        ..    LDA (&84),Y
970C  20 5B 97      [.   JSR &975B
970F  C8           .     INY
9710  C0 20        .     CPY #&20
9712  D0 F6        ..    BNE &970A
9714  A2 00        ..    LDX #&00
9716  E8           .     INX
9717  8A           .     TXA
9718  48           H     PHA
9719  20 45 A2      E.   JSR &A245
971C  A0 00        ..    LDY #&00
971E  B1 84        ..    LDA (&84),Y
9720  20 5B 97      [.   JSR &975B
9723  C8           .     INY
9724  C0 28        .(    CPY #&28
9726  D0 F6        ..    BNE &971E
9728  68           h     PLA
9729  AA           .     TAX
972A  E0 19        ..    CPX #&19
972C  D0 E8        ..    BNE &9716
972E  AD 4D 7A     .Mz   LDA &7A4D
9731  CD 4C 7A     .Lz   CMP &7A4C
9734  D0 0C        ..    BNE &9742
9736  AD 4E 7A     .Nz   LDA &7A4E
9739  CD 4B 7A     .Kz   CMP &7A4B
973C  D0 04        ..    BNE &9742
973E  A9 01        ..    LDA #&01
9740  D0 06        ..    BNE &9748
9742  A9 FF        ..    LDA #&FF
9744  D0 02        ..    BNE &9748
9746  A9 00        ..    LDA #&00
9748  A0 03        ..    LDY #&03
974A  91 F0        ..    STA (&F0),Y
974C  68           h     PLA
974D  85 85        ..    STA &85
974F  68           h     PLA
9750  85 84        ..    STA &84
9752  68           h     PLA
9753  85 83        ..    STA &83
9755  68           h     PLA
9756  85 82        ..    STA &82
9758  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call
975B  48           H     PHA
975C  AD 4D 7A     .Mz   LDA &7A4D
975F  8D 51 7A     .Qz   STA &7A51
9762  AD 4E 7A     .Nz   LDA &7A4E
9765  8D 52 7A     .Rz   STA &7A52
9768  A2 04        ..    LDX #&04
976A  0E 4D 7A     .Mz   ASL &7A4D
976D  2E 4E 7A     .Nz   ROL &7A4E
9770  CA           .     DEX
9771  D0 F7        ..    BNE &976A
9773  AD 4E 7A     .Nz   LDA &7A4E
9776  8D 4F 7A     .Oz   STA &7A4F
9779  A2 03        ..    LDX #&03
977B  0E 4D 7A     .Mz   ASL &7A4D
977E  2E 4E 7A     .Nz   ROL &7A4E
9781  CA           .     DEX
9782  D0 F7        ..    BNE &977B
9784  AD 4E 7A     .Nz   LDA &7A4E
9787  8D 50 7A     .Pz   STA &7A50
978A  A2 02        ..    LDX #&02
978C  0E 4D 7A     .Mz   ASL &7A4D
978F  2E 4E 7A     .Nz   ROL &7A4E
9792  CA           .     DEX
9793  D0 F7        ..    BNE &978C
9795  68           h     PLA
9796  4D 52 7A     MRz   EOR &7A52
9799  4D 4F 7A     MOz   EOR &7A4F
979C  4D 50 7A     MPz   EOR &7A50
979F  4D 4E 7A     MNz   EOR &7A4E
97A2  8D 52 7A     .Rz   STA &7A52
97A5  2A           *     ROL A
97A6  A9 00        ..    LDA #&00
97A8  2A           *     ROL A
97A9  4D 52 7A     MRz   EOR &7A52
97AC  8D 4D 7A     .Mz   STA &7A4D
97AF  AD 51 7A     .Qz   LDA &7A51
97B2  8D 4E 7A     .Nz   STA &7A4E
97B5  60           `     RTS

; -----------------------------------------------------------------------------
; OSWORD &7A Command &18 : Download a file from teletext
; -----------------------------------------------------------------------------
.
97B6  A0 01        ..    LDY #&01
97B8  B1 F0        ..    LDA (&F0),Y
97BA  85 A8        ..    STA &A8
97BC  C8           .     INY
97BD  B1 F0        ..    LDA (&F0),Y
97BF  85 A9        ..    STA &A9
97C1  A0 00        ..    LDY #&00
97C3  B1 A8        ..    LDA (&A8),Y
97C5  99 DA 70     ..p   STA &70DA,Y
97C8  C8           .     INY
97C9  C9 0D        ..    CMP #&0D
97CB  D0 F6        ..    BNE &97C3
97CD  A0 03        ..    LDY #&03
97CF  B1 F0        ..    LDA (&F0),Y
97D1  99 B1 70     ..p   STA &70B1,Y
97D4  C8           .     INY
97D5  C0 0B        ..    CPY #&0B
97D7  D0 F6        ..    BNE &97CF
97D9  B1 F0        ..    LDA (&F0),Y
97DB  8D 9D 70     ..p   STA &709D
97DE  C8           .     INY
97DF  B1 F0        ..    LDA (&F0),Y
97E1  8D 9E 70     ..p   STA &709E
97E4  C8           .     INY
97E5  B1 F0        ..    LDA (&F0),Y
97E7  8D 9B 70     ..p   STA &709B
97EA  C8           .     INY
97EB  B1 F0        ..    LDA (&F0),Y
97ED  8D B2 70     ..p   STA &70B2
97F0  58           X     CLI
97F1  20 AD AD      ..   JSR &ADAD
97F4  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A Command &19 : De-Ham a byte
; -----------------------------------------------------------------------------
.
97F7  A0 01        ..    LDY #&01
97F9  B1 F0        ..    LDA (&F0),Y
97FB  AA           .     TAX
97FC  BD AF 91     ...   LDA hamtable,X
97FF  A0 02        ..    LDY #&02
9801  91 F0        ..    STA (&F0),Y
9803  4C E1 82     L..   JMP &82E1                                    ; Restore registers and exit OSWORD call

; -----------------------------------------------------------------------------
; OSWORD &7A parameter block
; -----------------------------------------------------------------------------
.
9806  05           .     EQU &05                                      ; Command &05 : Set a page grabber record
9807  00           .     EQU &00                                      ; Record number = &00
9808  01           .     EQU &01                                      ; Magazine number of page to be looked for = &01
9809  00           .     EQU &00                                      ; Page number of page (in BCD) = &00
980A  3F           ?     EQU &3F                                      ; Sub-page number (hi-byte) = &3F (any sub-page)
980B  7F                EQU &7F                                      ; Sub-page number (lo-byte) = &7F (any sub-page)
980C  00 4A        .J    EQU &4A00                                    ; Address to put page data

980E  FF           .     EQU &FF                                      ; 
980F  FF           .     EQU &FF                                      ; 

; -----------------------------------------------------------------------------
; Language entry
; -----------------------------------------------------------------------------
.language
9810  C9 01        ..    CMP #&01
9812  F0 01        ..    BEQ &9815
9814  60           `     RTS
.
9815  58           X     CLI
9816  D8           .     CLD
9817  A2 FF        ..    LDX #&FF
9819  9A           .     TXS
.
981A  20 E7 85      ..   JSR &85E7                          ; Switch on teletext interrupts (OSWORD &7A command &0D)
981D  AD 02 02     ...   LDA brkv                           ; Preserve brkv on the stack
9820  48           H     PHA
9821  AD 03 02     ...   LDA brkv+1
9824  48           H     PHA
9825  BA           .     TSX
9826  8E 57 7A     .Wz   STX &7A57                          ; Preserve stack to &7A57
9829  A2 00        ..    LDX #&00                           ; Preserve stack to &7A58-7B57
982B  BD 00 01     ...   LDA &0100,X
982E  9D 58 7A     .Xz   STA &7A58,X
9831  E8           .     INX
9832  D0 F7        ..    BNE &982B
9834  A9 01        ..    LDA #&01
9836  8D 00 7A     ..z   STA &7A00
9839  A9 00        ..    LDA #&00
983B  8D 01 7A     ..z   STA &7A01
983E  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9841  A2 FF        ..    LDX #&FF
9843  9A           .     TXS
9844  20 BE A0      ..   JSR &A0BE
9847  A9 83        ..    LDA #&83
9849  20 F4 FF      ..   JSR osbyte                         ; Read OSHWM (PAGE)
984C  8E 58 7B     .X{   STX &7B58                          ; LSB of OSHWM
984F  8E 5A 7B     .Z{   STX &7B5A                          ; LSB of OSHWM
9852  8C 59 7B     .Y{   STY &7B59                          ; MSB of OSHWM
9855  8C 5B 7B     .[{   STY &7B5B                          ; MSB of OSHWM
9858  A9 08        ..    LDA #&08
985A  8D 5C 7B     .\{   STA &7B5C
985D  18           .     CLC
985E  AD 5B 7B     .[{   LDA &7B5B
9861  69 05        i.    ADC #&05
9863  8D 5B 7B     .[{   STA &7B5B
9866  C9 4A        .J    CMP #&4A
9868  B0 06        ..    BCS &9870
986A  EE 5C 7B     .\{   INC &7B5C
986D  4C 5D 98     L].   JMP &985D
9870  38           8     SEC
9871  AD 5B 7B     .[{   LDA &7B5B
9874  E9 05        ..    SBC #&05
9876  8D 5B 7B     .[{   STA &7B5B
9879  A9 09        ..    LDA #&09                           ; Set the header line status
987B  8D 00 7A     ..z   STA &7A00
987E  A9 01        ..    LDA #&01                           ; Header on with clock
9880  8D 01 7A     ..z   STA &7A01
9883  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9886  A9 0B        ..    LDA #&0B                           ; Set the magazine for header display
9888  8D 00 7A     ..z   STA &7A00
988B  A9 01        ..    LDA #&01                           ; Magazine 1
988D  8D 01 7A     ..z   STA &7A01
9890  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9893  A9 07        ..    LDA #&07                           ; Set the number of rows to be captured
9895  8D 00 7A     ..z   STA &7A00
9898  A9 1E        ..    LDA #&1E                           ; Number of rows is 30 (&1E)
989A  8D 01 7A     ..z   STA &7A01
989D  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
98A0  20 BC 9D      ..   JSR &9DBC                          ; Display user friendly channel number (BBC1 / BBC2 / ITV / Ch4/S4C) in top left corner
98A3  A9 82        ..    LDA #&82
98A5  20 5E 9F      ^.   JSR &9F5E                          ; Write character at position 7,0
98A8  A9 00        ..    LDA #&00
98AA  8D 2B 7A     .+z   STA &7A2B
98AD  8D 54 7A     .Tz   STA &7A54
98B0  A9 FF        ..    LDA #&FF
98B2  8D 00 4A     ..J   STA &4A00
98B5  8D 55 7A     .Uz   STA &7A55
98B8  A9 87        ..    LDA #&87
98BA  8D 5E 7B     .^{   STA &7B5E
98BD  A9 04        ..    LDA #&04
98BF  8D 2A 7A     .*z   STA &7A2A
98C2  A9 03        ..    LDA #&03
98C4  8D 25 7A     .%z   STA &7A25
98C7  A9 31        .1    LDA #&31
98C9  8D 26 7A     .&z   STA &7A26
98CC  A9 30        .0    LDA #&30
98CE  8D 27 7A     .'z   STA &7A27
98D1  8D 28 7A     .(z   STA &7A28
98D4  A9 0E        ..    LDA #&0E                           ; Clear all page grabber records
98D6  8D 00 7A     ..z   STA &7A00
98D9  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
98DC  A0 09        ..    LDY #&09
98DE  B9 06 98     ...   LDA &9806,Y
98E1  99 00 7A     ..z   STA &7A00,Y
98E4  88           .     DEY
98E5  10 F7        ..    BPL &98DE
98E7  20 38 A3      8.   JSR &A338                          ; Set a page grabber record
98EA  A9 03        ..    LDA #&03
98EC  8D 00 7A     ..z   STA &7A00                          ; Set a record flag
98EF  A9 00        ..    LDA #&00
98F1  8D 01 7A     ..z   STA &7A01                          ; Record number = &00
98F4  8D 02 7A     ..z   STA &7A02                          ; New value for record number = &00
98F7  20 38 A3      8.   JSR &A338                          ; Set a record flag
98FA  A9 0D        ..    LDA #&0D
98FC  8D 00 7A     ..z   STA &7A00
98FF  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9902  A9 0B        ..    LDA #&0B                           ; Set auto repeat delay
9904  A2 00        ..    LDX #&00                           ; Disable auto repeat delay
9906  20 B9 A0      ..   JSR &A0B9                          ; Call OSBYTE with Y=&00
9909  A9 02        ..    LDA #&02                           ; Read a record flag
990B  8D 00 7A     ..z   STA &7A00
990E  A9 00        ..    LDA #&00                           ; Record number = &00
9910  8D 01 7A     ..z   STA &7A01
9913  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9916  AD 02 7A     ..z   LDA &7A02
9919  29 02        ).    AND #%00000010                     ; Mask out the 'page received' flag
991B  F0 3D        .=    BEQ &995A
991D  A9 83        ..    LDA #&83
991F  8D 5E 7B     .^{   STA &7B5E
9922  A9 87        ..    LDA #&87
9924  20 5E 9F      ^.   JSR &9F5E                          ; Write character at position 7,0
9927  A9 17        ..    LDA #&17                           ; Check CRC
9929  8D 12 7A     ..z   STA &7A12
992C  A9 00        ..    LDA #&00                           ; LSB of pointer to page &4A00
992E  8D 13 7A     ..z   STA &7A13
9931  A9 4A        .J    LDA #&4A                           ; MSB of pointer to page &4A00
9933  8D 14 7A     ..z   STA &7A14
9936  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9939  AD 15 7A     ..z   LDA &7A15
993C  30 04        0.    BMI &9942                          ; Jump if &FF (CRC failed)
993E  D0 09        ..    BNE &9949                          ; Jump if &01 (CRC OK)
9940  F0 0C        ..    BEQ &994E                          ; Jump if &00 (No CRC)

9942  A9 81        ..    LDA #&81
9944  8D 5E 7B     .^{   STA &7B5E
9947  D0 05        ..    BNE &994E

.
9949  A9 87        ..    LDA #&87
994B  8D 5E 7B     .^{   STA &7B5E

.
994E  20 8B 9C      ..   JSR &9C8B
9951  20 9C AA      ..   JSR &AA9C
9954  20 50 A1      P.   JSR &A150
9957  20 C1 A6      ..   JSR &A6C1
995A  AD 00 4A     ..J   LDA &4A00
995D  30 03        0.    BMI &9962
995F  4C E5 99     L..   JMP &99E5
9962  A9 0F        ..    LDA #&0F
9964  8D 12 7A     ..z   STA &7A12
9967  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
996A  AD 14 7A     ..z   LDA &7A14
996D  C9 FF        ..    CMP #&FF
996F  F0 74        .t    BEQ &99E5
9971  AD 13 7A     ..z   LDA &7A13
9974  30 6F        0o    BMI &99E5
9976  A9 0B        ..    LDA #&0B
9978  8D 12 7A     ..z   STA &7A12
997B  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
997E  A9 04        ..    LDA #&04
9980  8D 00 7A     ..z   STA &7A00
9983  A9 00        ..    LDA #&00
9985  8D 01 7A     ..z   STA &7A01
9988  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
998B  AD 13 7A     ..z   LDA &7A13
998E  8D 02 7A     ..z   STA &7A02
9991  18           .     CLC
9992  69 30        i0    ADC #&30
9994  C9 30        .0    CMP #&30
9996  D0 02        ..    BNE &999A
9998  A9 38        .8    LDA #&38
999A  8D 26 7A     .&z   STA &7A26
999D  AD 14 7A     ..z   LDA &7A14
99A0  8D 03 7A     ..z   STA &7A03
99A3  29 F0        ).    AND #&F0
99A5  4A           J     LSR A
99A6  4A           J     LSR A
99A7  4A           J     LSR A
99A8  4A           J     LSR A
99A9  18           .     CLC
99AA  69 30        i0    ADC #&30
99AC  8D 27 7A     .'z   STA &7A27
99AF  AD 14 7A     ..z   LDA &7A14
99B2  29 0F        ).    AND #&0F
99B4  18           .     CLC
99B5  69 30        i0    ADC #&30
99B7  8D 28 7A     .(z   STA &7A28
99BA  A9 3F        .?    LDA #&3F
99BC  8D 04 7A     ..z   STA &7A04
99BF  A9 7F        .    LDA #&7F
99C1  8D 05 7A     ..z   STA &7A05
99C4  A9 05        ..    LDA #&05
99C6  8D 00 7A     ..z   STA &7A00
99C9  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
99CC  AD 02 7A     ..z   LDA &7A02
99CF  8D 01 7A     ..z   STA &7A01
99D2  8D 00 4A     ..J   STA &4A00
99D5  A9 0B        ..    LDA #&0B
99D7  8D 00 7A     ..z   STA &7A00
99DA  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
99DD  20 3C 9D      <.   JSR &9D3C
99E0  A9 03        ..    LDA #&03
99E2  8D 25 7A     .%z   STA &7A25
99E5  A9 80        ..    LDA #&80
99E7  A2 FF        ..    LDX #&FF
99E9  A0 FF        ..    LDY #&FF
99EB  20 F4 FF      ..   JSR osbyte               ; Read keyboard buffer level
99EE  E0 00        ..    CPX #&00
99F0  D0 03        ..    BNE &99F5
99F2  4C 02 99     L..   JMP &9902
99F5  20 E0 FF      ..   JSR osrdch
99F8  48           H     PHA
99F9  A9 0F        ..    LDA #&0F
99FB  A2 01        ..    LDX #&01
99FD  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
9A00  68           h     PLA
9A01  C9 A0        ..    CMP #&A0
9A03  90 17        ..    BCC &9A1C
9A05  C9 BA        ..    CMP #&BA
9A07  B0 13        ..    BCS &9A1C
9A09  38           8     SEC
9A0A  E9 A0        ..    SBC #&A0
9A0C  0A           .     ASL A
9A0D  A8           .     TAY
9A0E  B9 08 9D     ...   LDA &9D08,Y
9A11  85 A8        ..    STA &A8
9A13  C8           .     INY
9A14  B9 08 9D     ...   LDA &9D08,Y
9A17  85 A9        ..    STA &A9
9A19  6C A8 00     l..   JMP (&00A8)
9A1C  C9 30        .0    CMP #&30
9A1E  90 04        ..    BCC &9A24
9A20  C9 3A        .:    CMP #&3A
9A22  90 03        ..    BCC &9A27
9A24  4C BC 9B     L..   JMP &9BBC
9A27  48           H     PHA
9A28  AD 00 4A     ..J   LDA &4A00
9A2B  29 7F        )    AND #&7F
9A2D  8D 00 4A     ..J   STA &4A00
9A30  A9 87        ..    LDA #&87
9A32  8D 5E 7B     .^{   STA &7B5E
9A35  AD 25 7A     .%z   LDA &7A25
9A38  18           .     CLC
9A39  69 01        i.    ADC #&01
9A3B  CD 2A 7A     .*z   CMP &7A2A
9A3E  D0 02        ..    BNE &9A42
9A40  A9 01        ..    LDA #&01
9A42  8D 25 7A     .%z   STA &7A25
9A45  A8           .     TAY
9A46  68           h     PLA
9A47  99 25 7A     .%z   STA &7A25,Y
9A4A  20 8B 9C      ..   JSR &9C8B
9A4D  AE 25 7A     .%z   LDX &7A25
9A50  E8           .     INX
9A51  EC 2A 7A     .*z   CPX &7A2A
9A54  F0 03        ..    BEQ &9A59
9A56  4C B9 9B     L..   JMP &9BB9
9A59  A9 82        ..    LDA #&82
9A5B  20 5E 9F      ^.   JSR &9F5E                          ; Write character at position 7,0
9A5E  AD 2A 7A     .*z   LDA &7A2A
9A61  C9 04        ..    CMP #&04
9A63  F0 03        ..    BEQ &9A68
9A65  4C 49 9C     LI.   JMP &9C49
9A68  A9 0B        ..    LDA #&0B
9A6A  8D 00 7A     ..z   STA &7A00
9A6D  AD 26 7A     .&z   LDA &7A26
9A70  38           8     SEC
9A71  E9 30        .0    SBC #&30
9A73  29 07        ).    AND #&07
9A75  8D 01 7A     ..z   STA &7A01
9A78  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9A7B  A9 09        ..    LDA #&09
9A7D  8D 00 7A     ..z   STA &7A00
9A80  A9 01        ..    LDA #&01
9A82  8D 01 7A     ..z   STA &7A01
9A85  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9A88  A9 0C        ..    LDA #&0C
9A8A  8D 00 7A     ..z   STA &7A00
9A8D  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9A90  A9 10        ..    LDA #&10
9A92  8D 00 7A     ..z   STA &7A00
9A95  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9A98  A9 00        ..    LDA #&00
9A9A  8D 01 7A     ..z   STA &7A01
9A9D  AD 26 7A     .&z   LDA &7A26
9AA0  38           8     SEC
9AA1  E9 30        .0    SBC #&30
9AA3  29 07        ).    AND #&07
9AA5  8D 02 7A     ..z   STA &7A02
9AA8  8D 14 7A     ..z   STA &7A14
9AAB  AD 27 7A     .'z   LDA &7A27
9AAE  38           8     SEC
9AAF  E9 30        .0    SBC #&30
9AB1  0A           .     ASL A
9AB2  0A           .     ASL A
9AB3  0A           .     ASL A
9AB4  0A           .     ASL A
9AB5  8D 03 7A     ..z   STA &7A03
9AB8  AD 28 7A     .(z   LDA &7A28
9ABB  38           8     SEC
9ABC  E9 30        .0    SBC #&30
9ABE  0D 03 7A     ..z   ORA &7A03
9AC1  8D 03 7A     ..z   STA &7A03
9AC4  18           .     CLC
9AC5  69 01        i.    ADC #&01
9AC7  8D 15 7A     ..z   STA &7A15
9ACA  A9 3F        .?    LDA #&3F
9ACC  8D 04 7A     ..z   STA &7A04
9ACF  8D 16 7A     ..z   STA &7A16
9AD2  A9 7F        .    LDA #&7F
9AD4  8D 05 7A     ..z   STA &7A05
9AD7  8D 17 7A     ..z   STA &7A17
9ADA  A9 05        ..    LDA #&05
9ADC  8D 12 7A     ..z   STA &7A12
9ADF  A9 07        ..    LDA #&07
9AE1  8D 13 7A     ..z   STA &7A13
9AE4  A9 00        ..    LDA #&00
9AE6  8D 18 7A     ..z   STA &7A18
9AE9  A9 4F        .O    LDA #&4F
9AEB  8D 19 7A     ..z   STA &7A19
9AEE  A9 FF        ..    LDA #&FF
9AF0  8D 1A 7A     ..z   STA &7A1A
9AF3  8D 1B 7A     ..z   STA &7A1B
9AF6  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9AF9  A9 04        ..    LDA #&04
9AFB  8D 12 7A     ..z   STA &7A12
9AFE  A9 01        ..    LDA #&01
9B00  8D 13 7A     ..z   STA &7A13
9B03  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9B06  A0 02        ..    LDY #&02
9B08  B9 00 7A     ..z   LDA &7A00,Y
9B0B  D9 12 7A     ..z   CMP &7A12,Y
9B0E  D0 5A        .Z    BNE &9B6A
9B10  C8           .     INY
9B11  C0 06        ..    CPY #&06
9B13  D0 F3        ..    BNE &9B08
9B15  A9 02        ..    LDA #&02
9B17  8D 12 7A     ..z   STA &7A12
9B1A  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9B1D  AD 14 7A     ..z   LDA &7A14
9B20  29 02        ).    AND #&02
9B22  F0 50        .P    BEQ &9B74
9B24  AD 14 7A     ..z   LDA &7A14
9B27  48           H     PHA
9B28  A9 04        ..    LDA #&04
9B2A  8D 12 7A     ..z   STA &7A12
9B2D  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9B30  AD 18 7A     ..z   LDA &7A18
9B33  85 82        ..    STA &82
9B35  AD 19 7A     ..z   LDA &7A19
9B38  85 83        ..    STA &83
9B3A  A9 00        ..    LDA #&00
9B3C  85 84        ..    STA &84
9B3E  A9 4A        .J    LDA #&4A
9B40  85 85        ..    STA &85
9B42  A2 00        ..    LDX #&00
9B44  A0 00        ..    LDY #&00
9B46  B1 82        ..    LDA (&82),Y
9B48  91 84        ..    STA (&84),Y
9B4A  C8           .     INY
9B4B  D0 F9        ..    BNE &9B46
9B4D  E6 83        ..    INC &83
9B4F  E6 85        ..    INC &85
9B51  E8           .     INX
9B52  E0 05        ..    CPX #&05
9B54  D0 EE        ..    BNE &9B44
9B56  68           h     PLA
9B57  8D 14 7A     ..z   STA &7A14
9B5A  A9 00        ..    LDA #&00
9B5C  8D 13 7A     ..z   STA &7A13
9B5F  A9 03        ..    LDA #&03
9B61  8D 12 7A     ..z   STA &7A12
9B64  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9B67  4C 84 9B     L..   JMP &9B84
9B6A  EE 13 7A     ..z   INC &7A13
9B6D  AD 13 7A     ..z   LDA &7A13
9B70  C9 14        ..    CMP #&14
9B72  D0 8F        ..    BNE &9B03
9B74  A9 03        ..    LDA #&03
9B76  8D 12 7A     ..z   STA &7A12
9B79  A9 00        ..    LDA #&00
9B7B  8D 13 7A     ..z   STA &7A13
9B7E  8D 14 7A     ..z   STA &7A14
9B81  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9B84  A9 10        ..    LDA #&10
9B86  8D 12 7A     ..z   STA &7A12
9B89  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9B8C  A9 00        ..    LDA #&00
9B8E  8D 06 7A     ..z   STA &7A06
9B91  A9 4A        .J    LDA #&4A
9B93  8D 07 7A     ..z   STA &7A07
9B96  A9 FF        ..    LDA #&FF
9B98  8D 08 7A     ..z   STA &7A08
9B9B  8D 09 7A     ..z   STA &7A09
9B9E  A9 05        ..    LDA #&05
9BA0  8D 00 7A     ..z   STA &7A00
9BA3  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9BA6  20 3C 9D      <.   JSR &9D3C
9BA9  A9 0D        ..    LDA #&0D
9BAB  8D 00 7A     ..z   STA &7A00
9BAE  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9BB1  A9 00        ..    LDA #&00
9BB3  8D 54 7A     .Tz   STA &7A54
9BB6  8D 2B 7A     .+z   STA &7A2B
9BB9  4C 02 99     L..   JMP &9902
9BBC  C9 7F        .    CMP #&7F
9BBE  D0 11        ..    BNE &9BD1
9BC0  AD 25 7A     .%z   LDA &7A25
9BC3  F0 0C        ..    BEQ &9BD1
9BC5  38           8     SEC
9BC6  E9 01        ..    SBC #&01
9BC8  8D 25 7A     .%z   STA &7A25
9BCB  20 8B 9C      ..   JSR &9C8B
9BCE  4C 02 99     L..   JMP &9902
9BD1  C9 09        ..    CMP #&09
9BD3  D0 0E        ..    BNE &9BE3
9BD5  20 38 A7      8.   JSR &A738
9BD8  AD 55 7A     .Uz   LDA &7A55
9BDB  49 01        I.    EOR #&01
9BDD  8D 55 7A     .Uz   STA &7A55
9BE0  4C 02 99     L..   JMP &9902
9BE3  C9 2A        .*    CMP #&2A
9BE5  D0 03        ..    BNE &9BEA
9BE7  4C 76 A7     Lv.   JMP &A776
9BEA  C9 20        .     CMP #&20
9BEC  D0 03        ..    BNE &9BF1
9BEE  4C 23 A8     L#.   JMP &A823
9BF1  C9 87        ..    CMP #&87
9BF3  D0 3A        .:    BNE &9C2F
9BF5  A9 81        ..    LDA #&81
9BF7  A2 FF        ..    LDX #&FF
9BF9  A0 FF        ..    LDY #&FF
9BFB  20 F4 FF      ..   JSR osbyte               ; Read Key with Time Limit (INKEY)
9BFE  86 77        .w    STX &77
9C00  98           .     TYA
9C01  25 77        %w    AND &77
9C03  C9 FF        ..    CMP #&FF
9C05  D0 25        .%    BNE &9C2C
9C07  A9 08        ..    LDA #&08
9C09  85 77        .w    STA &77
9C0B  A9 14        ..    LDA #&14
9C0D  85 78        .x    STA &78
9C0F  20 52 9D      R.   JSR &9D52
9C12  A2 19        ..    LDX #&19
9C14  A0 9C        ..    LDY #&9C
9C16  4C 21 AA     L!.   JMP &AA21
9C19  84 9D        ..    STY &9D
9C1B  86 41        .A    STX &41
9C1D  6C 6C 20     ll    JMP (&206C)
9C20  52           R     ...
9C21  65 6C        el    ADC &6C
9C23  65 61        ea    ADC &61
9C25  73           s     ...
9C26  65 64        ed    ADC &64
9C28  20 20 9C       .   JSR &9C20
9C2B  00           .     BRK
9C2C  4C EC A8     L..   JMP &A8EC
9C2F  C9 0D        ..    CMP #&0D
9C31  D0 03        ..    BNE &9C36
9C33  4C 28 AB     L(.   JMP &AB28
9C36  4C 02 99     L..   JMP &9902
9C39  98           .     TYA
9C3A  4A           J     LSR A
9C3B  8D 01 7A     ..z   STA &7A01
9C3E  A9 A0        ..    LDA #&A0
9C40  8D 00 7A     ..z   STA &7A00
9C43  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9C46  4C 02 99     L..   JMP &9902
9C49  A9 04        ..    LDA #&04
9C4B  8D 00 7A     ..z   STA &7A00
9C4E  A9 00        ..    LDA #&00
9C50  8D 01 7A     ..z   STA &7A01
9C53  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9C56  AD 26 7A     .&z   LDA &7A26
9C59  38           8     SEC
9C5A  E9 30        .0    SBC #&30
9C5C  0A           .     ASL A
9C5D  0A           .     ASL A
9C5E  0A           .     ASL A
9C5F  0A           .     ASL A
9C60  8D 04 7A     ..z   STA &7A04
9C63  AD 27 7A     .'z   LDA &7A27
9C66  38           8     SEC
9C67  E9 30        .0    SBC #&30
9C69  0D 04 7A     ..z   ORA &7A04
9C6C  8D 04 7A     ..z   STA &7A04
9C6F  AD 28 7A     .(z   LDA &7A28
9C72  38           8     SEC
9C73  E9 30        .0    SBC #&30
9C75  0A           .     ASL A
9C76  0A           .     ASL A
9C77  0A           .     ASL A
9C78  0A           .     ASL A
9C79  8D 05 7A     ..z   STA &7A05
9C7C  AD 29 7A     .)z   LDA &7A29
9C7F  38           8     SEC
9C80  E9 30        .0    SBC #&30
9C82  0D 05 7A     ..z   ORA &7A05
9C85  8D 05 7A     ..z   STA &7A05
9C88  4C F9 9A     L..   JMP &9AF9
9C8B  AD 2A 7A     .*z   LDA &7A2A
9C8E  C9 04        ..    CMP #&04
9C90  F0 0E        ..    BEQ &9CA0
9C92  A9 06        ..    LDA #&06
9C94  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

9C97  1F           .     EQUB &1F                 ; Place text cursor at 32,0
9C98  20 00        ..    EQUW &2000
9C9A  83           .     EQUB &83                 ; Alphanumeric yellow
9C9B  53 20        S     EQUS "S "

9C9D  4C B2 9C     L.    JMP &9CB2
9CA0  A9 02        ..    LDA #&02
9CA2  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

9CA5  1E           .     EQUB &1E                 ; Home text cursor
9CA6  20                 EQUS " "

9CA7  AD 5E 7B     .^{   LDA &7B5E
9CAA  20 EE FF      ..   JSR oswrch
9CAD  A9 50        .P    LDA #&50
9CAF  20 EE FF      ..   JSR oswrch
9CB2  A2 00        ..    LDX #&00
9CB4  AD 25 7A     .%z   LDA &7A25
9CB7  F0 1C        ..    BEQ &9CD5
9CB9  BD 26 7A     .&z   LDA &7A26,X
9CBC  20 EE FF      ..   JSR oswrch
9CBF  E0 01        ..    CPX #&01
9CC1  D0 0C        ..    BNE &9CCF
9CC3  AD 2A 7A     .*z   LDA &7A2A
9CC6  C9 05        ..    CMP #&05
9CC8  D0 05        ..    BNE &9CCF
9CCA  A9 3A        .:    LDA #&3A
9CCC  20 EE FF      ..   JSR oswrch
9CCF  E8           .     INX
9CD0  EC 25 7A     .%z   CPX &7A25
9CD3  D0 E4        ..    BNE &9CB9
9CD5  38           8     SEC
9CD6  AD 2A 7A     .*z   LDA &7A2A
9CD9  ED 25 7A     .%z   SBC &7A25
9CDC  38           8     SEC
9CDD  E9 01        ..    SBC #&01
9CDF  F0 1A        ..    BEQ &9CFB
9CE1  A8           .     TAY
9CE2  A9 5F        ._    LDA #&5F
9CE4  20 EE FF      ..   JSR oswrch
9CE7  E0 01        ..    CPX #&01
9CE9  D0 0C        ..    BNE &9CF7
9CEB  AD 2A 7A     .*z   LDA &7A2A
9CEE  C9 05        ..    CMP #&05
9CF0  D0 05        ..    BNE &9CF7
9CF2  A9 3A        .:    LDA #&3A
9CF4  20 EE FF      ..   JSR oswrch
9CF7  E8           .     INX
9CF8  88           .     DEY
9CF9  D0 E7        ..    BNE &9CE2
9CFB  AD 2A 7A     .*z   LDA &7A2A
9CFE  C9 05        ..    CMP #&05
9D00  F0 05        ..    BEQ &9D07
9D02  A9 20        .     LDA #&20
9D04  20 EE FF      ..   JSR oswrch
9D07  60           `     RTS
9D08  27           '     ...
9D09  A5 D0        ..    LDA &D0
9D0B  A4 D9        ..    LDY &D9
9D0D  A4 F3        ..    LDY &F3
9D0F  A4 0D        ..    LDY &0D
9D11  A5 A3        ..    LDA &A3
9D13  AC 2F 9F     ./.   LDY &9F2F
9D16  07           .     ...
9D17  9E           .     ...
9D18  70 9E        p.    BCS &9CB8
9D1A  B6 A2        ..    LDX &A2,Y
9D1C  02           .     ...
9D1D  99 02 99     ...   STA &9902,Y
9D20  02           .     ...
9D21  99 02 99     ...   STA &9902,Y
9D24  02           .     ...
9D25  99 02 99     ...   STA &9902,Y
9D28  8E AA 89     ...   STX &89AA
9D2B  9D 8D 9D     ...   STA &9D8D,X
9D2E  91 9D        ..    STA (&9D),Y
9D30  95 9D        ..    STA &9D,X
9D32  39 9C 96     9..   AND &969C,Y
9D35  9F           .     ...
9D36  6B           k     ...
9D37  9F           .     ...
9D38  39 9C 39     9.9   AND &399C,Y
9D3B  9C           .     ...
9D3C  A9 01        ..    LDA #&01
9D3E  85 77        .w    STA &77
9D40  A9 07        ..    LDA #&07
9D42  85 78        .x    STA &78
9D44  A9 01        ..    LDA #&01
9D46  20 52 9D      R.   JSR &9D52
9D49  A9 00        ..    LDA #&00
9D4B  8D 54 7A     .Tz   STA &7A54
9D4E  20 45 A1      E.   JSR &A145
9D51  60           `     RTS
9D52  A5 77        .w    LDA &77
9D54  8D 13 7A     ..z   STA &7A13
9D57  8D 01 7A     ..z   STA &7A01
9D5A  A9 FF        ..    LDA #&FF
9D5C  A2 00        ..    LDX #&00
9D5E  9D 02 7A     ..z   STA &7A02,X
9D61  E8           .     INX
9D62  E0 0A        ..    CPX #&0A
9D64  D0 F8        ..    BNE &9D5E
9D66  A9 03        ..    LDA #&03
9D68  8D 12 7A     ..z   STA &7A12
9D6B  A9 00        ..    LDA #&00
9D6D  8D 14 7A     ..z   STA &7A14
9D70  A9 05        ..    LDA #&05
9D72  8D 00 7A     ..z   STA &7A00
9D75  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9D78  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
9D7B  EE 01 7A     ..z   INC &7A01
9D7E  EE 13 7A     ..z   INC &7A13
9D81  AD 01 7A     ..z   LDA &7A01
9D84  C5 78        .x    CMP &78
9D86  D0 ED        ..    BNE &9D75
9D88  60           `     RTS
9D89  A9 00        ..    LDA #&00
9D8B  F0 0A        ..    BEQ &9D97
9D8D  A9 01        ..    LDA #&01
9D8F  D0 06        ..    BNE &9D97
9D91  A9 02        ..    LDA #&02
9D93  D0 02        ..    BNE &9D97
9D95  A9 03        ..    LDA #&03
9D97  8D 01 7A     ..z   STA &7A01
9D9A  A9 01        ..    LDA #&01
9D9C  8D 00 7A     ..z   STA &7A00
9D9F  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9DA2  4C 79 98     Ly.   JMP &9879
9DA5  00           .     BRK
9DA6  42           B     ...
9DA7  42           B     ...
9DA8  43           C     ...
9DA9  31 00        1.    AND (&00),Y
9DAB  42           B     ...
9DAC  42           B     ...
9DAD  43           C     ...
9DAE  32           2     ...
9DAF  00           .     BRK
9DB0  49 54        IT    EOR #&54
9DB2  56 00        V.    LSR &00,X
9DB4  43           C     ...
9DB5  68           h     PLA
9DB6  34           4     ...
9DB7  2F           /     ...
9DB8  53           S     ...
9DB9  34           4     ...
9DBA  43           C     ...
9DBB  00           .     BRK

; -----------------------------------------------------------------------------
; Display user friendly channel number (BBC1 / BBC2 / ITV / Ch4/S4C) in top left corner
; -----------------------------------------------------------------------------
.
9DBC  A9 1E        ..    LDA #&1E                           ; Home text cursor to top left
9DBE  20 EE FF      ..   JSR oswrch
9DC1  A9 20        .     LDA #&20                           ; Clear first 7 characters top left
9DC3  A2 07        ..    LDX #&07
9DC5  20 EE FF      ..   JSR oswrch
9DC8  CA           .     DEX
9DC9  D0 FA        ..    BNE &9DC5
9DCB  A9 1E        ..    LDA #&1E                           ; Home text cursot to top left
9DCD  20 EE FF      ..   JSR oswrch
.
9DD0  A5 77        .w    LDA &77
9DD2  48           H     PHA
9DD3  A5 78        .x    LDA &78
9DD5  48           H     PHA
9DD6  A9 00        ..    LDA #&00
9DD8  85 77        .w    STA &77                            ; Parameter 0 = &00 (Read channel)
9DDA  A2 77        .w    LDX #&77
9DDC  A0 00        ..    LDY #&00
9DDE  A9 7A        .z    LDA #&7A
9DE0  20 F1 FF      ..   JSR osword                         ; Perform OSWORD &7A with parameterblock at &0077
9DE3  A5 78        .x    LDA &78                            ; Parameter 1 = channel number
9DE5  AA           .     TAX
9DE6  E8           .     INX
9DE7  A0 00        ..    LDY #&00

.
9DE9  B9 A5 9D     ...   LDA &9DA5,Y
9DEC  F0 03        ..    BEQ &9DF1
9DEE  C8           .     INY
9DEF  D0 F8        ..    BNE &9DE9

.
9DF1  C8           .     INY
9DF2  CA           .     DEX
9DF3  D0 F4        ..    BNE &9DE9
9DF5  B9 A5 9D     ...   LDA &9DA5,Y
9DF8  20 EE FF      ..   JSR oswrch                         ; Display user friendly channel number (BBC1 / BBC2 / ITV / Ch4/S4C )
9DFB  C8           .     INY
9DFC  C9 00        ..    CMP #&00
9DFE  D0 F5        ..    BNE &9DF5
9E00  68           h     PLA
9E01  85 78        .x    STA &78
9E03  68           h     PLA
9E04  85 77        .w    STA &77
9E06  60           `     RTS

.

9E07  A9 02        ..    LDA #&02
9E09  8D 00 7A     ..z   STA &7A00
9E0C  A9 00        ..    LDA #&00
9E0E  8D 01 7A     ..z   STA &7A01
9E11  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9E14  AD 02 7A     ..z   LDA &7A02
9E17  29 01        ).    AND #&01
9E19  D0 3D        .=    BNE &9E58
9E1B  20 E3 9E      ..   JSR &9EE3
9E1E  AD 02 7A     ..z   LDA &7A02
9E21  09 01        ..    ORA #&01
9E23  8D 02 7A     ..z   STA &7A02
9E26  A9 03        ..    LDA #&03
9E28  8D 00 7A     ..z   STA &7A00
9E2B  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9E2E  A9 09        ..    LDA #&09
9E30  8D 00 7A     ..z   STA &7A00
9E33  A9 FF        ..    LDA #&FF
9E35  8D 01 7A     ..z   STA &7A01
9E38  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9E3B  A9 0B        ..    LDA #&0B
9E3D  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

9E40  1F           .     EQUB &1F                 ; Place text cursor at 32,0
9E41  20 00
9E43  20                 EQUS " "
9E44  82           .     EQUB &82                 ; Alphanumeric green
9E45  48 4F 4C 44  HOLD  EQUS "HOLD  "
9E49  20 20          

9E4B  A9 01        ..    LDA #&01
9E4D  8D 2B 7A     .+z   STA &7A2B
9E50  A9 04        ..    LDA #&04
9E52  8D 2A 7A     .*z   STA &7A2A
9E55  4C 02 99     L..   JMP &9902
9E58  AD 02 7A     ..z   LDA &7A02
9E5B  29 FE        ).    AND #&FE
9E5D  8D 02 7A     ..z   STA &7A02
9E60  A9 03        ..    LDA #&03
9E62  8D 00 7A     ..z   STA &7A00
9E65  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9E68  A9 00        ..    LDA #&00
9E6A  8D 2B 7A     .+z   STA &7A2B
9E6D  4C B4 9E     L..   JMP &9EB4
9E70  AD 2B 7A     .+z   LDA &7A2B
9E73  F0 03        ..    BEQ &9E78
9E75  4C 02 99     L..   JMP &9902
9E78  AD 2A 7A     .*z   LDA &7A2A
9E7B  C9 04        ..    CMP #&04
9E7D  D0 2B        .+    BNE &9EAA
9E7F  A9 05        ..    LDA #&05
9E81  8D 2A 7A     .*z   STA &7A2A
9E84  A9 04        ..    LDA #&04
9E86  8D 25 7A     .%z   STA &7A25
9E89  A9 30        .0    LDA #&30
9E8B  8D 26 7A     .&z   STA &7A26
9E8E  8D 27 7A     .'z   STA &7A27
9E91  8D 28 7A     .(z   STA &7A28
9E94  8D 29 7A     .)z   STA &7A29
9E97  A9 09        ..    LDA #&09
9E99  8D 00 7A     ..z   STA &7A00
9E9C  A9 FF        ..    LDA #&FF
9E9E  8D 01 7A     ..z   STA &7A01
9EA1  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9EA4  20 8B 9C      ..   JSR &9C8B
9EA7  4C 02 99     L..   JMP &9902
9EAA  A9 04        ..    LDA #&04
9EAC  8D 2A 7A     .*z   STA &7A2A
9EAF  A9 00        ..    LDA #&00
9EB1  8D 25 7A     .%z   STA &7A25
9EB4  A9 09        ..    LDA #&09
9EB6  8D 00 7A     ..z   STA &7A00
9EB9  A9 01        ..    LDA #&01
9EBB  8D 01 7A     ..z   STA &7A01
9EBE  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9EC1  A9 04        ..    LDA #&04
9EC3  8D 00 7A     ..z   STA &7A00
9EC6  A9 00        ..    LDA #&00
9EC8  8D 01 7A     ..z   STA &7A01
9ECB  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9ECE  A9 3F        .?    LDA #&3F
9ED0  8D 04 7A     ..z   STA &7A04
9ED3  A9 7F        .    LDA #&7F
9ED5  8D 05 7A     ..z   STA &7A05
9ED8  A9 05        ..    LDA #&05
9EDA  8D 00 7A     ..z   STA &7A00
9EDD  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9EE0  4C 02 99     L..   JMP &9902
9EE3  A9 00        ..    LDA #&00
9EE5  85 82        ..    STA &82
9EE7  A9 4A        .J    LDA #&4A
9EE9  85 83        ..    STA &83
9EEB  A2 00        ..    LDX #&00
9EED  20 45 A2      E.   JSR &A245
9EF0  38           8     SEC
9EF1  A5 84        ..    LDA &84
9EF3  E9 02        ..    SBC #&02
9EF5  85 84        ..    STA &84
9EF7  A5 85        ..    LDA &85
9EF9  E9 00        ..    SBC #&00
9EFB  85 85        ..    STA &85
9EFD  A0 00        ..    LDY #&00
9EFF  B1 84        ..    LDA (&84),Y
9F01  18           .     CLC
9F02  69 30        i0    ADC #&30
9F04  C9 30        .0    CMP #&30
9F06  D0 02        ..    BNE &9F0A
9F08  A9 38        .8    LDA #&38
9F0A  8D 26 7A     .&z   STA &7A26
9F0D  C8           .     INY
9F0E  C8           .     INY
9F0F  B1 84        ..    LDA (&84),Y
9F11  29 F0        ).    AND #&F0
9F13  4A           J     LSR A
9F14  4A           J     LSR A
9F15  4A           J     LSR A
9F16  4A           J     LSR A
9F17  18           .     CLC
9F18  69 30        i0    ADC #&30
9F1A  8D 27 7A     .'z   STA &7A27
9F1D  B1 84        ..    LDA (&84),Y
9F1F  29 0F        ).    AND #&0F
9F21  18           .     CLC
9F22  69 30        i0    ADC #&30
9F24  8D 28 7A     .(z   STA &7A28
9F27  A9 03        ..    LDA #&03
9F29  8D 25 7A     .%z   STA &7A25
9F2C  4C 8B 9C     L..   JMP &9C8B
9F2F  A9 00        ..    LDA #&00
9F31  85 82        ..    STA &82
9F33  A9 7C        .|    LDA #&7C
9F35  85 83        ..    STA &83
9F37  A0 00        ..    LDY #&00
9F39  B1 82        ..    LDA (&82),Y
9F3B  09 80        ..    ORA #&80
9F3D  C9 98        ..    CMP #&98
9F3F  D0 07        ..    BNE &9F48
9F41  A9 80        ..    LDA #&80
9F43  91 82        ..    STA (&82),Y
9F45  4C 50 9F     LP.   JMP &9F50
9F48  C9 80        ..    CMP #&80
9F4A  D0 04        ..    BNE &9F50
9F4C  A9 98        ..    LDA #&98
9F4E  91 82        ..    STA (&82),Y
9F50  C8           .     INY
9F51  D0 E6        ..    BNE &9F39
9F53  E6 83        ..    INC &83
9F55  A5 83        ..    LDA &83
9F57  C9 80        ..    CMP #&80
9F59  D0 DC        ..    BNE &9F37
9F5B  4C 07 9E     L..   JMP &9E07

; -----------------------------------------------------------------------------
; Write character at position 7,0
; -----------------------------------------------------------------------------
.
9F5E  48           H     PHA
9F5F  A9 03        ..    LDA #&03
9F61  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

9F64  1F           .     EQUB &1F                 ; Place text cursor at 7,0
9F65  07 00        ..    EQUW &0700

9F67  68           h     PLA
9F68  4C EE FF     L..   JMP oswrch

9F6B  20 E3 9E      ..   JSR &9EE3
9F6E  20 45 A1      E.   JSR &A145
9F71  A9 11        ..    LDA #&11
9F73  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

9F76  1A           .     EQUB &1A                 ; Reset windows, home cursors and reset graphics origin
9F77  1F           .     EQUB &1F                 ; Place text cursor at 0,24
9F78  00 18        ..    EQUW &0018
9F7A  20 53 61      Sav  EQUS " Save Page : "
      65 20 50 61  e Pa
      67 65 20 3A  ge :
      20            

9F87  20 D6 9F      ..   JSR &9FD6
9F8A  A9 00        ..    LDA #&00
9F8C  A2 00        ..    LDX #&00
9F8E  A0 7A        .z    LDY #&7A
9F90  20 DD FF      ..   JSR osfile
9F93  4C BE 9F     L..   JMP &9FBE
9F96  20 45 A1      E.   JSR &A145
9F99  A9 11        ..    LDA #&11
9F9B  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

9F9E  1A           .     EQUB &1A                 ; Reset windows, home cursors and reset graphics origin
9F9F  1F           .     EQUB &1F                 ; Place text cursor at 0,24
9FA0  00 18        ..    EQUW &0018
9FA2  20 4C 6F 61   Loa  EQUS " Load Page : "
      64 20 50 61  d Pa
      67 65 20 3A  ge :
      20            

9FAF  20 D6 9F      ..   JSR &9FD6
9FB1  9F           .     ...
9FB2  A9 FF        ..    LDA #&FF
9FB4  A2 00        ..    LDX #&00
9FB6  A0 7A        .z    LDY #&7A
9FB8  20 DD FF      ..   JSR osfile
9FBB  20 3B A0      ;.   JSR &A03B
9FBE  A9 09        ..    LDA #&09
9FC0  8D 00 7A     ..z   STA &7A00
9FC3  A9 01        ..    LDA #&01
9FC5  8D 01 7A     ..z   STA &7A01
9FC8  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
9FCB  A9 1A        ..    LDA #&1A
9FCD  20 EE FF      ..   JSR oswrch
9FD0  20 50 A1      P.   JSR &A150
9FD3  4C 02 99     L..   JMP &9902
9FD6  20 43 A8      C.   JSR &A843                ; Set up new BRKV handler
9FD9  A9 E5        ..    LDA #&E5
9FDB  A2 00        ..    LDX #&00
9FDD  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
9FE0  20 11 A0      ..   JSR &A011
9FE3  20 F9 A0      ..   JSR &A0F9
9FE6  AD 2D 7A     .-z   LDA &7A2D
9FE9  C9 0D        ..    CMP #&0D
9FEB  F0 D1        ..    BEQ &9FBE
9FED  A9 06        ..    LDA #&06
9FEF  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

9FF2  1C           .     EQUB &1C                 ; Set up a text window
9FF3  01           .     EQUB &01                 ; left = 1
9FF4  18           .     EQUB &18                 ; bottom = 24
9FF5  27           '     EQUB &27                 ; right = 39
9FF6  18           .     EQUB &18                 ; top = 24
9FF7  0C           .     EQUB &0C                 ; Clear text window and move text cursor home

9FF8  A9 09        ..    LDA #&09
9FFA  8D 00 7A     ..z   STA &7A00
9FFD  A9 00        ..    LDA #&00
9FFF  8D 01 7A     ..z   STA &7A01
A002  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A005  A0 11        ..    LDY #&11
A007  B9 29 A0     .).   LDA &A029,Y
A00A  99 00 7A     ..z   STA &7A00,Y
A00D  88           .     DEY
A00E  10 F7        ..    BPL &A007
A010  60           `     RTS
A011  A9 00        ..    LDA #&00
A013  A8           .     TAY
A014  20 DA FF      ..   JSR osargs
A017  C9 04        ..    CMP #&04
A019  B0 09        ..    BCS &A024
A01B  A9 8B        ..    LDA #&8B
A01D  A2 01        ..    LDX #&01
A01F  A0 01        ..    LDY #&01                 ; *OPT 1,1
A021  4C F4 FF     L..   JMP osbyte               ; Set filing system attributes (*OPT)
A024  A9 8B        ..    LDA #&8B
A026  4C B7 A0     L..   JMP &A0B7
A029  2D 7A 00     -z.   AND &007A
A02C  7C           |     ...
A02D  FF           .     ...
A02E  FF           .     ...
A02F  00           .     BRK
A030  7C           |     ...
A031  FF           .     ...
A032  FF           .     ...
A033  00           .     BRK
A034  7C           |     ...
A035  FF           .     ...
A036  FF           .     ...
A037  C0 7F        .    CPY #&7F
A039  FF           .     ...
A03A  FF           .     ...
A03B  A0 00        ..    LDY #&00                           ; Display 'Press SPACE to continue'
A03D  B9 5E A0     .^.   LDA &A05E,Y
A040  99 C0 7F     ..   STA &7FC0,Y
A043  C8           .     INY
A044  C0 28        .(    CPY #&28
A046  D0 F5        ..    BNE &A03D
A048  20 E0 FF      ..   JSR osrdch
A04B  C9 20        .     CMP #&20
A04D  F0 04        ..    BEQ &A053
A04F  C9 2A        .*    CMP #&2A
A051  D0 F5        ..    BNE &A048
A053  48           H     PHA
A054  A9 1A        ..    LDA #&1A
A056  20 EE FF      ..   JSR oswrch
A059  20 86 A0      ..   JSR &A086
A05C  68           h     PLA
A05D  60           `     RTS
A05E  97           .     ...
A05F  AC AC AC     ...   LDY &ACAC
A062  AC AC AC     ...   LDY &ACAC
A065  AC 87 50     ..P   LDY &5087
A068  72           r     ...
A069  65 73        es    ADC &73
A06B  73           s     ...
A06C  85 53        .S    STA &53
A06E  50 41        PA    BVC &A0B1
A070  43           C     ...
A071  45 87        E.    EOR &87
A073  74           t     ...
A074  6F           o     ...
A075  20 63 6F      co   JSR &6F63
A078  6E 74 69     nti   ROR &6974
A07B  6E 75 65     nue   ROR &6575
A07E  97           .     ...
A07F  AC AC AC     ...   LDY &ACAC
A082  AC AC AC     ...   LDY &ACAC
A085  AC AD 2A     ..*   LDY &2AAD
A088  7A           z     ...
A089  48           H     PHA
A08A  AD 25 7A     .%z   LDA &7A25
A08D  48           H     PHA
A08E  AD 26 7A     .&z   LDA &7A26
A091  48           H     PHA
A092  AD 27 7A     .'z   LDA &7A27
A095  48           H     PHA
A096  AD 28 7A     .(z   LDA &7A28
A099  48           H     PHA
A09A  A9 04        ..    LDA #&04
A09C  8D 2A 7A     .*z   STA &7A2A
A09F  20 E3 9E      ..   JSR &9EE3
A0A2  68           h     PLA
A0A3  8D 28 7A     .(z   STA &7A28
A0A6  68           h     PLA
A0A7  8D 27 7A     .'z   STA &7A27
A0AA  68           h     PLA
A0AB  8D 26 7A     .&z   STA &7A26
A0AE  68           h     PLA
A0AF  8D 25 7A     .%z   STA &7A25
A0B2  68           h     PLA
A0B3  8D 2A 7A     .*z   STA &7A2A
A0B6  60           `     RTS

; -----------------------------------------------------------------------------
; Call OSBYTE with X=&01 and Y=&00
; -----------------------------------------------------------------------------
.
A0B7  A2 01        ..    LDX #&01
.
A0B9  A0 00        ..    LDY #&00
A0BB  4C F4 FF     L..   JMP osbyte

A0BE  20 43 A8      C.   JSR &A843                ; Set up new BRKV handler
A0C1  A9 72        .r    LDA #&72                 ; Write to Shadow/Main toggle (only use shadow memory if mode number is > 127)
A0C3  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
A0C6  A9 02        ..    LDA #&02
A0C8  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

A0CB  16 07        ..    EQUW &1607               ; Set screen mode 7

A0CD  20 2A A8      *.   JSR &A82A                          ; VDU 23, 0, 0, 0, 0, 0, 0, 0, 0, 0
A0D0  A9 E1        ..    LDA #&E1                 ; Read/Write Interpretation of F-Keys
A0D2  A2 A0        ..    LDX #&A0
A0D4  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A0D7  A9 E2        ..    LDA #&E2                 ; Read/Write Interpretation of Shift-F-Keys
A0D9  A2 B0        ..    LDX #&B0
A0DB  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A0DE  A9 E3        ..    LDA #&E3                 ; Read/Write Interpretation of Ctrl-F-Keys
A0E0  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
A0E3  A9 04        ..    LDA #&04                 ; Define action of cursor editing keys
A0E5  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
A0E8  A9 DB        ..    LDA #&DB                 ; Read/Write ASCII code for TAB
A0EA  A2 09        ..    LDX #&09                 ; TAB = &09
A0EC  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A0EF  A9 E5        ..    LDA #&E5                 ; Read/Write ESCAPE key status
A0F1  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
A0F4  A9 0F        ..    LDA #&0F                 ; Flush input buffer
A0F6  4C B7 A0     L..   JMP &A0B7                ; Call OSBYTE with X=&01 and Y=&00
A0F9  20 26 A8      &.   JSR &A826
A0FC  A9 00        ..    LDA #&00
A0FE  8D 2C 7A     .,z   STA &7A2C
.
A101  20 E0 FF      ..   JSR osrdch
A104  C9 7F        .    CMP #&7F
A106  D0 13        ..    BNE &A11B
A108  AD 2C 7A     .,z   LDA &7A2C
A10B  F0 F4        ..    BEQ &A101
A10D  CE 2C 7A     .,z   DEC &7A2C
A110  A9 03        ..    LDA #&03
A112  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

A115  08           .     EQUB &08                 ; Backspace
A116  20                 EQUB &20                 ; Space
A117  08           .     EQUB &08                 ; Backspace

AA18  4C 01 A1     L..   JMP &A101
A119  01 A1        ..    ORA (&A1,X)
A11B  C9 0D        ..    CMP #&0D
A11D  D0 0A        ..    BNE &A129
A11F  AC 2C 7A     .,z   LDY &7A2C
A122  99 2D 7A     .-z   STA &7A2D,Y
A125  20 2A A8      *.   JSR &A82A                          ; VDU 23, 0, 0, 0, 0, 0, 0, 0, 0, 0
A128  60           `     RTS
A129  48           H     PHA
A12A  AD 2C 7A     .,z   LDA &7A2C
A12D  C9 1C        ..    CMP #&1C
A12F  D0 04        ..    BNE &A135
A131  68           h     PLA
A132  4C 01 A1     L..   JMP &A101
A135  68           h     PLA
A136  AC 2C 7A     .,z   LDY &7A2C
A139  99 2D 7A     .-z   STA &7A2D,Y
A13C  20 EE FF      ..   JSR oswrch
A13F  EE 2C 7A     .,z   INC &7A2C
A142  4C 01 A1     L..   JMP &A101
A145  A0 27        .'    LDY #&27
A147  A9 A0        ..    LDA #&A0
A149  99 C0 7F     ..   STA &7FC0,Y
A14C  88           .     DEY
A14D  10 FA        ..    BPL &A149
A14F  60           `     RTS
A150  A9 04        ..    LDA #&04
A152  8D 00 7A     ..z   STA &7A00
A155  A9 00        ..    LDA #&00
A157  8D 01 7A     ..z   STA &7A01
A15A  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A15D  AD 02 7A     ..z   LDA &7A02
A160  CD 00 4A     ..J   CMP &4A00
A163  D0 0C        ..    BNE &A171
A165  AD 03 7A     ..z   LDA &7A03
A168  CD 02 4A     ..J   CMP &4A02
A16B  D0 04        ..    BNE &A171
A16D  A9 87        ..    LDA #&87
A16F  D0 02        ..    BNE &A173
A171  A9 82        ..    LDA #&82
A173  20 5E 9F      ^.   JSR &9F5E                          ; Write character at position 7,0
A176  A9 00        ..    LDA #&00
A178  85 82        ..    STA &82
A17A  A9 4A        .J    LDA #&4A
A17C  85 83        ..    STA &83
A17E  20 C9 A1      ..   JSR &A1C9
A181  A2 18        ..    LDX #&18
A183  20 45 A2      E.   JSR &A245
A186  08           .     PHP
A187  A9 02        ..    LDA #&02
A189  8D 00 7A     ..z   STA &7A00
A18C  A9 00        ..    LDA #&00
A18E  8D 01 7A     ..z   STA &7A01
A191  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A194  29 20        )     AND #&20
A196  F0 03        ..    BEQ &A19B
A198  20 48 A3      H.   JSR &A348
A19B  28           (     PLP
A19C  90 1A        ..    BCC &A1B8
A19E  A9 02        ..    LDA #&02
A1A0  8D 00 7A     ..z   STA &7A00
A1A3  A9 00        ..    LDA #&00
A1A5  8D 01 7A     ..z   STA &7A01
A1A8  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A1AB  29 20        )     AND #&20
A1AD  D0 06        ..    BNE &A1B5
A1AF  20 45 A1      E.   JSR &A145
A1B2  4C B8 A1     L..   JMP &A1B8
A1B5  20 3E A6      >.   JSR &A63E
A1B8  A9 03        ..    LDA #&03
A1BA  8D 00 7A     ..z   STA &7A00
A1BD  A9 00        ..    LDA #&00
A1BF  8D 01 7A     ..z   STA &7A01
A1C2  8D 02 7A     ..z   STA &7A02
A1C5  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A1C8  60           `     RTS
A1C9  A9 00        ..    LDA #&00
A1CB  85 86        ..    STA &86
A1CD  A9 7C        .|    LDA #&7C
A1CF  85 87        ..    STA &87
A1D1  A9 08        ..    LDA #&08
A1D3  8D 56 7A     .Vz   STA &7A56
A1D6  A0 00        ..    LDY #&00
A1D8  B1 82        ..    LDA (&82),Y
A1DA  D0 09        ..    BNE &A1E5
A1DC  A0 05        ..    LDY #&05
A1DE  B1 82        ..    LDA (&82),Y
A1E0  29 08        ).    AND #&08
A1E2  8D 56 7A     .Vz   STA &7A56
A1E5  A2 01        ..    LDX #&01
A1E7  20 45 A2      E.   JSR &A245
A1EA  90 0F        ..    BCC &A1FB
A1EC  E0 18        ..    CPX #&18
A1EE  F0 41        .A    BEQ &A231
A1F0  AD 56 7A     .Vz   LDA &7A56
A1F3  D0 06        ..    BNE &A1FB
A1F5  20 37 A2      7.   JSR &A237
A1F8  4C 31 A2     L1.   JMP &A231
A1FB  A9 00        ..    LDA #&00
A1FD  8D 24 7A     .$z   STA &7A24
A200  20 37 A2      7.   JSR &A237
A203  A0 00        ..    LDY #&00
A205  B1 84        ..    LDA (&84),Y
A207  09 80        ..    ORA #&80
A209  91 86        ..    STA (&86),Y
A20B  C9 8D        ..    CMP #&8D
A20D  D0 03        ..    BNE &A212
A20F  EE 24 7A     .$z   INC &7A24
A212  C8           .     INY
A213  C0 28        .(    CPY #&28
A215  D0 EE        ..    BNE &A205
A217  AD 24 7A     .$z   LDA &7A24
A21A  F0 15        ..    BEQ &A231
A21C  E0 18        ..    CPX #&18
A21E  F0 11        ..    BEQ &A231
A220  20 37 A2      7.   JSR &A237
A223  A0 00        ..    LDY #&00
A225  B1 84        ..    LDA (&84),Y
A227  09 80        ..    ORA #&80
A229  91 86        ..    STA (&86),Y
A22B  C8           .     INY
A22C  C0 28        .(    CPY #&28
A22E  D0 F5        ..    BNE &A225
A230  E8           .     INX
A231  E8           .     INX
A232  E0 19        ..    CPX #&19
A234  90 B1        ..    BCC &A1E7
A236  60           `     RTS
A237  18           .     CLC
A238  A5 86        ..    LDA &86
A23A  69 28        i(    ADC #&28
A23C  85 86        ..    STA &86
A23E  A5 87        ..    LDA &87
A240  69 00        i.    ADC #&00
A242  85 87        ..    STA &87
A244  60           `     RTS
A245  8A           .     TXA
A246  48           H     PHA
A247  A5 82        ..    LDA &82
A249  85 84        ..    STA &84
A24B  A5 83        ..    LDA &83
A24D  85 85        ..    STA &85
A24F  A2 00        ..    LDX #&00
A251  A0 01        ..    LDY #&01
A253  68           h     PLA
A254  48           H     PHA
A255  D1 84        ..    CMP (&84),Y
A257  F0 1E        ..    BEQ &A277
A259  18           .     CLC
A25A  A5 84        ..    LDA &84
A25C  69 2A        i*    ADC #&2A
A25E  85 84        ..    STA &84
A260  A5 85        ..    LDA &85
A262  69 00        i.    ADC #&00
A264  85 85        ..    STA &85
A266  E8           .     INX
A267  E0 1E        ..    CPX #&1E
A269  D0 E6        ..    BNE &A251
A26B  A9 8C        ..    LDA #&8C
A26D  85 84        ..    STA &84
A26F  A9 A2        ..    LDA #&A2
A271  85 85        ..    STA &85
A273  68           h     PLA
A274  AA           .     TAX
A275  38           8     SEC
A276  60           `     RTS
A277  8A           .     TXA
A278  A8           .     TAY
A279  18           .     CLC
A27A  A5 84        ..    LDA &84
A27C  69 02        i.    ADC #&02
A27E  85 84        ..    STA &84
A280  A5 85        ..    LDA &85
A282  69 00        i.    ADC #&00
A284  85 85        ..    STA &85
A286  68           h     PLA
A287  AA           .     TAX
A288  18           .     CLC
A289  60           `     RTS
A28A  01 00        ..    ORA (&00,X)
A28C  20 20 20           JSR &2020
A28F  20 20 20           JSR &2020
A292  20 20 20           JSR &2020
A295  20 20 20           JSR &2020
A298  20 20 20           JSR &2020
A29B  20 20 20           JSR &2020
A29E  20 20 20           JSR &2020
A2A1  20 20 20           JSR &2020
A2A4  20 20 20           JSR &2020
A2A7  20 20 20           JSR &2020
A2AA  20 20 20           JSR &2020
A2AD  20 20 20           JSR &2020
A2B0  20 20 20           JSR &2020
A2B3  20 20 20           JSR &2020
A2B6  A9 09        ..    LDA #&09
A2B8  8D 00 7A     ..z   STA &7A00
A2BB  A9 00        ..    LDA #&00
A2BD  8D 01 7A     ..z   STA &7A01
A2C0  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A2C3  A9 0E        ..    LDA #&0E
A2C5  8D 00 7A     ..z   STA &7A00
A2C8  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A2CB  A9 0C        ..    LDA #&0C
A2CD  8D 00 7A     ..z   STA &7A00
A2D0  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A2D3  A2 00        ..    LDX #&00
A2D5  BD 58 7A     .Xz   LDA &7A58,X
A2D8  9D 00 01     ...   STA &0100,X
A2DB  E8           .     INX
A2DC  D0 F7        ..    BNE &A2D5
A2DE  AE 57 7A     .Wz   LDX &7A57
A2E1  9A           .     TXS
A2E2  68           h     PLA
A2E3  8D 03 02     ...   STA brkv+1
A2E6  68           h     PLA
A2E7  8D 02 02     ...   STA brkv
A2EA  A9 16        ..    LDA #&16                 ; Set screen mode
A2EC  20 EE FF      ..   JSR oswrch
A2EF  A9 07        ..    LDA #&07                 ; Mode 7
A2F1  20 EE FF      ..   JSR oswrch
A2F4  A9 04        ..    LDA #&04                 ; Define action of cursor editing keys
A2F6  A2 00        ..    LDX #&00                 ; Cursor keys have editing effect
A2F8  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A2FB  A9 0C        ..    LDA #&0C                 ; Auto Repeat Period
A2FD  A2 00        ..    LDX #&00                 ; Delay = 0 cs
A2FF  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A302  A9 E1        ..    LDA #&E1                 ; Read/Write Interpretation of F-Keys
A304  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
A307  A9 E2        ..    LDA #&E2                 ; Read/Write Interpretation of Shift-F-Keys
A309  A2 80        ..    LDX #&80
A30B  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A30E  A9 E3        ..    LDA #&E3                 ; Read/Write Interpretation of Ctrl-F-Keys
A310  A2 90        ..    LDX #&90
A312  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A315  A9 E5        ..    LDA #&E5                 ; Read/Write ESCAPE key status
A317  A2 00        ..    LDX #&00                 ; ESCAPE will cause an ESCAPE condition
A319  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
A31C  20 8A 89      ..   JSR &898A                ; Check if the TUBE is active
A31F  F0 09        ..    BEQ &A32A
A321  68           h     PLA
A322  AA           .     TAX
A323  68           h     PLA
A324  A8           .     TAY
A325  68           h     PLA
A326  A9 00        ..    LDA #&00
A328  28           (     PLP
A329  60           `     RTS
.
A32A  A9 BB        ..    LDA #&BB                 ; Read ROM number of BASIC
A32C  A2 00        ..    LDX #&00
A32E  A0 FF        ..    LDY #&FF
A330  20 F4 FF      ..   JSR osbyte
A333  A9 8E        ..    LDA #&8E                 ; Enter Langauge ROM
A335  4C F4 FF     L..   JMP osbyte               ; *BASIC

; -----------------------------------------------------------------------------
; Perform OSWORD &7A with parameterblock at &7A00
; -----------------------------------------------------------------------------
.
A338  A2 00        ..    LDX #&00
A33A  A0 7A        .z    LDY #&7A
A33C  4C 43 A3     LC.   JMP &A343                ; Perform OSWORD &7A with parameterblock at &7A00

; -----------------------------------------------------------------------------
; Perform OSWORD &7A with parameterblock at &7A12
; -----------------------------------------------------------------------------
.
A33F  A2 12        ..    LDX #&12
A341  A0 7A        .z    LDY #&7A
.
A343  A9 7A        .z    LDA #&7A
A345  4C F1 FF     L..   JMP osword               ; Perform OSWORD &7A with parameterblock at &7A12

.
A348  A9 03        ..    LDA #&03
A34A  8D 12 7A     ..z   STA &7A12
A34D  A9 01        ..    LDA #&01
A34F  8D 13 7A     ..z   STA &7A13
A352  A9 00        ..    LDA #&00
A354  8D 14 7A     ..z   STA &7A14
A357  A9 05        ..    LDA #&05
A359  8D 00 7A     ..z   STA &7A00
A35C  A9 01        ..    LDA #&01
A35E  8D 01 7A     ..z   STA &7A01
A361  A9 00        ..    LDA #&00
A363  8D 06 7A     ..z   STA &7A06
A366  A9 6D        .m    LDA #&6D
A368  8D 07 7A     ..z   STA &7A07
A36B  A9 FF        ..    LDA #&FF
A36D  8D 08 7A     ..z   STA &7A08
A370  8D 09 7A     ..z   STA &7A09
A373  A9 00        ..    LDA #&00
A375  85 82        ..    STA &82
A377  A9 4A        .J    LDA #&4A
A379  85 83        ..    STA &83
A37B  20 90 A4      ..   JSR &A490
A37E  90 03        ..    BCC &A383
A380  A9 00        ..    LDA #&00
A382  60           `     RTS
A383  A0 01        ..    LDY #&01
A385  B1 84        ..    LDA (&84),Y
A387  AA           .     TAX
A388  BD AF 91     ...   LDA hamtable,X
A38B  30 43        0C    BMI &A3D0
A38D  29 0F        ).    AND #&0F
A38F  99 76 00     .v.   STA &0076,Y
A392  C8           .     INY
A393  C0 07        ..    CPY #&07
A395  D0 EE        ..    BNE &A385
A397  20 55 91      U.   JSR &9155
A39A  A5 75        .u    LDA &75
A39C  4A           J     LSR A
A39D  4A           J     LSR A
A39E  4A           J     LSR A
A39F  4D 00 4A     M.J   EOR &4A00
A3A2  F0 2C        .,    BEQ &A3D0
A3A4  8D 02 7A     ..z   STA &7A02
A3A7  A5 72        .r    LDA &72
A3A9  C9 FF        ..    CMP #&FF
A3AB  F0 23        .#    BEQ &A3D0
A3AD  A5 72        .r    LDA &72
A3AF  8D 03 7A     ..z   STA &7A03
A3B2  A5 73        .s    LDA &73
A3B4  8D 04 7A     ..z   STA &7A04
A3B7  A5 74        .t    LDA &74
A3B9  8D 05 7A     ..z   STA &7A05
A3BC  05 73        .s    ORA &73
A3BE  D0 0A        ..    BNE &A3CA
A3C0  A9 3F        .?    LDA #&3F
A3C2  8D 04 7A     ..z   STA &7A04
A3C5  A9 7F        .    LDA #&7F
A3C7  8D 05 7A     ..z   STA &7A05
A3CA  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A3CD  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
A3D0  EE 13 7A     ..z   INC &7A13
A3D3  EE 01 7A     ..z   INC &7A01
A3D6  38           8     SEC
A3D7  AD 07 7A     ..z   LDA &7A07
A3DA  E9 05        ..    SBC #&05
A3DC  8D 07 7A     ..z   STA &7A07
A3DF  18           .     CLC
A3E0  A5 84        ..    LDA &84
A3E2  69 06        i.    ADC #&06
A3E4  85 84        ..    STA &84
A3E6  A5 85        ..    LDA &85
A3E8  69 00        i.    ADC #&00
A3EA  85 85        ..    STA &85
A3EC  AD 01 7A     ..z   LDA &7A01
A3EF  C9 07        ..    CMP #&07
A3F1  D0 90        ..    BNE &A383
A3F3  A9 01        ..    LDA #&01
A3F5  8D 01 7A     ..z   STA &7A01
A3F8  A9 00        ..    LDA #&00
A3FA  85 82        ..    STA &82
A3FC  A9 6D        .m    LDA #&6D
A3FE  85 83        ..    STA &83
A400  A9 04        ..    LDA #&04
A402  8D 00 7A     ..z   STA &7A00
A405  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A408  A5 82        ..    LDA &82
A40A  85 84        ..    STA &84
A40C  A5 83        ..    LDA &83
A40E  85 85        ..    STA &85
A410  A0 00        ..    LDY #&00
A412  B1 84        ..    LDA (&84),Y
A414  CD 02 7A     ..z   CMP &7A02
A417  D0 52        .R    BNE &A46B
A419  C8           .     INY
A41A  C8           .     INY
A41B  B1 84        ..    LDA (&84),Y
A41D  CD 03 7A     ..z   CMP &7A03
A420  D0 49        .I    BNE &A46B
A422  AD 04 7A     ..z   LDA &7A04
A425  C9 3F        .?    CMP #&3F
A427  D0 07        ..    BNE &A430
A429  AD 05 7A     ..z   LDA &7A05
A42C  C9 7F        .    CMP #&7F
A42E  F0 10        ..    BEQ &A440
A430  C8           .     INY
A431  B1 84        ..    LDA (&84),Y
A433  CD 04 7A     ..z   CMP &7A04
A436  D0 33        .3    BNE &A46B
A438  C8           .     INY
A439  B1 84        ..    LDA (&84),Y
A43B  CD 05 7A     ..z   CMP &7A05
A43E  D0 2B        .+    BNE &A46B
A440  A2 00        ..    LDX #&00
A442  A0 00        ..    LDY #&00
A444  B1 84        ..    LDA (&84),Y
A446  91 82        ..    STA (&82),Y
A448  C8           .     INY
A449  D0 F9        ..    BNE &A444
A44B  E6 83        ..    INC &83
A44D  E6 85        ..    INC &85
A44F  E8           .     INX
A450  E0 05        ..    CPX #&05
A452  D0 F0        ..    BNE &A444
A454  A9 03        ..    LDA #&03
A456  8D 00 7A     ..z   STA &7A00
A459  A9 2A        .*    LDA #&2A
A45B  8D 02 7A     ..z   STA &7A02
A45E  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A461  38           8     SEC
A462  A5 83        ..    LDA &83
A464  E9 05        ..    SBC #&05
A466  85 83        ..    STA &83
A468  4C 79 A4     Ly.   JMP &A479
A46B  38           8     SEC
A46C  A5 85        ..    LDA &85
A46E  E9 05        ..    SBC #&05
A470  85 85        ..    STA &85
A472  C9 4A        .J    CMP #&4A
A474  F0 03        ..    BEQ &A479
A476  4C 10 A4     L..   JMP &A410
A479  38           8     SEC
A47A  A5 83        ..    LDA &83
A47C  E9 05        ..    SBC #&05
A47E  85 83        ..    STA &83
A480  EE 01 7A     ..z   INC &7A01
A483  AD 01 7A     ..z   LDA &7A01
A486  C9 07        ..    CMP #&07
A488  F0 03        ..    BEQ &A48D
A48A  4C 00 A4     L..   JMP &A400
A48D  A9 01        ..    LDA #&01
A48F  60           `     RTS
A490  A2 1B        ..    LDX #&1B
A492  20 45 A2      E.   JSR &A245
A495  B0 1C        ..    BCS &A4B3
A497  A0 00        ..    LDY #&00
A499  B1 84        ..    LDA (&84),Y
A49B  AA           .     TAX
A49C  BD AF 91     ...   LDA hamtable,X
A49F  29 0F        ).    AND #&0F
A4A1  F0 12        ..    BEQ &A4B5
A4A3  18           .     CLC
A4A4  A5 84        ..    LDA &84
A4A6  69 2A        i*    ADC #&2A
A4A8  85 82        ..    STA &82
A4AA  A5 85        ..    LDA &85
A4AC  69 00        i.    ADC #&00
A4AE  85 83        ..    STA &83
A4B0  4C 90 A4     L..   JMP &A490
A4B3  38           8     SEC
A4B4  60           `     RTS
A4B5  A0 25        .%    LDY #&25
A4B7  B1 84        ..    LDA (&84),Y
A4B9  AA           .     TAX
A4BA  BD AF 91     ...   LDA hamtable,X
A4BD  29 0F        ).    AND #&0F
A4BF  8D 53 7A     .Sz   STA &7A53
A4C2  C8           .     INY
A4C3  B1 84        ..    LDA (&84),Y
A4C5  8D 4B 7A     .Kz   STA &7A4B
A4C8  C8           .     INY
A4C9  B1 84        ..    LDA (&84),Y
A4CB  8D 4C 7A     .Lz   STA &7A4C
A4CE  18           .     CLC
A4CF  60           `     RTS
A4D0  A9 01        ..    LDA #&01
A4D2  A2 00        ..    LDX #&00
A4D4  A0 6D        .m    LDY #&6D
A4D6  4C 30 A5     L0.   JMP &A530
A4D9  AD 53 7A     .Sz   LDA &7A53
A4DC  29 08        ).    AND #&08
A4DE  F0 0A        ..    BEQ &A4EA
A4E0  AD 53 7A     .Sz   LDA &7A53
A4E3  29 01        ).    AND #&01
A4E5  D0 03        ..    BNE &A4EA
A4E7  4C 49 A5     LI.   JMP &A549
A4EA  A9 02        ..    LDA #&02
A4EC  A2 00        ..    LDX #&00
A4EE  A0 68        .h    LDY #&68
A4F0  4C 30 A5     L0.   JMP &A530
A4F3  AD 53 7A     .Sz   LDA &7A53
A4F6  29 08        ).    AND #&08
A4F8  F0 0A        ..    BEQ &A504
A4FA  AD 53 7A     .Sz   LDA &7A53
A4FD  29 02        ).    AND #&02
A4FF  D0 03        ..    BNE &A504
A501  4C 49 A5     LI.   JMP &A549
A504  A9 03        ..    LDA #&03
A506  A2 00        ..    LDX #&00
A508  A0 63        .c    LDY #&63
A50A  4C 30 A5     L0.   JMP &A530
A50D  AD 53 7A     .Sz   LDA &7A53
A510  29 08        ).    AND #&08
A512  F0 0A        ..    BEQ &A51E
A514  AD 53 7A     .Sz   LDA &7A53
A517  29 04        ).    AND #&04
A519  D0 03        ..    BNE &A51E
A51B  4C 49 A5     LI.   JMP &A549
A51E  A9 04        ..    LDA #&04
A520  A2 00        ..    LDX #&00
A522  A0 5E        .^    LDY #&5E
A524  4C 30 A5     L0.   JMP &A530
A527  A9 06        ..    LDA #&06
A529  A2 00        ..    LDX #&00
A52B  A0 54        .T    LDY #&54
A52D  4C 30 A5     L0.   JMP &A530
A530  86 82        ..    STX &82
A532  84 83        ..    STY &83
A534  8D 01 7A     ..z   STA &7A01
A537  8D 13 7A     ..z   STA &7A13
A53A  A9 04        ..    LDA #&04
A53C  8D 00 7A     ..z   STA &7A00
A53F  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A542  AD 03 7A     ..z   LDA &7A03
A545  C9 FF        ..    CMP #&FF
A547  D0 12        ..    BNE &A55B
A549  AD 01 7A     ..z   LDA &7A01
A54C  C9 06        ..    CMP #&06
A54E  D0 03        ..    BNE &A553
A550  4C 79 98     Ly.   JMP &9879
A553  A9 07        ..    LDA #&07
A555  20 EE FF      ..   JSR oswrch
A558  4C 02 99     L..   JMP &9902
A55B  A9 87        ..    LDA #&87
A55D  8D 5E 7B     .^{   STA &7B5E
A560  A9 00        ..    LDA #&00
A562  8D 01 7A     ..z   STA &7A01
A565  A9 00        ..    LDA #&00
A567  8D 06 7A     ..z   STA &7A06
A56A  A9 4A        .J    LDA #&4A
A56C  8D 07 7A     ..z   STA &7A07
A56F  A9 05        ..    LDA #&05
A571  8D 00 7A     ..z   STA &7A00
A574  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A577  AD 02 7A     ..z   LDA &7A02
A57A  18           .     CLC
A57B  69 30        i0    ADC #&30
A57D  C9 30        .0    CMP #&30
A57F  D0 02        ..    BNE &A583
A581  A9 38        .8    LDA #&38
A583  8D 26 7A     .&z   STA &7A26
A586  AD 03 7A     ..z   LDA &7A03
A589  29 F0        ).    AND #&F0
A58B  4A           J     LSR A
A58C  4A           J     LSR A
A58D  4A           J     LSR A
A58E  4A           J     LSR A
A58F  18           .     CLC
A590  69 30        i0    ADC #&30
A592  8D 27 7A     .'z   STA &7A27
A595  AD 03 7A     ..z   LDA &7A03
A598  29 0F        ).    AND #&0F
A59A  18           .     CLC
A59B  69 30        i0    ADC #&30
A59D  8D 28 7A     .(z   STA &7A28
A5A0  A9 03        ..    LDA #&03
A5A2  8D 25 7A     .%z   STA &7A25
A5A5  A9 04        ..    LDA #&04
A5A7  8D 2A 7A     .*z   STA &7A2A
A5AA  20 8B 9C      ..   JSR &9C8B
A5AD  A9 03        ..    LDA #&03
A5AF  8D 00 7A     ..z   STA &7A00
A5B2  A9 00        ..    LDA #&00
A5B4  8D 02 7A     ..z   STA &7A02
A5B7  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A5BA  A9 00        ..    LDA #&00
A5BC  8D 54 7A     .Tz   STA &7A54
A5BF  A9 02        ..    LDA #&02
A5C1  8D 12 7A     ..z   STA &7A12
A5C4  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
A5C7  AD 14 7A     ..z   LDA &7A14
A5CA  29 02        ).    AND #&02
A5CC  D0 0F        ..    BNE &A5DD
A5CE  A9 82        ..    LDA #&82
A5D0  20 5E 9F      ^.   JSR &9F5E                          ; Write character at position 7,0
A5D3  AD 14 7A     ..z   LDA &7A14
A5D6  29 04        ).    AND #&04
A5D8  F0 61        .a    BEQ &A63B
A5DA  4C BF A5     L..   JMP &A5BF
A5DD  A9 03        ..    LDA #&03
A5DF  8D 00 7A     ..z   STA &7A00
A5E2  A9 00        ..    LDA #&00
A5E4  8D 01 7A     ..z   STA &7A01
A5E7  A9 01        ..    LDA #&01
A5E9  8D 02 7A     ..z   STA &7A02
A5EC  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A5EF  A9 00        ..    LDA #&00
A5F1  85 84        ..    STA &84
A5F3  A9 4A        .J    LDA #&4A
A5F5  85 85        ..    STA &85
A5F7  A2 00        ..    LDX #&00
A5F9  A0 00        ..    LDY #&00
A5FB  B1 82        ..    LDA (&82),Y
A5FD  91 84        ..    STA (&84),Y
A5FF  C8           .     INY
A600  D0 F9        ..    BNE &A5FB
A602  E6 83        ..    INC &83
A604  E6 85        ..    INC &85
A606  E8           .     INX
A607  E0 06        ..    CPX #&06
A609  D0 EE        ..    BNE &A5F9
A60B  A9 03        ..    LDA #&03
A60D  8D 00 7A     ..z   STA &7A00
A610  A9 00        ..    LDA #&00
A612  8D 01 7A     ..z   STA &7A01
A615  8D 02 7A     ..z   STA &7A02
A618  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A61B  A9 10        ..    LDA #&10
A61D  8D 00 7A     ..z   STA &7A00
A620  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A623  A9 09        ..    LDA #&09
A625  8D 00 7A     ..z   STA &7A00
A628  A9 01        ..    LDA #&01
A62A  8D 01 7A     ..z   STA &7A01
A62D  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A630  A9 87        ..    LDA #&87
A632  20 5E 9F      ^.   JSR &9F5E                          ; Write character at position 7,0
A635  20 3C 9D      <.   JSR &9D3C
A638  20 50 A1      P.   JSR &A150
A63B  4C 02 99     L..   JMP &9902
A63E  20 45 A1      E.   JSR &A145
A641  A9 04        ..    LDA #&04
A643  8D 00 7A     ..z   STA &7A00
A646  A9 01        ..    LDA #&01
A648  8D 01 7A     ..z   STA &7A01
A64B  A9 02        ..    LDA #&02
A64D  8D 12 7A     ..z   STA &7A12
A650  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A653  AD 02 7A     ..z   LDA &7A02
A656  C9 FF        ..    CMP #&FF
A658  F0 4B        .K    BEQ &A6A5
A65A  A9 1F        ..    LDA #&1F
A65C  20 EE FF      ..   JSR oswrch
A65F  AD 12 7A     ..z   LDA &7A12
A662  20 EE FF      ..   JSR oswrch
A665  A9 18        ..    LDA #&18
A667  20 EE FF      ..   JSR oswrch
A66A  AD 01 7A     ..z   LDA &7A01
A66D  A8           .     TAY
A66E  B9 BC A6     ...   LDA &A6BC,Y
A671  20 EE FF      ..   JSR oswrch
A674  A9 03        ..    LDA #&03
A676  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

A679  FF           .     EQUB &FF                 ; Block
A67A  87           .     EQUB &87                 ; Alphanumeric white
A67B  50           P     EQUS "P"

A67C  AD 02 7A     ..z   LDA &7A02
A67F  18           .     CLC
A680  69 30        i0    ADC #&30
A682  C9 30        .0    CMP #&30
A684  D0 02        ..    BNE &A688
A686  A9 38        .8    LDA #&38
A688  20 EE FF      ..   JSR oswrch
A68B  AD 03 7A     ..z   LDA &7A03
A68E  29 F0        ).    AND #&F0
A690  4A           J     LSR A
A691  4A           J     LSR A
A692  4A           J     LSR A
A693  4A           J     LSR A
A694  18           .     CLC
A695  69 30        i0    ADC #&30
A697  20 EE FF      ..   JSR oswrch
A69A  AD 03 7A     ..z   LDA &7A03
A69D  29 0F        ).    AND #&0F
A69F  18           .     CLC
A6A0  69 30        i0    ADC #&30
A6A2  20 EE FF      ..   JSR oswrch
A6A5  EE 01 7A     ..z   INC &7A01
A6A8  18           .     CLC
A6A9  AD 12 7A     ..z   LDA &7A12
A6AC  69 09        i.    ADC #&09
A6AE  8D 12 7A     ..z   STA &7A12
A6B1  AD 01 7A     ..z   LDA &7A01
A6B4  C9 05        ..    CMP #&05
A6B6  F0 03        ..    BEQ &A6BB
A6B8  4C 50 A6     LP.   JMP &A650
A6BB  60           `     RTS
A6BC  00           .     BRK
A6BD  81 82        ..    STA (&82,X)
A6BF  83           .     ...
A6C0  86 A9        ..    STX &A9
A6C2  00           .     BRK
A6C3  85 82        ..    STA &82
A6C5  A9 7C        .|    LDA #&7C
A6C7  85 83        ..    STA &83
A6C9  A9 00        ..    LDA #&00
A6CB  85 84        ..    STA &84
A6CD  A9 72        .r    LDA #&72
A6CF  85 85        ..    STA &85
A6D1  A9 00        ..    LDA #&00
A6D3  85 86        ..    STA &86
A6D5  A9 76        .v    LDA #&76
A6D7  85 87        ..    STA &87
A6D9  A0 28        .(    LDY #&28
A6DB  B1 82        ..    LDA (&82),Y
A6DD  D1 84        ..    CMP (&84),Y
A6DF  D0 04        ..    BNE &A6E5
A6E1  C8           .     INY
A6E2  D0 F7        ..    BNE &A6DB
A6E4  60           `     RTS
A6E5  A2 00        ..    LDX #&00
A6E7  BD 26 A7     .&.   LDA &A726,X
A6EA  85 77        .w    STA &77
A6EC  A0 00        ..    LDY #&00
A6EE  B1 84        ..    LDA (&84),Y
A6F0  91 86        ..    STA (&86),Y
A6F2  B1 82        ..    LDA (&82),Y
A6F4  91 84        ..    STA (&84),Y
A6F6  C8           .     INY
A6F7  C4 77        .w    CPY &77
A6F9  D0 F3        ..    BNE &A6EE
A6FB  E6 83        ..    INC &83
A6FD  E6 85        ..    INC &85
A6FF  E6 87        ..    INC &87
A701  E8           .     INX
A702  E0 04        ..    CPX #&04
A704  D0 E1        ..    BNE &A6E7
A706  C6 87        ..    DEC &87
A708  A0 C0        ..    LDY #&C0
A70A  A2 00        ..    LDX #&00
A70C  BD 2A A7     .*.   LDA &A72A,X
A70F  91 86        ..    STA (&86),Y
A711  E8           .     INX
A712  C8           .     INY
A713  E0 0E        ..    CPX #&0E
A715  D0 F5        ..    BNE &A70C
A717  A9 A0        ..    LDA #&A0
A719  91 86        ..    STA (&86),Y
A71B  C8           .     INY
A71C  C0 E8        ..    CPY #&E8
A71E  D0 F9        ..    BNE &A719
A720  A9 00        ..    LDA #&00
A722  8D 55 7A     .Uz   STA &7A55
A725  60           `     RTS
A726  00           .     BRK
A727  00           .     BRK
A728  00           .     BRK
A729  E8           .     INX
A72A  20 50 72      Pr   JSR &7250
A72D  65 76        ev    ADC &76
A72F  69 6F        io    ADC #&6F
A731  75 73        us    ADC &73,X
A733  20 50 61      Pa   JSR &6150
A736  67           g     ...
A737  65 A9        e.    ADC &A9
A739  00           .     BRK
A73A  85 82        ..    STA &82
A73C  A9 7C        .|    LDA #&7C
A73E  85 83        ..    STA &83
A740  AD 55 7A     .Uz   LDA &7A55
A743  30 30        00    BMI &A775
A745  F0 0B        ..    BEQ &A752
A747  A9 00        ..    LDA #&00
A749  85 84        ..    STA &84
A74B  A9 72        .r    LDA #&72
A74D  85 85        ..    STA &85
A74F  4C 5A A7     LZ.   JMP &A75A
A752  A9 00        ..    LDA #&00
A754  85 84        ..    STA &84
A756  A9 76        .v    LDA #&76
A758  85 85        ..    STA &85
A75A  A2 00        ..    LDX #&00
A75C  BD 26 A7     .&.   LDA &A726,X
A75F  85 77        .w    STA &77
A761  A0 00        ..    LDY #&00
A763  B1 84        ..    LDA (&84),Y
A765  91 82        ..    STA (&82),Y
A767  C8           .     INY
A768  C4 77        .w    CPY &77
A76A  D0 F7        ..    BNE &A763
A76C  E6 83        ..    INC &83
A76E  E6 85        ..    INC &85
A770  E8           .     INX
A771  E0 04        ..    CPX #&04
A773  D0 E7        ..    BNE &A75C
A775  60           `     RTS
A776  20 45 A1      E.   JSR &A145
A779  A9 05        ..    LDA #&05
A77B  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length

A77E  1A           .     EQUB &1A                 ; Reset windows, home cursors and reset graphics origin
A77F  1F           .     EQUB &1F                 ; Place text cursor at 1,24
A780  01 18        ..    EQUW &0118
A782  2A           *     EQUS "*"

A783  20 F9 A0      ..   JSR &A0F9
A786  AD 2D 7A     .-z   LDA &7A2D
A789  C9 0D        ..    CMP #&0D
A78B  D0 0F        ..    BNE &A79C
A78D  20 BE A0      ..   JSR &A0BE
A790  20 86 A0      ..   JSR &A086
A793  20 8B 9C      ..   JSR &9C8B
A796  20 50 A1      P.   JSR &A150
A799  4C 02 99     L..   JMP &9902
A79C  A0 00        ..    LDY #&00
A79E  B9 FB A7     ...   LDA &A7FB,Y
A7A1  99 C0 7F     ..   STA &7FC0,Y
A7A4  C8           .     INY
A7A5  C0 28        .(    CPY #&28
A7A7  D0 F5        ..    BNE &A79E
A7A9  A9 15        ..    LDA #&15
A7AB  20 1A BB      ..   JSR &BB1A                          ; Write the following characters; A=length

A7AE  1A           .     EQUB &1A                           ; Reset windows, home cursors and reset graphics origin
A7AF  1E           .     EQUB &1E                           ; Home text cursor
A7B0  4F 53 20 43  OS C  EQUS "OS Cmnd"
      6D 6E 64
A7B7  1C           .     EQUB &1C                           ; Set up a text window
A7B8  00           .     EQUB &00                           ; left = 0
A7B9  17           .     EQUB &17                           ; bottom = 23
A7BA  27           '     EQUB &27                           ; right = 39
A7BB  01           .     EQUB &01                           ; top = 1
A7BC  0C           .     EQUB &0C                           ; Clear text screen
A7BD  1C           .     EQUB &1C                           ; Set up a text window
A7BE  00           .     EQUB &00                           ; left = 0
A7BF  16           .     EQUB &16                           ; bottom = 22
A7C0  27           '     EQUB &27                           ; right = 39
A7C1  02           .     EQUB &02                           ; top = 2
A7C2  0E           .     EQUB &0E                           ; Enter paged mode

A7C3  20 43 A8     C.    JSR &A843
A7C6  A9 E5        ..    LDA #&E5                           ; Read/Write ESCAPE key status
A7C8  A2 00        ..    LDX #&00                           ; ESCAPE will cause an ESCAPE condition
A7CA  A0 00        ..    LDY #&00
A7CC  20 F4 FF      ..   JSR osbyte
A7CF  A2 2D        .-    LDX #&2D
A7D1  A0 7A        .z    LDY #&7A
A7D3  20 F7 FF      ..   JSR oscli
A7D6  A9 E5        ..    LDA #&E5                           ; Read/Write ESCAPE key status
A7D8  A2 01        ..    LDX #&01                           ; ESCAPE will insert it's ASCII value (usually 27) into the input buffer
A7DA  A0 00        ..    LDY #&00
A7DC  20 F4 FF      ..   JSR osbyte
A7DF  A9 0F        ..    LDA #&0F
A7E1  20 EE FF      ..   JSR oswrch
A7E4  20 3B A0      ;.   JSR &A03B
A7E7  C9 2A        .*    CMP #&2A
A7E9  D0 08        ..    BNE &A7F3
A7EB  A9 1A        ..    LDA #&1A
A7ED  20 EE FF      ..   JSR oswrch
A7F0  4C 76 A7     Lv.   JMP &A776
A7F3  A9 1A        ..    LDA #&1A
A7F5  20 EE FF      ..   JSR oswrch
A7F8  4C 8D A7     L..   JMP &A78D
A7FB  97           .     ...
A7FC  AC AC AC     ...   LDY &ACAC
A7FF  AC AC AC     ...   LDY &ACAC
A802  AC 87 50     ..P   LDY &5087
A805  72           r     ...
A806  65 73        es    ADC &73
A808  73           s     ...
A809  85 53        .S    STA &53
A80B  48           H     PHA
A80C  49 46        IF    EOR #&46
A80E  54           T     ...
A80F  87           .     ...
A810  74           t     ...
A811  6F           o     ...
A812  20 63 6F      co   JSR &6F63
A815  6E 74 69     nti   ROR &6974
A818  6E 75 65     nue   ROR &6575
A81B  97           .     ...
A81C  AC AC AC     ...   LDY &ACAC
A81F  AC AC AC     ...   LDY &ACAC
A822  AC 4C 02     .L.   LDY &024C
A825  99 A9 01     ...   STA &01A9,Y
A828  D0 02        ..    BNE &A82C

; -----------------------------------------------------------------------------
; VDU 23, 0, 0, 0, 0, 0, 0, 0, 0, 0
; -----------------------------------------------------------------------------
.
A82A  A9 00        ..    LDA #&00
A82C  48           H     PHA
A82D  A9 02        ..    LDA #&02
A82F  20 1A BB      ..   JSR &BB1A                          ; Write the following characters; A=length

A832  17 01        ..    EQUW &1701                         ; Change cursor appearance

A834  68           h     PLA
A835  20 EE FF      ..   JSR oswrch
A838  A9 00        ..    LDA #&00
A83A  A2 08        ..    LDX #&08
.
A83C  20 EE FF      ..   JSR oswrch
A83F  CA           .     DEX
A840  D0 FA        ..    BNE &A83C
A842  60           `     RTS

; -----------------------------------------------------------------------------
; Set up new BRKV handler
; -----------------------------------------------------------------------------
.
A843  A9 03        ..    LDA #&03
A845  8D 02 02     ...   STA brkv                           ; Point LSB of BRKV to the extended vector table entry for BRKV (&FF03)
A848  A9 FF        ..    LDA #&FF
A84A  8D 03 02     ...   STA brkv+1                         ; Point MSB of BRKV to the extended vector table entry for BRKV (&FF03)
A84D  A9 A8        ..    LDA #&A8                           ; Read address of extended vector table (&0D9F)
A84F  A2 00        ..    LDX #&00
A851  A0 FF        ..    LDY #&FF
A853  20 F4 FF      ..   JSR osbyte
A856  86 82        ..    STX &82
A858  84 83        ..    STY &83
A85A  A0 03        ..    LDY #&03                           ; Offset = &03 : extended BRKV
A85C  A9 6B        .k    LDA #&6B
A85E  91 82        ..    STA (&82),Y                        ; Store LSB of the new BRKV handler in the extended vectors table
A860  C8           .     INY
A861  A9 A8        ..    LDA #&A8
A863  91 82        ..    STA (&82),Y                        ; Store MSB of the new BRKV handler in the extended vectors table
A865  C8           .     INY
A866  A5 F4        ..    LDA &F4
A868  91 82        ..    STA (&82),Y                        ; Store ROM number in the extended vectors table
A86A  60           `     RTS

; -----------------------------------------------------------------------------
; New BRK
; -----------------------------------------------------------------------------
.
A86B  A2 FF        ..    LDX #&FF
A86D  9A           .     TXS
A86E  A9 E5        ..    LDA #&E5                           ; Read/Write ESCAPE key status
A870  A2 01        ..    LDX #&01                           ; ESCAPE will insert it's ASCII value (usually 27) into the input buffer
A872  A0 00        ..    LDY #&00
A874  20 F4 FF      ..   JSR osbyte
A877  A5 FF        ..    LDA &FF                            ; Poll escape flag
A879  10 09        ..    BPL &A884                          ; Jump if escape not pressed

.
A87B  A9 7E        .~    LDA #&7E
A87D  20 F4 FF      ..   JSR osbyte                         ; Acknowledge escape
A880  E0 FF        ..    CPX #&FF
A882  D0 F7        ..    BNE &A87B
.
A884  A9 00        ..    LDA #&00                           ; Close all open files
A886  A8           .     TAY
A887  AA           .     TAX
A888  20 CE FF      ..   JSR osfind
A88B  A9 06        ..    LDA #&06
A88D  20 1A BB      ..   JSR &BB1A                          ; Write the following characters; A=length

A890  1C           .     EQUB &1C                           ; Set up a text window
A891  00           .     EQUB &00                           ; left = 0
A892  18           .     EQUB &18                           ; bottom = 24
A893  27           '     EQUB &27                           ; right = 39
A894  14           .     EQUB &14                           ; top = &20
A895  0C           .     EQUB &0C                           ; Clear text window and move text cursor home

A896  A9 00        ..    LDA #&00
A898  20 41 BB      A.   JSR &BB41
A89B  A9 0C        ..    LDA #&0C
A89D  20 1A BB      ..   JSR &BB1A                          ; Write the following characters; A=length

A8A0  0A           .     ASL A
A8A1  20 45 72      Er   JSR &7245
A8A4  72           r     ...
A8A5  6F           o     ...
A8A6  72           r     ...
A8A7  20 3A 81      :.   JSR &813A
A8AA  9D 83

A8AC  A0 01        ..    LDY #&01

.
A8AE  B1 FD        ..    LDA (&FD),Y
A8B0  20 EE FF      ..   JSR &FFEE
A8B3  C8           .     INY
A8B4  C0 19        ..    CPY #&19
A8B6  F0 04        ..    BEQ &A8BC
A8B8  C9 00        ..    CMP #&00
A8BA  D0 F2        ..    BNE &A8AE

.
A8BC  A9 03        ..    LDA #&03
A8BE  20 1A BB      ..   JSR &BB1A                          ; Write the following characters; A=length
A8C1  20 20 9C       .   JSR &9C20
A8C4  20 3B A0      ;.   JSR &A03B
A8C7  A9 1A        ..    LDA #&1A
A8C9  20 EE FF      ..   JSR oswrch
A8CC  A9 0D        ..    LDA #&0D
A8CE  8D 00 7A     ..z   STA &7A00
A8D1  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A8D4  A9 09        ..    LDA #&09
A8D6  8D 00 7A     ..z   STA &7A00
A8D9  A9 01        ..    LDA #&01
A8DB  8D 01 7A     ..z   STA &7A01
A8DE  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A8E1  A9 04        ..    LDA #&04
A8E3  8D 2A 7A     .*z   STA &7A2A
A8E6  20 E3 9E      ..   JSR &9EE3
A8E9  4C 8D A7     L..   JMP &A78D
A8EC  20 45 A1      E.   JSR &A145
A8EF  A9 04        ..    LDA #&04
A8F1  8D 12 7A     ..z   STA &7A12
A8F4  A9 00        ..    LDA #&00
A8F6  8D 13 7A     ..z   STA &7A13
A8F9  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
A8FC  A9 08        ..    LDA #&08
A8FE  8D 01 7A     ..z   STA &7A01
A901  A9 04        ..    LDA #&04
A903  8D 00 7A     ..z   STA &7A00
A906  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A909  A2 02        ..    LDX #&02
A90B  BD 00 7A     ..z   LDA &7A00,X
A90E  DD 12 7A     ..z   CMP &7A12,X
A911  D0 2D        .-    BNE &A940
A913  E8           .     INX
A914  E0 06        ..    CPX #&06
A916  D0 F3        ..    BNE &A90B
A918  A9 FF        ..    LDA #&FF
A91A  A2 02        ..    LDX #&02
A91C  9D 00 7A     ..z   STA &7A00,X
A91F  E8           .     INX
A920  E0 0A        ..    CPX #&0A
A922  D0 F8        ..    BNE &A91C
A924  A9 05        ..    LDA #&05
A926  8D 00 7A     ..z   STA &7A00
A929  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A92C  A9 03        ..    LDA #&03
A92E  8D 00 7A     ..z   STA &7A00
A931  A9 00        ..    LDA #&00
A933  8D 02 7A     ..z   STA &7A02
A936  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A939  A2 62        .b    LDX #&62
A93B  A0 AA        ..    LDY #&AA
A93D  4C 21 AA     L!.   JMP &AA21
A940  EE 01 7A     ..z   INC &7A01
A943  AD 01 7A     ..z   LDA &7A01
A946  CD 5C 7B     .\{   CMP &7B5C
A949  D0 BB        ..    BNE &A906
A94B  A9 08        ..    LDA #&08
A94D  8D 01 7A     ..z   STA &7A01
A950  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A953  AD 02 7A     ..z   LDA &7A02
A956  C9 FF        ..    CMP #&FF
A958  F0 12        ..    BEQ &A96C
A95A  EE 01 7A     ..z   INC &7A01
A95D  AD 01 7A     ..z   LDA &7A01
A960  CD 5C 7B     .\{   CMP &7B5C
A963  D0 EB        ..    BNE &A950
A965  A2 71        .q    LDX #&71
A967  A0 AA        ..    LDY #&AA
A969  4C 21 AA     L!.   JMP &AA21
A96C  A2 02        ..    LDX #&02
A96E  BD 12 7A     ..z   LDA &7A12,X
A971  9D 00 7A     ..z   STA &7A00,X
A974  E8           .     INX
A975  E0 0A        ..    CPX #&0A
A977  D0 F5        ..    BNE &A96E
A979  A9 05        ..    LDA #&05
A97B  8D 00 7A     ..z   STA &7A00
A97E  AD 01 7A     ..z   LDA &7A01
A981  38           8     SEC
A982  E9 08        ..    SBC #&08
A984  A8           .     TAY
A985  AD 58 7B     .X{   LDA &7B58
A988  8D 06 7A     ..z   STA &7A06
A98B  AD 59 7B     .Y{   LDA &7B59
A98E  8D 07 7A     ..z   STA &7A07
A991  C0 00        ..    CPY #&00
A993  F0 0C        ..    BEQ &A9A1
A995  18           .     CLC
A996  AD 07 7A     ..z   LDA &7A07
A999  69 05        i.    ADC #&05
A99B  8D 07 7A     ..z   STA &7A07
A99E  88           .     DEY
A99F  D0 F4        ..    BNE &A995
A9A1  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
A9A4  A9 00        ..    LDA #&00
A9A6  8D 02 7A     ..z   STA &7A02
A9A9  A9 03        ..    LDA #&03
A9AB  8D 00 7A     ..z   STA &7A00
A9AE  AD 00 4A     ..J   LDA &4A00
A9B1  CD 02 7A     ..z   CMP &7A02
A9B4  D0 61        .a    BNE &AA17
A9B6  AD 02 4A     ..J   LDA &4A02
A9B9  CD 03 7A     ..z   CMP &7A03
A9BC  D0 59        .Y    BNE &AA17
A9BE  AD 04 7A     ..z   LDA &7A04
A9C1  C9 3F        .?    CMP #&3F
A9C3  D0 07        ..    BNE &A9CC
A9C5  AD 05 7A     ..z   LDA &7A05
A9C8  C9 7F        .    CMP #&7F
A9CA  F0 10        ..    BEQ &A9DC
A9CC  AD 03 4A     ..J   LDA &4A03
A9CF  CD 04 7A     ..z   CMP &7A04
A9D2  D0 43        .C    BNE &AA17
A9D4  AD 04 4A     ..J   LDA &4A04
A9D7  CD 05 7A     ..z   CMP &7A05
A9DA  D0 3B        .;    BNE &AA17
A9DC  A2 00        ..    LDX #&00
A9DE  A0 00        ..    LDY #&00
A9E0  A9 00        ..    LDA #&00
A9E2  85 82        ..    STA &82
A9E4  A9 4A        .J    LDA #&4A
A9E6  85 83        ..    STA &83
A9E8  AD 06 7A     ..z   LDA &7A06
A9EB  85 84        ..    STA &84
A9ED  AD 07 7A     ..z   LDA &7A07
A9F0  85 85        ..    STA &85
A9F2  30 23        0#    BMI &AA17
A9F4  B1 82        ..    LDA (&82),Y
A9F6  91 84        ..    STA (&84),Y
A9F8  C8           .     INY
A9F9  D0 F9        ..    BNE &A9F4
A9FB  E6 83        ..    INC &83
A9FD  E6 85        ..    INC &85
A9FF  E8           .     INX
AA00  E0 05        ..    CPX #&05
AA02  D0 F0        ..    BNE &A9F4
AA04  AD 01 7A     ..z   LDA &7A01
AA07  8D 13 7A     ..z   STA &7A13
AA0A  A9 03        ..    LDA #&03
AA0C  8D 12 7A     ..z   STA &7A12
AA0F  A9 2A        .*    LDA #&2A
AA11  8D 14 7A     ..z   STA &7A14
AA14  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
AA17  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
AA1A  A2 83        ..    LDX #&83
AA1C  A0 AA        ..    LDY #&AA
AA1E  4C 21 AA     L!.   JMP &AA21
AA21  86 82        ..    STX &82
AA23  84 83        ..    STY &83
AA25  20 45 A1      E.   JSR &A145
AA28  A9 04        ..    LDA #&04
AA2A  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
AA2D  1F           .     ...
AA2E  00           .     BRK
AA2F  18           .     CLC
AA30  07           .     ...
AA31  A0 00        ..    LDY #&00
AA33  B1 82        ..    LDA (&82),Y
AA35  20 EE FF      ..   JSR oswrch
AA38  C8           .     INY
AA39  C9 00        ..    CMP #&00
AA3B  D0 F6        ..    BNE &AA33
AA3D  A2 00        ..    LDX #&00
.
AA3F  8A           .     TXA
AA40  48           H     PHA
AA41  A9 13        ..    LDA #&13
AA43  20 F4 FF      ..   JSR osbyte               ; Wait for Vertical Retrace
AA46  A9 80        ..    LDA #&80                 ; Read keyboard buffer level
AA48  A2 FF        ..    LDX #&FF
AA4A  A0 FF        ..    LDY #&FF
AA4C  20 F4 FF      ..   JSR osbyte
AA4F  E0 00        ..    CPX #&00
AA51  D0 08        ..    BNE &AA5B
AA53  68           h     PLA
AA54  AA           .     TAX
AA55  E8           .     INX
AA56  E0 50        .P    CPX #&50
AA58  D0 E5        ..    BNE &AA3F
AA5A  48           H     PHA
.
AA5B  68           h     PLA
AA5C  20 50 A1      P.   JSR &A150
AA5F  4C 02 99     L..   JMP &9902
AA62  84 9D        ..    STY &9D
AA64  86 52        .R    STX &52
AA66  65 6C        el    ADC &6C
AA68  65 61        ea    ADC &61
AA6A  73           s     ...
AA6B  65 64        ed    ADC &64
AA6D  20 20 9C       .   JSR &9C20
AA70  00           .     BRK
AA71  81 9D        ..    STA (&9D,X)
AA73  83           .     ...
AA74  42           B     ...
AA75  75 66        uf    ADC &66,X
AA77  66 65        fe    ROR &65
AA79  72           r     ...
AA7A  20 46 75      Fu   JSR &7546
AA7D  6C 6C 20     ll    JMP (&206C)
AA80  20 9C 00      ..   JSR &009C
AA83  84 9D        ..    STY &9D
AA85  86 4B        .K    STX &4B
AA87  65 70        ep    ADC &70
AA89  74           t     ...
AA8A  20 20 9C       .   JSR &9C20
AA8D  00           .     BRK
AA8E  A9 14        ..    LDA #&14
AA90  8D 00 7A     ..z   STA &7A00
AA93  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
AA96  20 50 A1      P.   JSR &A150
AA99  4C 02 99     L..   JMP &9902
AA9C  A9 04        ..    LDA #&04
AA9E  8D 00 7A     ..z   STA &7A00
AAA1  A9 08        ..    LDA #&08
AAA3  8D 01 7A     ..z   STA &7A01
AAA6  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
AAA9  AD 00 4A     ..J   LDA &4A00
AAAC  CD 02 7A     ..z   CMP &7A02
AAAF  D0 69        .i    BNE &AB1A
AAB1  AD 02 4A     ..J   LDA &4A02
AAB4  CD 03 7A     ..z   CMP &7A03
AAB7  D0 61        .a    BNE &AB1A
AAB9  AD 04 7A     ..z   LDA &7A04
AABC  C9 3F        .?    CMP #&3F
AABE  D0 07        ..    BNE &AAC7
AAC0  AD 05 7A     ..z   LDA &7A05
AAC3  C9 7F        .    CMP #&7F
AAC5  F0 10        ..    BEQ &AAD7
AAC7  AD 03 4A     ..J   LDA &4A03
AACA  CD 04 7A     ..z   CMP &7A04
AACD  D0 4B        .K    BNE &AB1A
AACF  AD 04 4A     ..J   LDA &4A04
AAD2  CD 05 7A     ..z   CMP &7A05
AAD5  D0 43        .C    BNE &AB1A
AAD7  A2 00        ..    LDX #&00
AAD9  A0 00        ..    LDY #&00
AADB  A9 00        ..    LDA #&00
AADD  85 82        ..    STA &82
AADF  A9 4A        .J    LDA #&4A
AAE1  85 83        ..    STA &83
AAE3  AD 06 7A     ..z   LDA &7A06
AAE6  85 84        ..    STA &84
AAE8  AD 07 7A     ..z   LDA &7A07
AAEB  85 85        ..    STA &85
AAED  30 2B        0+    BMI &AB1A
AAEF  B1 82        ..    LDA (&82),Y
AAF1  91 84        ..    STA (&84),Y
AAF3  C8           .     INY
AAF4  D0 F9        ..    BNE &AAEF
AAF6  E6 83        ..    INC &83
AAF8  E6 85        ..    INC &85
AAFA  E8           .     INX
AAFB  E0 05        ..    CPX #&05
AAFD  D0 F0        ..    BNE &AAEF
AAFF  A9 02        ..    LDA #&02
AB01  8D 12 7A     ..z   STA &7A12
AB04  A9 00        ..    LDA #&00
AB06  8D 13 7A     ..z   STA &7A13
AB09  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
AB0C  AD 01 7A     ..z   LDA &7A01
AB0F  8D 13 7A     ..z   STA &7A13
AB12  A9 03        ..    LDA #&03
AB14  8D 12 7A     ..z   STA &7A12
AB17  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
AB1A  EE 01 7A     ..z   INC &7A01
AB1D  AD 01 7A     ..z   LDA &7A01
AB20  C9 0D        ..    CMP #&0D
AB22  F0 03        ..    BEQ &AB27
AB24  4C A6 AA     L..   JMP &AAA6
AB27  60           `     RTS
AB28  A9 08        ..    LDA #&08
AB2A  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
AB2D  1A           .     ...
AB2E  1C           .     ...
AB2F  00           .     BRK
AB30  18           .     CLC
AB31  27           '     ...
AB32  01 0C        ..    ORA (&0C,X)
AB34  1A           .     ...
AB35  A9 01        ..    LDA #&01
AB37  20 41 BB      A.   JSR &BB41
AB3A  A9 54        .T    LDA #&54
AB3C  85 82        ..    STA &82
AB3E  A9 AC        ..    LDA #&AC
AB40  85 83        ..    STA &83
AB42  A9 04        ..    LDA #&04
AB44  8D 00 7A     ..z   STA &7A00
AB47  A9 00        ..    LDA #&00
AB49  8D 01 7A     ..z   STA &7A01
AB4C  A9 1F        ..    LDA #&1F
AB4E  20 EE FF      ..   JSR oswrch
AB51  AD 01 7A     ..z   LDA &7A01
AB54  C9 0A        ..    CMP #&0A
AB56  B0 04        ..    BCS &AB5C
AB58  A9 00        ..    LDA #&00
AB5A  F0 02        ..    BEQ &AB5E
AB5C  A9 14        ..    LDA #&14
AB5E  20 EE FF      ..   JSR oswrch
AB61  AD 01 7A     ..z   LDA &7A01
AB64  0A           .     ASL A
AB65  C9 14        ..    CMP #&14
AB67  90 03        ..    BCC &AB6C
AB69  38           8     SEC
AB6A  E9 14        ..    SBC #&14
AB6C  18           .     CLC
AB6D  69 03        i.    ADC #&03
AB6F  20 EE FF      ..   JSR oswrch
AB72  AD 01 7A     ..z   LDA &7A01
AB75  C9 08        ..    CMP #&08
AB77  B0 1B        ..    BCS &AB94
AB79  A0 00        ..    LDY #&00
AB7B  B1 82        ..    LDA (&82),Y
AB7D  20 EE FF      ..   JSR oswrch
AB80  C8           .     INY
AB81  C9 00        ..    CMP #&00
AB83  D0 F6        ..    BNE &AB7B
AB85  18           .     CLC
AB86  98           .     TYA
AB87  65 82        e.    ADC &82
AB89  85 82        ..    STA &82
AB8B  A5 83        ..    LDA &83
AB8D  69 00        i.    ADC #&00
AB8F  85 83        ..    STA &83
AB91  4C CA AB     L..   JMP &ABCA
AB94  A2 00        ..    LDX #&00
AB96  BD 9C AC     ...   LDA &AC9C,X
AB99  20 EE FF      ..   JSR oswrch
AB9C  E8           .     INX
AB9D  E0 06        ..    CPX #&06
AB9F  D0 F5        ..    BNE &AB96
ABA1  AD 01 7A     ..z   LDA &7A01
ABA4  38           8     SEC
ABA5  E9 07        ..    SBC #&07
ABA7  C9 0A        ..    CMP #&0A
ABA9  90 0A        ..    BCC &ABB5
ABAB  48           H     PHA
ABAC  A9 31        .1    LDA #&31
ABAE  20 EE FF      ..   JSR oswrch
ABB1  68           h     PLA
ABB2  38           8     SEC
ABB3  E9 0A        ..    SBC #&0A
ABB5  18           .     CLC
ABB6  69 30        i0    ADC #&30
ABB8  20 EE FF      ..   JSR oswrch
ABBB  AD 01 7A     ..z   LDA &7A01
ABBE  38           8     SEC
ABBF  E9 07        ..    SBC #&07
ABC1  C9 0A        ..    CMP #&0A
ABC3  B0 05        ..    BCS &ABCA
ABC5  A9 20        .     LDA #&20
ABC7  20 EE FF      ..   JSR oswrch
ABCA  A9 02        ..    LDA #&02
ABCC  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
ABCF  3A           :     ...
ABD0  20 20 38       8   JSR &3820
ABD3  A3           .     ...
ABD4  20 EB AB      ..   JSR &ABEB
ABD7  EE 01 7A     ..z   INC &7A01
ABDA  AD 01 7A     ..z   LDA &7A01
ABDD  CD 5C 7B     .\{   CMP &7B5C
ABE0  B0 03        ..    BCS &ABE5
ABE2  4C 4C AB     LL.   JMP &AB4C
ABE5  20 3B A0      ;.   JSR &A03B
ABE8  4C 8D A7     L..   JMP &A78D
ABEB  AD 03 7A     ..z   LDA &7A03
ABEE  C9 FF        ..    CMP #&FF
ABF0  D0 0E        ..    BNE &AC00
ABF2  A2 00        ..    LDX #&00
ABF4  BD 4B AC     .K.   LDA &AC4B,X
ABF7  20 EE FF      ..   JSR oswrch
ABFA  E8           .     INX
ABFB  E0 09        ..    CPX #&09
ABFD  D0 F5        ..    BNE &ABF4
ABFF  60           `     RTS
AC00  A9 50        .P    LDA #&50
AC02  20 EE FF      ..   JSR oswrch
AC05  AD 02 7A     ..z   LDA &7A02
AC08  AA           .     TAX
AC09  BD C0 B7     ...   LDA &B7C0,X
AC0C  C9 30        .0    CMP #&30
AC0E  D0 02        ..    BNE &AC12
AC10  A9 38        .8    LDA #&38
AC12  20 EE FF      ..   JSR oswrch
AC15  AD 03 7A     ..z   LDA &7A03
AC18  20 48 AC      H.   JSR &AC48
AC1B  AD 04 7A     ..z   LDA &7A04
AC1E  C9 3F        .?    CMP #&3F
AC20  D0 07        ..    BNE &AC29
AC22  AD 05 7A     ..z   LDA &7A05
AC25  C9 7F        .    CMP #&7F
AC27  F0 14        ..    BEQ &AC3D
AC29  A9 73        .s    LDA #&73
AC2B  20 EE FF      ..   JSR oswrch
AC2E  AD 04 7A     ..z   LDA &7A04
AC31  20 48 AC      H.   JSR &AC48
AC34  AD 05 7A     ..z   LDA &7A05
AC37  20 48 AC      H.   JSR &AC48
AC3A  4C 47 AC     LG.   JMP &AC47
AC3D  A9 20        .     LDA #&20
AC3F  A2 05        ..    LDX #&05
AC41  20 EE FF      ..   JSR oswrch
AC44  CA           .     DEX
AC45  D0 FA        ..    BNE &AC41
AC47  60           `     RTS
AC48  4C D8 B7     L..   JMP &B7D8
AC4B  5F           _     ...
AC4C  5F           _     ...
AC4D  5F           _     ...
AC4E  5F           _     ...
AC4F  20 20 20           JSR &2020
AC52  20 20 20           JSR &2020
AC55  50 61        Pa    BVC &ACB8
AC57  67           g     ...
AC58  65 20        e     ADC &20
AC5A  20 20 00       .   JSR &0020
AC5D  81 4C        .L    STA (&4C,X)
AC5F  69 6E        in    ADC #&6E
AC61  6B           k     ...
AC62  20 31 87      1.   JSR &8731
AC65  00           .     BRK
AC66  82           .     ...
AC67  4C 69 6E     Lin   JMP &6E69
AC6A  6B           k     ...
AC6B  20 32 87      2.   JSR &8732
AC6E  00           .     BRK
AC6F  83           .     ...
AC70  4C 69 6E     Lin   JMP &6E69
AC73  6B           k     ...
AC74  20 33 87      3.   JSR &8733
AC77  00           .     BRK
AC78  86 4C        .L    STX &4C
AC7A  69 6E        in    ADC #&6E
AC7C  6B           k     ...
AC7D  20 34 87      4.   JSR &8734
AC80  00           .     BRK
AC81  20 4C 69      Li   JSR &694C
AC84  6E 6B 20     nk    ROR &206B
AC87  35 20        5     AND &20,X
AC89  00           .     BRK
AC8A  20 49 6E      In   JSR &6E49
AC8D  64           d     ...
AC8E  65 78        ex    ADC &78
AC90  20 20 00       .   JSR &0020
AC93  20 4E 65      Ne   JSR &654E
AC96  78           x     SEI
AC97  74           t     ...
AC98  20 20 20           JSR &2020
AC9B  00           .     BRK
AC9C  20 4B 65      Ke   JSR &654B
AC9F  70 74        pt    BCS &AD15
ACA1  20 0D A9      ..   JSR &A90D
ACA4  E5 A2        ..    SBC &A2
ACA6  00           .     BRK
ACA7  20 B9 A0      ..   JSR &A0B9
ACAA  A9 0E        ..    LDA #&0E
ACAC  8D 00 7A     ..z   STA &7A00
ACAF  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
ACB2  A9 19        ..    LDA #&19
ACB4  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
ACB7  1A           .     ...
ACB8  0C           .     ...
ACB9  1F           .     ...
ACBA  01 03        ..    ORA (&03,X)
ACBC  46 69        Fi    LSR &69
ACBE  6E 64 69     ndi   ROR &6964
ACC1  6E 67 20     ng    ROR &2067
ACC4  63           c     ...
ACC5  61 74        at    ADC (&74,X)
ACC7  61 6C        al    ADC (&6C,X)
ACC9  6F           o     ...
ACCA  67           g     ...
ACCB  75 65        ue    ADC &65,X
ACCD  2E 2E 2E     ...   ROL &2E2E
ACD0  A9 01        ..    LDA #&01
ACD2  20 41 BB      A.   JSR &BB41
ACD5  A9 0F        ..    LDA #&0F
ACD7  8D 12 7A     ..z   STA &7A12
ACDA  20 3F A3      ?.   JSR &A33F                          ; Perform OSWORD &7A with parameterblock at &7A12
ACDD  AD 14 7A     ..z   LDA &7A14
ACE0  C9 FF        ..    CMP #&FF
ACE2  D0 0F        ..    BNE &ACF3
ACE4  00           .     BRK
ACE5  FF           .     ...
ACE6  4E 6F 20     No    LSR &206F
ACE9  63           c     ...
ACEA  61 74        at    ADC (&74,X)
ACEC  61 6C        al    ADC (&6C,X)
ACEE  6F           o     ...
ACEF  67           g     ...
ACF0  75 65        ue    ADC &65,X
ACF2  00           .     BRK
ACF3  AD 13 7A     ..z   LDA &7A13
ACF6  30 DD        0.    BMI &ACD5
ACF8  A0 03        ..    LDY #&03
ACFA  B9 13 7A     ..z   LDA &7A13,Y
ACFD  99 02 7A     ..z   STA &7A02,Y
AD00  88           .     DEY
AD01  10 F7        ..    BPL &ACFA
AD03  A9 AB        ..    LDA #&AB
AD05  8D 06 7A     ..z   STA &7A06
AD08  85 82        ..    STA &82
AD0A  A9 6B        .k    LDA #&6B
AD0C  8D 07 7A     ..z   STA &7A07
AD0F  85 83        ..    STA &83
AD11  A9 05        ..    LDA #&05
AD13  8D 00 7A     ..z   STA &7A00
AD16  A9 00        ..    LDA #&00
AD18  8D 01 7A     ..z   STA &7A01
AD1B  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
AD1E  A9 03        ..    LDA #&03
AD20  8D 00 7A     ..z   STA &7A00
AD23  A9 00        ..    LDA #&00
AD25  8D 9B 70     ..p   STA &709B
AD28  8D 01 7A     ..z   STA &7A01
AD2B  8D 02 7A     ..z   STA &7A02
AD2E  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
AD31  20 45 B1      E.   JSR &B145
AD34  A9 02        ..    LDA #&02
AD36  8D 00 7A     ..z   STA &7A00
AD39  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
AD3C  AD 02 7A     ..z   LDA &7A02
AD3F  29 02        ).    AND #&02
AD41  F0 EE        ..    BEQ &AD31
AD43  A0 00        ..    LDY #&00
AD45  98           .     TYA
AD46  99 00 7A     ..z   STA &7A00,Y
AD49  C8           .     INY
AD4A  C0 0F        ..    CPY #&0F
AD4C  D0 F8        ..    BNE &AD46
AD4E  20 90 A4      ..   JSR &A490
AD51  A0 19        ..    LDY #&19
AD53  B1 84        ..    LDA (&84),Y
AD55  AA           .     TAX
AD56  BD AF 91     ...   LDA hamtable,X
AD59  30 C3        0.    BMI &AD1E
AD5B  29 0F        ).    AND #&0F
AD5D  99 5E 00     .^.   STA &005E,Y
AD60  C8           .     INY
AD61  C0 1F        ..    CPY #&1F
AD63  D0 EE        ..    BNE &AD53
AD65  20 55 91      U.   JSR &9155
AD68  A5 75        .u    LDA &75
AD6A  4A           J     LSR A
AD6B  4A           J     LSR A
AD6C  4A           J     LSR A
AD6D  4D AB 6B     M.k   EOR &6BAB
AD70  8D 0B 7A     ..z   STA &7A0B
AD73  A5 72        .r    LDA &72
AD75  C9 FF        ..    CMP #&FF
AD77  D0 03        ..    BNE &AD7C
AD79  4C E4 AC     L..   JMP &ACE4
AD7C  8D 0C 7A     ..z   STA &7A0C
AD7F  A9 18        ..    LDA #&18
AD81  8D 00 7A     ..z   STA &7A00
AD84  A9 A2        ..    LDA #&A2
AD86  8D 01 7A     ..z   STA &7A01
AD89  A9 AC        ..    LDA #&AC
AD8B  8D 02 7A     ..z   STA &7A02
AD8E  A9 00        ..    LDA #&00
AD90  8D 03 7A     ..z   STA &7A03
AD93  8D 04 7A     ..z   STA &7A04
AD96  8D 0D 7A     ..z   STA &7A0D
AD99  8D 0E 7A     ..z   STA &7A0E
AD9C  A9 06        ..    LDA #&06
AD9E  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
ADA1  1F           .     ...
ADA2  01 03        ..    ORA (&03,X)
ADA4  4C 6F 61     Loa   JMP &616F
ADA7  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
ADAA  4C 60 BB     L`.   JMP &BB60
ADAD  20 90 B5      ..   JSR &B590
ADB0  20 11 A0      ..   JSR &A011
ADB3  A9 05        ..    LDA #&05
ADB5  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
ADB8  1C           .     ...
ADB9  00           .     BRK
ADBA  18           .     CLC
ADBB  27           '     ...
ADBC  13           .     ...
ADBD  A9 00        ..    LDA #&00
ADBF  8D B3 70     ..p   STA &70B3
ADC2  8D AB 70     ..p   STA &70AB
ADC5  8D BC 70     ..p   STA &70BC
ADC8  8D C5 70     ..p   STA &70C5
ADCB  8D C6 70     ..p   STA &70C6
ADCE  8D C7 70     ..p   STA &70C7
ADD1  8D C8 70     ..p   STA &70C8
ADD4  8D C3 70     ..p   STA &70C3
ADD7  8D C4 70     ..p   STA &70C4
ADDA  A8           .     TAY
ADDB  99 00 71     ..q   STA &7100,Y
ADDE  C8           .     INY
ADDF  D0 FA        ..    BNE &ADDB
ADE1  A9 FF        ..    LDA #&FF
ADE3  8D BF 70     ..p   STA &70BF
ADE6  8D C0 70     ..p   STA &70C0
ADE9  A9 01        ..    LDA #&01
ADEB  8D F1 70     ..p   STA &70F1
ADEE  A9 3F        .?    LDA #&3F
ADF0  8D 9F 70     ..p   STA &709F
ADF3  A9 7F        .    LDA #&7F
ADF5  8D A0 70     ..p   STA &70A0
ADF8  20 AD B9      ..   JSR &B9AD
ADFB  AD 9A 70     ..p   LDA &709A
ADFE  C9 91        ..    CMP #&91
AE00  F0 F6        ..    BEQ &ADF8
AE02  AD B2 70     ..p   LDA &70B2
AE05  D0 03        ..    BNE &AE0A
AE07  20 12 B0      ..   JSR &B012
AE0A  20 EC AF      ..   JSR &AFEC
AE0D  A9 83        ..    LDA #&83
AE0F  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
AE12  8E BD 70     ..p   STX &70BD                ; LSB of OSHWM
AE15  8E AC 70     ..p   STX &70AC
AE18  8C BE 70     ..p   STY &70BE                ; MSB of OSHWM
AE1B  8C AD 70     ..p   STY &70AD
AE1E  A9 01        ..    LDA #&01
AE20  8D EC 70     ..p   STA &70EC
AE23  8D EE 70     ..p   STA &70EE
AE26  20 45 B1      E.   JSR &B145
AE29  20 57 AF      W.   JSR &AF57
AE2C  AD FD 70     ..p   LDA &70FD
AE2F  C9 03        ..    CMP #&03
AE31  90 03        ..    BCC &AE36
AE33  4C C4 AE     L..   JMP &AEC4
AE36  C9 02        ..    CMP #&02
AE38  F0 EC        ..    BEQ &AE26
AE3A  C9 01        ..    CMP #&01
AE3C  F0 1D        ..    BEQ &AE5B
AE3E  AD FE 70     ..p   LDA &70FE
AE41  18           .     CLC
AE42  6D FA 70     m.p   ADC &70FA
AE45  20 07 AF      ..   JSR &AF07
AE48  AD FA 70     ..p   LDA &70FA
AE4B  C9 58        .X    CMP #&58
AE4D  F0 04        ..    BEQ &AE53
AE4F  C9 A8        ..    CMP #&A8
AE51  D0 05        ..    BNE &AE58
AE53  A9 00        ..    LDA #&00
AE55  8D FA 70     ..p   STA &70FA
AE58  4C 26 AE     L&.   JMP &AE26
AE5B  AD F9 70     ..p   LDA &70F9
AE5E  F0 26        .&    BEQ &AE86
AE60  AD FE 70     ..p   LDA &70FE
AE63  29 7F        )    AND #&7F
AE65  8D FE 70     ..p   STA &70FE
AE68  AD EE 70     ..p   LDA &70EE
AE6B  F0 19        ..    BEQ &AE86
AE6D  AD FE 70     ..p   LDA &70FE
AE70  C9 61        .a    CMP #&61
AE72  F0 12        ..    BEQ &AE86
AE74  C9 63        .c    CMP #&63
AE76  F0 0E        ..    BEQ &AE86
AE78  C9 41        .A    CMP #&41
AE7A  90 07        ..    BCC &AE83
AE7C  C9 5B        .[    CMP #&5B
AE7E  B0 03        ..    BCS &AE83
AE80  4C 86 AE     L..   JMP &AE86
AE83  4C 26 AE     L&.   JMP &AE26
AE86  A9 50        .P    LDA #&50
AE88  85 86        ..    STA &86
AE8A  A9 B1        ..    LDA #&B1
AE8C  85 87        ..    STA &87
AE8E  AD FE 70     ..p   LDA &70FE
AE91  A0 00        ..    LDY #&00
AE93  D1 86        ..    CMP (&86),Y
AE95  F0 19        ..    BEQ &AEB0
AE97  18           .     CLC
AE98  A5 86        ..    LDA &86
AE9A  69 06        i.    ADC #&06
AE9C  85 86        ..    STA &86
AE9E  A5 87        ..    LDA &87
AEA0  69 00        i.    ADC #&00
AEA2  85 87        ..    STA &87
AEA4  B1 86        ..    LDA (&86),Y
AEA6  D0 E6        ..    BNE &AE8E
AEA8  20 92 BA      ..   JSR &BA92
AEAB  48           H     PHA
AEAC  48           H     PHA
AEAD  4C 50 B4     LP.   JMP &B450
AEB0  A0 04        ..    LDY #&04
AEB2  B1 86        ..    LDA (&86),Y
AEB4  85 77        .w    STA &77
AEB6  C8           .     INY
AEB7  B1 86        ..    LDA (&86),Y
AEB9  85 78        .x    STA &78
AEBB  20 C1 AE      ..   JSR &AEC1
AEBE  4C 26 AE     L&.   JMP &AE26
AEC1  6C 77 00     lw.   JMP (&0077)
AEC4  AD FE 70     ..p   LDA &70FE
AEC7  85 86        ..    STA &86
AEC9  AD FD 70     ..p   LDA &70FD
AECC  85 87        ..    STA &87
AECE  A0 00        ..    LDY #&00
AED0  B1 86        ..    LDA (&86),Y
AED2  8D F8 70     ..p   STA &70F8
AED5  E6 86        ..    INC &86
AED7  D0 02        ..    BNE &AEDB
AED9  E6 87        ..    INC &87
AEDB  A0 00        ..    LDY #&00
AEDD  B1 86        ..    LDA (&86),Y
AEDF  18           .     CLC
AEE0  6D FA 70     m.p   ADC &70FA
AEE3  20 07 AF      ..   JSR &AF07
AEE6  AD FA 70     ..p   LDA &70FA
AEE9  C9 58        .X    CMP #&58
AEEB  F0 04        ..    BEQ &AEF1
AEED  C9 A8        ..    CMP #&A8
AEEF  D0 05        ..    BNE &AEF6
AEF1  A9 00        ..    LDA #&00
AEF3  8D FA 70     ..p   STA &70FA
AEF6  C8           .     INY
AEF7  CC F8 70     ..p   CPY &70F8
AEFA  F0 08        ..    BEQ &AF04
AEFC  B1 86        ..    LDA (&86),Y
AEFE  20 07 AF      ..   JSR &AF07
AF01  4C F6 AE     L..   JMP &AEF6
AF04  4C 26 AE     L&.   JMP &AE26
AF07  8D FE 70     ..p   STA &70FE
AF0A  98           .     TYA
AF0B  48           H     PHA
AF0C  AD EE 70     ..p   LDA &70EE
AF0F  D0 25        .%    BNE &AF36
AF11  A5 86        ..    LDA &86
AF13  48           H     PHA
AF14  A5 87        ..    LDA &87
AF16  48           H     PHA
AF17  AD BD 70     ..p   LDA &70BD
AF1A  85 86        ..    STA &86
AF1C  AD BE 70     ..p   LDA &70BE
AF1F  85 87        ..    STA &87
AF21  A0 00        ..    LDY #&00
AF23  AD FE 70     ..p   LDA &70FE
AF26  91 86        ..    STA (&86),Y
AF28  68           h     PLA
AF29  85 87        ..    STA &87
AF2B  68           h     PLA
AF2C  85 86        ..    STA &86
AF2E  EE BD 70     ..p   INC &70BD
AF31  D0 03        ..    BNE &AF36
AF33  EE BE 70     ..p   INC &70BE
AF36  AD BE 70     ..p   LDA &70BE
AF39  CD AD 70     ..p   CMP &70AD
AF3C  90 16        ..    BCC &AF54
AF3E  D0 08        ..    BNE &AF48
AF40  AD BD 70     ..p   LDA &70BD
AF43  CD AC 70     ..p   CMP &70AC
AF46  90 0C        ..    BCC &AF54
AF48  AD BD 70     ..p   LDA &70BD
AF4B  8D AC 70     ..p   STA &70AC
AF4E  AD BE 70     ..p   LDA &70BE
AF51  8D AD 70     ..p   STA &70AD
AF54  68           h     PLA
AF55  A8           .     TAY
AF56  60           `     RTS
AF57  20 A6 BA      ..   JSR &BAA6
AF5A  8D FF 70     ..p   STA &70FF
AF5D  A8           .     TAY
AF5E  B1 82        ..    LDA (&82),Y
AF60  8D FE 70     ..p   STA &70FE
AF63  B1 84        ..    LDA (&84),Y
AF65  8D FD 70     ..p   STA &70FD
AF68  C9 01        ..    CMP #&01
AF6A  D0 0D        ..    BNE &AF79
AF6C  AD FE 70     ..p   LDA &70FE
AF6F  C9 1B        ..    CMP #&1B
AF71  D0 06        ..    BNE &AF79
AF73  20 FF AF      ..   JSR &AFFF
AF76  4C 57 AF     LW.   JMP &AF57
AF79  20 EC AF      ..   JSR &AFEC
AF7C  60           `     RTS
AF7D  98           .     TYA
AF7E  48           H     PHA
AF7F  8A           .     TXA
AF80  48           H     PHA
AF81  20 EC AF      ..   JSR &AFEC
AF84  20 57 AF      W.   JSR &AF57
AF87  AD FD 70     ..p   LDA &70FD
AF8A  C9 01        ..    CMP #&01
AF8C  D0 3B        .;    BNE &AFC9
AF8E  AD FE 70     ..p   LDA &70FE
AF91  C9 60        .`    CMP #&60
AF93  D0 04        ..    BNE &AF99
AF95  A9 58        .X    LDA #&58
AF97  D0 06        ..    BNE &AF9F
AF99  C9 7E        .~    CMP #&7E
AF9B  D0 2C        .,    BNE &AFC9
AF9D  A9 A8        ..    LDA #&A8
AF9F  8D FA 70     ..p   STA &70FA
AFA2  20 A6 BA      ..   JSR &BAA6
AFA5  8D FE 70     ..p   STA &70FE
AFA8  AD F9 70     ..p   LDA &70F9
AFAB  F0 08        ..    BEQ &AFB5
AFAD  AD FE 70     ..p   LDA &70FE
AFB0  29 7F        )    AND #&7F
AFB2  8D FE 70     ..p   STA &70FE
AFB5  AD FE 70     ..p   LDA &70FE
AFB8  18           .     CLC
AFB9  6D FA 70     m.p   ADC &70FA
AFBC  8D FE 70     ..p   STA &70FE
AFBF  A9 00        ..    LDA #&00
AFC1  8D FD 70     ..p   STA &70FD
AFC4  8D FA 70     ..p   STA &70FA
AFC7  F0 1B        ..    BEQ &AFE4
AFC9  AD FF 70     ..p   LDA &70FF
AFCC  8D FE 70     ..p   STA &70FE
AFCF  A9 00        ..    LDA #&00
AFD1  8D FD 70     ..p   STA &70FD
AFD4  8D FA 70     ..p   STA &70FA
AFD7  AD F9 70     ..p   LDA &70F9
AFDA  F0 08        ..    BEQ &AFE4
AFDC  AD FE 70     ..p   LDA &70FE
AFDF  29 7F        )    AND #&7F
AFE1  8D FE 70     ..p   STA &70FE
AFE4  68           h     PLA
AFE5  AA           .     TAX
AFE6  68           h     PLA
AFE7  A8           .     TAY
AFE8  AD FE 70     ..p   LDA &70FE
AFEB  60           `     RTS
AFEC  48           H     PHA
AFED  A9 00        ..    LDA #&00
AFEF  85 82        ..    STA &82
AFF1  A9 79        .y    LDA #&79
AFF3  85 83        ..    STA &83
AFF5  A9 00        ..    LDA #&00
AFF7  85 84        ..    STA &84
AFF9  A9 78        .x    LDA #&78
AFFB  85 85        ..    STA &85
AFFD  68           h     PLA
AFFE  60           `     RTS
AFFF  48           H     PHA
B000  A9 00        ..    LDA #&00
B002  85 82        ..    STA &82
B004  A9 77        .w    LDA #&77
B006  85 83        ..    STA &83
B008  A9 00        ..    LDA #&00
B00A  85 84        ..    STA &84
B00C  A9 76        .v    LDA #&76
B00E  85 85        ..    STA &85
B010  68           h     PLA
B011  60           `     RTS
B012  A9 00        ..    LDA #&00
B014  8D B0 70     ..p   STA &70B0
B017  A9 72        .r    LDA #&72
B019  8D B1 70     ..p   STA &70B1
B01C  A0 00        ..    LDY #&00
B01E  98           .     TYA
B01F  99 00 79     ..y   STA &7900,Y
B022  A9 00        ..    LDA #&00
B024  99 00 78     ..x   STA &7800,Y
B027  A9 1B        ..    LDA #&1B
B029  99 00 77     ..w   STA &7700,Y
B02C  A9 01        ..    LDA #&01
B02E  99 00 76     ..v   STA &7600,Y
B031  C8           .     INY
B032  D0 EA        ..    BNE &B01E
B034  A9 1B        ..    LDA #&1B
B036  8D 1B 79     ..y   STA &791B
B039  8D 7C 79     .|y   STA &797C
B03C  8D 9B 79     ..y   STA &799B
B03F  8D FC 79     ..y   STA &79FC
B042  A9 01        ..    LDA #&01
B044  8D 1B 78     ..x   STA &781B
B047  8D 7C 78     .|x   STA &787C
B04A  8D 9B 78     ..x   STA &789B
B04D  8D FC 78     ..x   STA &78FC
B050  A9 00        ..    LDA #&00
B052  8D 1B 76     ..v   STA &761B
B055  8D 7C 76     .|v   STA &767C
B058  8D 9B 76     ..v   STA &769B
B05B  8D FC 76     ..v   STA &76FC
B05E  A9 1B        ..    LDA #&1B
B060  8D 1B 77     ..w   STA &771B
B063  A9 7C        .|    LDA #&7C
B065  8D 7C 77     .|w   STA &777C
B068  A9 9B        ..    LDA #&9B
B06A  8D 9B 77     ..w   STA &779B
B06D  A9 FC        ..    LDA #&FC
B06F  8D FC 77     ..w   STA &77FC
B072  A0 61        .a    LDY #&61
B074  98           .     TYA
B075  99 00 77     ..w   STA &7700,Y
B078  99 80 77     ..w   STA &7780,Y
B07B  C8           .     INY
B07C  C0 7B        .{    CPY #&7B
B07E  D0 F4        ..    BNE &B074
B080  A0 41        .A    LDY #&41
B082  98           .     TYA
B083  99 00 77     ..w   STA &7700,Y
B086  99 80 77     ..w   STA &7780,Y
B089  C8           .     INY
B08A  C0 5B        .[    CPY #&5B
B08C  D0 F4        ..    BNE &B082
B08E  60           `     RTS
B08F  48           H     PHA
B090  A9 00        ..    LDA #&00
B092  8D FC 70     ..p   STA &70FC
B095  68           h     PLA
B096  48           H     PHA
B097  A2 08        ..    LDX #&08
B099  0A           .     ASL A
B09A  90 03        ..    BCC &B09F
B09C  EE FC 70     ..p   INC &70FC
B09F  CA           .     DEX
B0A0  D0 F7        ..    BNE &B099
B0A2  AD FC 70     ..p   LDA &70FC
B0A5  29 01        ).    AND #&01
B0A7  8D FC 70     ..p   STA &70FC
B0AA  68           h     PLA
B0AB  60           `     RTS
B0AC  A0 00        ..    LDY #&00
B0AE  98           .     TYA
B0AF  20 8F B0      ..   JSR &B08F
B0B2  AD FC 70     ..p   LDA &70FC
B0B5  4D FB 70     M.p   EOR &70FB
B0B8  D0 13        ..    BNE &B0CD
B0BA  A9 7F        .    LDA #&7F
B0BC  99 00 79     ..y   STA &7900,Y
B0BF  99 00 77     ..w   STA &7700,Y
B0C2  A9 01        ..    LDA #&01
B0C4  99 00 78     ..x   STA &7800,Y
B0C7  99 00 76     ..v   STA &7600,Y
B0CA  4C E7 B0     L..   JMP &B0E7
B0CD  B9 00 78     ..x   LDA &7800,Y
B0D0  D0 08        ..    BNE &B0DA
B0D2  B9 00 79     ..y   LDA &7900,Y
B0D5  29 7F        )    AND #&7F
B0D7  99 00 79     ..y   STA &7900,Y
B0DA  B9 00 76     ..v   LDA &7600,Y
B0DD  D0 08        ..    BNE &B0E7
B0DF  B9 00 77     ..w   LDA &7700,Y
B0E2  29 7F        )    AND #&7F
B0E4  99 00 77     ..w   STA &7700,Y
B0E7  C8           .     INY
B0E8  D0 C4        ..    BNE &B0AE
B0EA  60           `     RTS
B0EB  A9 00        ..    LDA #&00
B0ED  8D FB 70     ..p   STA &70FB
B0F0  20 AC B0      ..   JSR &B0AC
B0F3  A9 60        .`    LDA #&60
B0F5  8D E0 77     ..w   STA &77E0
B0F8  8D E0 79     ..y   STA &79E0
B0FB  A9 7E        .~    LDA #&7E
B0FD  8D FE 77     ..w   STA &77FE
B100  8D FE 79     ..y   STA &79FE
B103  A9 00        ..    LDA #&00
B105  8D E0 76     ..v   STA &76E0
B108  8D FE 76     ..v   STA &76FE
B10B  A9 01        ..    LDA #&01
B10D  8D E0 78     ..x   STA &78E0
B110  8D FE 78     ..x   STA &78FE
B113  60           `     RTS
B114  A9 1B        ..    LDA #&1B
B116  8D 7C 77     .|w   STA &777C
B119  8D 9B 77     ..w   STA &779B
B11C  8D FC 77     ..w   STA &77FC
B11F  A9 01        ..    LDA #&01
B121  8D 7C 76     .|v   STA &767C
B124  8D 9B 76     ..v   STA &769B
B127  8D FC 76     ..v   STA &76FC
B12A  A9 00        ..    LDA #&00
B12C  8D 7C 78     .|x   STA &787C
B12F  8D 9B 78     ..x   STA &789B
B132  8D FC 78     ..x   STA &78FC
B135  A9 7C        .|    LDA #&7C
B137  8D 7C 79     .|y   STA &797C
B13A  A9 9B        ..    LDA #&9B
B13C  8D 9B 79     ..y   STA &799B
B13F  A9 FC        ..    LDA #&FC
B141  8D FC 79     ..y   STA &79FC
B144  60           `     RTS
B145  A5 FF        ..    LDA &FF
B147  30 01        0.    BMI &B14A
B149  60           `     RTS
B14A  20 55 89      U.   JSR &8955
B14D  4C C4 88     L..   JMP &88C4
B150  1B           .     ...
B151  45 53        ES    EOR &53
B153  43           C     ...
B154  F3           .     ...
B155  B1 60        .`    LDA (&60),Y
B157  55 4C        UL    EOR &4C,X
B159  42           B     ...
B15A  F3           .     ...
B15B  B1 7E        .~    LDA (&7E),Y
B15D  55 52        UR    EOR &52,X
B15F  42           B     ...
B160  F9 B1 42     ..B   SBC &42B1,Y
B163  54           T     ...
B164  58           X     CLI
B165  54           T     ...
B166  14           .     ...
B167  B2           .     ...
B168  43           C     ...
B169  54           T     ...
B16A  58           X     CLI
B16B  38           8     SEC
B16C  1C           .     ...
B16D  B2           .     ...
B16E  46 54        FT    LSR &54
B170  58           X     CLI
B171  4F           O     ...
B172  FF           .     ...
B173  B1 61        .a    LDA (&61),Y
B175  44           D     ...
B176  54           T     ...
B177  4C 93 B2     L..   JMP &B293
B17A  62           b     ...
B17B  44           D     ...
B17C  53           S     ...
B17D  42           B     ...
B17E  F8           .     SED
B17F  B2           .     ...
B180  63           c     ...
B181  44           D     ...
B182  45 42        EB    EOR &42
B184  58           X     CLI
B185  B3           .     ...
B186  64           d     ...
B187  44           D     ...
B188  45 54        ET    EOR &54
B18A  80           .     ...
B18B  B4 65        .e    LDY &65
B18D  44           D     ...
B18E  53           S     ...
B18F  4C DF B4     L..   JMP &B4DF
B192  68           h     PLA
B193  44           D     ...
B194  53           S     ...
B195  54           T     ...
B196  D7           .     ...
B197  B4 69        .i    LDY &69
B199  44           D     ...
B19A  44           D     ...
B19B  54           T     ...
B19C  90 B4        ..    BCC &B152
B19E  6A           j     ROR A
B19F  44           D     ...
B1A0  43           C     ...
B1A1  4F           O     ...
B1A2  93           .     ...
B1A3  B4 6B        .k    LDY &6B
B1A5  44           D     ...
B1A6  49 47        IG    EOR #&47
B1A8  B9 B4 6C     ..l   LDA &6CB4,Y
B1AB  44           D     ...
B1AC  4C 41 E3     LA.   JMP &E341
B1AF  B4 6D        .m    LDY &6D
B1B1  44           D     ...
B1B2  4C 52 24     LR$   JMP &2452
B1B5  B5 6E        .n    LDA &6E,X
B1B7  44           D     ...
B1B8  58           X     CLI
B1B9  41 5F        A_    EOR (&5F,X)
B1BB  B5 6F        .o    LDA &6F,X
B1BD  44           D     ...
B1BE  58           X     CLI
B1BF  52           R     ...
B1C0  6E B5 70     n.p   ROR &70B5
B1C3  44           D     ...
B1C4  49 52        IR    EOR #&52
B1C6  90 B5        ..    BCC &B17D
B1C8  71 44        qD    ADC (&44),Y
B1CA  45 53        ES    EOR &53
B1CC  AB           .     ...
B1CD  B5 72        .r    LDA &72,X
B1CF  44           D     ...
B1D0  45 43        EC    EOR &43
B1D2  B6 B5        ..    LDX &B5,Y
B1D4  73           s     ...
B1D5  44           D     ...
B1D6  4C 53 BE     LS.   JMP &BE53
B1D9  B5 74        .t    LDA &74,X
B1DB  44           D     ...
B1DC  4C 43 C9     LC.   JMP &C943
B1DF  B5 78        .x    LDA &78,X
B1E1  44           D     ...
B1E2  4E 44 FD     ND.   LSR &FD44
B1E5  B6 79        .y    LDX &79,Y
B1E7  44           D     ...
B1E8  45 46        EF    EOR &46
B1EA  FE B6 7F     ..   INC &7FB6,X
B1ED  55 45        UE    EOR &45,X
B1EF  52           R     ...
B1F0  F7           .     ...
B1F1  B6 00        ..    LDX &00,Y
B1F3  A9 58        .X    LDA #&58
B1F5  8D FA 70     ..p   STA &70FA
B1F8  60           `     RTS
B1F9  A9 A8        ..    LDA #&A8
B1FB  8D FA 70     ..p   STA &70FA
B1FE  60           `     RTS
B1FF  A9 01        ..    LDA #&01
B201  8D B3 70     ..p   STA &70B3
B204  AD B2 70     ..p   LDA &70B2
B207  D0 03        ..    BNE &B20C
B209  20 EB B0      ..   JSR &B0EB
B20C  A9 01        ..    LDA #&01
B20E  8D F9 70     ..p   STA &70F9
B211  4C F8 B2     L..   JMP &B2F8
B214  A9 00        ..    LDA #&00
B216  8D B3 70     ..p   STA &70B3
B219  4C 04 B2     L..   JMP &B204
B21C  AD B2 70     ..p   LDA &70B2
B21F  D0 03        ..    BNE &B224
B221  20 14 B1      ..   JSR &B114
B224  A9 00        ..    LDA #&00
B226  8D F9 70     ..p   STA &70F9
B229  8D B3 70     ..p   STA &70B3
B22C  4C F8 B2     L..   JMP &B2F8
B22F  29 7F        )    AND #&7F
B231  C9 61        .a    CMP #&61
B233  90 07        ..    BCC &B23C
B235  C9 7B        .{    CMP #&7B
B237  B0 03        ..    BCS &B23C
B239  38           8     SEC
B23A  E9 20        .     SBC #&20
B23C  60           `     RTS
B23D  99 C9 70     ..p   STA &70C9,Y
B240  C8           .     INY
B241  CA           .     DEX
B242  F0 06        ..    BEQ &B24A
B244  20 7D AF      }.   JSR &AF7D
B247  4C 3D B2     L=.   JMP &B23D
B24A  A9 00        ..    LDA #&00
B24C  99 C9 70     ..p   STA &70C9,Y
B24F  A9 12        ..    LDA #&12
B251  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B254  44           D     ...
B255  69 66        if    ADC #&66
B257  66 65        fe    ROR &65
B259  72           r     ...
B25A  65 6E        en    ADC &6E
B25C  74           t     ...
B25D  20 66 69      fi   JSR &6966
B260  6C 65 20     le    JMP (&2065)
B263  3A           :     ...
B264  20 22 A0      ".   JSR &A022
B267  00           .     BRK
B268  B9 C9 70     ..p   LDA &70C9,Y
B26B  20 EE FF      ..   JSR oswrch
B26E  C8           .     INY
B26F  C9 00        ..    CMP #&00
B271  D0 F5        ..    BNE &B268
B273  A9 03        ..    LDA #&03
B275  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B278  22           "     ...
B279  20 26 AD      &.   JSR &AD26
B27C  F2           .     ...
B27D  70 20        p     BCS &B29F
B27F  D8           .     CLD
B280  B7           .     ...
B281  A9 02        ..    LDA #&02
B283  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B286  0D 0A A9     ...   ORA &A90A
B289  00           .     BRK
B28A  8D F2 70     ..p   STA &70F2
B28D  A9 FF        ..    LDA #&FF
B28F  8D EE 70     ..p   STA &70EE
B292  60           `     RTS
B293  20 0A B7      ..   JSR &B70A
B296  8D F8 70     ..p   STA &70F8
B299  20 0A B7      ..   JSR &B70A
B29C  F0 31        .1    BEQ &B2CF
B29E  AA           .     TAX
B29F  A0 00        ..    LDY #&00
B2A1  AD DA 70     ..p   LDA &70DA
B2A4  C9 0D        ..    CMP #&0D
B2A6  F0 15        ..    BEQ &B2BD
B2A8  20 7D AF      }.   JSR &AF7D
B2AB  99 C9 70     ..p   STA &70C9,Y
B2AE  20 2F B2      /.   JSR &B22F
B2B1  D9 DA 70     ..p   CMP &70DA,Y
B2B4  D0 87        ..    BNE &B23D
B2B6  C8           .     INY
B2B7  CA           .     DEX
B2B8  D0 EE        ..    BNE &B2A8
B2BA  4C CF B2     L..   JMP &B2CF
B2BD  20 7D AF      }.   JSR &AF7D
B2C0  20 2F B2      /.   JSR &B22F
B2C3  99 DA 70     ..p   STA &70DA,Y
B2C6  C8           .     INY
B2C7  CA           .     DEX
B2C8  D0 F3        ..    BNE &B2BD
B2CA  A9 0D        ..    LDA #&0D
B2CC  99 DA 70     ..p   STA &70DA,Y
B2CF  CE F8 70     ..p   DEC &70F8
B2D2  AD F8 70     ..p   LDA &70F8
B2D5  F0 20        .     BEQ &B2F7
B2D7  20 0A B7      ..   JSR &B70A
B2DA  F0 07        ..    BEQ &B2E3
B2DC  AA           .     TAX
B2DD  20 7D AF      }.   JSR &AF7D
B2E0  CA           .     DEX
B2E1  D0 FA        ..    BNE &B2DD
B2E3  CE F8 70     ..p   DEC &70F8
B2E6  AD F8 70     ..p   LDA &70F8
B2E9  F0 0C        ..    BEQ &B2F7
B2EB  20 0A B7      ..   JSR &B70A
B2EE  F0 07        ..    BEQ &B2F7
B2F0  AA           .     TAX
B2F1  20 7D AF      }.   JSR &AF7D
B2F4  CA           .     DEX
B2F5  D0 FA        ..    BNE &B2F1
B2F7  60           `     RTS
B2F8  A9 00        ..    LDA #&00
B2FA  8D FA 70     ..p   STA &70FA
B2FD  8D F2 70     ..p   STA &70F2
B300  8D EF 70     ..p   STA &70EF
B303  20 EC AF      ..   JSR &AFEC
B306  20 0A B7      ..   JSR &B70A
B309  8D F8 70     ..p   STA &70F8
B30C  F0 19        ..    BEQ &B327
B30E  20 40 B7      @.   JSR &B740
B311  AD F4 70     ..p   LDA &70F4
B314  8D F2 70     ..p   STA &70F2
B317  AD F8 70     ..p   LDA &70F8
B31A  C9 02        ..    CMP #&02
B31C  D0 09        ..    BNE &B327
B31E  20 40 B7      @.   JSR &B740
B321  AD F4 70     ..p   LDA &70F4
B324  8D EF 70     ..p   STA &70EF
B327  AD B3 70     ..p   LDA &70B3
B32A  F0 0C        ..    BEQ &B338
B32C  AD F2 70     ..p   LDA &70F2
B32F  CD F1 70     ..p   CMP &70F1
B332  F0 04        ..    BEQ &B338
B334  A9 09        ..    LDA #&09
B336  D0 0A        ..    BNE &B342
B338  AC F2 70     ..p   LDY &70F2
B33B  B9 00 71     ..q   LDA &7100,Y
B33E  10 0B        ..    BPL &B34B
B340  A9 09        ..    LDA #&09
B342  8D 9A 70     ..p   STA &709A
B345  A9 01        ..    LDA #&01
B347  8D EE 70     ..p   STA &70EE
B34A  60           `     RTS
B34B  AD 9A 70     ..p   LDA &709A
B34E  C9 92        ..    CMP #&92
B350  D0 05        ..    BNE &B357
B352  A9 00        ..    LDA #&00
B354  8D EE 70     ..p   STA &70EE
B357  60           `     RTS
B358  AD EE 70     ..p   LDA &70EE
B35B  10 01        ..    BPL &B35E
B35D  60           `     RTS
B35E  AD EC 70     ..p   LDA &70EC
B361  F0 14        ..    BEQ &B377
B363  20 03 B8      ..   JSR &B803
B366  AD 9C 70     ..p   LDA &709C
B369  F0 0C        ..    BEQ &B377
B36B  A2 DA        ..    LDX #&DA
B36D  A0 70        .p    LDY #&70
B36F  A9 80        ..    LDA #&80
B371  20 CE FF      ..   JSR osfind
B374  8D BC 70     ..p   STA &70BC
B377  AD EE 70     ..p   LDA &70EE
B37A  D0 03        ..    BNE &B37F
B37C  EE AB 70     ..p   INC &70AB
B37F  20 B7 B8      ..   JSR &B8B7
B382  AD EE 70     ..p   LDA &70EE
B385  F0 01        ..    BEQ &B388
B387  60           `     RTS
B388  AC F2 70     ..p   LDY &70F2
B38B  A9 FF        ..    LDA #&FF
B38D  99 00 71     ..q   STA &7100,Y
B390  EE F1 70     ..p   INC &70F1
B393  A9 01        ..    LDA #&01
B395  8D EE 70     ..p   STA &70EE
B398  AD 9C 70     ..p   LDA &709C
B39B  F0 52        .R    BEQ &B3EF
B39D  AD BC 70     ..p   LDA &70BC
B3A0  F0 4D        .M    BEQ &B3EF
B3A2  A9 83        ..    LDA #&83
B3A4  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
B3A7  8E BD 70     ..p   STX &70BD                ; LSB of OSHWM
B3AA  8C BE 70     ..p   STY &70BE                ; MSB of OSHWM
B3AD  38           8     SEC
B3AE  AD AC 70     ..p   LDA &70AC
B3B1  ED BD 70     ..p   SBC &70BD
B3B4  8D C1 70     ..p   STA &70C1
B3B7  AD AD 70     ..p   LDA &70AD
B3BA  ED BE 70     ..p   SBC &70BE
B3BD  8D C2 70     ..p   STA &70C2
B3C0  A0 03        ..    LDY #&03
B3C2  B9 C5 70     ..p   LDA &70C5,Y
B3C5  99 82 00     ...   STA &0082,Y
B3C8  88           .     DEY
B3C9  10 F7        ..    BPL &B3C2
B3CB  AC BC 70     ..p   LDY &70BC
B3CE  A2 82        ..    LDX #&82
B3D0  A9 01        ..    LDA #&01
B3D2  20 DA FF      ..   JSR osargs
B3D5  A2 BC        ..    LDX #&BC
B3D7  A0 70        .p    LDY #&70
B3D9  A9 02        ..    LDA #&02
B3DB  20 D1 FF      ..   JSR osgbpb
B3DE  A9 83        ..    LDA #&83
B3E0  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
B3E3  8E BD 70     ..p   STX &70BD                ; LSB of OSHWM
B3E6  8E AC 70     ..p   STX &70AC                ; LSB of OSHWM
B3E9  8C BE 70     ..p   STY &70BE                ; MSB of OSHWM
B3EC  8C AD 70     ..p   STY &70AD                ; MSB of OSHWM
B3EF  A0 00        ..    LDY #&00
B3F1  C8           .     INY
B3F2  B9 00 71     ..q   LDA &7100,Y
B3F5  10 58        .X    BPL &B44F
B3F7  CC EF 70     ..p   CPY &70EF
B3FA  D0 F5        ..    BNE &B3F1
B3FC  A9 0E        ..    LDA #&0E
B3FE  8D 00 7A     ..z   STA &7A00
B401  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
B404  AD 9C 70     ..p   LDA &709C
B407  F0 15        ..    BEQ &B41E
B409  A9 00        ..    LDA #&00
B40B  AC BC 70     ..p   LDY &70BC
B40E  20 CE FF      ..   JSR osfind
B411  A9 05        ..    LDA #&05
B413  20 60 B4      `.   JSR &B460
B416  A9 01        ..    LDA #&01
B418  20 60 B4      `.   JSR &B460
B41B  4C 4D B4     LM.   JMP &B44D
B41E  AD 9B 70     ..p   LDA &709B
B421  F0 2A        .*    BEQ &B44D
B423  A9 FF        ..    LDA #&FF
B425  8D 0C 7A     ..z   STA &7A0C
B428  8D 0D 7A     ..z   STA &7A0D
B42B  8D 10 7A     ..z   STA &7A10
B42E  8D 11 7A     ..z   STA &7A11
B431  A9 83        ..    LDA #&83
B433  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
B436  8E 0A 7A     ..z   STX &7A0A                ; LSB of OSHWM
B439  8C 0B 7A     ..z   STY &7A0B                ; MSB of OSHWM
B43C  AD AC 70     ..p   LDA &70AC
B43F  8D 0E 7A     ..z   STA &7A0E
B442  AD AD 70     ..p   LDA &70AD
B445  8D 0F 7A     ..z   STA &7A0F
B448  A9 00        ..    LDA #&00
B44A  20 60 B4      `.   JSR &B460
B44D  68           h     PLA
B44E  68           h     PLA
B44F  60           `     RTS
B450  20 5F 89      _.   JSR &895F
B453  AC BC 70     ..p   LDY &70BC
B456  F0 F5        ..    BEQ &B44D
B458  A9 00        ..    LDA #&00
B45A  20 CE FF      ..   JSR osfind
B45D  4C 4D B4     LM.   JMP &B44D
B460  48           H     PHA
B461  A9 DA        ..    LDA #&DA
B463  8D 00 7A     ..z   STA &7A00
B466  A9 70        .p    LDA #&70
B468  8D 01 7A     ..z   STA &7A01
B46B  A0 00        ..    LDY #&00
B46D  B9 B4 70     ..p   LDA &70B4,Y
B470  99 02 7A     ..z   STA &7A02,Y
B473  C8           .     INY
B474  C0 08        ..    CPY #&08
B476  D0 F5        ..    BNE &B46D
B478  A2 00        ..    LDX #&00
B47A  A0 7A        .z    LDY #&7A
B47C  68           h     PLA
B47D  4C DD FF     L..   JMP osfile
B480  A9 01        ..    LDA #&01
B482  8D ED 70     ..p   STA &70ED
B485  AD B3 70     ..p   LDA &70B3
B488  D0 03        ..    BNE &B48D
B48A  4C 58 B3     LX.   JMP &B358
B48D  4C FC B3     L..   JMP &B3FC
B490  4C B9 B4     L..   JMP &B4B9
B493  20 0A B7      ..   JSR &B70A
B496  8D F8 70     ..p   STA &70F8
B499  AD F8 70     ..p   LDA &70F8
B49C  F0 1A        ..    BEQ &B4B8
B49E  20 0A B7      ..   JSR &B70A
B4A1  AA           .     TAX
B4A2  F0 0E        ..    BEQ &B4B2
B4A4  20 7D AF      }.   JSR &AF7D
B4A7  09 80        ..    ORA #&80
B4A9  20 EE FF      ..   JSR oswrch
B4AC  CA           .     DEX
B4AD  D0 F5        ..    BNE &B4A4
B4AF  20 E7 FF      ..   JSR osnewl
B4B2  CE F8 70     ..p   DEC &70F8
B4B5  4C 99 B4     L..   JMP &B499
B4B8  60           `     RTS
B4B9  20 0A B7      ..   JSR &B70A
B4BC  8D F8 70     ..p   STA &70F8
B4BF  AD F8 70     ..p   LDA &70F8
B4C2  F0 12        ..    BEQ &B4D6
B4C4  20 0A B7      ..   JSR &B70A
B4C7  AA           .     TAX
B4C8  F0 06        ..    BEQ &B4D0
B4CA  20 7D AF      }.   JSR &AF7D
B4CD  CA           .     DEX
B4CE  D0 FA        ..    BNE &B4CA
B4D0  CE F8 70     ..p   DEC &70F8
B4D3  4C BF B4     L..   JMP &B4BF
B4D6  60           `     RTS
B4D7  A9 01        ..    LDA #&01
B4D9  8D F8 70     ..p   STA &70F8
B4DC  4C BF B4     L..   JMP &B4BF
B4DF  20 40 B7      @.   JSR &B740
B4E2  60           `     RTS
B4E3  A9 83        ..    LDA #&83
B4E5  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
B4E8  8E BD 70     ..p   STX &70BD                ; LSB of OSHWM
B4EB  8C BE 70     ..p   STY &70BE                ; MSB of OSHWM
B4EE  20 40 B7      @.   JSR &B740
B4F1  AD F2 70     ..p   LDA &70F2
B4F4  C9 01        ..    CMP #&01
B4F6  D0 14        ..    BNE &B50C
B4F8  A0 00        ..    LDY #&00
B4FA  B9 F4 70     ..p   LDA &70F4,Y
B4FD  99 B4 70     ..p   STA &70B4,Y
B500  A9 00        ..    LDA #&00
B502  99 F4 70     ..p   STA &70F4,Y
B505  C8           .     INY
B506  C0 04        ..    CPY #&04
B508  D0 F0        ..    BNE &B4FA
B50A  F0 15        ..    BEQ &B521
B50C  A0 00        ..    LDY #&00
B50E  38           8     SEC
B50F  08           .     PHP
B510  28           (     PLP
B511  B9 F4 70     ..p   LDA &70F4,Y
B514  F9 B4 70     ..p   SBC &70B4,Y
B517  99 F4 70     ..p   STA &70F4,Y
B51A  08           .     PHP
B51B  C8           .     INY
B51C  C0 04        ..    CPY #&04
B51E  D0 F0        ..    BNE &B510
B520  28           (     PLP
B521  4C 32 B5     L2.   JMP &B532
B524  A9 83        ..    LDA #&83                 ; Read OSHWM (PAGE)
B526  20 F4 FF      ..   JSR osbyte
B529  8E BD 70     ..p   STX &70BD                ; LSB of OSHWM
B52C  8C BE 70     ..p   STY &70BE                ; MSB of OSHWM
B52F  20 40 B7      @.   JSR &B740
B532  AD 9C 70     ..p   LDA &709C
B535  D0 14        ..    BNE &B54B
B537  18           .     CLC
B538  AD BD 70     ..p   LDA &70BD
B53B  6D F4 70     m.p   ADC &70F4
B53E  8D BD 70     ..p   STA &70BD
B541  AD BE 70     ..p   LDA &70BE
B544  6D F5 70     m.p   ADC &70F5
B547  8D BE 70     ..p   STA &70BE
B54A  60           `     RTS
B54B  A9 00        ..    LDA #&00
B54D  8D AC 70     ..p   STA &70AC
B550  8D AD 70     ..p   STA &70AD
B553  A2 03        ..    LDX #&03
B555  BD F4 70     ..p   LDA &70F4,X
B558  9D C5 70     ..p   STA &70C5,X
B55B  CA           .     DEX
B55C  10 F7        ..    BPL &B555
B55E  60           `     RTS
B55F  20 40 B7      @.   JSR &B740
B562  A0 03        ..    LDY #&03
B564  B9 F4 70     ..p   LDA &70F4,Y
B567  99 B8 70     ..p   STA &70B8,Y
B56A  88           .     DEY
B56B  10 F7        ..    BPL &B564
B56D  60           `     RTS
B56E  20 5F B5      _.   JSR &B55F
B571  A9 83        ..    LDA #&83
B573  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
B576  8E F4 70     ..p   STX &70F4                ; LSB of OSHWM
B579  8C F5 70     ..p   STY &70F5                ; MSB of OSHWM
B57C  18           .     CLC
B57D  AD B8 70     ..p   LDA &70B8
B580  6D F4 70     m.p   ADC &70F4
B583  8D B8 70     ..p   STA &70B8
B586  AD B9 70     ..p   LDA &70B9
B589  6D F5 70     m.p   ADC &70F5
B58C  8D B9 70     ..p   STA &70B9
B58F  60           `     RTS
B590  A9 01        ..    LDA #&01
B592  8D EB 70     ..p   STA &70EB
B595  AD 9B 70     ..p   LDA &709B
B598  8D 9C 70     ..p   STA &709C
B59B  A9 00        ..    LDA #&00
B59D  A8           .     TAY
B59E  20 DA FF      ..   JSR osargs
B5A1  C9 04        ..    CMP #&04
B5A3  B0 05        ..    BCS &B5AA
B5A5  A9 00        ..    LDA #&00
B5A7  8D 9C 70     ..p   STA &709C
B5AA  60           `     RTS
B5AB  20 DC B5      ..   JSR &B5DC
B5AE  A9 01        ..    LDA #&01
B5B0  8D AA 70     ..p   STA &70AA
B5B3  4C FF B5     L..   JMP &B5FF
B5B6  A9 01        ..    LDA #&01
B5B8  8D AA 70     ..p   STA &70AA
B5BB  4C 89 B6     L..   JMP &B689
B5BE  20 DC B5      ..   JSR &B5DC
B5C1  A9 00        ..    LDA #&00
B5C3  8D AA 70     ..p   STA &70AA
B5C6  4C FF B5     L..   JMP &B5FF
B5C9  A9 00        ..    LDA #&00
B5CB  8D AA 70     ..p   STA &70AA
B5CE  4C 89 B6     L..   JMP &B689
B5D1  AD AA 70     ..p   LDA &70AA
B5D4  F0 03        ..    BEQ &B5D9
B5D6  4C FF AF     L..   JMP &AFFF
B5D9  4C EC AF     L..   JMP &AFEC
B5DC  20 7D AF      }.   JSR &AF7D
B5DF  AD F9 70     ..p   LDA &70F9
B5E2  F0 1A        ..    BEQ &B5FE
B5E4  AD FE 70     ..p   LDA &70FE
B5E7  29 7F        )    AND #&7F
B5E9  8D FE 70     ..p   STA &70FE
B5EC  20 8F B0      ..   JSR &B08F
B5EF  AD FC 70     ..p   LDA &70FC
B5F2  29 01        ).    AND #&01
B5F4  D0 08        ..    BNE &B5FE
B5F6  AD FE 70     ..p   LDA &70FE
B5F9  09 80        ..    ORA #&80
B5FB  8D FE 70     ..p   STA &70FE
B5FE  60           `     RTS
B5FF  20 D1 B5      ..   JSR &B5D1
B602  AC FE 70     ..p   LDY &70FE
B605  84 78        .x    STY &78
B607  20 0A B7      ..   JSR &B70A
B60A  8D F8 70     ..p   STA &70F8
B60D  D0 10        ..    BNE &B61F
B60F  20 D1 B5      ..   JSR &B5D1
B612  A9 02        ..    LDA #&02
B614  A4 78        .x    LDY &78
B616  91 84        ..    STA (&84),Y
B618  A9 00        ..    LDA #&00
B61A  91 82        ..    STA (&82),Y
B61C  4C 86 B6     L..   JMP &B686
B61F  C9 01        ..    CMP #&01
B621  D0 14        ..    BNE &B637
B623  20 7D AF      }.   JSR &AF7D
B626  20 D1 B5      ..   JSR &B5D1
B629  A4 78        .x    LDY &78
B62B  AD FE 70     ..p   LDA &70FE
B62E  91 82        ..    STA (&82),Y
B630  A9 00        ..    LDA #&00
B632  91 84        ..    STA (&84),Y
B634  4C 86 B6     L..   JMP &B686
B637  20 D1 B5      ..   JSR &B5D1
B63A  A4 78        .x    LDY &78
B63C  AD B0 70     ..p   LDA &70B0
B63F  91 82        ..    STA (&82),Y
B641  85 86        ..    STA &86
B643  AD B1 70     ..p   LDA &70B1
B646  91 84        ..    STA (&84),Y
B648  85 87        ..    STA &87
B64A  A0 00        ..    LDY #&00
B64C  AD F8 70     ..p   LDA &70F8
B64F  91 86        ..    STA (&86),Y
B651  E6 86        ..    INC &86
B653  D0 02        ..    BNE &B657
B655  E6 87        ..    INC &87
B657  98           .     TYA
B658  48           H     PHA
B659  20 7D AF      }.   JSR &AF7D
B65C  20 D1 B5      ..   JSR &B5D1
B65F  68           h     PLA
B660  A8           .     TAY
B661  AD FE 70     ..p   LDA &70FE
B664  91 86        ..    STA (&86),Y
B666  C8           .     INY
B667  CC F8 70     ..p   CPY &70F8
B66A  D0 EB        ..    BNE &B657
B66C  18           .     CLC
B66D  AD B0 70     ..p   LDA &70B0
B670  6D F8 70     m.p   ADC &70F8
B673  8D B0 70     ..p   STA &70B0
B676  AD B1 70     ..p   LDA &70B1
B679  69 00        i.    ADC #&00
B67B  8D B1 70     ..p   STA &70B1
B67E  EE B0 70     ..p   INC &70B0
B681  D0 03        ..    BNE &B686
B683  EE B1 70     ..p   INC &70B1
B686  4C EC AF     L..   JMP &AFEC
B689  20 EC AF      ..   JSR &AFEC
B68C  20 DC B5      ..   JSR &B5DC
B68F  20 D1 B5      ..   JSR &B5D1
B692  AC FE 70     ..p   LDY &70FE
B695  8C F7 70     ..p   STY &70F7
B698  20 7D AF      }.   JSR &AF7D
B69B  AD FE 70     ..p   LDA &70FE
B69E  29 7F        )    AND #&7F
B6A0  8D F4 70     ..p   STA &70F4
B6A3  20 7D AF      }.   JSR &AF7D
B6A6  AD FE 70     ..p   LDA &70FE
B6A9  29 7F        )    AND #&7F
B6AB  8D F5 70     ..p   STA &70F5
B6AE  20 7D AF      }.   JSR &AF7D
B6B1  AD FE 70     ..p   LDA &70FE
B6B4  29 7F        )    AND #&7F
B6B6  8D F6 70     ..p   STA &70F6
B6B9  A9 50        .P    LDA #&50
B6BB  85 86        ..    STA &86
B6BD  A9 B1        ..    LDA #&B1
B6BF  85 87        ..    STA &87
B6C1  A0 01        ..    LDY #&01
B6C3  B1 86        ..    LDA (&86),Y
B6C5  D9 F3 70     ..p   CMP &70F3,Y
B6C8  D0 1A        ..    BNE &B6E4
B6CA  C8           .     INY
B6CB  C0 04        ..    CPY #&04
B6CD  D0 F4        ..    BNE &B6C3
B6CF  A0 00        ..    LDY #&00
B6D1  B1 86        ..    LDA (&86),Y
B6D3  48           H     PHA
B6D4  20 D1 B5      ..   JSR &B5D1
B6D7  AC F7 70     ..p   LDY &70F7
B6DA  68           h     PLA
B6DB  91 82        ..    STA (&82),Y
B6DD  A9 01        ..    LDA #&01
B6DF  91 84        ..    STA (&84),Y
B6E1  4C EC AF     L..   JMP &AFEC
B6E4  18           .     CLC
B6E5  A5 86        ..    LDA &86
B6E7  69 06        i.    ADC #&06
B6E9  85 86        ..    STA &86
B6EB  A5 87        ..    LDA &87
B6ED  69 00        i.    ADC #&00
B6EF  85 87        ..    STA &87
B6F1  A0 00        ..    LDY #&00
B6F3  B1 86        ..    LDA (&86),Y
B6F5  D0 CA        ..    BNE &B6C1
B6F7  20 92 BA      ..   JSR &BA92
B6FA  4C 50 B4     LP.   JMP &B450
B6FD  60           `     RTS
B6FE  20 12 B0      ..   JSR &B012
B701  A9 00        ..    LDA #&00
B703  8D B2 70     ..p   STA &70B2
B706  8D F9 70     ..p   STA &70F9
B709  60           `     RTS
B70A  AD F9 70     ..p   LDA &70F9
B70D  F0 2B        .+    BEQ &B73A
B70F  20 A6 BA      ..   JSR &BAA6
B712  20 9D B7      ..   JSR &B79D
B715  C9 11        ..    CMP #&11
B717  F0 03        ..    BEQ &B71C
B719  C9 00        ..    CMP #&00
B71B  60           `     RTS
B71C  20 A6 BA      ..   JSR &BAA6
B71F  20 9D B7      ..   JSR &B79D
B722  0A           .     ASL A
B723  0A           .     ASL A
B724  0A           .     ASL A
B725  0A           .     ASL A
B726  8D F9 70     ..p   STA &70F9
B729  20 A6 BA      ..   JSR &BAA6
B72C  20 9D B7      ..   JSR &B79D
B72F  0D F9 70     ..p   ORA &70F9
B732  48           H     PHA
B733  A9 01        ..    LDA #&01
B735  8D F9 70     ..p   STA &70F9
B738  68           h     PLA
B739  60           `     RTS
B73A  20 A6 BA      ..   JSR &BAA6
B73D  C9 00        ..    CMP #&00
B73F  60           `     RTS
B740  A9 00        ..    LDA #&00
B742  8D F4 70     ..p   STA &70F4
B745  8D F5 70     ..p   STA &70F5
B748  8D F6 70     ..p   STA &70F6
B74B  8D F7 70     ..p   STA &70F7
B74E  AD F9 70     ..p   LDA &70F9
B751  F0 2B        .+    BEQ &B77E
B753  20 0A B7      ..   JSR &B70A
B756  AA           .     TAX
B757  A0 00        ..    LDY #&00
B759  0E F4 70     ..p   ASL &70F4
B75C  2E F5 70     ..p   ROL &70F5
B75F  2E F6 70     ..p   ROL &70F6
B762  2E F7 70     ..p   ROL &70F7
B765  C8           .     INY
B766  C0 04        ..    CPY #&04
B768  D0 EF        ..    BNE &B759
B76A  8A           .     TXA
B76B  48           H     PHA
B76C  20 A6 BA      ..   JSR &BAA6
B76F  20 9D B7      ..   JSR &B79D
B772  0D F4 70     ..p   ORA &70F4
B775  8D F4 70     ..p   STA &70F4
B778  68           h     PLA
B779  AA           .     TAX
B77A  CA           .     DEX
B77B  D0 DA        ..    BNE &B757
B77D  60           `     RTS
B77E  20 0A B7      ..   JSR &B70A
B781  C9 05        ..    CMP #&05
B783  B0 0C        ..    BCS &B791
B785  AA           .     TAX
B786  CA           .     DEX
B787  20 A6 BA      ..   JSR &BAA6
B78A  9D F4 70     ..p   STA &70F4,X
B78D  CA           .     DEX
B78E  10 F7        ..    BPL &B787
B790  60           `     RTS
B791  AA           .     TAX
B792  20 A6 BA      ..   JSR &BAA6
B795  CA           .     DEX
B796  E0 05        ..    CPX #&05
B798  B0 F8        ..    BCS &B792
B79A  4C 86 B7     L..   JMP &B786
B79D  A2 00        ..    LDX #&00
B79F  29 7F        )    AND #&7F
B7A1  DD C0 B7     ...   CMP &B7C0,X
B7A4  F0 08        ..    BEQ &B7AE
B7A6  E8           .     INX
B7A7  E0 18        ..    CPX #&18
B7A9  D0 F6        ..    BNE &B7A1
B7AB  A9 FF        ..    LDA #&FF
B7AD  60           `     RTS
B7AE  E0 16        ..    CPX #&16
B7B0  B0 0B        ..    BCS &B7BD
B7B2  E0 10        ..    CPX #&10
B7B4  B0 02        ..    BCS &B7B8
B7B6  8A           .     TXA
B7B7  60           `     RTS
B7B8  8A           .     TXA
B7B9  38           8     SEC
B7BA  E9 06        ..    SBC #&06
B7BC  60           `     RTS
B7BD  A9 11        ..    LDA #&11
B7BF  60           `     RTS
B7C0  30 31        01    BMI &B7F3
B7C2  32           2     ...
B7C3  33           3     ...
B7C4  34           4     ...
B7C5  35 36        56    AND &36,X
B7C7  37           7     ...
B7C8  38           8     SEC
B7C9  39 41 42     9AB   AND &4241,Y
B7CC  43           C     ...
B7CD  44           D     ...
B7CE  45 46        EF    EOR &46
B7D0  61 62        ab    ADC (&62,X)
B7D2  63           c     ...
B7D3  64           d     ...
B7D4  65 66        ef    ADC &66
B7D6  58           X     CLI
B7D7  78           x     SEI
B7D8  8D FF 70     ..p   STA &70FF
B7DB  8A           .     TXA
B7DC  48           H     PHA
B7DD  98           .     TYA
B7DE  48           H     PHA
B7DF  AD FF 70     ..p   LDA &70FF
B7E2  29 F0        ).    AND #&F0
B7E4  4A           J     LSR A
B7E5  4A           J     LSR A
B7E6  4A           J     LSR A
B7E7  4A           J     LSR A
B7E8  AA           .     TAX
B7E9  BD C0 B7     ...   LDA &B7C0,X
B7EC  20 EE FF      ..   JSR oswrch
B7EF  AD FF 70     ..p   LDA &70FF
B7F2  29 0F        ).    AND #&0F
B7F4  AA           .     TAX
B7F5  BD C0 B7     ...   LDA &B7C0,X
B7F8  20 EE FF      ..   JSR oswrch
B7FB  68           h     PLA
B7FC  A8           .     TAY
B7FD  68           h     PLA
B7FE  AA           .     TAX
B7FF  AD FF 70     ..p   LDA &70FF
B802  60           `     RTS
B803  AD EF 70     ..p   LDA &70EF
B806  F0 04        ..    BEQ &B80C
B808  C9 51        .Q    CMP #&51
B80A  90 01        ..    BCC &B80D
B80C  60           `     RTS
B80D  A9 86        ..    LDA #&86                 ; Read text cursor position
B80F  20 F4 FF      ..   JSR osbyte
B812  98           .     TYA
B813  48           H     PHA
B814  8A           .     TXA
B815  48           H     PHA
B816  A9 2B        .+    LDA #&2B
B818  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B81B  1A           .     ...
B81C  1F           .     ...
B81D  00           .     BRK
B81E  09 97        ..    ORA #&97
B820  AF           .     ...
B821  87           .     ...
B822  4E 6F 74     Not   LSR &746F
B825  20 52 65      Re   JSR &6552
B828  63           c     ...
B829  65 69        ei    ADC &69
B82B  76 65        ve    ROR &65,X
B82D  64           d     ...
B82E  20 92 AF      ..   JSR &AF92
B831  87           .     ...
B832  4F           O     ...
B833  4B           K     ...
B834  20 20 91       .   JSR &9120
B837  AF           .     ...
B838  87           .     ...
B839  45 72        Er    EOR &72
B83B  72           r     ...
B83C  6F           o     ...
B83D  72           r     ...
B83E  20 2D 20      -    JSR &202D
B841  52           R     ...
B842  65 74        et    ADC &74
B844  72           r     ...
B845  79 A9 01     y..   ADC &01A9,Y
B848  8D B2 70     ..p   STA &70B2
B84B  A9 00        ..    LDA #&00
B84D  8D F4 70     ..p   STA &70F4
B850  A9 0B        ..    LDA #&0B
B852  8D F5 70     ..p   STA &70F5
B855  AD EF 70     ..p   LDA &70EF
B858  8D F6 70     ..p   STA &70F6
B85B  F0 41        .A    BEQ &B89E
B85D  A9 1F        ..    LDA #&1F
B85F  20 EE FF      ..   JSR oswrch
B862  AD F4 70     ..p   LDA &70F4
B865  8D AE 70     ..p   STA &70AE
B868  20 EE FF      ..   JSR oswrch
B86B  AD F5 70     ..p   LDA &70F5
B86E  8D AF 70     ..p   STA &70AF
B871  20 EE FF      ..   JSR oswrch
B874  A9 02        ..    LDA #&02
B876  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B879  97           .     ...
B87A  AF           .     ...
B87B  18           .     CLC
B87C  AD F4 70     ..p   LDA &70F4
B87F  69 02        i.    ADC #&02
B881  8D F4 70     ..p   STA &70F4
B884  C9 28        .(    CMP #&28
B886  D0 0E        ..    BNE &B896
B888  A9 00        ..    LDA #&00
B88A  8D F4 70     ..p   STA &70F4
B88D  18           .     CLC
B88E  AD F5 70     ..p   LDA &70F5
B891  69 02        i.    ADC #&02
B893  8D F5 70     ..p   STA &70F5
B896  CE F6 70     ..p   DEC &70F6
B899  AD F6 70     ..p   LDA &70F6
B89C  D0 BF        ..    BNE &B85D
B89E  A9 00        ..    LDA #&00
B8A0  8D EC 70     ..p   STA &70EC
B8A3  A9 06        ..    LDA #&06
B8A5  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B8A8  1C           .     ...
B8A9  00           .     BRK
B8AA  18           .     CLC
B8AB  27           '     ...
B8AC  13           .     ...
B8AD  1F           .     ...
B8AE  68           h     PLA
B8AF  20 EE FF      ..   JSR oswrch
B8B2  68           h     PLA
B8B3  20 EE FF      ..   JSR oswrch
B8B6  60           `     RTS
B8B7  AD EC 70     ..p   LDA &70EC
B8BA  D0 03        ..    BNE &B8BF
B8BC  4C C3 B8     L..   JMP &B8C3
B8BF  60           `     RTS
B8C0  4C 9A B9     L..   JMP &B99A
B8C3  A9 86        ..    LDA #&86                 ; Read text cursor position
B8C5  20 F4 FF      ..   JSR osbyte
B8C8  98           .     TYA
B8C9  48           H     PHA
B8CA  8A           .     TXA
B8CB  48           H     PHA
B8CC  A9 06        ..    LDA #&06
B8CE  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B8D1  1A           .     ...
B8D2  1F           .     ...
B8D3  00           .     BRK
B8D4  07           .     ...
B8D5  86 26        .&    STX &26
B8D7  AD AB 70     ..p   LDA &70AB
B8DA  20 D8 B7      ..   JSR &B7D8
B8DD  AD EF 70     ..p   LDA &70EF
B8E0  F0 14        ..    BEQ &B8F6
B8E2  A9 09        ..    LDA #&09
B8E4  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B8E7  87           .     ...
B8E8  6F           o     ...
B8E9  75 74        ut    ADC &74,X
B8EB  20 6F 66      of   JSR &666F
B8EE  86 26        .&    STX &26
B8F0  AD EF 70     ..p   LDA &70EF
B8F3  20 D8 B7      ..   JSR &B7D8
B8F6  A9 13        ..    LDA #&13
B8F8  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B8FB  87           .     ...
B8FC  62           b     ...
B8FD  6C 6F 63     loc   JMP (&636F)
B900  6B           k     ...
B901  28           (     PLP
B902  73           s     ...
B903  29 20        )     AND #&20
B905  72           r     ...
B906  65 63        ec    ADC &63
B908  65 69        ei    ADC &69
B90A  76 65        ve    ROR &65,X
B90C  64           d     ...
B90D  2E AD EF     ...   ROL &EFAD
B910  70 C9        p.    BCS &B8DB
B912  51 B0        Q.    EOR (&B0),Y
B914  AB           .     ...
B915  AD F2 70     ..p   LDA &70F2
B918  F0 A6        ..    BEQ &B8C0
B91A  C9 51        .Q    CMP #&51
B91C  B0 A2        ..    BCS &B8C0
B91E  A9 00        ..    LDA #&00
B920  8D F4 70     ..p   STA &70F4
B923  A9 0B        ..    LDA #&0B
B925  8D F5 70     ..p   STA &70F5
B928  AD EF 70     ..p   LDA &70EF
B92B  8D F6 70     ..p   STA &70F6
B92E  A9 01        ..    LDA #&01
B930  8D F7 70     ..p   STA &70F7
B933  AD F7 70     ..p   LDA &70F7
B936  CD F2 70     ..p   CMP &70F2
B939  D0 3E        .>    BNE &B979
B93B  A9 1F        ..    LDA #&1F
B93D  20 EE FF      ..   JSR oswrch
B940  AD AE 70     ..p   LDA &70AE
B943  20 EE FF      ..   JSR oswrch
B946  AD AF 70     ..p   LDA &70AF
B949  20 EE FF      ..   JSR oswrch
B94C  A9 04        ..    LDA #&04
B94E  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B951  09 0A        ..    ORA #&0A
B953  20 1F AD      ..   JSR &AD1F
B956  F4           .     ...
B957  70 8D        p.    BCS &B8E6
B959  AE 70 20     .p    LDX &2070
B95C  EE FF AD     ...   INC &ADFF
B95F  F5 70        .p    SBC &70,X
B961  8D AF 70     ..p   STA &70AF
B964  20 EE FF      ..   JSR oswrch
B967  AD 9A 70     ..p   LDA &709A
B96A  20 EE FF      ..   JSR oswrch
B96D  A9 04        ..    LDA #&04
B96F  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B972  AF           .     ...
B973  08           .     PHP
B974  0A           .     ASL A
B975  5E 4C 9A     ^L.   LSR &9A4C,Y
B978  B9 EE F7     ...   LDA &F7EE,Y
B97B  70 18        p.    BCS &B995
B97D  AD F4 70     ..p   LDA &70F4
B980  69 02        i.    ADC #&02
B982  8D F4 70     ..p   STA &70F4
B985  C9 28        .(    CMP #&28
B987  D0 0E        ..    BNE &B997
B989  A9 00        ..    LDA #&00
B98B  8D F4 70     ..p   STA &70F4
B98E  18           .     CLC
B98F  AD F5 70     ..p   LDA &70F5
B992  69 02        i.    ADC #&02
B994  8D F5 70     ..p   STA &70F5
B997  4C 33 B9     L3.   JMP &B933
B99A  A9 06        ..    LDA #&06
B99C  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
B99F  1C           .     ...
B9A0  00           .     BRK
B9A1  18           .     CLC
B9A2  27           '     ...
B9A3  13           .     ...
B9A4  1F           .     ...
B9A5  68           h     PLA
B9A6  20 EE FF      ..   JSR oswrch
B9A9  68           h     PLA
B9AA  4C EE FF     L..   JMP oswrch
B9AD  A9 07        ..    LDA #&07
B9AF  8D 00 7A     ..z   STA &7A00
B9B2  A9 1E        ..    LDA #&1E
B9B4  8D 01 7A     ..z   STA &7A01
B9B7  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
B9BA  A9 05        ..    LDA #&05
B9BC  8D 00 7A     ..z   STA &7A00
B9BF  A9 00        ..    LDA #&00
B9C1  8D 01 7A     ..z   STA &7A01
B9C4  A2 03        ..    LDX #&03
B9C6  BD 9D 70     ..p   LDA &709D,X
B9C9  9D 02 7A     ..z   STA &7A02,X
B9CC  CA           .     DEX
B9CD  10 F7        ..    BPL &B9C6
B9CF  A9 AB        ..    LDA #&AB
B9D1  8D 06 7A     ..z   STA &7A06
B9D4  A9 6B        .k    LDA #&6B
B9D6  8D 07 7A     ..z   STA &7A07
B9D9  A9 FF        ..    LDA #&FF
B9DB  8D 08 7A     ..z   STA &7A08
B9DE  8D 09 7A     ..z   STA &7A09
B9E1  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
B9E4  A9 03        ..    LDA #&03
B9E6  8D 00 7A     ..z   STA &7A00
B9E9  A9 00        ..    LDA #&00
B9EB  8D 01 7A     ..z   STA &7A01
B9EE  8D 02 7A     ..z   STA &7A02
B9F1  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
B9F4  20 45 B1      E.   JSR &B145
B9F7  A9 02        ..    LDA #&02
B9F9  8D 00 7A     ..z   STA &7A00
B9FC  A9 00        ..    LDA #&00
B9FE  8D 01 7A     ..z   STA &7A01
BA01  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
BA04  AD 02 7A     ..z   LDA &7A02
BA07  29 02        ).    AND #&02
BA09  F0 E9        ..    BEQ &B9F4
BA0B  A9 3F        .?    LDA #&3F
BA0D  8D 9F 70     ..p   STA &709F
BA10  A9 7F        .    LDA #&7F
BA12  8D A0 70     ..p   STA &70A0
BA15  A9 AB        ..    LDA #&AB
BA17  85 82        ..    STA &82
BA19  A9 6B        .k    LDA #&6B
BA1B  85 83        ..    STA &83
BA1D  20 90 A4      ..   JSR &A490
BA20  B0 40        .@    BCS &BA62
BA22  A0 01        ..    LDY #&01
BA24  B1 84        ..    LDA (&84),Y
BA26  AA           .     TAX
BA27  BD AF 91     ...   LDA hamtable,X
BA2A  30 36        06    BMI &BA62
BA2C  29 0F        ).    AND #&0F
BA2E  99 76 00     .v.   STA &0076,Y
BA31  C8           .     INY
BA32  C0 07        ..    CPY #&07
BA34  D0 EE        ..    BNE &BA24
BA36  20 55 91      U.   JSR &9155
BA39  A5 75        .u    LDA &75
BA3B  4A           J     LSR A
BA3C  4A           J     LSR A
BA3D  4A           J     LSR A
BA3E  4D AB 6B     M.k   EOR &6BAB
BA41  8D 9D 70     ..p   STA &709D
BA44  A5 72        .r    LDA &72
BA46  8D 9E 70     ..p   STA &709E
BA49  A9 3F        .?    LDA #&3F
BA4B  8D 9F 70     ..p   STA &709F
BA4E  A9 7F        .    LDA #&7F
BA50  8D A0 70     ..p   STA &70A0
BA53  AD B3 70     ..p   LDA &70B3
BA56  F0 0A        ..    BEQ &BA62
BA58  A5 73        .s    LDA &73
BA5A  8D 9F 70     ..p   STA &709F
BA5D  A5 74        .t    LDA &74
BA5F  8D A0 70     ..p   STA &70A0
BA62  A9 92        ..    LDA #&92
BA64  8D 9A 70     ..p   STA &709A
BA67  A9 17        ..    LDA #&17
BA69  8D 00 7A     ..z   STA &7A00
BA6C  A9 AB        ..    LDA #&AB
BA6E  8D 01 7A     ..z   STA &7A01
BA71  A9 6B        .k    LDA #&6B
BA73  8D 02 7A     ..z   STA &7A02
BA76  20 38 A3      8.   JSR &A338                          ; Perform OSWORD &7A with parameterblock at &7A00
BA79  AD 03 7A     ..z   LDA &7A03
BA7C  10 0D        ..    BPL &BA8B
BA7E  A9 91        ..    LDA #&91
BA80  8D 9A 70     ..p   STA &709A
BA83  A9 01        ..    LDA #&01
BA85  8D EE 70     ..p   STA &70EE
BA88  20 92 BA      ..   JSR &BA92
BA8B  A9 00        ..    LDA #&00
BA8D  85 71        .q    STA &71
BA8F  4C F4 BA     L..   JMP &BAF4
BA92  A9 0E        ..    LDA #&0E
BA94  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BA97  42           B     ...
BA98  61 64        ad    ADC (&64,X)
BA9A  20 44 61      Da   JSR &6144
BA9D  74           t     ...
BA9E  61 2E        a.    ADC (&2E,X)
BAA0  2E 2E 07     ...   ROL &072E
BAA3  0D 0A 60     ..`   ORA &600A
BAA6  98           .     TYA
BAA7  48           H     PHA
BAA8  8A           .     TXA
BAA9  48           H     PHA
BAAA  A5 78        .x    LDA &78
BAAC  48           H     PHA
BAAD  A5 82        ..    LDA &82
BAAF  48           H     PHA
BAB0  A5 83        ..    LDA &83
BAB2  48           H     PHA
BAB3  A5 84        ..    LDA &84
BAB5  48           H     PHA
BAB6  A5 85        ..    LDA &85
BAB8  48           H     PHA
BAB9  AD 99 70     ..p   LDA &7099
BABC  C9 28        .(    CMP #&28
BABE  D0 03        ..    BNE &BAC3
BAC0  20 F4 BA      ..   JSR &BAF4
BAC3  EE 99 70     ..p   INC &7099
BAC6  AD 97 70     ..p   LDA &7097
BAC9  85 77        .w    STA &77
BACB  AD 98 70     ..p   LDA &7098
BACE  85 78        .x    STA &78
BAD0  A0 00        ..    LDY #&00
BAD2  B1 77        .w    LDA (&77),Y
BAD4  85 77        .w    STA &77
BAD6  EE 97 70     ..p   INC &7097
BAD9  D0 03        ..    BNE &BADE
BADB  EE 98 70     ..p   INC &7098
BADE  68           h     PLA
BADF  85 85        ..    STA &85
BAE1  68           h     PLA
BAE2  85 84        ..    STA &84
BAE4  68           h     PLA
BAE5  85 83        ..    STA &83
BAE7  68           h     PLA
BAE8  85 82        ..    STA &82
BAEA  68           h     PLA
BAEB  85 78        .x    STA &78
BAED  68           h     PLA
BAEE  AA           .     TAX
BAEF  68           h     PLA
BAF0  A8           .     TAY
BAF1  A5 77        .w    LDA &77
BAF3  60           `     RTS
BAF4  E6 71        .q    INC &71
BAF6  A6 71        .q    LDX &71
BAF8  E0 1A        ..    CPX #&1A
BAFA  F0 1B        ..    BEQ &BB17
BAFC  A9 AB        ..    LDA #&AB
BAFE  85 82        ..    STA &82
BB00  A9 6B        .k    LDA #&6B
BB02  85 83        ..    STA &83
BB04  20 45 A2      E.   JSR &A245
BB07  A5 84        ..    LDA &84
BB09  8D 97 70     ..p   STA &7097
BB0C  A5 85        ..    LDA &85
BB0E  8D 98 70     ..p   STA &7098
BB11  A9 00        ..    LDA #&00
BB13  8D 99 70     ..p   STA &7099
BB16  60           `     RTS
BB17  4C AD B9     L..   JMP &B9AD

; -----------------------------------------------------------------------------
; Write the following characters; A=length
; -----------------------------------------------------------------------------
.
BB1A  8D 5D 7B     .]{   STA &7B5D
BB1D  68           h     PLA
BB1E  85 7B        .{    STA &7B
BB20  68           h     PLA
BB21  85 7C        .|    STA &7C
BB23  A0 00        ..    LDY #&00
.
BB25  C8           .     INY
BB26  B1 7B        .{    LDA (&7B),Y
BB28  20 EE FF      ..   JSR oswrch
BB2B  CC 5D 7B     .]{   CPY &7B5D
BB2E  D0 F5        ..    BNE &BB25
BB30  A5 7B        .{    LDA &7B
BB32  18           .     CLC
BB33  6D 5D 7B     m]{   ADC &7B5D
BB36  85 7B        .{    STA &7B
BB38  A5 7C        .|    LDA &7C
BB3A  69 00        i.    ADC #&00
BB3C  48           H     PHA
BB3D  A5 7B        .{    LDA &7B
BB3F  48           H     PHA
BB40  60           `     RTS

; -----------------------------------------------------------------------------
; 
; -----------------------------------------------------------------------------
.
BB41  48           H     PHA
BB42  A9 1F        ..    LDA #&1F
BB44  20 EE FF      ..   JSR oswrch
BB47  A9 00        ..    LDA #&00
BB49  20 EE FF      ..   JSR oswrch
BB4C  68           h     PLA
BB4D  20 EE FF      ..   JSR oswrch
BB50  A9 97        ..    LDA #&97
BB52  20 EE FF      ..   JSR oswrch
BB55  A9 AC        ..    LDA #&AC
BB57  A2 27        .'    LDX #&27
.
BB59  20 EE FF      ..   JSR oswrch
BB5C  CA           .     DEX
BB5D  D0 FA        ..    BNE &BB59
BB5F  60           `     RTS

.
BB60  A9 E5        ..    LDA #&E5                 ; Read/Write ESCAPE key status (ESCAPE will insert it's ASCII value (usually 27) into the input buffer)
BB62  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
BB65  A9 04        ..    LDA #&04                 ; Define action of cursor editing keys (Cursor keys return ASCII values 135-139)
BB67  20 B7 A0      ..   JSR &A0B7                ; Call OSBYTE with X=&01 and Y=&00
BB6A  A9 0C        ..    LDA #&0C                 ; Set auto repeat period
BB6C  A2 00        ..    LDX #&00                 ; Delay is 0 cs
BB6E  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
BB71  A9 02        ..    LDA #&02
BB73  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BB76  1A           .     ...
BB77  0C           .     ...
BB78  A9 83        ..    LDA #&83
BB7A  20 F4 FF      ..   JSR osbyte               ; Read OSHWM (PAGE)
BB7D  86 82        ..    STX &82                  ; LSB of OSHWM
BB7F  86 84        ..    STX &84                  ; LSB of OSHWM
BB81  84 83        ..    STY &83                  ; MSB of OSHWM
BB83  84 85        ..    STY &85                  ; MSB of OSHWM
BB85  A9 01        ..    LDA #&01
BB87  20 41 BB      A.   JSR &BB41
BB8A  A0 00        ..    LDY #&00
BB8C  20 73 BF      s.   JSR &BF73
BB8F  A9 03        ..    LDA #&03
BB91  20 41 BB      A.   JSR &BB41
BB94  A9 10        ..    LDA #&10
BB96  20 41 BB      A.   JSR &BB41
BB99  20 73 BF      s.   JSR &BF73
BB9C  A9 12        ..    LDA #&12
BB9E  20 41 BB      A.   JSR &BB41
BBA1  A9 00        ..    LDA #&00
BBA3  8D A7 70     ..p   STA &70A7
BBA6  8D A8 70     ..p   STA &70A8
BBA9  8D A5 70     ..p   STA &70A5
BBAC  8D A6 70     ..p   STA &70A6
BBAF  8D A3 70     ..p   STA &70A3
BBB2  8D A4 70     ..p   STA &70A4
BBB5  8D A9 70     ..p   STA &70A9
BBB8  8D AA 70     ..p   STA &70AA
BBBB  8D A2 70     ..p   STA &70A2
BBBE  A9 75        .u    LDA #&75
BBC0  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BBC3  1F           .     ...
BBC4  01 14        ..    ORA (&14,X)
BBC6  55 73        Us    EOR &73,X
BBC8  65 20        e     ADC &20
BBCA  74           t     ...
BBCB  68           h     PLA
BBCC  65 85        e.    ADC &85
BBCE  55 50        UP    EOR &50,X
BBD0  87           .     ...
BBD1  26 85        &.    ROL &85
BBD3  44           D     ...
BBD4  4F           O     ...
BBD5  57           W     ...
BBD6  4E 87 63     N.c   LSR &6387
BBD9  75 72        ur    ADC &72,X
BBDB  73           s     ...
BBDC  6F           o     ...
BBDD  72           r     ...
BBDE  20 6B 65      ke   JSR &656B
BBE1  79 73 20     ys    ADC &2073,Y
BBE4  74           t     ...
BBE5  6F           o     ...
BBE6  20 73 65      se   JSR &6573
BBE9  6C 65 63     lec   JMP (&6365)
BBEC  74           t     ...
BBED  0A           .     ASL A
BBEE  20 61 20      a    JSR &2061
BBF1  66 69        fi    ROR &69
BBF3  6C 65 2C     le,   JMP (&2C65)
BBF6  20 61 6E      an   JSR &6E61
BBF9  64           d     ...
BBFA  20 70 72      pr   JSR &7270
BBFD  65 73        es    ADC &73
BBFF  73           s     ...
BC00  85 52        .R    STA &52
BC02  45 54        ET    EOR &54
BC04  55 52        UR    EOR &52,X
BC06  4E 87 74     N.t   LSR &7487
BC09  6F           o     ...
BC0A  20 64 6F      do   JSR &6F64
BC0D  77           w     ...
BC0E  6E 6C 6F     nlo   ROR &6F6C
BC11  61 64        ad    ADC (&64,X)
BC13  2E 0D 0A     ...   ROL &0A0D
BC16  0A           .     ASL A
BC17  20 50 72      Pr   JSR &7250
BC1A  65 73        es    ADC &73
BC1C  73           s     ...
BC1D  85 45        .E    STA &45
BC1F  53           S     ...
BC20  43           C     ...
BC21  41 50        AP    EOR (&50,X)
BC23  45 87        E.    EOR &87
BC25  74           t     ...
BC26  6F           o     ...
BC27  20 65 78      ex   JSR &7865
BC2A  69 74        it    ADC #&74
BC2C  2E 1C 00     ...   ROL &001C
BC2F  0E 27 05     .'.   ASL &0527
BC32  1F           .     ...
BC33  01 00        ..    ORA (&00,X)
BC35  9D 84 1E     ...   STA &1E84,X
BC38  20 C2 BE      ..   JSR &BEC2
BC3B  30 33        03    BMI &BC70
BC3D  D0 1E        ..    BNE &BC5D
BC3F  AD A9 70     ..p   LDA &70A9
BC42  D0 0C        ..    BNE &BC50
BC44  AD A7 70     ..p   LDA &70A7
BC47  8D A5 70     ..p   STA &70A5
BC4A  AD A8 70     ..p   LDA &70A8
BC4D  8D A6 70     ..p   STA &70A6
BC50  EE A9 70     ..p   INC &70A9
BC53  AD A9 70     ..p   LDA &70A9
BC56  C9 0A        ..    CMP #&0A
BC58  F0 16        ..    BEQ &BC70
BC5A  20 E7 FF      ..   JSR osnewl
BC5D  EE A7 70     ..p   INC &70A7
BC60  D0 03        ..    BNE &BC65
BC62  EE A8 70     ..p   INC &70A8
BC65  EE A3 70     ..p   INC &70A3
BC68  D0 03        ..    BNE &BC6D
BC6A  EE A4 70     ..p   INC &70A4
BC6D  4C 38 BC     L8.   JMP &BC38
BC70  AD A9 70     ..p   LDA &70A9
BC73  8D A1 70     ..p   STA &70A1
BC76  CE A1 70     ..p   DEC &70A1
BC79  A9 00        ..    LDA #&00
BC7B  8D A9 70     ..p   STA &70A9
BC7E  20 E0 FF      ..   JSR osrdch
BC81  C9 8A        ..    CMP #&8A
BC83  F0 03        ..    BEQ &BC88
BC85  4C 10 BD     L..   JMP &BD10
BC88  20 B2 BE      ..   JSR &BEB2
BC8B  A9 20        .     LDA #&20
BC8D  20 EE FF      ..   JSR oswrch
BC90  20 EE FF      ..   JSR oswrch
BC93  AD A9 70     ..p   LDA &70A9
BC96  C9 09        ..    CMP #&09
BC98  F0 18        ..    BEQ &BCB2
BC9A  CD A1 70     ..p   CMP &70A1
BC9D  B0 03        ..    BCS &BCA2
BC9F  EE A9 70     ..p   INC &70A9
BCA2  20 B2 BE      ..   JSR &BEB2
BCA5  A9 9D        ..    LDA #&9D
BCA7  20 EE FF      ..   JSR oswrch
BCAA  A9 84        ..    LDA #&84
BCAC  20 EE FF      ..   JSR oswrch
BCAF  4C 7E BC     L~.   JMP &BC7E
BCB2  A9 01        ..    LDA #&01
BCB4  8D A2 70     ..p   STA &70A2
BCB7  AD A3 70     ..p   LDA &70A3
BCBA  8D A7 70     ..p   STA &70A7
BCBD  AD A4 70     ..p   LDA &70A4
BCC0  8D A8 70     ..p   STA &70A8
BCC3  EE A7 70     ..p   INC &70A7
BCC6  D0 03        ..    BNE &BCCB
BCC8  EE A8 70     ..p   INC &70A8
BCCB  20 C2 BE      ..   JSR &BEC2
BCCE  30 D2        0.    BMI &BCA2
BCD0  D0 F1        ..    BNE &BCC3
BCD2  AD A7 70     ..p   LDA &70A7
BCD5  8D A3 70     ..p   STA &70A3
BCD8  AD A8 70     ..p   LDA &70A8
BCDB  8D A4 70     ..p   STA &70A4
BCDE  AD A5 70     ..p   LDA &70A5
BCE1  8D A7 70     ..p   STA &70A7
BCE4  AD A6 70     ..p   LDA &70A6
BCE7  8D A8 70     ..p   STA &70A8
BCEA  A9 15        ..    LDA #&15
BCEC  20 EE FF      ..   JSR oswrch
BCEF  EE A7 70     ..p   INC &70A7
BCF2  D0 03        ..    BNE &BCF7
BCF4  EE A8 70     ..p   INC &70A8
BCF7  20 C2 BE      ..   JSR &BEC2
BCFA  D0 F3        ..    BNE &BCEF
BCFC  A9 06        ..    LDA #&06
BCFE  20 EE FF      ..   JSR oswrch
BD01  AD A7 70     ..p   LDA &70A7
BD04  8D A5 70     ..p   STA &70A5
BD07  AD A8 70     ..p   LDA &70A8
BD0A  8D A6 70     ..p   STA &70A6
BD0D  4C A2 BC     L..   JMP &BCA2
BD10  C9 8B        ..    CMP #&8B
BD12  F0 03        ..    BEQ &BD17
BD14  4C A3 BD     L..   JMP &BDA3
BD17  20 B2 BE      ..   JSR &BEB2
BD1A  A9 20        .     LDA #&20
BD1C  20 EE FF      ..   JSR oswrch
BD1F  20 EE FF      ..   JSR oswrch
BD22  AD A9 70     ..p   LDA &70A9
BD25  F0 06        ..    BEQ &BD2D
BD27  CE A9 70     ..p   DEC &70A9
BD2A  4C A2 BC     L..   JMP &BCA2
BD2D  A9 02        ..    LDA #&02
BD2F  8D A2 70     ..p   STA &70A2
BD32  AD A5 70     ..p   LDA &70A5
BD35  8D A7 70     ..p   STA &70A7
BD38  AD A6 70     ..p   LDA &70A6
BD3B  8D A8 70     ..p   STA &70A8
BD3E  AD A7 70     ..p   LDA &70A7
BD41  0D A8 70     ..p   ORA &70A8
BD44  F0 E4        ..    BEQ &BD2A
BD46  38           8     SEC
BD47  AD A7 70     ..p   LDA &70A7
BD4A  E9 01        ..    SBC #&01
BD4C  8D A7 70     ..p   STA &70A7
BD4F  AD A8 70     ..p   LDA &70A8
BD52  E9 00        ..    SBC #&00
BD54  8D A8 70     ..p   STA &70A8
BD57  20 C2 BE      ..   JSR &BEC2
BD5A  D0 E2        ..    BNE &BD3E
BD5C  AD A7 70     ..p   LDA &70A7
BD5F  8D A5 70     ..p   STA &70A5
BD62  AD A8 70     ..p   LDA &70A8
BD65  8D A6 70     ..p   STA &70A6
BD68  AD A3 70     ..p   LDA &70A3
BD6B  8D A7 70     ..p   STA &70A7
BD6E  AD A4 70     ..p   LDA &70A4
BD71  8D A8 70     ..p   STA &70A8
BD74  A9 15        ..    LDA #&15
BD76  20 EE FF      ..   JSR oswrch
BD79  38           8     SEC
BD7A  AD A7 70     ..p   LDA &70A7
BD7D  E9 01        ..    SBC #&01
BD7F  8D A7 70     ..p   STA &70A7
BD82  AD A8 70     ..p   LDA &70A8
BD85  E9 00        ..    SBC #&00
BD87  8D A8 70     ..p   STA &70A8
BD8A  20 C2 BE      ..   JSR &BEC2
BD8D  D0 EA        ..    BNE &BD79
BD8F  A9 06        ..    LDA #&06
BD91  20 EE FF      ..   JSR oswrch
BD94  AD A7 70     ..p   LDA &70A7
BD97  8D A3 70     ..p   STA &70A3
BD9A  AD A8 70     ..p   LDA &70A8
BD9D  8D A4 70     ..p   STA &70A4
BDA0  4C A2 BC     L..   JMP &BCA2
BDA3  C9 0D        ..    CMP #&0D
BDA5  F0 07        ..    BEQ &BDAE
BDA7  C9 87        ..    CMP #&87
BDA9  F0 03        ..    BEQ &BDAE
BDAB  4C A3 BE     L..   JMP &BEA3
BDAE  A9 15        ..    LDA #&15
BDB0  20 EE FF      ..   JSR oswrch
BDB3  AD A5 70     ..p   LDA &70A5
BDB6  8D A7 70     ..p   STA &70A7
BDB9  AD A6 70     ..p   LDA &70A6
BDBC  8D A8 70     ..p   STA &70A8
BDBF  AD A9 70     ..p   LDA &70A9
BDC2  F0 13        ..    BEQ &BDD7
BDC4  EE A7 70     ..p   INC &70A7
BDC7  D0 03        ..    BNE &BDCC
BDC9  EE A8 70     ..p   INC &70A8
BDCC  20 C2 BE      ..   JSR &BEC2
BDCF  D0 F3        ..    BNE &BDC4
BDD1  CE A9 70     ..p   DEC &70A9
BDD4  4C BF BD     L..   JMP &BDBF
BDD7  20 8C BF      ..   JSR &BF8C
BDDA  A9 03        ..    LDA #&03
BDDC  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BDDF  06 1A        ..    ASL &1A
BDE1  0C           .     ...
BDE2  A9 01        ..    LDA #&01
BDE4  20 41 BB      A.   JSR &BB41
BDE7  A9 0D        ..    LDA #&0D
BDE9  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BDEC  1F           .     ...
BDED  01 03        ..    ORA (&03,X)
BDEF  46 69        Fi    LSR &69
BDF1  6C 65 6E     len   JMP (&6E65)
BDF4  61 6D        am    ADC (&6D,X)
BDF6  65 20        e     ADC &20
BDF8  3A           :     ...
BDF9  20 E2 BF      ..   JSR &BFE2
BDFC  B1 84        ..    LDA (&84),Y
BDFE  8D F8 70     ..p   STA &70F8
BE01  EE F8 70     ..p   INC &70F8
BE04  C8           .     INY
BE05  B1 84        ..    LDA (&84),Y
BE07  09 80        ..    ORA #&80
BE09  20 EE FF      ..   JSR oswrch
BE0C  C8           .     INY
BE0D  B1 84        ..    LDA (&84),Y
BE0F  20 2F B2      /.   JSR &B22F
BE12  20 EE FF      ..   JSR oswrch
BE15  99 D8 70     ..p   STA &70D8,Y
BE18  C8           .     INY
BE19  CC F8 70     ..p   CPY &70F8
BE1C  D0 EF        ..    BNE &BE0D
BE1E  A9 0D        ..    LDA #&0D
BE20  99 D8 70     ..p   STA &70D8,Y
BE23  98           .     TYA
BE24  18           .     CLC
BE25  65 84        e.    ADC &84
BE27  85 84        ..    STA &84
BE29  A5 85        ..    LDA &85
BE2B  69 00        i.    ADC #&00
BE2D  85 85        ..    STA &85
BE2F  20 E2 BF      ..   JSR &BFE2
BE32  20 E2 BF      ..   JSR &BFE2
BE35  A9 0B        ..    LDA #&0B
BE37  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BE3A  1F           .     ...
BE3B  01 05        ..    ORA (&05,X)
BE3D  4C 6F 61     Loa   JMP &616F
BE40  64           d     ...
BE41  20 3A 20      :    JSR &203A
BE44  26 A0        &.    ROL &A0
BE46  00           .     BRK
BE47  A2 03        ..    LDX #&03
BE49  B1 84        ..    LDA (&84),Y
BE4B  20 D8 B7      ..   JSR &B7D8
BE4E  9D B4 70     ..p   STA &70B4,X
BE51  C8           .     INY
BE52  CA           .     DEX
BE53  10 F4        ..    BPL &BE49
BE55  98           .     TYA
BE56  48           H     PHA
BE57  A9 0B        ..    LDA #&0B
BE59  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BE5C  1F           .     ...
BE5D  15 05        ..    ORA &05,X
BE5F  45 78        Ex    EOR &78
BE61  65 63        ec    ADC &63
BE63  20 3A 20      :    JSR &203A
BE66  26 68        &h    ROL &68
BE68  A8           .     TAY
BE69  A2 03        ..    LDX #&03
BE6B  B1 84        ..    LDA (&84),Y
BE6D  20 D8 B7      ..   JSR &B7D8
BE70  9D B8 70     ..p   STA &70B8,X
BE73  C8           .     INY
BE74  CA           .     DEX
BE75  10 F4        ..    BPL &BE6B
BE77  B1 84        ..    LDA (&84),Y
BE79  8D 9D 70     ..p   STA &709D
BE7C  C8           .     INY
BE7D  B1 84        ..    LDA (&84),Y
BE7F  8D 9E 70     ..p   STA &709E
BE82  A9 05        ..    LDA #&05
BE84  20 1A BB      ..   JSR &BB1A                ; Write the following characters; A=length
BE87  1C           .     ...
BE88  00           .     BRK
BE89  18           .     CLC
BE8A  27           '     ...
BE8B  13           .     ...
BE8C  A9 00        ..    LDA #&00
BE8E  8D B2 70     ..p   STA &70B2
BE91  A9 01        ..    LDA #&01
BE93  8D 9B 70     ..p   STA &709B
BE96  A9 E5        ..    LDA #&E5                 ; Read/Write ESCAPE key status
BE98  A2 00        ..    LDX #&00                 ; ESCAPE will cause an ESCAPE condition
BE9A  20 B9 A0      ..   JSR &A0B9                ; Call OSBYTE with Y=&00
BE9D  20 AD AD      ..   JSR &ADAD
BEA0  4C A3 AC     L..   JMP &ACA3
BEA3  C9 1B        ..    CMP #&1B
BEA5  D0 08        ..    BNE &BEAF
BEA7  A9 87        ..    LDA #&87
BEA9  8D 5E 7B     .^{   STA &7B5E
BEAC  4C 41 98     LA.   JMP &9841
BEAF  4C 7E BC     L~.   JMP &BC7E
BEB2  A9 1F        ..    LDA #&1F
BEB4  20 EE FF      ..   JSR oswrch
BEB7  A9 01        ..    LDA #&01
BEB9  20 EE FF      ..   JSR oswrch
BEBC  AD A9 70     ..p   LDA &70A9
BEBF  4C EE FF     L..   JMP oswrch
BEC2  20 8C BF      ..   JSR &BF8C
BEC5  B1 84        ..    LDA (&84),Y
BEC7  C9 03        ..    CMP #&03
BEC9  D0 1B        ..    BNE &BEE6
BECB  18           .     CLC
BECC  A9 00        ..    LDA #&00
BECE  C8           .     INY
BECF  71 84        q.    ADC (&84),Y
BED1  C8           .     INY
BED2  71 84        q.    ADC (&84),Y
BED4  C8           .     INY
BED5  71 84        q.    ADC (&84),Y
BED7  C8           .     INY
BED8  B0 0C        ..    BCS &BEE6
BEDA  C9 C7        ..    CMP #&C7
BEDC  F0 0B        ..    BEQ &BEE9
BEDE  C9 E8        ..    CMP #&E8
BEE0  F0 07        ..    BEQ &BEE9
BEE2  C9 7E        .~    CMP #&7E
BEE4  F0 6C        .l    BEQ &BF52
BEE6  4C 4F BF     LO.   JMP &BF4F
BEE9  A9 75        .u    LDA #&75                 ; Read VDU Status Byte
BEEB  20 F4 FF      ..   JSR osbyte
BEEE  8A           .     TXA
BEEF  30 2A        0*    BMI &BF1B
BEF1  AD A2 70     ..p   LDA &70A2
BEF4  F0 25        .%    BEQ &BF1B
BEF6  C9 01        ..    CMP #&01
BEF8  D0 17        ..    BNE &BF11
BEFA  A9 1F        ..    LDA #&1F
BEFC  20 EE FF      ..   JSR oswrch
BEFF  A9 00        ..    LDA #&00
BF01  20 EE FF      ..   JSR oswrch
BF04  A9 09        ..    LDA #&09
BF06  20 EE FF      ..   JSR oswrch
BF09  A9 0A        ..    LDA #&0A
BF0B  20 EE FF      ..   JSR oswrch
BF0E  4C 1B BF     L..   JMP &BF1B
BF11  A9 1E        ..    LDA #&1E
BF13  20 EE FF      ..   JSR oswrch
BF16  A9 0B        ..    LDA #&0B
BF18  20 EE FF      ..   JSR oswrch
BF1B  20 55 BF      U.   JSR &BF55
BF1E  8C F8 70     ..p   STY &70F8
BF21  A9 86        ..    LDA #&86                 ; Read text cursor position
BF23  20 F4 FF      ..   JSR osbyte
BF26  A9 1F        ..    LDA #&1F
BF28  20 EE FF      ..   JSR oswrch
BF2B  A9 10        ..    LDA #&10
BF2D  20 EE FF      ..   JSR oswrch
BF30  98           .     TYA
BF31  20 EE FF      ..   JSR oswrch
BF34  48           H     PHA
BF35  AC F8 70     ..p   LDY &70F8
BF38  20 73 BF      s.   JSR &BF73
BF3B  A9 1F        ..    LDA #&1F
BF3D  20 EE FF      ..   JSR oswrch
BF40  A9 1C        ..    LDA #&1C
BF42  20 EE FF      ..   JSR oswrch
BF45  68           h     PLA
BF46  20 EE FF      ..   JSR oswrch
BF49  20 73 BF      s.   JSR &BF73
BF4C  A9 00        ..    LDA #&00
BF4E  60           `     RTS
BF4F  A9 01        ..    LDA #&01
BF51  60           `     RTS
BF52  A9 FF        ..    LDA #&FF
BF54  60           `     RTS
BF55  B1 84        ..    LDA (&84),Y
BF57  8D F8 70     ..p   STA &70F8
BF5A  CE F8 70     ..p   DEC &70F8
BF5D  C8           .     INY
BF5E  B1 84        ..    LDA (&84),Y
BF60  09 80        ..    ORA #&80
BF62  20 EE FF      ..   JSR oswrch
BF65  A9 09        ..    LDA #&09
BF67  20 EE FF      ..   JSR oswrch
BF6A  20 EE FF      ..   JSR oswrch
BF6D  AD F8 70     ..p   LDA &70F8
BF70  4C 78 BF     Lx.   JMP &BF78
BF73  B1 84        ..    LDA (&84),Y
BF75  8D F8 70     ..p   STA &70F8
BF78  F0 10        ..    BEQ &BF8A
BF7A  A2 00        ..    LDX #&00
BF7C  C8           .     INY
BF7D  B1 84        ..    LDA (&84),Y
BF7F  09 80        ..    ORA #&80
BF81  20 EE FF      ..   JSR oswrch
BF84  E8           .     INX
BF85  EC F8 70     ..p   CPX &70F8
BF88  D0 F2        ..    BNE &BF7C
BF8A  C8           .     INY
BF8B  60           `     RTS
BF8C  AD A7 70     ..p   LDA &70A7
BF8F  48           H     PHA
BF90  AD A8 70     ..p   LDA &70A8
BF93  48           H     PHA
BF94  A5 82        ..    LDA &82
BF96  85 84        ..    STA &84
BF98  A5 83        ..    LDA &83
BF9A  85 85        ..    STA &85
BF9C  20 E2 BF      ..   JSR &BFE2
BF9F  20 E2 BF      ..   JSR &BFE2
BFA2  AD A7 70     ..p   LDA &70A7
BFA5  0D A8 70     ..p   ORA &70A8
BFA8  F0 2D        .-    BEQ &BFD7
BFAA  38           8     SEC
BFAB  AD A7 70     ..p   LDA &70A7
BFAE  E9 01        ..    SBC #&01
BFB0  8D A7 70     ..p   STA &70A7
BFB3  AD A8 70     ..p   LDA &70A8
BFB6  E9 00        ..    SBC #&00
BFB8  8D A8 70     ..p   STA &70A8
BFBB  20 E2 BF      ..   JSR &BFE2
BFBE  20 E2 BF      ..   JSR &BFE2
BFC1  20 E2 BF      ..   JSR &BFE2
BFC4  20 E2 BF      ..   JSR &BFE2
BFC7  18           .     CLC
BFC8  A5 84        ..    LDA &84
BFCA  69 0A        i.    ADC #&0A
BFCC  85 84        ..    STA &84
BFCE  A5 85        ..    LDA &85
BFD0  69 00        i.    ADC #&00
BFD2  85 85        ..    STA &85
BFD4  4C A2 BF     L..   JMP &BFA2
BFD7  68           h     PLA
BFD8  8D A8 70     ..p   STA &70A8
BFDB  68           h     PLA
BFDC  8D A7 70     ..p   STA &70A7
BFDF  A0 00        ..    LDY #&00
BFE1  60           `     RTS
BFE2  A0 00        ..    LDY #&00
BFE4  B1 84        ..    LDA (&84),Y
BFE6  8D F8 70     ..p   STA &70F8
BFE9  EE F8 70     ..p   INC &70F8
BFEC  18           .     CLC
BFED  A5 84        ..    LDA &84
BFEF  6D F8 70     m.p   ADC &70F8
BFF2  85 84        ..    STA &84
BFF4  A5 85        ..    LDA &85
BFF6  69 00        i.    ADC #&00
BFF8  85 85        ..    STA &85
BFFA  60           `     RTS
BFFB  20 47 2E      G.   JSR &2E47
BFFE  42           B     EQUB &42
BFFF  20                 EQUB &20          
