Home » CEEFAX disks » telesoftware14.adl » 05-03-89/T\TTX00

05-03-89/T\TTX00

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » CEEFAX disks » telesoftware14.adl
Filename: 05-03-89/T\TTX00
Read OK:
File size: 4494 bytes
Load address: 0000
Exec address: FFFFFFFF
File contents
Interfacing with the Acorn Teletext Adaptor - by - Gordon Horsington
--------------------------------------------------------------------

Module 0. Introduction
----------------------

This module introduces a block of eight modules which deal with the Acorn
Teletext Adaptor. The techniques described in this module also apply to
other adaptors which use a BBC Enterprises ATS ROM (such as the Morley
adaptor) and to the GIS ATS+ ROM, but the techniques described in modules
1 to 7 can only be used with the Acorn adaptor.

The eight modules are in files named T/TTX00 to T/TTX07. The following
topics will be covered in these modules.


Module 0. This module. Introduction and extending the ATS.
          Programs: SCROLL SUBTITL

Module 1. Teletext generated interrupts.
          Program: COUNTER

Module 2. The Teletext header packet.
          Program: HEADER

Module 3. Designing a simple Teletext frame grabber.
          Program: GRABBER

Module 4. Designing a simple Teletext keyword search utility.
          Programs: KEYWORD

Module 5. Independant Data Services, Channels 0 to 7, Part 1.
          Program: TSDP0

Module 6. Independant Data Services, Channels 0 to 7, Part 2.
          Program: TSDP2

Module 7. Independant Data Services, Channels 8 to 15.
          Program: DATCAST


The later modules develop the ideas and techniques described in the
earlier modules and for this reason they need to be worked through from
beginning to end rather than used as a reference guide. Before starting
you should read and understand either the ATS User Guide or the TFS User
Guide. It would be helpful if you have worked through the ATS course
modules previously broadcast on BBC Telesoftware, but this is not
essential. It is essential to have either BASIC 2 or BASIC 4 installed in
your computer.

When testing the programs associated with modules 1 to 7 I found that with
one particular sideways RAM / shadow RAM board installed in the BBC B
they would not work properly. The older types of sideways RAM/ROM board
(such as ATPL Sidewise) don't cause any problems. If you experience any
problems you should alter all references to the secondary interrupt vector
(irq2v at &206) to the primary interrupt vector (irq1v at &204). If a
program will still not run then disable the ATS with *NOTTX or *UNPLUG. If
this does not work then I suggest that you complain to the manufacturer of
the sideways RAM / shadow RAM board.

After completing the Teletext modules you might find the following
publications a useful source of additional information.

1) Broadcast Teletext Specification, September 1976.
   Published jointly by the BBC and IBA.

2) World System Teletext and Data Broadcasting System, August 1987.
   Published by Department of Trade and Industry, London SW1E 6SW.

I should like to thank Jeremy Brayshaw and Peter Vince both of whom have
given me access to the information used to write these modules.


--------------------------------------------
Extending the facilities provided by the ATS
--------------------------------------------

The Teletext terminal is entered using the command *TELETEXT and the
terminal is controlled using the computer keyboard. If you look at the ATS
function key strip you will see that there are three shifted function keys
which are not used by the terminal. These are Shift+f5 (ATS up to version
2.58 only), Shift+f8 and Shift+f9. If any of these shifted function keys
is pressed while in the Teletext terminal mode then the ATS issues an
unrecognised function key Osword call. The unrecognised function key
Osword call can be trapped and either two or three unused shifted function
keys (depending on the ATS version number) can be used to call up machine
code programs which extend the range of facilities offered by the ATS
terminal mode.

Osword calls are made with the accumulator containing the Osword call
number (in this case &7A) and the X and Y registers contain the address of
the Osword parameter block.

All Osword calls are passed through the Osword indirection vector at &20C
and &20D. This vector can be re-directed to point to a new routine which
can recognise the unrecognised function key and use it to call a new
machine code routine. The code used to re-direct the Osword indirection
vector and recognise a function key is shown in figure 1 below.


 .install
         LDX &20C      \ osword vector low byte
         LDY &20D      \ osword vector high byte
         CPY #newcode DIV 256 \ is the vector already modified?
         BEQ return    \ return if already altered
         STX oldvector \ save the original osword vector, low byte
         STY oldvector+1 \ and high byte
         LDX #newcode MOD 256 \ low byte of new code
         LDY #newcode DIV 256 \ and high byte
         STX &20C      \ alter osword vector, low byte
         STY &20D      \ and high byte
 .return
         RTS
 .newcode
         CMP #&7A      \ all ATS osword calls use osword &7A
         BNE jump      \ branch if not from ATS
         STX &70       \ X and Y point to the parameter block
         STY &71       \ store them for post-indexed indirect addressing
         LDY #&00      \ index to point to first parameter
         LDA (&70),Y   \ read first parameter
         CMP #&A0      \ &A0 = unused function key
         BNE exit      \ branch if not unused function key
         INY           \ point to second parameter
         LDA (&70),Y   \ read second parameter
         CMP #&15      \ shift+f5, ATS unused function key
         BEQ shiftf5   \ branch if shift+f5 pressed (ATS 2.58)
         CMP #&18      \ shift+f8, ATS unused function key
         BEQ shiftf8   \ branch if shift+f8 pressed (ATS and ATS+ 2.00)
         CMP #&1C      \ shift+f8, ATS+ unused function key
         BEQ shiftf8   \ branch if shift+f8 pressed (ATS+ 1.00)
         CMP #&19      \ shift+f9, ATS unused function key (ATS and ATS+)
         BEQ shiftf9   \ branch if shift+f9 pressed
 .exit
         LDA #&7A      \ restore accumulator
         LDY &71       \ restore Y
 .jump
         JMP (oldvector) \ exit using the original osword vector
 .oldvector
         NOP           \ store original osword vector, low byte
         NOP           \ store original osword vector, high byte
 .shiftf5
                       \ new shift+f5 routine goes in here
         RTS
 .shiftf8
                       \ new shift+f8 routine goes in here
         RTS
 .shiftf9
                       \ new shift+f9 routine goes in here
         RTS

Figure 1. Intercepting Osword &7A:&A0
-------------------------------------


All ATS Osword calls, including the unrecognised function key call, use
Osword &7A. The Osword parameter block used by the unrecognised function
key call contains two bytes. The first byte is &A0, which indicates an
unrecognised function key, and the second byte is either &15, &18, &19 or
&1C (&15 is only used by ATS versions up to 2.58 and &1C is only used by
ATS+ 1.00). If the second byte contains &15 this indicates that Shift+f5
has been pressed (ATS 2.58), &18 is used with Shift+f8, &1C with Shift+f8
(ATS+ 1.00), and &19 with Shift+f9.

The routine in figure 1 is installed by calling the memory location
labeled 'install'. This replaces the original Osword vector with a new
vector which points to the code labeled 'newcode'. The original vector is
saved in the two memory locations labeled 'oldvector'. When an Osword call
is issued it will be vectored to the newcode instead of the original code,
and the newcode can recognise the unrecognised function key call.

There are a number of important points to look at in figure 1. First of
all the install routine checks to see if the new code is already
installed. If the new code has been installed the program exits without
attempting to alter the Osword vector. When the new code is installed it
must not be installed a second time until after the Break key has been
pressed. If it is installed a second time, all Osword calls, other than
the ATS unrecognised function key call, will get into an endless loop and
hang up the computer.

The new routine does not completely replace the standard Osword code. If
an Osword call is not the Osword &7A unrecognised function key call the
routine restores the original registers and exits with an indirect jump to
the original vector. The JMP (oldvector) instruction allows all other
Osword calls to be processed as they were before the new routine was
installed.

If an ATS unrecognised funtion key call is intercepted the new routines
labeled shiftf5, shiftf8 and shiftf9 completely replace the original code
and, after executing the new routine, an exit is made with an RTS
instruction and not an indirect jump to the original code.

Any new routine used by the ATS terminal must be assembled into an area of
user memory which is not used by the ATS. If you are using a disc filing
system you can use the cassette output and input buffers (pages &09 and
&0A) and, on the BBC B, you could consider using page &0C which is not
used in mode 7. Page &0C is used for Econet workspace on the Master series
computers and may also be available to the ATS. The demonstration program
SCROLL is assembled into page &0A but this can be changed by altering the
value of mcode in line 80.

The program SCROLL is used to enlarge and scroll a part of the Teletext
page displayed by the terminal. Install the program by either *RUNning the
object code or chain the source code and press return when prompted for a
filename for the object code. Then type *TELETEXT to enter the terminal
mode. When a page is displayed press Shift+f8 to enlarge the top half of
the page to fill the screen. Press Shift+f9 to scroll the window downwards
and Shift+f8 to scroll it back up. If you are using ATS version number
2.58 (or less) then press Shift+f5 to restore the original window. The
original window will also be restored if you try to scroll down beyond the
last line (all versions of ATS and ATS+).

If double height characters are displayed on the screen you may have to
press either Shift+f8 or Shift+f9 twice to make sure that both halves of
the double height characters on the top and second lines are in the
displayed window. If only the lower half of the characters are displayed
on the top line of a screen which uses a lot of double height characters
the window looks quite confusing even though the interpretation of the
characters is correct.


   10 REM> SCROLL
   20 A%=&EA : REM : read Tube presence flag
   30 X%=0
   40 Y%=&FF
   50 IF ((USR(&FFF4)AND&FF00)DIV&100)<>0 END
   60 zeropage=&70 : REM : 2 byte workspace
   70 wordv=&20C : REM : osword indirection vector
   80 mcode=&A00 : REM :  machine code at &A00
   90 addreg=&FE00 : REM : 6845 internal register select register
  100 intreg=&FE01 : REM : 6845 internal register data register
  110 oswrch=&FFEE
  120 osbyte=&FFF4
  130 FOR pass=0 TO 2 STEP 2
  140 P%=mcode
  150 [       OPT pass
  160 .firstbyte
  170         LDX wordv     \ osword vector low byte
  180         LDY wordv+1   \ osword vector high byte
  190         CPY #newcode DIV 256 \ is the vector already modified?
  200         BEQ return    \ return if already altered
  210         STX oldvector \ save the original osword vector, low byte
  220         STY oldvector+1 \ and high byte
  230         LDX #newcode MOD 256 \ low byte of new code
  240         LDY #newcode DIV 256 \ and high byte
  250         STX wordv     \ alter osword vector, low byte
  260         STY wordv+1   \ and high byte
  270         LDA #&16      \ decimal 22
  280         JSR oswrch
  290         LDA #&07
  300         JSR oswrch    \ mode 7
  310 .screenaddr
  320         LDA #&0D      \ decimal 13
  330         STA counter   \ initialise line counter
  340         LDA #&A0      \ read VDU variable value
  350         LDX #&50      \ offset &50 points to start of screen
                            \ address
  360         JSR osbyte
  370         STX lsb       \ X contains low byte
  380         TYA           \ Y contains high byte, to be modified in
                            \ Mode 7
  390         CLD
  400         SEC
  410         SBC #&74      \ by subtracting &74
  420         EOR #&20      \ and EORing with #&20
  430         STA msb       \ Mode 7 modified high byte
  440 .return
  450         RTS
  460 .newcode
  470         CMP #&7A      \ all ATS osword calls use osword &7A
  480         BNE jump      \ branch if not from ATS
  490         STX zeropage  \ X and Y point to the parameter block
  500         STY zeropage+1
  510         LDY #&00      \ index to point to first parameter
  520         LDA (zeropage),Y \ read first parameter
  530         CMP #&A0      \ &A0 = unused function key
  540         BEQ unused    \ branch if unused function key
  550         LDA #&7A      \ restore accumulator
  560         LDY zeropage+1 \ restore Y
  570 .jump
  580         JMP (oldvector) \ exit using the original osword vector
  590 .unused
  600         INY
  610         LDA (zeropage),Y
  620         CMP #&15      \ 21 = shift+f5, ATS 2.58 unused function key
  630         BEQ full      \ display full screen
  640         CMP #&19      \ 25 = shift+f9, ATS/ATS+ unused function key
  650         BEQ down      \ scroll down screen
  660 .up
  670         LDA lsb       \ low byte of the top LH corner
  680         CLD
  690         SEC
  700         SBC #&28      \ calculate new top LH corner of screen,
                            \ low byte
  710         STA lsb
  720         LDA msb       \ high byte of the top LH corner
  730         SBC #&00      \ calculate new top LH corner of screen,
                            \ high byte
  740         STA msb
  750         INC counter
  760         BEQ up        \ if on the bottom line subtract again
  770         LDA counter
  780         CMP #&0E      \ are we on the top line?
  790         BCC scroll    \ scroll the picture
  800         JSR screenaddr \ re-initialise screen
  810 .scroll
  820         JSR all       \ and alter registers 12 and 13
  830         LDX #&00      \ register 0, horizontal total
  840         LDY #&7F      \ value 127
  850         JSR sheila    \ VDU 23;0,127;0;0;0
  860         LDX #&04      \ register 4, vertical total
  870         LDY #&0E      \ decimal 14
  880         JSR sheila    \ VDU 23;4,14;0;0;0
  890         LDX #&06      \ register 6, vertical displayed
  900         LDY #&0C      \ decimal 12
  910         JSR sheila    \ VDU 23;6,12;0;0;0
  920         INX           \ register 7, vertical sync
  930         INY           \ Y = 13
  940 .sheila
  950         STX addreg    \ select 6845 internal register
  960         STY intreg    \ store Y in 6845 internal register
  970         RTS
  980 .down
  990         LDA lsb       \ low byte of the top LH corner
 1000         CLD
 1010         CLC
 1020         ADC #&28      \ calculate new top LH corner of screen,
                            \ low byte
 1030         STA lsb
 1040         LDA msb       \ high byte of the top LH corner
 1050         ADC #&00      \ calculate new top LH corner of screen,
                            \ high byte
 1060         STA msb
 1070         DEC counter
 1080         BMI full      \ restore full page
 1090         BNE scroll    \ scroll if not the last line
 1100         LDA #&07
 1110         JSR oswrch    \ beep on the bottom line
 1120         BNE scroll    \ scroll for the last ime
 1130 .full
 1140         JSR screenaddr \ address of top LH corner of displayed
                            \ screen
 1150         JSR all       \ alter registers 12 and 13
 1160         LDX #&00      \ register 0, horizontal total
 1170         LDY #&3F      \ decimal 63
 1180         JSR sheila    \ VDU 23;0,63;0;0;0
 1190         LDX #&04      \ register 4, vertical total
 1200         LDY #&1E      \ decimal 30
 1210         JSR sheila    \ VDU 23;4,30;0;0;0
 1220         LDX #&06      \ register 6, vertical displayed
 1230         LDY #&19      \ decimal 25
 1240         JSR sheila    \ VDU 23;6,25;0;0;0
 1250         INX           \ register 7, vertical sync
 1260         LDY #&1B      \ decimal 27
 1270         JMP sheila    \ VDU 23;7,27;0;0;0 and return
 1280 .all
 1290         LDX #&0C      \ register 12, high byte screen start address
 1300         LDY msb       \ value
 1310         JSR sheila    \ VDU 23;12,msb;0;0;0
 1320         INX           \ register 13, low byte screen start address
 1330         LDY lsb       \ value
 1340         JSR sheila    \ VDU 23;13,lsb;0;0;0
 1350         LDA #&13      \ decimal 19
 1360         JMP osbyte    \ wait for vertical sync then return
 1370 .counter
 1380         EQUB &00
 1390 .lsb
 1400         EQUB &00
 1410 .msb
 1420         EQUB &00
 1430 .oldvector
 1440         EQUW &00
 1450 .lastbyte
 1460 ]
 1470 NEXT
 1480 INPUT"Filename for object code = "save$
 1490 IF save$ ="" CALL mcode : END
 1500 *OPT1,2
 1510 OSCLI("SAVE "+save$+" "+STR$~(&FFFF0000 OR firstbyte)+" "
      +STR$~(&FFFF0000 OR lastbyte))
 1520 *OPT0,0


A program called SUBTITL is also broadcast with this module and it can be
used to give the ATS function keys the same capability as the ATS+ 1.00
function keys used with the Advanced Teletext Receiver. This program
enables the use of subtitles with Shift+f8. Chain the program and either
specify a filename for the object code or press the Return key to install
the routine. Subtitles can then be called on the currently selected
channel by pressing Shift+f8. To exit from the subtitle routine press f9
(without Shift) followed by Break.
00000000  49 6e 74 65 72 66 61 63  69 6e 67 20 77 69 74 68  |Interfacing with|
00000010  20 74 68 65 20 41 63 6f  72 6e 20 54 65 6c 65 74  | the Acorn Telet|
00000020  65 78 74 20 41 64 61 70  74 6f 72 20 2d 20 62 79  |ext Adaptor - by|
00000030  20 2d 20 47 6f 72 64 6f  6e 20 48 6f 72 73 69 6e  | - Gordon Horsin|
00000040  67 74 6f 6e 0d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |gton.-----------|
00000050  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000080  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 0d 4d 6f 64 75 6c  |---------..Modul|
00000090  65 20 30 2e 20 49 6e 74  72 6f 64 75 63 74 69 6f  |e 0. Introductio|
000000a0  6e 0d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |n.--------------|
000000b0  2d 2d 2d 2d 2d 2d 2d 2d  0d 0d 54 68 69 73 20 6d  |--------..This m|
000000c0  6f 64 75 6c 65 20 69 6e  74 72 6f 64 75 63 65 73  |odule introduces|
000000d0  20 61 20 62 6c 6f 63 6b  20 6f 66 20 65 69 67 68  | a block of eigh|
000000e0  74 20 6d 6f 64 75 6c 65  73 20 77 68 69 63 68 20  |t modules which |
000000f0  64 65 61 6c 20 77 69 74  68 20 74 68 65 20 41 63  |deal with the Ac|
00000100  6f 72 6e 0d 54 65 6c 65  74 65 78 74 20 41 64 61  |orn.Teletext Ada|
00000110  70 74 6f 72 2e 20 54 68  65 20 74 65 63 68 6e 69  |ptor. The techni|
00000120  71 75 65 73 20 64 65 73  63 72 69 62 65 64 20 69  |ques described i|
00000130  6e 20 74 68 69 73 20 6d  6f 64 75 6c 65 20 61 6c  |n this module al|
00000140  73 6f 20 61 70 70 6c 79  20 74 6f 0d 6f 74 68 65  |so apply to.othe|
00000150  72 20 61 64 61 70 74 6f  72 73 20 77 68 69 63 68  |r adaptors which|
00000160  20 75 73 65 20 61 20 42  42 43 20 45 6e 74 65 72  | use a BBC Enter|
00000170  70 72 69 73 65 73 20 41  54 53 20 52 4f 4d 20 28  |prises ATS ROM (|
00000180  73 75 63 68 20 61 73 20  74 68 65 20 4d 6f 72 6c  |such as the Morl|
00000190  65 79 0d 61 64 61 70 74  6f 72 29 20 61 6e 64 20  |ey.adaptor) and |
000001a0  74 6f 20 74 68 65 20 47  49 53 20 41 54 53 2b 20  |to the GIS ATS+ |
000001b0  52 4f 4d 2c 20 62 75 74  20 74 68 65 20 74 65 63  |ROM, but the tec|
000001c0  68 6e 69 71 75 65 73 20  64 65 73 63 72 69 62 65  |hniques describe|
000001d0  64 20 69 6e 20 6d 6f 64  75 6c 65 73 0d 31 20 74  |d in modules.1 t|
000001e0  6f 20 37 20 63 61 6e 20  6f 6e 6c 79 20 62 65 20  |o 7 can only be |
000001f0  75 73 65 64 20 77 69 74  68 20 74 68 65 20 41 63  |used with the Ac|
00000200  6f 72 6e 20 61 64 61 70  74 6f 72 2e 0d 0d 54 68  |orn adaptor...Th|
00000210  65 20 65 69 67 68 74 20  6d 6f 64 75 6c 65 73 20  |e eight modules |
00000220  61 72 65 20 69 6e 20 66  69 6c 65 73 20 6e 61 6d  |are in files nam|
00000230  65 64 20 54 2f 54 54 58  30 30 20 74 6f 20 54 2f  |ed T/TTX00 to T/|
00000240  54 54 58 30 37 2e 20 54  68 65 20 66 6f 6c 6c 6f  |TTX07. The follo|
00000250  77 69 6e 67 0d 74 6f 70  69 63 73 20 77 69 6c 6c  |wing.topics will|
00000260  20 62 65 20 63 6f 76 65  72 65 64 20 69 6e 20 74  | be covered in t|
00000270  68 65 73 65 20 6d 6f 64  75 6c 65 73 2e 0d 0d 0d  |hese modules....|
00000280  4d 6f 64 75 6c 65 20 30  2e 20 54 68 69 73 20 6d  |Module 0. This m|
00000290  6f 64 75 6c 65 2e 20 49  6e 74 72 6f 64 75 63 74  |odule. Introduct|
000002a0  69 6f 6e 20 61 6e 64 20  65 78 74 65 6e 64 69 6e  |ion and extendin|
000002b0  67 20 74 68 65 20 41 54  53 2e 0d 20 20 20 20 20  |g the ATS..     |
000002c0  20 20 20 20 20 50 72 6f  67 72 61 6d 73 3a 20 53  |     Programs: S|
000002d0  43 52 4f 4c 4c 20 53 55  42 54 49 54 4c 0d 0d 4d  |CROLL SUBTITL..M|
000002e0  6f 64 75 6c 65 20 31 2e  20 54 65 6c 65 74 65 78  |odule 1. Teletex|
000002f0  74 20 67 65 6e 65 72 61  74 65 64 20 69 6e 74 65  |t generated inte|
00000300  72 72 75 70 74 73 2e 0d  20 20 20 20 20 20 20 20  |rrupts..        |
00000310  20 20 50 72 6f 67 72 61  6d 3a 20 43 4f 55 4e 54  |  Program: COUNT|
00000320  45 52 0d 0d 4d 6f 64 75  6c 65 20 32 2e 20 54 68  |ER..Module 2. Th|
00000330  65 20 54 65 6c 65 74 65  78 74 20 68 65 61 64 65  |e Teletext heade|
00000340  72 20 70 61 63 6b 65 74  2e 0d 20 20 20 20 20 20  |r packet..      |
00000350  20 20 20 20 50 72 6f 67  72 61 6d 3a 20 48 45 41  |    Program: HEA|
00000360  44 45 52 0d 0d 4d 6f 64  75 6c 65 20 33 2e 20 44  |DER..Module 3. D|
00000370  65 73 69 67 6e 69 6e 67  20 61 20 73 69 6d 70 6c  |esigning a simpl|
00000380  65 20 54 65 6c 65 74 65  78 74 20 66 72 61 6d 65  |e Teletext frame|
00000390  20 67 72 61 62 62 65 72  2e 0d 20 20 20 20 20 20  | grabber..      |
000003a0  20 20 20 20 50 72 6f 67  72 61 6d 3a 20 47 52 41  |    Program: GRA|
000003b0  42 42 45 52 0d 0d 4d 6f  64 75 6c 65 20 34 2e 20  |BBER..Module 4. |
000003c0  44 65 73 69 67 6e 69 6e  67 20 61 20 73 69 6d 70  |Designing a simp|
000003d0  6c 65 20 54 65 6c 65 74  65 78 74 20 6b 65 79 77  |le Teletext keyw|
000003e0  6f 72 64 20 73 65 61 72  63 68 20 75 74 69 6c 69  |ord search utili|
000003f0  74 79 2e 0d 20 20 20 20  20 20 20 20 20 20 50 72  |ty..          Pr|
00000400  6f 67 72 61 6d 73 3a 20  4b 45 59 57 4f 52 44 0d  |ograms: KEYWORD.|
00000410  0d 4d 6f 64 75 6c 65 20  35 2e 20 49 6e 64 65 70  |.Module 5. Indep|
00000420  65 6e 64 61 6e 74 20 44  61 74 61 20 53 65 72 76  |endant Data Serv|
00000430  69 63 65 73 2c 20 43 68  61 6e 6e 65 6c 73 20 30  |ices, Channels 0|
00000440  20 74 6f 20 37 2c 20 50  61 72 74 20 31 2e 0d 20  | to 7, Part 1.. |
00000450  20 20 20 20 20 20 20 20  20 50 72 6f 67 72 61 6d  |         Program|
00000460  3a 20 54 53 44 50 30 0d  0d 4d 6f 64 75 6c 65 20  |: TSDP0..Module |
00000470  36 2e 20 49 6e 64 65 70  65 6e 64 61 6e 74 20 44  |6. Independant D|
00000480  61 74 61 20 53 65 72 76  69 63 65 73 2c 20 43 68  |ata Services, Ch|
00000490  61 6e 6e 65 6c 73 20 30  20 74 6f 20 37 2c 20 50  |annels 0 to 7, P|
000004a0  61 72 74 20 32 2e 0d 20  20 20 20 20 20 20 20 20  |art 2..         |
000004b0  20 50 72 6f 67 72 61 6d  3a 20 54 53 44 50 32 0d  | Program: TSDP2.|
000004c0  0d 4d 6f 64 75 6c 65 20  37 2e 20 49 6e 64 65 70  |.Module 7. Indep|
000004d0  65 6e 64 61 6e 74 20 44  61 74 61 20 53 65 72 76  |endant Data Serv|
000004e0  69 63 65 73 2c 20 43 68  61 6e 6e 65 6c 73 20 38  |ices, Channels 8|
000004f0  20 74 6f 20 31 35 2e 0d  20 20 20 20 20 20 20 20  | to 15..        |
00000500  20 20 50 72 6f 67 72 61  6d 3a 20 44 41 54 43 41  |  Program: DATCA|
00000510  53 54 0d 0d 0d 54 68 65  20 6c 61 74 65 72 20 6d  |ST...The later m|
00000520  6f 64 75 6c 65 73 20 64  65 76 65 6c 6f 70 20 74  |odules develop t|
00000530  68 65 20 69 64 65 61 73  20 61 6e 64 20 74 65 63  |he ideas and tec|
00000540  68 6e 69 71 75 65 73 20  64 65 73 63 72 69 62 65  |hniques describe|
00000550  64 20 69 6e 20 74 68 65  0d 65 61 72 6c 69 65 72  |d in the.earlier|
00000560  20 6d 6f 64 75 6c 65 73  20 61 6e 64 20 66 6f 72  | modules and for|
00000570  20 74 68 69 73 20 72 65  61 73 6f 6e 20 74 68 65  | this reason the|
00000580  79 20 6e 65 65 64 20 74  6f 20 62 65 20 77 6f 72  |y need to be wor|
00000590  6b 65 64 20 74 68 72 6f  75 67 68 20 66 72 6f 6d  |ked through from|
000005a0  0d 62 65 67 69 6e 6e 69  6e 67 20 74 6f 20 65 6e  |.beginning to en|
000005b0  64 20 72 61 74 68 65 72  20 74 68 61 6e 20 75 73  |d rather than us|
000005c0  65 64 20 61 73 20 61 20  72 65 66 65 72 65 6e 63  |ed as a referenc|
000005d0  65 20 67 75 69 64 65 2e  20 42 65 66 6f 72 65 20  |e guide. Before |
000005e0  73 74 61 72 74 69 6e 67  0d 79 6f 75 20 73 68 6f  |starting.you sho|
000005f0  75 6c 64 20 72 65 61 64  20 61 6e 64 20 75 6e 64  |uld read and und|
00000600  65 72 73 74 61 6e 64 20  65 69 74 68 65 72 20 74  |erstand either t|
00000610  68 65 20 41 54 53 20 55  73 65 72 20 47 75 69 64  |he ATS User Guid|
00000620  65 20 6f 72 20 74 68 65  20 54 46 53 20 55 73 65  |e or the TFS Use|
00000630  72 0d 47 75 69 64 65 2e  20 49 74 20 77 6f 75 6c  |r.Guide. It woul|
00000640  64 20 62 65 20 68 65 6c  70 66 75 6c 20 69 66 20  |d be helpful if |
00000650  79 6f 75 20 68 61 76 65  20 77 6f 72 6b 65 64 20  |you have worked |
00000660  74 68 72 6f 75 67 68 20  74 68 65 20 41 54 53 20  |through the ATS |
00000670  63 6f 75 72 73 65 0d 6d  6f 64 75 6c 65 73 20 70  |course.modules p|
00000680  72 65 76 69 6f 75 73 6c  79 20 62 72 6f 61 64 63  |reviously broadc|
00000690  61 73 74 20 6f 6e 20 42  42 43 20 54 65 6c 65 73  |ast on BBC Teles|
000006a0  6f 66 74 77 61 72 65 2c  20 62 75 74 20 74 68 69  |oftware, but thi|
000006b0  73 20 69 73 20 6e 6f 74  0d 65 73 73 65 6e 74 69  |s is not.essenti|
000006c0  61 6c 2e 20 49 74 20 69  73 20 65 73 73 65 6e 74  |al. It is essent|
000006d0  69 61 6c 20 74 6f 20 68  61 76 65 20 65 69 74 68  |ial to have eith|
000006e0  65 72 20 42 41 53 49 43  20 32 20 6f 72 20 42 41  |er BASIC 2 or BA|
000006f0  53 49 43 20 34 20 69 6e  73 74 61 6c 6c 65 64 20  |SIC 4 installed |
00000700  69 6e 0d 79 6f 75 72 20  63 6f 6d 70 75 74 65 72  |in.your computer|
00000710  2e 0d 0d 57 68 65 6e 20  74 65 73 74 69 6e 67 20  |...When testing |
00000720  74 68 65 20 70 72 6f 67  72 61 6d 73 20 61 73 73  |the programs ass|
00000730  6f 63 69 61 74 65 64 20  77 69 74 68 20 6d 6f 64  |ociated with mod|
00000740  75 6c 65 73 20 31 20 74  6f 20 37 20 49 20 66 6f  |ules 1 to 7 I fo|
00000750  75 6e 64 20 74 68 61 74  20 77 69 74 68 0d 6f 6e  |und that with.on|
00000760  65 20 70 61 72 74 69 63  75 6c 61 72 20 73 69 64  |e particular sid|
00000770  65 77 61 79 73 20 52 41  4d 20 2f 20 73 68 61 64  |eways RAM / shad|
00000780  6f 77 20 52 41 4d 20 62  6f 61 72 64 20 69 6e 73  |ow RAM board ins|
00000790  74 61 6c 6c 65 64 20 69  6e 20 74 68 65 20 42 42  |talled in the BB|
000007a0  43 20 42 0d 74 68 65 79  20 77 6f 75 6c 64 20 6e  |C B.they would n|
000007b0  6f 74 20 77 6f 72 6b 20  70 72 6f 70 65 72 6c 79  |ot work properly|
000007c0  2e 20 54 68 65 20 6f 6c  64 65 72 20 74 79 70 65  |. The older type|
000007d0  73 20 6f 66 20 73 69 64  65 77 61 79 73 20 52 41  |s of sideways RA|
000007e0  4d 2f 52 4f 4d 20 62 6f  61 72 64 0d 28 73 75 63  |M/ROM board.(suc|
000007f0  68 20 61 73 20 41 54 50  4c 20 53 69 64 65 77 69  |h as ATPL Sidewi|
00000800  73 65 29 20 64 6f 6e 27  74 20 63 61 75 73 65 20  |se) don't cause |
00000810  61 6e 79 20 70 72 6f 62  6c 65 6d 73 2e 20 49 66  |any problems. If|
00000820  20 79 6f 75 20 65 78 70  65 72 69 65 6e 63 65 20  | you experience |
00000830  61 6e 79 0d 70 72 6f 62  6c 65 6d 73 20 79 6f 75  |any.problems you|
00000840  20 73 68 6f 75 6c 64 20  61 6c 74 65 72 20 61 6c  | should alter al|
00000850  6c 20 72 65 66 65 72 65  6e 63 65 73 20 74 6f 20  |l references to |
00000860  74 68 65 20 73 65 63 6f  6e 64 61 72 79 20 69 6e  |the secondary in|
00000870  74 65 72 72 75 70 74 20  76 65 63 74 6f 72 0d 28  |terrupt vector.(|
00000880  69 72 71 32 76 20 61 74  20 26 32 30 36 29 20 74  |irq2v at &206) t|
00000890  6f 20 74 68 65 20 70 72  69 6d 61 72 79 20 69 6e  |o the primary in|
000008a0  74 65 72 72 75 70 74 20  76 65 63 74 6f 72 20 28  |terrupt vector (|
000008b0  69 72 71 31 76 20 61 74  20 26 32 30 34 29 2e 20  |irq1v at &204). |
000008c0  49 66 20 61 0d 70 72 6f  67 72 61 6d 20 77 69 6c  |If a.program wil|
000008d0  6c 20 73 74 69 6c 6c 20  6e 6f 74 20 72 75 6e 20  |l still not run |
000008e0  74 68 65 6e 20 64 69 73  61 62 6c 65 20 74 68 65  |then disable the|
000008f0  20 41 54 53 20 77 69 74  68 20 2a 4e 4f 54 54 58  | ATS with *NOTTX|
00000900  20 6f 72 20 2a 55 4e 50  4c 55 47 2e 20 49 66 0d  | or *UNPLUG. If.|
00000910  74 68 69 73 20 64 6f 65  73 20 6e 6f 74 20 77 6f  |this does not wo|
00000920  72 6b 20 74 68 65 6e 20  49 20 73 75 67 67 65 73  |rk then I sugges|
00000930  74 20 74 68 61 74 20 79  6f 75 20 63 6f 6d 70 6c  |t that you compl|
00000940  61 69 6e 20 74 6f 20 74  68 65 20 6d 61 6e 75 66  |ain to the manuf|
00000950  61 63 74 75 72 65 72 20  6f 66 0d 74 68 65 20 73  |acturer of.the s|
00000960  69 64 65 77 61 79 73 20  52 41 4d 20 2f 20 73 68  |ideways RAM / sh|
00000970  61 64 6f 77 20 52 41 4d  20 62 6f 61 72 64 2e 0d  |adow RAM board..|
00000980  0d 41 66 74 65 72 20 63  6f 6d 70 6c 65 74 69 6e  |.After completin|
00000990  67 20 74 68 65 20 54 65  6c 65 74 65 78 74 20 6d  |g the Teletext m|
000009a0  6f 64 75 6c 65 73 20 79  6f 75 20 6d 69 67 68 74  |odules you might|
000009b0  20 66 69 6e 64 20 74 68  65 20 66 6f 6c 6c 6f 77  | find the follow|
000009c0  69 6e 67 0d 70 75 62 6c  69 63 61 74 69 6f 6e 73  |ing.publications|
000009d0  20 61 20 75 73 65 66 75  6c 20 73 6f 75 72 63 65  | a useful source|
000009e0  20 6f 66 20 61 64 64 69  74 69 6f 6e 61 6c 20 69  | of additional i|
000009f0  6e 66 6f 72 6d 61 74 69  6f 6e 2e 0d 0d 31 29 20  |nformation...1) |
00000a00  42 72 6f 61 64 63 61 73  74 20 54 65 6c 65 74 65  |Broadcast Telete|
00000a10  78 74 20 53 70 65 63 69  66 69 63 61 74 69 6f 6e  |xt Specification|
00000a20  2c 20 53 65 70 74 65 6d  62 65 72 20 31 39 37 36  |, September 1976|
00000a30  2e 0d 20 20 20 50 75 62  6c 69 73 68 65 64 20 6a  |..   Published j|
00000a40  6f 69 6e 74 6c 79 20 62  79 20 74 68 65 20 42 42  |ointly by the BB|
00000a50  43 20 61 6e 64 20 49 42  41 2e 0d 0d 32 29 20 57  |C and IBA...2) W|
00000a60  6f 72 6c 64 20 53 79 73  74 65 6d 20 54 65 6c 65  |orld System Tele|
00000a70  74 65 78 74 20 61 6e 64  20 44 61 74 61 20 42 72  |text and Data Br|
00000a80  6f 61 64 63 61 73 74 69  6e 67 20 53 79 73 74 65  |oadcasting Syste|
00000a90  6d 2c 20 41 75 67 75 73  74 20 31 39 38 37 2e 0d  |m, August 1987..|
00000aa0  20 20 20 50 75 62 6c 69  73 68 65 64 20 62 79 20  |   Published by |
00000ab0  44 65 70 61 72 74 6d 65  6e 74 20 6f 66 20 54 72  |Department of Tr|
00000ac0  61 64 65 20 61 6e 64 20  49 6e 64 75 73 74 72 79  |ade and Industry|
00000ad0  2c 20 4c 6f 6e 64 6f 6e  20 53 57 31 45 20 36 53  |, London SW1E 6S|
00000ae0  57 2e 0d 0d 49 20 73 68  6f 75 6c 64 20 6c 69 6b  |W...I should lik|
00000af0  65 20 74 6f 20 74 68 61  6e 6b 20 4a 65 72 65 6d  |e to thank Jerem|
00000b00  79 20 42 72 61 79 73 68  61 77 20 61 6e 64 20 50  |y Brayshaw and P|
00000b10  65 74 65 72 20 56 69 6e  63 65 20 62 6f 74 68 20  |eter Vince both |
00000b20  6f 66 20 77 68 6f 6d 20  68 61 76 65 0d 67 69 76  |of whom have.giv|
00000b30  65 6e 20 6d 65 20 61 63  63 65 73 73 20 74 6f 20  |en me access to |
00000b40  74 68 65 20 69 6e 66 6f  72 6d 61 74 69 6f 6e 20  |the information |
00000b50  75 73 65 64 20 74 6f 20  77 72 69 74 65 20 74 68  |used to write th|
00000b60  65 73 65 20 6d 6f 64 75  6c 65 73 2e 0d 0d 0d 2d  |ese modules....-|
00000b70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000b90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 45 78 74 65  |-----------.Exte|
00000ba0  6e 64 69 6e 67 20 74 68  65 20 66 61 63 69 6c 69  |nding the facili|
00000bb0  74 69 65 73 20 70 72 6f  76 69 64 65 64 20 62 79  |ties provided by|
00000bc0  20 74 68 65 20 41 54 53  0d 2d 2d 2d 2d 2d 2d 2d  | the ATS.-------|
00000bd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000bf0  2d 2d 2d 2d 2d 0d 0d 54  68 65 20 54 65 6c 65 74  |-----..The Telet|
00000c00  65 78 74 20 74 65 72 6d  69 6e 61 6c 20 69 73 20  |ext terminal is |
00000c10  65 6e 74 65 72 65 64 20  75 73 69 6e 67 20 74 68  |entered using th|
00000c20  65 20 63 6f 6d 6d 61 6e  64 20 2a 54 45 4c 45 54  |e command *TELET|
00000c30  45 58 54 20 61 6e 64 20  74 68 65 0d 74 65 72 6d  |EXT and the.term|
00000c40  69 6e 61 6c 20 69 73 20  63 6f 6e 74 72 6f 6c 6c  |inal is controll|
00000c50  65 64 20 75 73 69 6e 67  20 74 68 65 20 63 6f 6d  |ed using the com|
00000c60  70 75 74 65 72 20 6b 65  79 62 6f 61 72 64 2e 20  |puter keyboard. |
00000c70  49 66 20 79 6f 75 20 6c  6f 6f 6b 20 61 74 20 74  |If you look at t|
00000c80  68 65 20 41 54 53 0d 66  75 6e 63 74 69 6f 6e 20  |he ATS.function |
00000c90  6b 65 79 20 73 74 72 69  70 20 79 6f 75 20 77 69  |key strip you wi|
00000ca0  6c 6c 20 73 65 65 20 74  68 61 74 20 74 68 65 72  |ll see that ther|
00000cb0  65 20 61 72 65 20 74 68  72 65 65 20 73 68 69 66  |e are three shif|
00000cc0  74 65 64 20 66 75 6e 63  74 69 6f 6e 20 6b 65 79  |ted function key|
00000cd0  73 0d 77 68 69 63 68 20  61 72 65 20 6e 6f 74 20  |s.which are not |
00000ce0  75 73 65 64 20 62 79 20  74 68 65 20 74 65 72 6d  |used by the term|
00000cf0  69 6e 61 6c 2e 20 54 68  65 73 65 20 61 72 65 20  |inal. These are |
00000d00  53 68 69 66 74 2b 66 35  20 28 41 54 53 20 75 70  |Shift+f5 (ATS up|
00000d10  20 74 6f 20 76 65 72 73  69 6f 6e 0d 32 2e 35 38  | to version.2.58|
00000d20  20 6f 6e 6c 79 29 2c 20  53 68 69 66 74 2b 66 38  | only), Shift+f8|
00000d30  20 61 6e 64 20 53 68 69  66 74 2b 66 39 2e 20 49  | and Shift+f9. I|
00000d40  66 20 61 6e 79 20 6f 66  20 74 68 65 73 65 20 73  |f any of these s|
00000d50  68 69 66 74 65 64 20 66  75 6e 63 74 69 6f 6e 20  |hifted function |
00000d60  6b 65 79 73 0d 69 73 20  70 72 65 73 73 65 64 20  |keys.is pressed |
00000d70  77 68 69 6c 65 20 69 6e  20 74 68 65 20 54 65 6c  |while in the Tel|
00000d80  65 74 65 78 74 20 74 65  72 6d 69 6e 61 6c 20 6d  |etext terminal m|
00000d90  6f 64 65 20 74 68 65 6e  20 74 68 65 20 41 54 53  |ode then the ATS|
00000da0  20 69 73 73 75 65 73 20  61 6e 0d 75 6e 72 65 63  | issues an.unrec|
00000db0  6f 67 6e 69 73 65 64 20  66 75 6e 63 74 69 6f 6e  |ognised function|
00000dc0  20 6b 65 79 20 4f 73 77  6f 72 64 20 63 61 6c 6c  | key Osword call|
00000dd0  2e 20 54 68 65 20 75 6e  72 65 63 6f 67 6e 69 73  |. The unrecognis|
00000de0  65 64 20 66 75 6e 63 74  69 6f 6e 20 6b 65 79 0d  |ed function key.|
00000df0  4f 73 77 6f 72 64 20 63  61 6c 6c 20 63 61 6e 20  |Osword call can |
00000e00  62 65 20 74 72 61 70 70  65 64 20 61 6e 64 20 65  |be trapped and e|
00000e10  69 74 68 65 72 20 74 77  6f 20 6f 72 20 74 68 72  |ither two or thr|
00000e20  65 65 20 75 6e 75 73 65  64 20 73 68 69 66 74 65  |ee unused shifte|
00000e30  64 20 66 75 6e 63 74 69  6f 6e 0d 6b 65 79 73 20  |d function.keys |
00000e40  28 64 65 70 65 6e 64 69  6e 67 20 6f 6e 20 74 68  |(depending on th|
00000e50  65 20 41 54 53 20 76 65  72 73 69 6f 6e 20 6e 75  |e ATS version nu|
00000e60  6d 62 65 72 29 20 63 61  6e 20 62 65 20 75 73 65  |mber) can be use|
00000e70  64 20 74 6f 20 63 61 6c  6c 20 75 70 20 6d 61 63  |d to call up mac|
00000e80  68 69 6e 65 0d 63 6f 64  65 20 70 72 6f 67 72 61  |hine.code progra|
00000e90  6d 73 20 77 68 69 63 68  20 65 78 74 65 6e 64 20  |ms which extend |
00000ea0  74 68 65 20 72 61 6e 67  65 20 6f 66 20 66 61 63  |the range of fac|
00000eb0  69 6c 69 74 69 65 73 20  6f 66 66 65 72 65 64 20  |ilities offered |
00000ec0  62 79 20 74 68 65 20 41  54 53 0d 74 65 72 6d 69  |by the ATS.termi|
00000ed0  6e 61 6c 20 6d 6f 64 65  2e 0d 0d 4f 73 77 6f 72  |nal mode...Oswor|
00000ee0  64 20 63 61 6c 6c 73 20  61 72 65 20 6d 61 64 65  |d calls are made|
00000ef0  20 77 69 74 68 20 74 68  65 20 61 63 63 75 6d 75  | with the accumu|
00000f00  6c 61 74 6f 72 20 63 6f  6e 74 61 69 6e 69 6e 67  |lator containing|
00000f10  20 74 68 65 20 4f 73 77  6f 72 64 20 63 61 6c 6c  | the Osword call|
00000f20  0d 6e 75 6d 62 65 72 20  28 69 6e 20 74 68 69 73  |.number (in this|
00000f30  20 63 61 73 65 20 26 37  41 29 20 61 6e 64 20 74  | case &7A) and t|
00000f40  68 65 20 58 20 61 6e 64  20 59 20 72 65 67 69 73  |he X and Y regis|
00000f50  74 65 72 73 20 63 6f 6e  74 61 69 6e 20 74 68 65  |ters contain the|
00000f60  20 61 64 64 72 65 73 73  20 6f 66 0d 74 68 65 20  | address of.the |
00000f70  4f 73 77 6f 72 64 20 70  61 72 61 6d 65 74 65 72  |Osword parameter|
00000f80  20 62 6c 6f 63 6b 2e 0d  0d 41 6c 6c 20 4f 73 77  | block...All Osw|
00000f90  6f 72 64 20 63 61 6c 6c  73 20 61 72 65 20 70 61  |ord calls are pa|
00000fa0  73 73 65 64 20 74 68 72  6f 75 67 68 20 74 68 65  |ssed through the|
00000fb0  20 4f 73 77 6f 72 64 20  69 6e 64 69 72 65 63 74  | Osword indirect|
00000fc0  69 6f 6e 20 76 65 63 74  6f 72 20 61 74 20 26 32  |ion vector at &2|
00000fd0  30 43 0d 61 6e 64 20 26  32 30 44 2e 20 54 68 69  |0C.and &20D. Thi|
00000fe0  73 20 76 65 63 74 6f 72  20 63 61 6e 20 62 65 20  |s vector can be |
00000ff0  72 65 2d 64 69 72 65 63  74 65 64 20 74 6f 20 70  |re-directed to p|
00001000  6f 69 6e 74 20 74 6f 20  61 20 6e 65 77 20 72 6f  |oint to a new ro|
00001010  75 74 69 6e 65 20 77 68  69 63 68 0d 63 61 6e 20  |utine which.can |
00001020  72 65 63 6f 67 6e 69 73  65 20 74 68 65 20 75 6e  |recognise the un|
00001030  72 65 63 6f 67 6e 69 73  65 64 20 66 75 6e 63 74  |recognised funct|
00001040  69 6f 6e 20 6b 65 79 20  61 6e 64 20 75 73 65 20  |ion key and use |
00001050  69 74 20 74 6f 20 63 61  6c 6c 20 61 20 6e 65 77  |it to call a new|
00001060  0d 6d 61 63 68 69 6e 65  20 63 6f 64 65 20 72 6f  |.machine code ro|
00001070  75 74 69 6e 65 2e 20 54  68 65 20 63 6f 64 65 20  |utine. The code |
00001080  75 73 65 64 20 74 6f 20  72 65 2d 64 69 72 65 63  |used to re-direc|
00001090  74 20 74 68 65 20 4f 73  77 6f 72 64 20 69 6e 64  |t the Osword ind|
000010a0  69 72 65 63 74 69 6f 6e  0d 76 65 63 74 6f 72 20  |irection.vector |
000010b0  61 6e 64 20 72 65 63 6f  67 6e 69 73 65 20 61 20  |and recognise a |
000010c0  66 75 6e 63 74 69 6f 6e  20 6b 65 79 20 69 73 20  |function key is |
000010d0  73 68 6f 77 6e 20 69 6e  20 66 69 67 75 72 65 20  |shown in figure |
000010e0  31 20 62 65 6c 6f 77 2e  0d 0d 0d 20 2e 69 6e 73  |1 below.... .ins|
000010f0  74 61 6c 6c 0d 20 20 20  20 20 20 20 20 20 4c 44  |tall.         LD|
00001100  58 20 26 32 30 43 20 20  20 20 20 20 5c 20 6f 73  |X &20C      \ os|
00001110  77 6f 72 64 20 76 65 63  74 6f 72 20 6c 6f 77 20  |word vector low |
00001120  62 79 74 65 0d 20 20 20  20 20 20 20 20 20 4c 44  |byte.         LD|
00001130  59 20 26 32 30 44 20 20  20 20 20 20 5c 20 6f 73  |Y &20D      \ os|
00001140  77 6f 72 64 20 76 65 63  74 6f 72 20 68 69 67 68  |word vector high|
00001150  20 62 79 74 65 0d 20 20  20 20 20 20 20 20 20 43  | byte.         C|
00001160  50 59 20 23 6e 65 77 63  6f 64 65 20 44 49 56 20  |PY #newcode DIV |
00001170  32 35 36 20 5c 20 69 73  20 74 68 65 20 76 65 63  |256 \ is the vec|
00001180  74 6f 72 20 61 6c 72 65  61 64 79 20 6d 6f 64 69  |tor already modi|
00001190  66 69 65 64 3f 0d 20 20  20 20 20 20 20 20 20 42  |fied?.         B|
000011a0  45 51 20 72 65 74 75 72  6e 20 20 20 20 5c 20 72  |EQ return    \ r|
000011b0  65 74 75 72 6e 20 69 66  20 61 6c 72 65 61 64 79  |eturn if already|
000011c0  20 61 6c 74 65 72 65 64  0d 20 20 20 20 20 20 20  | altered.       |
000011d0  20 20 53 54 58 20 6f 6c  64 76 65 63 74 6f 72 20  |  STX oldvector |
000011e0  5c 20 73 61 76 65 20 74  68 65 20 6f 72 69 67 69  |\ save the origi|
000011f0  6e 61 6c 20 6f 73 77 6f  72 64 20 76 65 63 74 6f  |nal osword vecto|
00001200  72 2c 20 6c 6f 77 20 62  79 74 65 0d 20 20 20 20  |r, low byte.    |
00001210  20 20 20 20 20 53 54 59  20 6f 6c 64 76 65 63 74  |     STY oldvect|
00001220  6f 72 2b 31 20 5c 20 61  6e 64 20 68 69 67 68 20  |or+1 \ and high |
00001230  62 79 74 65 0d 20 20 20  20 20 20 20 20 20 4c 44  |byte.         LD|
00001240  58 20 23 6e 65 77 63 6f  64 65 20 4d 4f 44 20 32  |X #newcode MOD 2|
00001250  35 36 20 5c 20 6c 6f 77  20 62 79 74 65 20 6f 66  |56 \ low byte of|
00001260  20 6e 65 77 20 63 6f 64  65 0d 20 20 20 20 20 20  | new code.      |
00001270  20 20 20 4c 44 59 20 23  6e 65 77 63 6f 64 65 20  |   LDY #newcode |
00001280  44 49 56 20 32 35 36 20  5c 20 61 6e 64 20 68 69  |DIV 256 \ and hi|
00001290  67 68 20 62 79 74 65 0d  20 20 20 20 20 20 20 20  |gh byte.        |
000012a0  20 53 54 58 20 26 32 30  43 20 20 20 20 20 20 5c  | STX &20C      \|
000012b0  20 61 6c 74 65 72 20 6f  73 77 6f 72 64 20 76 65  | alter osword ve|
000012c0  63 74 6f 72 2c 20 6c 6f  77 20 62 79 74 65 0d 20  |ctor, low byte. |
000012d0  20 20 20 20 20 20 20 20  53 54 59 20 26 32 30 44  |        STY &20D|
000012e0  20 20 20 20 20 20 5c 20  61 6e 64 20 68 69 67 68  |      \ and high|
000012f0  20 62 79 74 65 0d 20 2e  72 65 74 75 72 6e 0d 20  | byte. .return. |
00001300  20 20 20 20 20 20 20 20  52 54 53 0d 20 2e 6e 65  |        RTS. .ne|
00001310  77 63 6f 64 65 0d 20 20  20 20 20 20 20 20 20 43  |wcode.         C|
00001320  4d 50 20 23 26 37 41 20  20 20 20 20 20 5c 20 61  |MP #&7A      \ a|
00001330  6c 6c 20 41 54 53 20 6f  73 77 6f 72 64 20 63 61  |ll ATS osword ca|
00001340  6c 6c 73 20 75 73 65 20  6f 73 77 6f 72 64 20 26  |lls use osword &|
00001350  37 41 0d 20 20 20 20 20  20 20 20 20 42 4e 45 20  |7A.         BNE |
00001360  6a 75 6d 70 20 20 20 20  20 20 5c 20 62 72 61 6e  |jump      \ bran|
00001370  63 68 20 69 66 20 6e 6f  74 20 66 72 6f 6d 20 41  |ch if not from A|
00001380  54 53 0d 20 20 20 20 20  20 20 20 20 53 54 58 20  |TS.         STX |
00001390  26 37 30 20 20 20 20 20  20 20 5c 20 58 20 61 6e  |&70       \ X an|
000013a0  64 20 59 20 70 6f 69 6e  74 20 74 6f 20 74 68 65  |d Y point to the|
000013b0  20 70 61 72 61 6d 65 74  65 72 20 62 6c 6f 63 6b  | parameter block|
000013c0  0d 20 20 20 20 20 20 20  20 20 53 54 59 20 26 37  |.         STY &7|
000013d0  31 20 20 20 20 20 20 20  5c 20 73 74 6f 72 65 20  |1       \ store |
000013e0  74 68 65 6d 20 66 6f 72  20 70 6f 73 74 2d 69 6e  |them for post-in|
000013f0  64 65 78 65 64 20 69 6e  64 69 72 65 63 74 20 61  |dexed indirect a|
00001400  64 64 72 65 73 73 69 6e  67 0d 20 20 20 20 20 20  |ddressing.      |
00001410  20 20 20 4c 44 59 20 23  26 30 30 20 20 20 20 20  |   LDY #&00     |
00001420  20 5c 20 69 6e 64 65 78  20 74 6f 20 70 6f 69 6e  | \ index to poin|
00001430  74 20 74 6f 20 66 69 72  73 74 20 70 61 72 61 6d  |t to first param|
00001440  65 74 65 72 0d 20 20 20  20 20 20 20 20 20 4c 44  |eter.         LD|
00001450  41 20 28 26 37 30 29 2c  59 20 20 20 5c 20 72 65  |A (&70),Y   \ re|
00001460  61 64 20 66 69 72 73 74  20 70 61 72 61 6d 65 74  |ad first paramet|
00001470  65 72 0d 20 20 20 20 20  20 20 20 20 43 4d 50 20  |er.         CMP |
00001480  23 26 41 30 20 20 20 20  20 20 5c 20 26 41 30 20  |#&A0      \ &A0 |
00001490  3d 20 75 6e 75 73 65 64  20 66 75 6e 63 74 69 6f  |= unused functio|
000014a0  6e 20 6b 65 79 0d 20 20  20 20 20 20 20 20 20 42  |n key.         B|
000014b0  4e 45 20 65 78 69 74 20  20 20 20 20 20 5c 20 62  |NE exit      \ b|
000014c0  72 61 6e 63 68 20 69 66  20 6e 6f 74 20 75 6e 75  |ranch if not unu|
000014d0  73 65 64 20 66 75 6e 63  74 69 6f 6e 20 6b 65 79  |sed function key|
000014e0  0d 20 20 20 20 20 20 20  20 20 49 4e 59 20 20 20  |.         INY   |
000014f0  20 20 20 20 20 20 20 20  5c 20 70 6f 69 6e 74 20  |        \ point |
00001500  74 6f 20 73 65 63 6f 6e  64 20 70 61 72 61 6d 65  |to second parame|
00001510  74 65 72 0d 20 20 20 20  20 20 20 20 20 4c 44 41  |ter.         LDA|
00001520  20 28 26 37 30 29 2c 59  20 20 20 5c 20 72 65 61  | (&70),Y   \ rea|
00001530  64 20 73 65 63 6f 6e 64  20 70 61 72 61 6d 65 74  |d second paramet|
00001540  65 72 0d 20 20 20 20 20  20 20 20 20 43 4d 50 20  |er.         CMP |
00001550  23 26 31 35 20 20 20 20  20 20 5c 20 73 68 69 66  |#&15      \ shif|
00001560  74 2b 66 35 2c 20 41 54  53 20 75 6e 75 73 65 64  |t+f5, ATS unused|
00001570  20 66 75 6e 63 74 69 6f  6e 20 6b 65 79 0d 20 20  | function key.  |
00001580  20 20 20 20 20 20 20 42  45 51 20 73 68 69 66 74  |       BEQ shift|
00001590  66 35 20 20 20 5c 20 62  72 61 6e 63 68 20 69 66  |f5   \ branch if|
000015a0  20 73 68 69 66 74 2b 66  35 20 70 72 65 73 73 65  | shift+f5 presse|
000015b0  64 20 28 41 54 53 20 32  2e 35 38 29 0d 20 20 20  |d (ATS 2.58).   |
000015c0  20 20 20 20 20 20 43 4d  50 20 23 26 31 38 20 20  |      CMP #&18  |
000015d0  20 20 20 20 5c 20 73 68  69 66 74 2b 66 38 2c 20  |    \ shift+f8, |
000015e0  41 54 53 20 75 6e 75 73  65 64 20 66 75 6e 63 74  |ATS unused funct|
000015f0  69 6f 6e 20 6b 65 79 0d  20 20 20 20 20 20 20 20  |ion key.        |
00001600  20 42 45 51 20 73 68 69  66 74 66 38 20 20 20 5c  | BEQ shiftf8   \|
00001610  20 62 72 61 6e 63 68 20  69 66 20 73 68 69 66 74  | branch if shift|
00001620  2b 66 38 20 70 72 65 73  73 65 64 20 28 41 54 53  |+f8 pressed (ATS|
00001630  20 61 6e 64 20 41 54 53  2b 20 32 2e 30 30 29 0d  | and ATS+ 2.00).|
00001640  20 20 20 20 20 20 20 20  20 43 4d 50 20 23 26 31  |         CMP #&1|
00001650  43 20 20 20 20 20 20 5c  20 73 68 69 66 74 2b 66  |C      \ shift+f|
00001660  38 2c 20 41 54 53 2b 20  75 6e 75 73 65 64 20 66  |8, ATS+ unused f|
00001670  75 6e 63 74 69 6f 6e 20  6b 65 79 0d 20 20 20 20  |unction key.    |
00001680  20 20 20 20 20 42 45 51  20 73 68 69 66 74 66 38  |     BEQ shiftf8|
00001690  20 20 20 5c 20 62 72 61  6e 63 68 20 69 66 20 73  |   \ branch if s|
000016a0  68 69 66 74 2b 66 38 20  70 72 65 73 73 65 64 20  |hift+f8 pressed |
000016b0  28 41 54 53 2b 20 31 2e  30 30 29 0d 20 20 20 20  |(ATS+ 1.00).    |
000016c0  20 20 20 20 20 43 4d 50  20 23 26 31 39 20 20 20  |     CMP #&19   |
000016d0  20 20 20 5c 20 73 68 69  66 74 2b 66 39 2c 20 41  |   \ shift+f9, A|
000016e0  54 53 20 75 6e 75 73 65  64 20 66 75 6e 63 74 69  |TS unused functi|
000016f0  6f 6e 20 6b 65 79 20 28  41 54 53 20 61 6e 64 20  |on key (ATS and |
00001700  41 54 53 2b 29 0d 20 20  20 20 20 20 20 20 20 42  |ATS+).         B|
00001710  45 51 20 73 68 69 66 74  66 39 20 20 20 5c 20 62  |EQ shiftf9   \ b|
00001720  72 61 6e 63 68 20 69 66  20 73 68 69 66 74 2b 66  |ranch if shift+f|
00001730  39 20 70 72 65 73 73 65  64 0d 20 2e 65 78 69 74  |9 pressed. .exit|
00001740  0d 20 20 20 20 20 20 20  20 20 4c 44 41 20 23 26  |.         LDA #&|
00001750  37 41 20 20 20 20 20 20  5c 20 72 65 73 74 6f 72  |7A      \ restor|
00001760  65 20 61 63 63 75 6d 75  6c 61 74 6f 72 0d 20 20  |e accumulator.  |
00001770  20 20 20 20 20 20 20 4c  44 59 20 26 37 31 20 20  |       LDY &71  |
00001780  20 20 20 20 20 5c 20 72  65 73 74 6f 72 65 20 59  |     \ restore Y|
00001790  0d 20 2e 6a 75 6d 70 0d  20 20 20 20 20 20 20 20  |. .jump.        |
000017a0  20 4a 4d 50 20 28 6f 6c  64 76 65 63 74 6f 72 29  | JMP (oldvector)|
000017b0  20 5c 20 65 78 69 74 20  75 73 69 6e 67 20 74 68  | \ exit using th|
000017c0  65 20 6f 72 69 67 69 6e  61 6c 20 6f 73 77 6f 72  |e original oswor|
000017d0  64 20 76 65 63 74 6f 72  0d 20 2e 6f 6c 64 76 65  |d vector. .oldve|
000017e0  63 74 6f 72 0d 20 20 20  20 20 20 20 20 20 4e 4f  |ctor.         NO|
000017f0  50 20 20 20 20 20 20 20  20 20 20 20 5c 20 73 74  |P           \ st|
00001800  6f 72 65 20 6f 72 69 67  69 6e 61 6c 20 6f 73 77  |ore original osw|
00001810  6f 72 64 20 76 65 63 74  6f 72 2c 20 6c 6f 77 20  |ord vector, low |
00001820  62 79 74 65 0d 20 20 20  20 20 20 20 20 20 4e 4f  |byte.         NO|
00001830  50 20 20 20 20 20 20 20  20 20 20 20 5c 20 73 74  |P           \ st|
00001840  6f 72 65 20 6f 72 69 67  69 6e 61 6c 20 6f 73 77  |ore original osw|
00001850  6f 72 64 20 76 65 63 74  6f 72 2c 20 68 69 67 68  |ord vector, high|
00001860  20 62 79 74 65 0d 20 2e  73 68 69 66 74 66 35 0d  | byte. .shiftf5.|
00001870  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001880  20 20 20 20 20 20 20 5c  20 6e 65 77 20 73 68 69  |       \ new shi|
00001890  66 74 2b 66 35 20 72 6f  75 74 69 6e 65 20 67 6f  |ft+f5 routine go|
000018a0  65 73 20 69 6e 20 68 65  72 65 0d 20 20 20 20 20  |es in here.     |
000018b0  20 20 20 20 52 54 53 0d  20 2e 73 68 69 66 74 66  |    RTS. .shiftf|
000018c0  38 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8.              |
000018d0  20 20 20 20 20 20 20 20  20 5c 20 6e 65 77 20 73  |         \ new s|
000018e0  68 69 66 74 2b 66 38 20  72 6f 75 74 69 6e 65 20  |hift+f8 routine |
000018f0  67 6f 65 73 20 69 6e 20  68 65 72 65 0d 20 20 20  |goes in here.   |
00001900  20 20 20 20 20 20 52 54  53 0d 20 2e 73 68 69 66  |      RTS. .shif|
00001910  74 66 39 0d 20 20 20 20  20 20 20 20 20 20 20 20  |tf9.            |
00001920  20 20 20 20 20 20 20 20  20 20 20 5c 20 6e 65 77  |           \ new|
00001930  20 73 68 69 66 74 2b 66  39 20 72 6f 75 74 69 6e  | shift+f9 routin|
00001940  65 20 67 6f 65 73 20 69  6e 20 68 65 72 65 0d 20  |e goes in here. |
00001950  20 20 20 20 20 20 20 20  52 54 53 0d 0d 46 69 67  |        RTS..Fig|
00001960  75 72 65 20 31 2e 20 49  6e 74 65 72 63 65 70 74  |ure 1. Intercept|
00001970  69 6e 67 20 4f 73 77 6f  72 64 20 26 37 41 3a 26  |ing Osword &7A:&|
00001980  41 30 0d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |A0.-------------|
00001990  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000019a0  2d 2d 2d 2d 2d 2d 2d 2d  0d 0d 0d 41 6c 6c 20 41  |--------...All A|
000019b0  54 53 20 4f 73 77 6f 72  64 20 63 61 6c 6c 73 2c  |TS Osword calls,|
000019c0  20 69 6e 63 6c 75 64 69  6e 67 20 74 68 65 20 75  | including the u|
000019d0  6e 72 65 63 6f 67 6e 69  73 65 64 20 66 75 6e 63  |nrecognised func|
000019e0  74 69 6f 6e 20 6b 65 79  20 63 61 6c 6c 2c 20 75  |tion key call, u|
000019f0  73 65 0d 4f 73 77 6f 72  64 20 26 37 41 2e 20 54  |se.Osword &7A. T|
00001a00  68 65 20 4f 73 77 6f 72  64 20 70 61 72 61 6d 65  |he Osword parame|
00001a10  74 65 72 20 62 6c 6f 63  6b 20 75 73 65 64 20 62  |ter block used b|
00001a20  79 20 74 68 65 20 75 6e  72 65 63 6f 67 6e 69 73  |y the unrecognis|
00001a30  65 64 20 66 75 6e 63 74  69 6f 6e 0d 6b 65 79 20  |ed function.key |
00001a40  63 61 6c 6c 20 63 6f 6e  74 61 69 6e 73 20 74 77  |call contains tw|
00001a50  6f 20 62 79 74 65 73 2e  20 54 68 65 20 66 69 72  |o bytes. The fir|
00001a60  73 74 20 62 79 74 65 20  69 73 20 26 41 30 2c 20  |st byte is &A0, |
00001a70  77 68 69 63 68 20 69 6e  64 69 63 61 74 65 73 20  |which indicates |
00001a80  61 6e 0d 75 6e 72 65 63  6f 67 6e 69 73 65 64 20  |an.unrecognised |
00001a90  66 75 6e 63 74 69 6f 6e  20 6b 65 79 2c 20 61 6e  |function key, an|
00001aa0  64 20 74 68 65 20 73 65  63 6f 6e 64 20 62 79 74  |d the second byt|
00001ab0  65 20 69 73 20 65 69 74  68 65 72 20 26 31 35 2c  |e is either &15,|
00001ac0  20 26 31 38 2c 20 26 31  39 20 6f 72 0d 26 31 43  | &18, &19 or.&1C|
00001ad0  20 28 26 31 35 20 69 73  20 6f 6e 6c 79 20 75 73  | (&15 is only us|
00001ae0  65 64 20 62 79 20 41 54  53 20 76 65 72 73 69 6f  |ed by ATS versio|
00001af0  6e 73 20 75 70 20 74 6f  20 32 2e 35 38 20 61 6e  |ns up to 2.58 an|
00001b00  64 20 26 31 43 20 69 73  20 6f 6e 6c 79 20 75 73  |d &1C is only us|
00001b10  65 64 20 62 79 0d 41 54  53 2b 20 31 2e 30 30 29  |ed by.ATS+ 1.00)|
00001b20  2e 20 49 66 20 74 68 65  20 73 65 63 6f 6e 64 20  |. If the second |
00001b30  62 79 74 65 20 63 6f 6e  74 61 69 6e 73 20 26 31  |byte contains &1|
00001b40  35 20 74 68 69 73 20 69  6e 64 69 63 61 74 65 73  |5 this indicates|
00001b50  20 74 68 61 74 20 53 68  69 66 74 2b 66 35 0d 68  | that Shift+f5.h|
00001b60  61 73 20 62 65 65 6e 20  70 72 65 73 73 65 64 20  |as been pressed |
00001b70  28 41 54 53 20 32 2e 35  38 29 2c 20 26 31 38 20  |(ATS 2.58), &18 |
00001b80  69 73 20 75 73 65 64 20  77 69 74 68 20 53 68 69  |is used with Shi|
00001b90  66 74 2b 66 38 2c 20 26  31 43 20 77 69 74 68 20  |ft+f8, &1C with |
00001ba0  53 68 69 66 74 2b 66 38  0d 28 41 54 53 2b 20 31  |Shift+f8.(ATS+ 1|
00001bb0  2e 30 30 29 2c 20 61 6e  64 20 26 31 39 20 77 69  |.00), and &19 wi|
00001bc0  74 68 20 53 68 69 66 74  2b 66 39 2e 0d 0d 54 68  |th Shift+f9...Th|
00001bd0  65 20 72 6f 75 74 69 6e  65 20 69 6e 20 66 69 67  |e routine in fig|
00001be0  75 72 65 20 31 20 69 73  20 69 6e 73 74 61 6c 6c  |ure 1 is install|
00001bf0  65 64 20 62 79 20 63 61  6c 6c 69 6e 67 20 74 68  |ed by calling th|
00001c00  65 20 6d 65 6d 6f 72 79  20 6c 6f 63 61 74 69 6f  |e memory locatio|
00001c10  6e 0d 6c 61 62 65 6c 65  64 20 27 69 6e 73 74 61  |n.labeled 'insta|
00001c20  6c 6c 27 2e 20 54 68 69  73 20 72 65 70 6c 61 63  |ll'. This replac|
00001c30  65 73 20 74 68 65 20 6f  72 69 67 69 6e 61 6c 20  |es the original |
00001c40  4f 73 77 6f 72 64 20 76  65 63 74 6f 72 20 77 69  |Osword vector wi|
00001c50  74 68 20 61 20 6e 65 77  0d 76 65 63 74 6f 72 20  |th a new.vector |
00001c60  77 68 69 63 68 20 70 6f  69 6e 74 73 20 74 6f 20  |which points to |
00001c70  74 68 65 20 63 6f 64 65  20 6c 61 62 65 6c 65 64  |the code labeled|
00001c80  20 27 6e 65 77 63 6f 64  65 27 2e 20 54 68 65 20  | 'newcode'. The |
00001c90  6f 72 69 67 69 6e 61 6c  20 76 65 63 74 6f 72 20  |original vector |
00001ca0  69 73 0d 73 61 76 65 64  20 69 6e 20 74 68 65 20  |is.saved in the |
00001cb0  74 77 6f 20 6d 65 6d 6f  72 79 20 6c 6f 63 61 74  |two memory locat|
00001cc0  69 6f 6e 73 20 6c 61 62  65 6c 65 64 20 27 6f 6c  |ions labeled 'ol|
00001cd0  64 76 65 63 74 6f 72 27  2e 20 57 68 65 6e 20 61  |dvector'. When a|
00001ce0  6e 20 4f 73 77 6f 72 64  20 63 61 6c 6c 0d 69 73  |n Osword call.is|
00001cf0  20 69 73 73 75 65 64 20  69 74 20 77 69 6c 6c 20  | issued it will |
00001d00  62 65 20 76 65 63 74 6f  72 65 64 20 74 6f 20 74  |be vectored to t|
00001d10  68 65 20 6e 65 77 63 6f  64 65 20 69 6e 73 74 65  |he newcode inste|
00001d20  61 64 20 6f 66 20 74 68  65 20 6f 72 69 67 69 6e  |ad of the origin|
00001d30  61 6c 20 63 6f 64 65 2c  0d 61 6e 64 20 74 68 65  |al code,.and the|
00001d40  20 6e 65 77 63 6f 64 65  20 63 61 6e 20 72 65 63  | newcode can rec|
00001d50  6f 67 6e 69 73 65 20 74  68 65 20 75 6e 72 65 63  |ognise the unrec|
00001d60  6f 67 6e 69 73 65 64 20  66 75 6e 63 74 69 6f 6e  |ognised function|
00001d70  20 6b 65 79 20 63 61 6c  6c 2e 0d 0d 54 68 65 72  | key call...Ther|
00001d80  65 20 61 72 65 20 61 20  6e 75 6d 62 65 72 20 6f  |e are a number o|
00001d90  66 20 69 6d 70 6f 72 74  61 6e 74 20 70 6f 69 6e  |f important poin|
00001da0  74 73 20 74 6f 20 6c 6f  6f 6b 20 61 74 20 69 6e  |ts to look at in|
00001db0  20 66 69 67 75 72 65 20  31 2e 20 46 69 72 73 74  | figure 1. First|
00001dc0  20 6f 66 0d 61 6c 6c 20  74 68 65 20 69 6e 73 74  | of.all the inst|
00001dd0  61 6c 6c 20 72 6f 75 74  69 6e 65 20 63 68 65 63  |all routine chec|
00001de0  6b 73 20 74 6f 20 73 65  65 20 69 66 20 74 68 65  |ks to see if the|
00001df0  20 6e 65 77 20 63 6f 64  65 20 69 73 20 61 6c 72  | new code is alr|
00001e00  65 61 64 79 0d 69 6e 73  74 61 6c 6c 65 64 2e 20  |eady.installed. |
00001e10  49 66 20 74 68 65 20 6e  65 77 20 63 6f 64 65 20  |If the new code |
00001e20  68 61 73 20 62 65 65 6e  20 69 6e 73 74 61 6c 6c  |has been install|
00001e30  65 64 20 74 68 65 20 70  72 6f 67 72 61 6d 20 65  |ed the program e|
00001e40  78 69 74 73 20 77 69 74  68 6f 75 74 0d 61 74 74  |xits without.att|
00001e50  65 6d 70 74 69 6e 67 20  74 6f 20 61 6c 74 65 72  |empting to alter|
00001e60  20 74 68 65 20 4f 73 77  6f 72 64 20 76 65 63 74  | the Osword vect|
00001e70  6f 72 2e 20 57 68 65 6e  20 74 68 65 20 6e 65 77  |or. When the new|
00001e80  20 63 6f 64 65 20 69 73  20 69 6e 73 74 61 6c 6c  | code is install|
00001e90  65 64 20 69 74 0d 6d 75  73 74 20 6e 6f 74 20 62  |ed it.must not b|
00001ea0  65 20 69 6e 73 74 61 6c  6c 65 64 20 61 20 73 65  |e installed a se|
00001eb0  63 6f 6e 64 20 74 69 6d  65 20 75 6e 74 69 6c 20  |cond time until |
00001ec0  61 66 74 65 72 20 74 68  65 20 42 72 65 61 6b 20  |after the Break |
00001ed0  6b 65 79 20 68 61 73 20  62 65 65 6e 0d 70 72 65  |key has been.pre|
00001ee0  73 73 65 64 2e 20 49 66  20 69 74 20 69 73 20 69  |ssed. If it is i|
00001ef0  6e 73 74 61 6c 6c 65 64  20 61 20 73 65 63 6f 6e  |nstalled a secon|
00001f00  64 20 74 69 6d 65 2c 20  61 6c 6c 20 4f 73 77 6f  |d time, all Oswo|
00001f10  72 64 20 63 61 6c 6c 73  2c 20 6f 74 68 65 72 20  |rd calls, other |
00001f20  74 68 61 6e 0d 74 68 65  20 41 54 53 20 75 6e 72  |than.the ATS unr|
00001f30  65 63 6f 67 6e 69 73 65  64 20 66 75 6e 63 74 69  |ecognised functi|
00001f40  6f 6e 20 6b 65 79 20 63  61 6c 6c 2c 20 77 69 6c  |on key call, wil|
00001f50  6c 20 67 65 74 20 69 6e  74 6f 20 61 6e 20 65 6e  |l get into an en|
00001f60  64 6c 65 73 73 20 6c 6f  6f 70 20 61 6e 64 0d 68  |dless loop and.h|
00001f70  61 6e 67 20 75 70 20 74  68 65 20 63 6f 6d 70 75  |ang up the compu|
00001f80  74 65 72 2e 0d 0d 54 68  65 20 6e 65 77 20 72 6f  |ter...The new ro|
00001f90  75 74 69 6e 65 20 64 6f  65 73 20 6e 6f 74 20 63  |utine does not c|
00001fa0  6f 6d 70 6c 65 74 65 6c  79 20 72 65 70 6c 61 63  |ompletely replac|
00001fb0  65 20 74 68 65 20 73 74  61 6e 64 61 72 64 20 4f  |e the standard O|
00001fc0  73 77 6f 72 64 20 63 6f  64 65 2e 20 49 66 0d 61  |sword code. If.a|
00001fd0  6e 20 4f 73 77 6f 72 64  20 63 61 6c 6c 20 69 73  |n Osword call is|
00001fe0  20 6e 6f 74 20 74 68 65  20 4f 73 77 6f 72 64 20  | not the Osword |
00001ff0  26 37 41 20 75 6e 72 65  63 6f 67 6e 69 73 65 64  |&7A unrecognised|
00002000  20 66 75 6e 63 74 69 6f  6e 20 6b 65 79 20 63 61  | function key ca|
00002010  6c 6c 20 74 68 65 0d 72  6f 75 74 69 6e 65 20 72  |ll the.routine r|
00002020  65 73 74 6f 72 65 73 20  74 68 65 20 6f 72 69 67  |estores the orig|
00002030  69 6e 61 6c 20 72 65 67  69 73 74 65 72 73 20 61  |inal registers a|
00002040  6e 64 20 65 78 69 74 73  20 77 69 74 68 20 61 6e  |nd exits with an|
00002050  20 69 6e 64 69 72 65 63  74 20 6a 75 6d 70 20 74  | indirect jump t|
00002060  6f 0d 74 68 65 20 6f 72  69 67 69 6e 61 6c 20 76  |o.the original v|
00002070  65 63 74 6f 72 2e 20 54  68 65 20 4a 4d 50 20 28  |ector. The JMP (|
00002080  6f 6c 64 76 65 63 74 6f  72 29 20 69 6e 73 74 72  |oldvector) instr|
00002090  75 63 74 69 6f 6e 20 61  6c 6c 6f 77 73 20 61 6c  |uction allows al|
000020a0  6c 20 6f 74 68 65 72 0d  4f 73 77 6f 72 64 20 63  |l other.Osword c|
000020b0  61 6c 6c 73 20 74 6f 20  62 65 20 70 72 6f 63 65  |alls to be proce|
000020c0  73 73 65 64 20 61 73 20  74 68 65 79 20 77 65 72  |ssed as they wer|
000020d0  65 20 62 65 66 6f 72 65  20 74 68 65 20 6e 65 77  |e before the new|
000020e0  20 72 6f 75 74 69 6e 65  20 77 61 73 0d 69 6e 73  | routine was.ins|
000020f0  74 61 6c 6c 65 64 2e 0d  0d 49 66 20 61 6e 20 41  |talled...If an A|
00002100  54 53 20 75 6e 72 65 63  6f 67 6e 69 73 65 64 20  |TS unrecognised |
00002110  66 75 6e 74 69 6f 6e 20  6b 65 79 20 63 61 6c 6c  |funtion key call|
00002120  20 69 73 20 69 6e 74 65  72 63 65 70 74 65 64 20  | is intercepted |
00002130  74 68 65 20 6e 65 77 20  72 6f 75 74 69 6e 65 73  |the new routines|
00002140  0d 6c 61 62 65 6c 65 64  20 73 68 69 66 74 66 35  |.labeled shiftf5|
00002150  2c 20 73 68 69 66 74 66  38 20 61 6e 64 20 73 68  |, shiftf8 and sh|
00002160  69 66 74 66 39 20 63 6f  6d 70 6c 65 74 65 6c 79  |iftf9 completely|
00002170  20 72 65 70 6c 61 63 65  20 74 68 65 20 6f 72 69  | replace the ori|
00002180  67 69 6e 61 6c 20 63 6f  64 65 0d 61 6e 64 2c 20  |ginal code.and, |
00002190  61 66 74 65 72 20 65 78  65 63 75 74 69 6e 67 20  |after executing |
000021a0  74 68 65 20 6e 65 77 20  72 6f 75 74 69 6e 65 2c  |the new routine,|
000021b0  20 61 6e 20 65 78 69 74  20 69 73 20 6d 61 64 65  | an exit is made|
000021c0  20 77 69 74 68 20 61 6e  20 52 54 53 0d 69 6e 73  | with an RTS.ins|
000021d0  74 72 75 63 74 69 6f 6e  20 61 6e 64 20 6e 6f 74  |truction and not|
000021e0  20 61 6e 20 69 6e 64 69  72 65 63 74 20 6a 75 6d  | an indirect jum|
000021f0  70 20 74 6f 20 74 68 65  20 6f 72 69 67 69 6e 61  |p to the origina|
00002200  6c 20 63 6f 64 65 2e 0d  0d 41 6e 79 20 6e 65 77  |l code...Any new|
00002210  20 72 6f 75 74 69 6e 65  20 75 73 65 64 20 62 79  | routine used by|
00002220  20 74 68 65 20 41 54 53  20 74 65 72 6d 69 6e 61  | the ATS termina|
00002230  6c 20 6d 75 73 74 20 62  65 20 61 73 73 65 6d 62  |l must be assemb|
00002240  6c 65 64 20 69 6e 74 6f  20 61 6e 20 61 72 65 61  |led into an area|
00002250  20 6f 66 0d 75 73 65 72  20 6d 65 6d 6f 72 79 20  | of.user memory |
00002260  77 68 69 63 68 20 69 73  20 6e 6f 74 20 75 73 65  |which is not use|
00002270  64 20 62 79 20 74 68 65  20 41 54 53 2e 20 49 66  |d by the ATS. If|
00002280  20 79 6f 75 20 61 72 65  20 75 73 69 6e 67 20 61  | you are using a|
00002290  20 64 69 73 63 20 66 69  6c 69 6e 67 0d 73 79 73  | disc filing.sys|
000022a0  74 65 6d 20 79 6f 75 20  63 61 6e 20 75 73 65 20  |tem you can use |
000022b0  74 68 65 20 63 61 73 73  65 74 74 65 20 6f 75 74  |the cassette out|
000022c0  70 75 74 20 61 6e 64 20  69 6e 70 75 74 20 62 75  |put and input bu|
000022d0  66 66 65 72 73 20 28 70  61 67 65 73 20 26 30 39  |ffers (pages &09|
000022e0  20 61 6e 64 0d 26 30 41  29 20 61 6e 64 2c 20 6f  | and.&0A) and, o|
000022f0  6e 20 74 68 65 20 42 42  43 20 42 2c 20 79 6f 75  |n the BBC B, you|
00002300  20 63 6f 75 6c 64 20 63  6f 6e 73 69 64 65 72 20  | could consider |
00002310  75 73 69 6e 67 20 70 61  67 65 20 26 30 43 20 77  |using page &0C w|
00002320  68 69 63 68 20 69 73 20  6e 6f 74 0d 75 73 65 64  |hich is not.used|
00002330  20 69 6e 20 6d 6f 64 65  20 37 2e 20 50 61 67 65  | in mode 7. Page|
00002340  20 26 30 43 20 69 73 20  75 73 65 64 20 66 6f 72  | &0C is used for|
00002350  20 45 63 6f 6e 65 74 20  77 6f 72 6b 73 70 61 63  | Econet workspac|
00002360  65 20 6f 6e 20 74 68 65  20 4d 61 73 74 65 72 20  |e on the Master |
00002370  73 65 72 69 65 73 0d 63  6f 6d 70 75 74 65 72 73  |series.computers|
00002380  20 61 6e 64 20 6d 61 79  20 61 6c 73 6f 20 62 65  | and may also be|
00002390  20 61 76 61 69 6c 61 62  6c 65 20 74 6f 20 74 68  | available to th|
000023a0  65 20 41 54 53 2e 20 54  68 65 20 64 65 6d 6f 6e  |e ATS. The demon|
000023b0  73 74 72 61 74 69 6f 6e  20 70 72 6f 67 72 61 6d  |stration program|
000023c0  0d 53 43 52 4f 4c 4c 20  69 73 20 61 73 73 65 6d  |.SCROLL is assem|
000023d0  62 6c 65 64 20 69 6e 74  6f 20 70 61 67 65 20 26  |bled into page &|
000023e0  30 41 20 62 75 74 20 74  68 69 73 20 63 61 6e 20  |0A but this can |
000023f0  62 65 20 63 68 61 6e 67  65 64 20 62 79 20 61 6c  |be changed by al|
00002400  74 65 72 69 6e 67 20 74  68 65 0d 76 61 6c 75 65  |tering the.value|
00002410  20 6f 66 20 6d 63 6f 64  65 20 69 6e 20 6c 69 6e  | of mcode in lin|
00002420  65 20 38 30 2e 0d 0d 54  68 65 20 70 72 6f 67 72  |e 80...The progr|
00002430  61 6d 20 53 43 52 4f 4c  4c 20 69 73 20 75 73 65  |am SCROLL is use|
00002440  64 20 74 6f 20 65 6e 6c  61 72 67 65 20 61 6e 64  |d to enlarge and|
00002450  20 73 63 72 6f 6c 6c 20  61 20 70 61 72 74 20 6f  | scroll a part o|
00002460  66 20 74 68 65 20 54 65  6c 65 74 65 78 74 0d 70  |f the Teletext.p|
00002470  61 67 65 20 64 69 73 70  6c 61 79 65 64 20 62 79  |age displayed by|
00002480  20 74 68 65 20 74 65 72  6d 69 6e 61 6c 2e 20 49  | the terminal. I|
00002490  6e 73 74 61 6c 6c 20 74  68 65 20 70 72 6f 67 72  |nstall the progr|
000024a0  61 6d 20 62 79 20 65 69  74 68 65 72 20 2a 52 55  |am by either *RU|
000024b0  4e 6e 69 6e 67 20 74 68  65 0d 6f 62 6a 65 63 74  |Nning the.object|
000024c0  20 63 6f 64 65 20 6f 72  20 63 68 61 69 6e 20 74  | code or chain t|
000024d0  68 65 20 73 6f 75 72 63  65 20 63 6f 64 65 20 61  |he source code a|
000024e0  6e 64 20 70 72 65 73 73  20 72 65 74 75 72 6e 20  |nd press return |
000024f0  77 68 65 6e 20 70 72 6f  6d 70 74 65 64 20 66 6f  |when prompted fo|
00002500  72 20 61 0d 66 69 6c 65  6e 61 6d 65 20 66 6f 72  |r a.filename for|
00002510  20 74 68 65 20 6f 62 6a  65 63 74 20 63 6f 64 65  | the object code|
00002520  2e 20 54 68 65 6e 20 74  79 70 65 20 2a 54 45 4c  |. Then type *TEL|
00002530  45 54 45 58 54 20 74 6f  20 65 6e 74 65 72 20 74  |ETEXT to enter t|
00002540  68 65 20 74 65 72 6d 69  6e 61 6c 0d 6d 6f 64 65  |he terminal.mode|
00002550  2e 20 57 68 65 6e 20 61  20 70 61 67 65 20 69 73  |. When a page is|
00002560  20 64 69 73 70 6c 61 79  65 64 20 70 72 65 73 73  | displayed press|
00002570  20 53 68 69 66 74 2b 66  38 20 74 6f 20 65 6e 6c  | Shift+f8 to enl|
00002580  61 72 67 65 20 74 68 65  20 74 6f 70 20 68 61 6c  |arge the top hal|
00002590  66 20 6f 66 0d 74 68 65  20 70 61 67 65 20 74 6f  |f of.the page to|
000025a0  20 66 69 6c 6c 20 74 68  65 20 73 63 72 65 65 6e  | fill the screen|
000025b0  2e 20 50 72 65 73 73 20  53 68 69 66 74 2b 66 39  |. Press Shift+f9|
000025c0  20 74 6f 20 73 63 72 6f  6c 6c 20 74 68 65 20 77  | to scroll the w|
000025d0  69 6e 64 6f 77 20 64 6f  77 6e 77 61 72 64 73 0d  |indow downwards.|
000025e0  61 6e 64 20 53 68 69 66  74 2b 66 38 20 74 6f 20  |and Shift+f8 to |
000025f0  73 63 72 6f 6c 6c 20 69  74 20 62 61 63 6b 20 75  |scroll it back u|
00002600  70 2e 20 49 66 20 79 6f  75 20 61 72 65 20 75 73  |p. If you are us|
00002610  69 6e 67 20 41 54 53 20  76 65 72 73 69 6f 6e 20  |ing ATS version |
00002620  6e 75 6d 62 65 72 0d 32  2e 35 38 20 28 6f 72 20  |number.2.58 (or |
00002630  6c 65 73 73 29 20 74 68  65 6e 20 70 72 65 73 73  |less) then press|
00002640  20 53 68 69 66 74 2b 66  35 20 74 6f 20 72 65 73  | Shift+f5 to res|
00002650  74 6f 72 65 20 74 68 65  20 6f 72 69 67 69 6e 61  |tore the origina|
00002660  6c 20 77 69 6e 64 6f 77  2e 20 54 68 65 0d 6f 72  |l window. The.or|
00002670  69 67 69 6e 61 6c 20 77  69 6e 64 6f 77 20 77 69  |iginal window wi|
00002680  6c 6c 20 61 6c 73 6f 20  62 65 20 72 65 73 74 6f  |ll also be resto|
00002690  72 65 64 20 69 66 20 79  6f 75 20 74 72 79 20 74  |red if you try t|
000026a0  6f 20 73 63 72 6f 6c 6c  20 64 6f 77 6e 20 62 65  |o scroll down be|
000026b0  79 6f 6e 64 20 74 68 65  0d 6c 61 73 74 20 6c 69  |yond the.last li|
000026c0  6e 65 20 28 61 6c 6c 20  76 65 72 73 69 6f 6e 73  |ne (all versions|
000026d0  20 6f 66 20 41 54 53 20  61 6e 64 20 41 54 53 2b  | of ATS and ATS+|
000026e0  29 2e 0d 0d 49 66 20 64  6f 75 62 6c 65 20 68 65  |)...If double he|
000026f0  69 67 68 74 20 63 68 61  72 61 63 74 65 72 73 20  |ight characters |
00002700  61 72 65 20 64 69 73 70  6c 61 79 65 64 20 6f 6e  |are displayed on|
00002710  20 74 68 65 20 73 63 72  65 65 6e 20 79 6f 75 20  | the screen you |
00002720  6d 61 79 20 68 61 76 65  20 74 6f 0d 70 72 65 73  |may have to.pres|
00002730  73 20 65 69 74 68 65 72  20 53 68 69 66 74 2b 66  |s either Shift+f|
00002740  38 20 6f 72 20 53 68 69  66 74 2b 66 39 20 74 77  |8 or Shift+f9 tw|
00002750  69 63 65 20 74 6f 20 6d  61 6b 65 20 73 75 72 65  |ice to make sure|
00002760  20 74 68 61 74 20 62 6f  74 68 20 68 61 6c 76 65  | that both halve|
00002770  73 20 6f 66 0d 74 68 65  20 64 6f 75 62 6c 65 20  |s of.the double |
00002780  68 65 69 67 68 74 20 63  68 61 72 61 63 74 65 72  |height character|
00002790  73 20 6f 6e 20 74 68 65  20 74 6f 70 20 61 6e 64  |s on the top and|
000027a0  20 73 65 63 6f 6e 64 20  6c 69 6e 65 73 20 61 72  | second lines ar|
000027b0  65 20 69 6e 20 74 68 65  0d 64 69 73 70 6c 61 79  |e in the.display|
000027c0  65 64 20 77 69 6e 64 6f  77 2e 20 49 66 20 6f 6e  |ed window. If on|
000027d0  6c 79 20 74 68 65 20 6c  6f 77 65 72 20 68 61 6c  |ly the lower hal|
000027e0  66 20 6f 66 20 74 68 65  20 63 68 61 72 61 63 74  |f of the charact|
000027f0  65 72 73 20 61 72 65 20  64 69 73 70 6c 61 79 65  |ers are displaye|
00002800  64 0d 6f 6e 20 74 68 65  20 74 6f 70 20 6c 69 6e  |d.on the top lin|
00002810  65 20 6f 66 20 61 20 73  63 72 65 65 6e 20 77 68  |e of a screen wh|
00002820  69 63 68 20 75 73 65 73  20 61 20 6c 6f 74 20 6f  |ich uses a lot o|
00002830  66 20 64 6f 75 62 6c 65  20 68 65 69 67 68 74 20  |f double height |
00002840  63 68 61 72 61 63 74 65  72 73 0d 74 68 65 20 77  |characters.the w|
00002850  69 6e 64 6f 77 20 6c 6f  6f 6b 73 20 71 75 69 74  |indow looks quit|
00002860  65 20 63 6f 6e 66 75 73  69 6e 67 20 65 76 65 6e  |e confusing even|
00002870  20 74 68 6f 75 67 68 20  74 68 65 20 69 6e 74 65  | though the inte|
00002880  72 70 72 65 74 61 74 69  6f 6e 20 6f 66 20 74 68  |rpretation of th|
00002890  65 0d 63 68 61 72 61 63  74 65 72 73 20 69 73 20  |e.characters is |
000028a0  63 6f 72 72 65 63 74 2e  0d 0d 0d 20 20 20 31 30  |correct....   10|
000028b0  20 52 45 4d 3e 20 53 43  52 4f 4c 4c 0d 20 20 20  | REM> SCROLL.   |
000028c0  32 30 20 41 25 3d 26 45  41 20 3a 20 52 45 4d 20  |20 A%=&EA : REM |
000028d0  3a 20 72 65 61 64 20 54  75 62 65 20 70 72 65 73  |: read Tube pres|
000028e0  65 6e 63 65 20 66 6c 61  67 0d 20 20 20 33 30 20  |ence flag.   30 |
000028f0  58 25 3d 30 0d 20 20 20  34 30 20 59 25 3d 26 46  |X%=0.   40 Y%=&F|
00002900  46 0d 20 20 20 35 30 20  49 46 20 28 28 55 53 52  |F.   50 IF ((USR|
00002910  28 26 46 46 46 34 29 41  4e 44 26 46 46 30 30 29  |(&FFF4)AND&FF00)|
00002920  44 49 56 26 31 30 30 29  3c 3e 30 20 45 4e 44 0d  |DIV&100)<>0 END.|
00002930  20 20 20 36 30 20 7a 65  72 6f 70 61 67 65 3d 26  |   60 zeropage=&|
00002940  37 30 20 3a 20 52 45 4d  20 3a 20 32 20 62 79 74  |70 : REM : 2 byt|
00002950  65 20 77 6f 72 6b 73 70  61 63 65 0d 20 20 20 37  |e workspace.   7|
00002960  30 20 77 6f 72 64 76 3d  26 32 30 43 20 3a 20 52  |0 wordv=&20C : R|
00002970  45 4d 20 3a 20 6f 73 77  6f 72 64 20 69 6e 64 69  |EM : osword indi|
00002980  72 65 63 74 69 6f 6e 20  76 65 63 74 6f 72 0d 20  |rection vector. |
00002990  20 20 38 30 20 6d 63 6f  64 65 3d 26 41 30 30 20  |  80 mcode=&A00 |
000029a0  3a 20 52 45 4d 20 3a 20  20 6d 61 63 68 69 6e 65  |: REM :  machine|
000029b0  20 63 6f 64 65 20 61 74  20 26 41 30 30 0d 20 20  | code at &A00.  |
000029c0  20 39 30 20 61 64 64 72  65 67 3d 26 46 45 30 30  | 90 addreg=&FE00|
000029d0  20 3a 20 52 45 4d 20 3a  20 36 38 34 35 20 69 6e  | : REM : 6845 in|
000029e0  74 65 72 6e 61 6c 20 72  65 67 69 73 74 65 72 20  |ternal register |
000029f0  73 65 6c 65 63 74 20 72  65 67 69 73 74 65 72 0d  |select register.|
00002a00  20 20 31 30 30 20 69 6e  74 72 65 67 3d 26 46 45  |  100 intreg=&FE|
00002a10  30 31 20 3a 20 52 45 4d  20 3a 20 36 38 34 35 20  |01 : REM : 6845 |
00002a20  69 6e 74 65 72 6e 61 6c  20 72 65 67 69 73 74 65  |internal registe|
00002a30  72 20 64 61 74 61 20 72  65 67 69 73 74 65 72 0d  |r data register.|
00002a40  20 20 31 31 30 20 6f 73  77 72 63 68 3d 26 46 46  |  110 oswrch=&FF|
00002a50  45 45 0d 20 20 31 32 30  20 6f 73 62 79 74 65 3d  |EE.  120 osbyte=|
00002a60  26 46 46 46 34 0d 20 20  31 33 30 20 46 4f 52 20  |&FFF4.  130 FOR |
00002a70  70 61 73 73 3d 30 20 54  4f 20 32 20 53 54 45 50  |pass=0 TO 2 STEP|
00002a80  20 32 0d 20 20 31 34 30  20 50 25 3d 6d 63 6f 64  | 2.  140 P%=mcod|
00002a90  65 0d 20 20 31 35 30 20  5b 20 20 20 20 20 20 20  |e.  150 [       |
00002aa0  4f 50 54 20 70 61 73 73  0d 20 20 31 36 30 20 2e  |OPT pass.  160 .|
00002ab0  66 69 72 73 74 62 79 74  65 0d 20 20 31 37 30 20  |firstbyte.  170 |
00002ac0  20 20 20 20 20 20 20 20  4c 44 58 20 77 6f 72 64  |        LDX word|
00002ad0  76 20 20 20 20 20 5c 20  6f 73 77 6f 72 64 20 76  |v     \ osword v|
00002ae0  65 63 74 6f 72 20 6c 6f  77 20 62 79 74 65 0d 20  |ector low byte. |
00002af0  20 31 38 30 20 20 20 20  20 20 20 20 20 4c 44 59  | 180         LDY|
00002b00  20 77 6f 72 64 76 2b 31  20 20 20 5c 20 6f 73 77  | wordv+1   \ osw|
00002b10  6f 72 64 20 76 65 63 74  6f 72 20 68 69 67 68 20  |ord vector high |
00002b20  62 79 74 65 0d 20 20 31  39 30 20 20 20 20 20 20  |byte.  190      |
00002b30  20 20 20 43 50 59 20 23  6e 65 77 63 6f 64 65 20  |   CPY #newcode |
00002b40  44 49 56 20 32 35 36 20  5c 20 69 73 20 74 68 65  |DIV 256 \ is the|
00002b50  20 76 65 63 74 6f 72 20  61 6c 72 65 61 64 79 20  | vector already |
00002b60  6d 6f 64 69 66 69 65 64  3f 0d 20 20 32 30 30 20  |modified?.  200 |
00002b70  20 20 20 20 20 20 20 20  42 45 51 20 72 65 74 75  |        BEQ retu|
00002b80  72 6e 20 20 20 20 5c 20  72 65 74 75 72 6e 20 69  |rn    \ return i|
00002b90  66 20 61 6c 72 65 61 64  79 20 61 6c 74 65 72 65  |f already altere|
00002ba0  64 0d 20 20 32 31 30 20  20 20 20 20 20 20 20 20  |d.  210         |
00002bb0  53 54 58 20 6f 6c 64 76  65 63 74 6f 72 20 5c 20  |STX oldvector \ |
00002bc0  73 61 76 65 20 74 68 65  20 6f 72 69 67 69 6e 61  |save the origina|
00002bd0  6c 20 6f 73 77 6f 72 64  20 76 65 63 74 6f 72 2c  |l osword vector,|
00002be0  20 6c 6f 77 20 62 79 74  65 0d 20 20 32 32 30 20  | low byte.  220 |
00002bf0  20 20 20 20 20 20 20 20  53 54 59 20 6f 6c 64 76  |        STY oldv|
00002c00  65 63 74 6f 72 2b 31 20  5c 20 61 6e 64 20 68 69  |ector+1 \ and hi|
00002c10  67 68 20 62 79 74 65 0d  20 20 32 33 30 20 20 20  |gh byte.  230   |
00002c20  20 20 20 20 20 20 4c 44  58 20 23 6e 65 77 63 6f  |      LDX #newco|
00002c30  64 65 20 4d 4f 44 20 32  35 36 20 5c 20 6c 6f 77  |de MOD 256 \ low|
00002c40  20 62 79 74 65 20 6f 66  20 6e 65 77 20 63 6f 64  | byte of new cod|
00002c50  65 0d 20 20 32 34 30 20  20 20 20 20 20 20 20 20  |e.  240         |
00002c60  4c 44 59 20 23 6e 65 77  63 6f 64 65 20 44 49 56  |LDY #newcode DIV|
00002c70  20 32 35 36 20 5c 20 61  6e 64 20 68 69 67 68 20  | 256 \ and high |
00002c80  62 79 74 65 0d 20 20 32  35 30 20 20 20 20 20 20  |byte.  250      |
00002c90  20 20 20 53 54 58 20 77  6f 72 64 76 20 20 20 20  |   STX wordv    |
00002ca0  20 5c 20 61 6c 74 65 72  20 6f 73 77 6f 72 64 20  | \ alter osword |
00002cb0  76 65 63 74 6f 72 2c 20  6c 6f 77 20 62 79 74 65  |vector, low byte|
00002cc0  0d 20 20 32 36 30 20 20  20 20 20 20 20 20 20 53  |.  260         S|
00002cd0  54 59 20 77 6f 72 64 76  2b 31 20 20 20 5c 20 61  |TY wordv+1   \ a|
00002ce0  6e 64 20 68 69 67 68 20  62 79 74 65 0d 20 20 32  |nd high byte.  2|
00002cf0  37 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 23  |70         LDA #|
00002d00  26 31 36 20 20 20 20 20  20 5c 20 64 65 63 69 6d  |&16      \ decim|
00002d10  61 6c 20 32 32 0d 20 20  32 38 30 20 20 20 20 20  |al 22.  280     |
00002d20  20 20 20 20 4a 53 52 20  6f 73 77 72 63 68 0d 20  |    JSR oswrch. |
00002d30  20 32 39 30 20 20 20 20  20 20 20 20 20 4c 44 41  | 290         LDA|
00002d40  20 23 26 30 37 0d 20 20  33 30 30 20 20 20 20 20  | #&07.  300     |
00002d50  20 20 20 20 4a 53 52 20  6f 73 77 72 63 68 20 20  |    JSR oswrch  |
00002d60  20 20 5c 20 6d 6f 64 65  20 37 0d 20 20 33 31 30  |  \ mode 7.  310|
00002d70  20 2e 73 63 72 65 65 6e  61 64 64 72 0d 20 20 33  | .screenaddr.  3|
00002d80  32 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 23  |20         LDA #|
00002d90  26 30 44 20 20 20 20 20  20 5c 20 64 65 63 69 6d  |&0D      \ decim|
00002da0  61 6c 20 31 33 0d 20 20  33 33 30 20 20 20 20 20  |al 13.  330     |
00002db0  20 20 20 20 53 54 41 20  63 6f 75 6e 74 65 72 20  |    STA counter |
00002dc0  20 20 5c 20 69 6e 69 74  69 61 6c 69 73 65 20 6c  |  \ initialise l|
00002dd0  69 6e 65 20 63 6f 75 6e  74 65 72 0d 20 20 33 34  |ine counter.  34|
00002de0  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 23 26  |0         LDA #&|
00002df0  41 30 20 20 20 20 20 20  5c 20 72 65 61 64 20 56  |A0      \ read V|
00002e00  44 55 20 76 61 72 69 61  62 6c 65 20 76 61 6c 75  |DU variable valu|
00002e10  65 0d 20 20 33 35 30 20  20 20 20 20 20 20 20 20  |e.  350         |
00002e20  4c 44 58 20 23 26 35 30  20 20 20 20 20 20 5c 20  |LDX #&50      \ |
00002e30  6f 66 66 73 65 74 20 26  35 30 20 70 6f 69 6e 74  |offset &50 point|
00002e40  73 20 74 6f 20 73 74 61  72 74 20 6f 66 20 73 63  |s to start of sc|
00002e50  72 65 65 6e 0d 20 20 20  20 20 20 20 20 20 20 20  |reen.           |
00002e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002e70  20 5c 20 61 64 64 72 65  73 73 0d 20 20 33 36 30  | \ address.  360|
00002e80  20 20 20 20 20 20 20 20  20 4a 53 52 20 6f 73 62  |         JSR osb|
00002e90  79 74 65 0d 20 20 33 37  30 20 20 20 20 20 20 20  |yte.  370       |
00002ea0  20 20 53 54 58 20 6c 73  62 20 20 20 20 20 20 20  |  STX lsb       |
00002eb0  5c 20 58 20 63 6f 6e 74  61 69 6e 73 20 6c 6f 77  |\ X contains low|
00002ec0  20 62 79 74 65 0d 20 20  33 38 30 20 20 20 20 20  | byte.  380     |
00002ed0  20 20 20 20 54 59 41 20  20 20 20 20 20 20 20 20  |    TYA         |
00002ee0  20 20 5c 20 59 20 63 6f  6e 74 61 69 6e 73 20 68  |  \ Y contains h|
00002ef0  69 67 68 20 62 79 74 65  2c 20 74 6f 20 62 65 20  |igh byte, to be |
00002f00  6d 6f 64 69 66 69 65 64  20 69 6e 0d 20 20 20 20  |modified in.    |
00002f10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002f20  20 20 20 20 20 20 20 20  5c 20 4d 6f 64 65 20 37  |        \ Mode 7|
00002f30  0d 20 20 33 39 30 20 20  20 20 20 20 20 20 20 43  |.  390         C|
00002f40  4c 44 0d 20 20 34 30 30  20 20 20 20 20 20 20 20  |LD.  400        |
00002f50  20 53 45 43 0d 20 20 34  31 30 20 20 20 20 20 20  | SEC.  410      |
00002f60  20 20 20 53 42 43 20 23  26 37 34 20 20 20 20 20  |   SBC #&74     |
00002f70  20 5c 20 62 79 20 73 75  62 74 72 61 63 74 69 6e  | \ by subtractin|
00002f80  67 20 26 37 34 0d 20 20  34 32 30 20 20 20 20 20  |g &74.  420     |
00002f90  20 20 20 20 45 4f 52 20  23 26 32 30 20 20 20 20  |    EOR #&20    |
00002fa0  20 20 5c 20 61 6e 64 20  45 4f 52 69 6e 67 20 77  |  \ and EORing w|
00002fb0  69 74 68 20 23 26 32 30  0d 20 20 34 33 30 20 20  |ith #&20.  430  |
00002fc0  20 20 20 20 20 20 20 53  54 41 20 6d 73 62 20 20  |       STA msb  |
00002fd0  20 20 20 20 20 5c 20 4d  6f 64 65 20 37 20 6d 6f  |     \ Mode 7 mo|
00002fe0  64 69 66 69 65 64 20 68  69 67 68 20 62 79 74 65  |dified high byte|
00002ff0  0d 20 20 34 34 30 20 2e  72 65 74 75 72 6e 0d 20  |.  440 .return. |
00003000  20 34 35 30 20 20 20 20  20 20 20 20 20 52 54 53  | 450         RTS|
00003010  0d 20 20 34 36 30 20 2e  6e 65 77 63 6f 64 65 0d  |.  460 .newcode.|
00003020  20 20 34 37 30 20 20 20  20 20 20 20 20 20 43 4d  |  470         CM|
00003030  50 20 23 26 37 41 20 20  20 20 20 20 5c 20 61 6c  |P #&7A      \ al|
00003040  6c 20 41 54 53 20 6f 73  77 6f 72 64 20 63 61 6c  |l ATS osword cal|
00003050  6c 73 20 75 73 65 20 6f  73 77 6f 72 64 20 26 37  |ls use osword &7|
00003060  41 0d 20 20 34 38 30 20  20 20 20 20 20 20 20 20  |A.  480         |
00003070  42 4e 45 20 6a 75 6d 70  20 20 20 20 20 20 5c 20  |BNE jump      \ |
00003080  62 72 61 6e 63 68 20 69  66 20 6e 6f 74 20 66 72  |branch if not fr|
00003090  6f 6d 20 41 54 53 0d 20  20 34 39 30 20 20 20 20  |om ATS.  490    |
000030a0  20 20 20 20 20 53 54 58  20 7a 65 72 6f 70 61 67  |     STX zeropag|
000030b0  65 20 20 5c 20 58 20 61  6e 64 20 59 20 70 6f 69  |e  \ X and Y poi|
000030c0  6e 74 20 74 6f 20 74 68  65 20 70 61 72 61 6d 65  |nt to the parame|
000030d0  74 65 72 20 62 6c 6f 63  6b 0d 20 20 35 30 30 20  |ter block.  500 |
000030e0  20 20 20 20 20 20 20 20  53 54 59 20 7a 65 72 6f  |        STY zero|
000030f0  70 61 67 65 2b 31 0d 20  20 35 31 30 20 20 20 20  |page+1.  510    |
00003100  20 20 20 20 20 4c 44 59  20 23 26 30 30 20 20 20  |     LDY #&00   |
00003110  20 20 20 5c 20 69 6e 64  65 78 20 74 6f 20 70 6f  |   \ index to po|
00003120  69 6e 74 20 74 6f 20 66  69 72 73 74 20 70 61 72  |int to first par|
00003130  61 6d 65 74 65 72 0d 20  20 35 32 30 20 20 20 20  |ameter.  520    |
00003140  20 20 20 20 20 4c 44 41  20 28 7a 65 72 6f 70 61  |     LDA (zeropa|
00003150  67 65 29 2c 59 20 5c 20  72 65 61 64 20 66 69 72  |ge),Y \ read fir|
00003160  73 74 20 70 61 72 61 6d  65 74 65 72 0d 20 20 35  |st parameter.  5|
00003170  33 30 20 20 20 20 20 20  20 20 20 43 4d 50 20 23  |30         CMP #|
00003180  26 41 30 20 20 20 20 20  20 5c 20 26 41 30 20 3d  |&A0      \ &A0 =|
00003190  20 75 6e 75 73 65 64 20  66 75 6e 63 74 69 6f 6e  | unused function|
000031a0  20 6b 65 79 0d 20 20 35  34 30 20 20 20 20 20 20  | key.  540      |
000031b0  20 20 20 42 45 51 20 75  6e 75 73 65 64 20 20 20  |   BEQ unused   |
000031c0  20 5c 20 62 72 61 6e 63  68 20 69 66 20 75 6e 75  | \ branch if unu|
000031d0  73 65 64 20 66 75 6e 63  74 69 6f 6e 20 6b 65 79  |sed function key|
000031e0  0d 20 20 35 35 30 20 20  20 20 20 20 20 20 20 4c  |.  550         L|
000031f0  44 41 20 23 26 37 41 20  20 20 20 20 20 5c 20 72  |DA #&7A      \ r|
00003200  65 73 74 6f 72 65 20 61  63 63 75 6d 75 6c 61 74  |estore accumulat|
00003210  6f 72 0d 20 20 35 36 30  20 20 20 20 20 20 20 20  |or.  560        |
00003220  20 4c 44 59 20 7a 65 72  6f 70 61 67 65 2b 31 20  | LDY zeropage+1 |
00003230  5c 20 72 65 73 74 6f 72  65 20 59 0d 20 20 35 37  |\ restore Y.  57|
00003240  30 20 2e 6a 75 6d 70 0d  20 20 35 38 30 20 20 20  |0 .jump.  580   |
00003250  20 20 20 20 20 20 4a 4d  50 20 28 6f 6c 64 76 65  |      JMP (oldve|
00003260  63 74 6f 72 29 20 5c 20  65 78 69 74 20 75 73 69  |ctor) \ exit usi|
00003270  6e 67 20 74 68 65 20 6f  72 69 67 69 6e 61 6c 20  |ng the original |
00003280  6f 73 77 6f 72 64 20 76  65 63 74 6f 72 0d 20 20  |osword vector.  |
00003290  35 39 30 20 2e 75 6e 75  73 65 64 0d 20 20 36 30  |590 .unused.  60|
000032a0  30 20 20 20 20 20 20 20  20 20 49 4e 59 0d 20 20  |0         INY.  |
000032b0  36 31 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |610         LDA |
000032c0  28 7a 65 72 6f 70 61 67  65 29 2c 59 0d 20 20 36  |(zeropage),Y.  6|
000032d0  32 30 20 20 20 20 20 20  20 20 20 43 4d 50 20 23  |20         CMP #|
000032e0  26 31 35 20 20 20 20 20  20 5c 20 32 31 20 3d 20  |&15      \ 21 = |
000032f0  73 68 69 66 74 2b 66 35  2c 20 41 54 53 20 32 2e  |shift+f5, ATS 2.|
00003300  35 38 20 75 6e 75 73 65  64 20 66 75 6e 63 74 69  |58 unused functi|
00003310  6f 6e 20 6b 65 79 0d 20  20 36 33 30 20 20 20 20  |on key.  630    |
00003320  20 20 20 20 20 42 45 51  20 66 75 6c 6c 20 20 20  |     BEQ full   |
00003330  20 20 20 5c 20 64 69 73  70 6c 61 79 20 66 75 6c  |   \ display ful|
00003340  6c 20 73 63 72 65 65 6e  0d 20 20 36 34 30 20 20  |l screen.  640  |
00003350  20 20 20 20 20 20 20 43  4d 50 20 23 26 31 39 20  |       CMP #&19 |
00003360  20 20 20 20 20 5c 20 32  35 20 3d 20 73 68 69 66  |     \ 25 = shif|
00003370  74 2b 66 39 2c 20 41 54  53 2f 41 54 53 2b 20 75  |t+f9, ATS/ATS+ u|
00003380  6e 75 73 65 64 20 66 75  6e 63 74 69 6f 6e 20 6b  |nused function k|
00003390  65 79 0d 20 20 36 35 30  20 20 20 20 20 20 20 20  |ey.  650        |
000033a0  20 42 45 51 20 64 6f 77  6e 20 20 20 20 20 20 5c  | BEQ down      \|
000033b0  20 73 63 72 6f 6c 6c 20  64 6f 77 6e 20 73 63 72  | scroll down scr|
000033c0  65 65 6e 0d 20 20 36 36  30 20 2e 75 70 0d 20 20  |een.  660 .up.  |
000033d0  36 37 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |670         LDA |
000033e0  6c 73 62 20 20 20 20 20  20 20 5c 20 6c 6f 77 20  |lsb       \ low |
000033f0  62 79 74 65 20 6f 66 20  74 68 65 20 74 6f 70 20  |byte of the top |
00003400  4c 48 20 63 6f 72 6e 65  72 0d 20 20 36 38 30 20  |LH corner.  680 |
00003410  20 20 20 20 20 20 20 20  43 4c 44 0d 20 20 36 39  |        CLD.  69|
00003420  30 20 20 20 20 20 20 20  20 20 53 45 43 0d 20 20  |0         SEC.  |
00003430  37 30 30 20 20 20 20 20  20 20 20 20 53 42 43 20  |700         SBC |
00003440  23 26 32 38 20 20 20 20  20 20 5c 20 63 61 6c 63  |#&28      \ calc|
00003450  75 6c 61 74 65 20 6e 65  77 20 74 6f 70 20 4c 48  |ulate new top LH|
00003460  20 63 6f 72 6e 65 72 20  6f 66 20 73 63 72 65 65  | corner of scree|
00003470  6e 2c 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  |n,.             |
00003480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00003490  20 6c 6f 77 20 62 79 74  65 0d 20 20 37 31 30 20  | low byte.  710 |
000034a0  20 20 20 20 20 20 20 20  53 54 41 20 6c 73 62 0d  |        STA lsb.|
000034b0  20 20 37 32 30 20 20 20  20 20 20 20 20 20 4c 44  |  720         LD|
000034c0  41 20 6d 73 62 20 20 20  20 20 20 20 5c 20 68 69  |A msb       \ hi|
000034d0  67 68 20 62 79 74 65 20  6f 66 20 74 68 65 20 74  |gh byte of the t|
000034e0  6f 70 20 4c 48 20 63 6f  72 6e 65 72 0d 20 20 37  |op LH corner.  7|
000034f0  33 30 20 20 20 20 20 20  20 20 20 53 42 43 20 23  |30         SBC #|
00003500  26 30 30 20 20 20 20 20  20 5c 20 63 61 6c 63 75  |&00      \ calcu|
00003510  6c 61 74 65 20 6e 65 77  20 74 6f 70 20 4c 48 20  |late new top LH |
00003520  63 6f 72 6e 65 72 20 6f  66 20 73 63 72 65 65 6e  |corner of screen|
00003530  2c 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |,.              |
00003540  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00003550  68 69 67 68 20 62 79 74  65 0d 20 20 37 34 30 20  |high byte.  740 |
00003560  20 20 20 20 20 20 20 20  53 54 41 20 6d 73 62 0d  |        STA msb.|
00003570  20 20 37 35 30 20 20 20  20 20 20 20 20 20 49 4e  |  750         IN|
00003580  43 20 63 6f 75 6e 74 65  72 0d 20 20 37 36 30 20  |C counter.  760 |
00003590  20 20 20 20 20 20 20 20  42 45 51 20 75 70 20 20  |        BEQ up  |
000035a0  20 20 20 20 20 20 5c 20  69 66 20 6f 6e 20 74 68  |      \ if on th|
000035b0  65 20 62 6f 74 74 6f 6d  20 6c 69 6e 65 20 73 75  |e bottom line su|
000035c0  62 74 72 61 63 74 20 61  67 61 69 6e 0d 20 20 37  |btract again.  7|
000035d0  37 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 63  |70         LDA c|
000035e0  6f 75 6e 74 65 72 0d 20  20 37 38 30 20 20 20 20  |ounter.  780    |
000035f0  20 20 20 20 20 43 4d 50  20 23 26 30 45 20 20 20  |     CMP #&0E   |
00003600  20 20 20 5c 20 61 72 65  20 77 65 20 6f 6e 20 74  |   \ are we on t|
00003610  68 65 20 74 6f 70 20 6c  69 6e 65 3f 0d 20 20 37  |he top line?.  7|
00003620  39 30 20 20 20 20 20 20  20 20 20 42 43 43 20 73  |90         BCC s|
00003630  63 72 6f 6c 6c 20 20 20  20 5c 20 73 63 72 6f 6c  |croll    \ scrol|
00003640  6c 20 74 68 65 20 70 69  63 74 75 72 65 0d 20 20  |l the picture.  |
00003650  38 30 30 20 20 20 20 20  20 20 20 20 4a 53 52 20  |800         JSR |
00003660  73 63 72 65 65 6e 61 64  64 72 20 5c 20 72 65 2d  |screenaddr \ re-|
00003670  69 6e 69 74 69 61 6c 69  73 65 20 73 63 72 65 65  |initialise scree|
00003680  6e 0d 20 20 38 31 30 20  2e 73 63 72 6f 6c 6c 0d  |n.  810 .scroll.|
00003690  20 20 38 32 30 20 20 20  20 20 20 20 20 20 4a 53  |  820         JS|
000036a0  52 20 61 6c 6c 20 20 20  20 20 20 20 5c 20 61 6e  |R all       \ an|
000036b0  64 20 61 6c 74 65 72 20  72 65 67 69 73 74 65 72  |d alter register|
000036c0  73 20 31 32 20 61 6e 64  20 31 33 0d 20 20 38 33  |s 12 and 13.  83|
000036d0  30 20 20 20 20 20 20 20  20 20 4c 44 58 20 23 26  |0         LDX #&|
000036e0  30 30 20 20 20 20 20 20  5c 20 72 65 67 69 73 74  |00      \ regist|
000036f0  65 72 20 30 2c 20 68 6f  72 69 7a 6f 6e 74 61 6c  |er 0, horizontal|
00003700  20 74 6f 74 61 6c 0d 20  20 38 34 30 20 20 20 20  | total.  840    |
00003710  20 20 20 20 20 4c 44 59  20 23 26 37 46 20 20 20  |     LDY #&7F   |
00003720  20 20 20 5c 20 76 61 6c  75 65 20 31 32 37 0d 20  |   \ value 127. |
00003730  20 38 35 30 20 20 20 20  20 20 20 20 20 4a 53 52  | 850         JSR|
00003740  20 73 68 65 69 6c 61 20  20 20 20 5c 20 56 44 55  | sheila    \ VDU|
00003750  20 32 33 3b 30 2c 31 32  37 3b 30 3b 30 3b 30 0d  | 23;0,127;0;0;0.|
00003760  20 20 38 36 30 20 20 20  20 20 20 20 20 20 4c 44  |  860         LD|
00003770  58 20 23 26 30 34 20 20  20 20 20 20 5c 20 72 65  |X #&04      \ re|
00003780  67 69 73 74 65 72 20 34  2c 20 76 65 72 74 69 63  |gister 4, vertic|
00003790  61 6c 20 74 6f 74 61 6c  0d 20 20 38 37 30 20 20  |al total.  870  |
000037a0  20 20 20 20 20 20 20 4c  44 59 20 23 26 30 45 20  |       LDY #&0E |
000037b0  20 20 20 20 20 5c 20 64  65 63 69 6d 61 6c 20 31  |     \ decimal 1|
000037c0  34 0d 20 20 38 38 30 20  20 20 20 20 20 20 20 20  |4.  880         |
000037d0  4a 53 52 20 73 68 65 69  6c 61 20 20 20 20 5c 20  |JSR sheila    \ |
000037e0  56 44 55 20 32 33 3b 34  2c 31 34 3b 30 3b 30 3b  |VDU 23;4,14;0;0;|
000037f0  30 0d 20 20 38 39 30 20  20 20 20 20 20 20 20 20  |0.  890         |
00003800  4c 44 58 20 23 26 30 36  20 20 20 20 20 20 5c 20  |LDX #&06      \ |
00003810  72 65 67 69 73 74 65 72  20 36 2c 20 76 65 72 74  |register 6, vert|
00003820  69 63 61 6c 20 64 69 73  70 6c 61 79 65 64 0d 20  |ical displayed. |
00003830  20 39 30 30 20 20 20 20  20 20 20 20 20 4c 44 59  | 900         LDY|
00003840  20 23 26 30 43 20 20 20  20 20 20 5c 20 64 65 63  | #&0C      \ dec|
00003850  69 6d 61 6c 20 31 32 0d  20 20 39 31 30 20 20 20  |imal 12.  910   |
00003860  20 20 20 20 20 20 4a 53  52 20 73 68 65 69 6c 61  |      JSR sheila|
00003870  20 20 20 20 5c 20 56 44  55 20 32 33 3b 36 2c 31  |    \ VDU 23;6,1|
00003880  32 3b 30 3b 30 3b 30 0d  20 20 39 32 30 20 20 20  |2;0;0;0.  920   |
00003890  20 20 20 20 20 20 49 4e  58 20 20 20 20 20 20 20  |      INX       |
000038a0  20 20 20 20 5c 20 72 65  67 69 73 74 65 72 20 37  |    \ register 7|
000038b0  2c 20 76 65 72 74 69 63  61 6c 20 73 79 6e 63 0d  |, vertical sync.|
000038c0  20 20 39 33 30 20 20 20  20 20 20 20 20 20 49 4e  |  930         IN|
000038d0  59 20 20 20 20 20 20 20  20 20 20 20 5c 20 59 20  |Y           \ Y |
000038e0  3d 20 31 33 0d 20 20 39  34 30 20 2e 73 68 65 69  |= 13.  940 .shei|
000038f0  6c 61 0d 20 20 39 35 30  20 20 20 20 20 20 20 20  |la.  950        |
00003900  20 53 54 58 20 61 64 64  72 65 67 20 20 20 20 5c  | STX addreg    \|
00003910  20 73 65 6c 65 63 74 20  36 38 34 35 20 69 6e 74  | select 6845 int|
00003920  65 72 6e 61 6c 20 72 65  67 69 73 74 65 72 0d 20  |ernal register. |
00003930  20 39 36 30 20 20 20 20  20 20 20 20 20 53 54 59  | 960         STY|
00003940  20 69 6e 74 72 65 67 20  20 20 20 5c 20 73 74 6f  | intreg    \ sto|
00003950  72 65 20 59 20 69 6e 20  36 38 34 35 20 69 6e 74  |re Y in 6845 int|
00003960  65 72 6e 61 6c 20 72 65  67 69 73 74 65 72 0d 20  |ernal register. |
00003970  20 39 37 30 20 20 20 20  20 20 20 20 20 52 54 53  | 970         RTS|
00003980  0d 20 20 39 38 30 20 2e  64 6f 77 6e 0d 20 20 39  |.  980 .down.  9|
00003990  39 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 6c  |90         LDA l|
000039a0  73 62 20 20 20 20 20 20  20 5c 20 6c 6f 77 20 62  |sb       \ low b|
000039b0  79 74 65 20 6f 66 20 74  68 65 20 74 6f 70 20 4c  |yte of the top L|
000039c0  48 20 63 6f 72 6e 65 72  0d 20 31 30 30 30 20 20  |H corner. 1000  |
000039d0  20 20 20 20 20 20 20 43  4c 44 0d 20 31 30 31 30  |       CLD. 1010|
000039e0  20 20 20 20 20 20 20 20  20 43 4c 43 0d 20 31 30  |         CLC. 10|
000039f0  32 30 20 20 20 20 20 20  20 20 20 41 44 43 20 23  |20         ADC #|
00003a00  26 32 38 20 20 20 20 20  20 5c 20 63 61 6c 63 75  |&28      \ calcu|
00003a10  6c 61 74 65 20 6e 65 77  20 74 6f 70 20 4c 48 20  |late new top LH |
00003a20  63 6f 72 6e 65 72 20 6f  66 20 73 63 72 65 65 6e  |corner of screen|
00003a30  2c 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |,.              |
00003a40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00003a50  6c 6f 77 20 62 79 74 65  0d 20 31 30 33 30 20 20  |low byte. 1030  |
00003a60  20 20 20 20 20 20 20 53  54 41 20 6c 73 62 0d 20  |       STA lsb. |
00003a70  31 30 34 30 20 20 20 20  20 20 20 20 20 4c 44 41  |1040         LDA|
00003a80  20 6d 73 62 20 20 20 20  20 20 20 5c 20 68 69 67  | msb       \ hig|
00003a90  68 20 62 79 74 65 20 6f  66 20 74 68 65 20 74 6f  |h byte of the to|
00003aa0  70 20 4c 48 20 63 6f 72  6e 65 72 0d 20 31 30 35  |p LH corner. 105|
00003ab0  30 20 20 20 20 20 20 20  20 20 41 44 43 20 23 26  |0         ADC #&|
00003ac0  30 30 20 20 20 20 20 20  5c 20 63 61 6c 63 75 6c  |00      \ calcul|
00003ad0  61 74 65 20 6e 65 77 20  74 6f 70 20 4c 48 20 63  |ate new top LH c|
00003ae0  6f 72 6e 65 72 20 6f 66  20 73 63 72 65 65 6e 2c  |orner of screen,|
00003af0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00003b00  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 68  |             \ h|
00003b10  69 67 68 20 62 79 74 65  0d 20 31 30 36 30 20 20  |igh byte. 1060  |
00003b20  20 20 20 20 20 20 20 53  54 41 20 6d 73 62 0d 20  |       STA msb. |
00003b30  31 30 37 30 20 20 20 20  20 20 20 20 20 44 45 43  |1070         DEC|
00003b40  20 63 6f 75 6e 74 65 72  0d 20 31 30 38 30 20 20  | counter. 1080  |
00003b50  20 20 20 20 20 20 20 42  4d 49 20 66 75 6c 6c 20  |       BMI full |
00003b60  20 20 20 20 20 5c 20 72  65 73 74 6f 72 65 20 66  |     \ restore f|
00003b70  75 6c 6c 20 70 61 67 65  0d 20 31 30 39 30 20 20  |ull page. 1090  |
00003b80  20 20 20 20 20 20 20 42  4e 45 20 73 63 72 6f 6c  |       BNE scrol|
00003b90  6c 20 20 20 20 5c 20 73  63 72 6f 6c 6c 20 69 66  |l    \ scroll if|
00003ba0  20 6e 6f 74 20 74 68 65  20 6c 61 73 74 20 6c 69  | not the last li|
00003bb0  6e 65 0d 20 31 31 30 30  20 20 20 20 20 20 20 20  |ne. 1100        |
00003bc0  20 4c 44 41 20 23 26 30  37 0d 20 31 31 31 30 20  | LDA #&07. 1110 |
00003bd0  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 77 72  |        JSR oswr|
00003be0  63 68 20 20 20 20 5c 20  62 65 65 70 20 6f 6e 20  |ch    \ beep on |
00003bf0  74 68 65 20 62 6f 74 74  6f 6d 20 6c 69 6e 65 0d  |the bottom line.|
00003c00  20 31 31 32 30 20 20 20  20 20 20 20 20 20 42 4e  | 1120         BN|
00003c10  45 20 73 63 72 6f 6c 6c  20 20 20 20 5c 20 73 63  |E scroll    \ sc|
00003c20  72 6f 6c 6c 20 66 6f 72  20 74 68 65 20 6c 61 73  |roll for the las|
00003c30  74 20 69 6d 65 0d 20 31  31 33 30 20 2e 66 75 6c  |t ime. 1130 .ful|
00003c40  6c 0d 20 31 31 34 30 20  20 20 20 20 20 20 20 20  |l. 1140         |
00003c50  4a 53 52 20 73 63 72 65  65 6e 61 64 64 72 20 5c  |JSR screenaddr \|
00003c60  20 61 64 64 72 65 73 73  20 6f 66 20 74 6f 70 20  | address of top |
00003c70  4c 48 20 63 6f 72 6e 65  72 20 6f 66 20 64 69 73  |LH corner of dis|
00003c80  70 6c 61 79 65 64 0d 20  20 20 20 20 20 20 20 20  |played.         |
00003c90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003ca0  20 20 20 5c 20 73 63 72  65 65 6e 0d 20 31 31 35  |   \ screen. 115|
00003cb0  30 20 20 20 20 20 20 20  20 20 4a 53 52 20 61 6c  |0         JSR al|
00003cc0  6c 20 20 20 20 20 20 20  5c 20 61 6c 74 65 72 20  |l       \ alter |
00003cd0  72 65 67 69 73 74 65 72  73 20 31 32 20 61 6e 64  |registers 12 and|
00003ce0  20 31 33 0d 20 31 31 36  30 20 20 20 20 20 20 20  | 13. 1160       |
00003cf0  20 20 4c 44 58 20 23 26  30 30 20 20 20 20 20 20  |  LDX #&00      |
00003d00  5c 20 72 65 67 69 73 74  65 72 20 30 2c 20 68 6f  |\ register 0, ho|
00003d10  72 69 7a 6f 6e 74 61 6c  20 74 6f 74 61 6c 0d 20  |rizontal total. |
00003d20  31 31 37 30 20 20 20 20  20 20 20 20 20 4c 44 59  |1170         LDY|
00003d30  20 23 26 33 46 20 20 20  20 20 20 5c 20 64 65 63  | #&3F      \ dec|
00003d40  69 6d 61 6c 20 36 33 0d  20 31 31 38 30 20 20 20  |imal 63. 1180   |
00003d50  20 20 20 20 20 20 4a 53  52 20 73 68 65 69 6c 61  |      JSR sheila|
00003d60  20 20 20 20 5c 20 56 44  55 20 32 33 3b 30 2c 36  |    \ VDU 23;0,6|
00003d70  33 3b 30 3b 30 3b 30 0d  20 31 31 39 30 20 20 20  |3;0;0;0. 1190   |
00003d80  20 20 20 20 20 20 4c 44  58 20 23 26 30 34 20 20  |      LDX #&04  |
00003d90  20 20 20 20 5c 20 72 65  67 69 73 74 65 72 20 34  |    \ register 4|
00003da0  2c 20 76 65 72 74 69 63  61 6c 20 74 6f 74 61 6c  |, vertical total|
00003db0  0d 20 31 32 30 30 20 20  20 20 20 20 20 20 20 4c  |. 1200         L|
00003dc0  44 59 20 23 26 31 45 20  20 20 20 20 20 5c 20 64  |DY #&1E      \ d|
00003dd0  65 63 69 6d 61 6c 20 33  30 0d 20 31 32 31 30 20  |ecimal 30. 1210 |
00003de0  20 20 20 20 20 20 20 20  4a 53 52 20 73 68 65 69  |        JSR shei|
00003df0  6c 61 20 20 20 20 5c 20  56 44 55 20 32 33 3b 34  |la    \ VDU 23;4|
00003e00  2c 33 30 3b 30 3b 30 3b  30 0d 20 31 32 32 30 20  |,30;0;0;0. 1220 |
00003e10  20 20 20 20 20 20 20 20  4c 44 58 20 23 26 30 36  |        LDX #&06|
00003e20  20 20 20 20 20 20 5c 20  72 65 67 69 73 74 65 72  |      \ register|
00003e30  20 36 2c 20 76 65 72 74  69 63 61 6c 20 64 69 73  | 6, vertical dis|
00003e40  70 6c 61 79 65 64 0d 20  31 32 33 30 20 20 20 20  |played. 1230    |
00003e50  20 20 20 20 20 4c 44 59  20 23 26 31 39 20 20 20  |     LDY #&19   |
00003e60  20 20 20 5c 20 64 65 63  69 6d 61 6c 20 32 35 0d  |   \ decimal 25.|
00003e70  20 31 32 34 30 20 20 20  20 20 20 20 20 20 4a 53  | 1240         JS|
00003e80  52 20 73 68 65 69 6c 61  20 20 20 20 5c 20 56 44  |R sheila    \ VD|
00003e90  55 20 32 33 3b 36 2c 32  35 3b 30 3b 30 3b 30 0d  |U 23;6,25;0;0;0.|
00003ea0  20 31 32 35 30 20 20 20  20 20 20 20 20 20 49 4e  | 1250         IN|
00003eb0  58 20 20 20 20 20 20 20  20 20 20 20 5c 20 72 65  |X           \ re|
00003ec0  67 69 73 74 65 72 20 37  2c 20 76 65 72 74 69 63  |gister 7, vertic|
00003ed0  61 6c 20 73 79 6e 63 0d  20 31 32 36 30 20 20 20  |al sync. 1260   |
00003ee0  20 20 20 20 20 20 4c 44  59 20 23 26 31 42 20 20  |      LDY #&1B  |
00003ef0  20 20 20 20 5c 20 64 65  63 69 6d 61 6c 20 32 37  |    \ decimal 27|
00003f00  0d 20 31 32 37 30 20 20  20 20 20 20 20 20 20 4a  |. 1270         J|
00003f10  4d 50 20 73 68 65 69 6c  61 20 20 20 20 5c 20 56  |MP sheila    \ V|
00003f20  44 55 20 32 33 3b 37 2c  32 37 3b 30 3b 30 3b 30  |DU 23;7,27;0;0;0|
00003f30  20 61 6e 64 20 72 65 74  75 72 6e 0d 20 31 32 38  | and return. 128|
00003f40  30 20 2e 61 6c 6c 0d 20  31 32 39 30 20 20 20 20  |0 .all. 1290    |
00003f50  20 20 20 20 20 4c 44 58  20 23 26 30 43 20 20 20  |     LDX #&0C   |
00003f60  20 20 20 5c 20 72 65 67  69 73 74 65 72 20 31 32  |   \ register 12|
00003f70  2c 20 68 69 67 68 20 62  79 74 65 20 73 63 72 65  |, high byte scre|
00003f80  65 6e 20 73 74 61 72 74  20 61 64 64 72 65 73 73  |en start address|
00003f90  0d 20 31 33 30 30 20 20  20 20 20 20 20 20 20 4c  |. 1300         L|
00003fa0  44 59 20 6d 73 62 20 20  20 20 20 20 20 5c 20 76  |DY msb       \ v|
00003fb0  61 6c 75 65 0d 20 31 33  31 30 20 20 20 20 20 20  |alue. 1310      |
00003fc0  20 20 20 4a 53 52 20 73  68 65 69 6c 61 20 20 20  |   JSR sheila   |
00003fd0  20 5c 20 56 44 55 20 32  33 3b 31 32 2c 6d 73 62  | \ VDU 23;12,msb|
00003fe0  3b 30 3b 30 3b 30 0d 20  31 33 32 30 20 20 20 20  |;0;0;0. 1320    |
00003ff0  20 20 20 20 20 49 4e 58  20 20 20 20 20 20 20 20  |     INX        |
00004000  20 20 20 5c 20 72 65 67  69 73 74 65 72 20 31 33  |   \ register 13|
00004010  2c 20 6c 6f 77 20 62 79  74 65 20 73 63 72 65 65  |, low byte scree|
00004020  6e 20 73 74 61 72 74 20  61 64 64 72 65 73 73 0d  |n start address.|
00004030  20 31 33 33 30 20 20 20  20 20 20 20 20 20 4c 44  | 1330         LD|
00004040  59 20 6c 73 62 20 20 20  20 20 20 20 5c 20 76 61  |Y lsb       \ va|
00004050  6c 75 65 0d 20 31 33 34  30 20 20 20 20 20 20 20  |lue. 1340       |
00004060  20 20 4a 53 52 20 73 68  65 69 6c 61 20 20 20 20  |  JSR sheila    |
00004070  5c 20 56 44 55 20 32 33  3b 31 33 2c 6c 73 62 3b  |\ VDU 23;13,lsb;|
00004080  30 3b 30 3b 30 0d 20 31  33 35 30 20 20 20 20 20  |0;0;0. 1350     |
00004090  20 20 20 20 4c 44 41 20  23 26 31 33 20 20 20 20  |    LDA #&13    |
000040a0  20 20 5c 20 64 65 63 69  6d 61 6c 20 31 39 0d 20  |  \ decimal 19. |
000040b0  31 33 36 30 20 20 20 20  20 20 20 20 20 4a 4d 50  |1360         JMP|
000040c0  20 6f 73 62 79 74 65 20  20 20 20 5c 20 77 61 69  | osbyte    \ wai|
000040d0  74 20 66 6f 72 20 76 65  72 74 69 63 61 6c 20 73  |t for vertical s|
000040e0  79 6e 63 20 74 68 65 6e  20 72 65 74 75 72 6e 0d  |ync then return.|
000040f0  20 31 33 37 30 20 2e 63  6f 75 6e 74 65 72 0d 20  | 1370 .counter. |
00004100  31 33 38 30 20 20 20 20  20 20 20 20 20 45 51 55  |1380         EQU|
00004110  42 20 26 30 30 0d 20 31  33 39 30 20 2e 6c 73 62  |B &00. 1390 .lsb|
00004120  0d 20 31 34 30 30 20 20  20 20 20 20 20 20 20 45  |. 1400         E|
00004130  51 55 42 20 26 30 30 0d  20 31 34 31 30 20 2e 6d  |QUB &00. 1410 .m|
00004140  73 62 0d 20 31 34 32 30  20 20 20 20 20 20 20 20  |sb. 1420        |
00004150  20 45 51 55 42 20 26 30  30 0d 20 31 34 33 30 20  | EQUB &00. 1430 |
00004160  2e 6f 6c 64 76 65 63 74  6f 72 0d 20 31 34 34 30  |.oldvector. 1440|
00004170  20 20 20 20 20 20 20 20  20 45 51 55 57 20 26 30  |         EQUW &0|
00004180  30 0d 20 31 34 35 30 20  2e 6c 61 73 74 62 79 74  |0. 1450 .lastbyt|
00004190  65 0d 20 31 34 36 30 20  5d 0d 20 31 34 37 30 20  |e. 1460 ]. 1470 |
000041a0  4e 45 58 54 0d 20 31 34  38 30 20 49 4e 50 55 54  |NEXT. 1480 INPUT|
000041b0  22 46 69 6c 65 6e 61 6d  65 20 66 6f 72 20 6f 62  |"Filename for ob|
000041c0  6a 65 63 74 20 63 6f 64  65 20 3d 20 22 73 61 76  |ject code = "sav|
000041d0  65 24 0d 20 31 34 39 30  20 49 46 20 73 61 76 65  |e$. 1490 IF save|
000041e0  24 20 3d 22 22 20 43 41  4c 4c 20 6d 63 6f 64 65  |$ ="" CALL mcode|
000041f0  20 3a 20 45 4e 44 0d 20  31 35 30 30 20 2a 4f 50  | : END. 1500 *OP|
00004200  54 31 2c 32 0d 20 31 35  31 30 20 4f 53 43 4c 49  |T1,2. 1510 OSCLI|
00004210  28 22 53 41 56 45 20 22  2b 73 61 76 65 24 2b 22  |("SAVE "+save$+"|
00004220  20 22 2b 53 54 52 24 7e  28 26 46 46 46 46 30 30  | "+STR$~(&FFFF00|
00004230  30 30 20 4f 52 20 66 69  72 73 74 62 79 74 65 29  |00 OR firstbyte)|
00004240  2b 22 20 22 0d 20 20 20  20 20 20 2b 53 54 52 24  |+" ".      +STR$|
00004250  7e 28 26 46 46 46 46 30  30 30 30 20 4f 52 20 6c  |~(&FFFF0000 OR l|
00004260  61 73 74 62 79 74 65 29  29 0d 20 31 35 32 30 20  |astbyte)). 1520 |
00004270  2a 4f 50 54 30 2c 30 0d  0d 0d 41 20 70 72 6f 67  |*OPT0,0...A prog|
00004280  72 61 6d 20 63 61 6c 6c  65 64 20 53 55 42 54 49  |ram called SUBTI|
00004290  54 4c 20 69 73 20 61 6c  73 6f 20 62 72 6f 61 64  |TL is also broad|
000042a0  63 61 73 74 20 77 69 74  68 20 74 68 69 73 20 6d  |cast with this m|
000042b0  6f 64 75 6c 65 20 61 6e  64 20 69 74 20 63 61 6e  |odule and it can|
000042c0  20 62 65 0d 75 73 65 64  20 74 6f 20 67 69 76 65  | be.used to give|
000042d0  20 74 68 65 20 41 54 53  20 66 75 6e 63 74 69 6f  | the ATS functio|
000042e0  6e 20 6b 65 79 73 20 74  68 65 20 73 61 6d 65 20  |n keys the same |
000042f0  63 61 70 61 62 69 6c 69  74 79 20 61 73 20 74 68  |capability as th|
00004300  65 20 41 54 53 2b 20 31  2e 30 30 0d 66 75 6e 63  |e ATS+ 1.00.func|
00004310  74 69 6f 6e 20 6b 65 79  73 20 75 73 65 64 20 77  |tion keys used w|
00004320  69 74 68 20 74 68 65 20  41 64 76 61 6e 63 65 64  |ith the Advanced|
00004330  20 54 65 6c 65 74 65 78  74 20 52 65 63 65 69 76  | Teletext Receiv|
00004340  65 72 2e 20 54 68 69 73  20 70 72 6f 67 72 61 6d  |er. This program|
00004350  0d 65 6e 61 62 6c 65 73  20 74 68 65 20 75 73 65  |.enables the use|
00004360  20 6f 66 20 73 75 62 74  69 74 6c 65 73 20 77 69  | of subtitles wi|
00004370  74 68 20 53 68 69 66 74  2b 66 38 2e 20 43 68 61  |th Shift+f8. Cha|
00004380  69 6e 20 74 68 65 20 70  72 6f 67 72 61 6d 20 61  |in the program a|
00004390  6e 64 20 65 69 74 68 65  72 0d 73 70 65 63 69 66  |nd either.specif|
000043a0  79 20 61 20 66 69 6c 65  6e 61 6d 65 20 66 6f 72  |y a filename for|
000043b0  20 74 68 65 20 6f 62 6a  65 63 74 20 63 6f 64 65  | the object code|
000043c0  20 6f 72 20 70 72 65 73  73 20 74 68 65 20 52 65  | or press the Re|
000043d0  74 75 72 6e 20 6b 65 79  20 74 6f 20 69 6e 73 74  |turn key to inst|
000043e0  61 6c 6c 0d 74 68 65 20  72 6f 75 74 69 6e 65 2e  |all.the routine.|
000043f0  20 53 75 62 74 69 74 6c  65 73 20 63 61 6e 20 74  | Subtitles can t|
00004400  68 65 6e 20 62 65 20 63  61 6c 6c 65 64 20 6f 6e  |hen be called on|
00004410  20 74 68 65 20 63 75 72  72 65 6e 74 6c 79 20 73  | the currently s|
00004420  65 6c 65 63 74 65 64 0d  63 68 61 6e 6e 65 6c 20  |elected.channel |
00004430  62 79 20 70 72 65 73 73  69 6e 67 20 53 68 69 66  |by pressing Shif|
00004440  74 2b 66 38 2e 20 54 6f  20 65 78 69 74 20 66 72  |t+f8. To exit fr|
00004450  6f 6d 20 74 68 65 20 73  75 62 74 69 74 6c 65 20  |om the subtitle |
00004460  72 6f 75 74 69 6e 65 20  70 72 65 73 73 20 66 39  |routine press f9|
00004470  0d 28 77 69 74 68 6f 75  74 20 53 68 69 66 74 29  |.(without Shift)|
00004480  20 66 6f 6c 6c 6f 77 65  64 20 62 79 20 42 72 65  | followed by Bre|
00004490  61 6b 2e 0d                                       |ak..|
00004494
05-03-89/T\TTX00.m0
05-03-89/T\TTX00.m1
05-03-89/T\TTX00.m2
05-03-89/T\TTX00.m4
05-03-89/T\TTX00.m5