Home » CEEFAX disks » telesoftware2.adl » ATS/B\ATS07

ATS/B\ATS07

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 » telesoftware2.adl
Filename: ATS/B\ATS07
Read OK:
File size: 0857 bytes
Load address: 1A00
Exec address: 801F
File contents
   10REM"�ATS07
   20REM"�*****************************
   30REM"�*�ATS�Routine to capture  � *
   40REM"�*�Teletext page, and check �*
   50REM"�*�the integrity of the data�*
   60REM"�*�by checking the CRC, then�*
   70REM"�*�calculates the sub-page  �*
   80REM"�*�number of the display.   �*
   90REM"�*****************************
  100REM"�*�(C)�J.J.Brayshaw�May 1986�*
  110REM"�*****************************
  120REM"�*�Lines following�GREEN�REM�*
  130REM"�*�statements to be adjusted�*
  140REM"�*�as required.             �*
  150REM"�*�REM's in�YELLOW�for info.�*
  160REM"�*�only.                    �*
  170REM"�*****************************
  180REM"�*�The procedure required is�*
  190REM"�*�PROCcheck_CRC(pagestore%)�*
  195REM"�*�followed by              �*
  200REM"�*�FNsub_page(pagestore%).  �*
  210REM"�*�The rest of the program  �*
  220REM"�*�is a demonstration only. �*
  230REM"�*****************************
  240:
  250:
  260:
  270REM"�Invoke demo routines:
  280MODE7
  290PROCset_variables
  300PROCoscli("DISPLAY "+STR$~(store%))
  310PROCcheck_CRC(store%)
  320PRINTTAB(20,24)"Sub-page: ";FNsub_page(store%);
  330PRINTTAB(38,24);
  340END
  350:
  360:
  370:
  380REM"�***�Set up variables�***
  390DEFPROCset_variables
  400REM"�Start address for page store:
  410store%=&6000
  420REM"�Set Channel & page no.:
  430*TTXON
  440*BBC2
  450*PAGE711
  460*HON
  470REM"�Transfer page to memory:
  480REM"�Note: Use *DATA for the
  490REM"�Full Level One Teletext
  500REM"�Page. *TRANSFER will only
  510REM"�select first 24 lines. The
  520REM"�CRC is carried in row 27.
  530REM"�This requires 2k of space.
  540PROCoscli("DATA "+STR$~(store%))
  550*HOFF
  560ENDPROC
  570:
  580:
  590:
  600REM"�***�OSCLI SIMULATION�***
  610DEFPROCoscli(command$)
  620DIM line% 20
  630$line%=command$
  640X%=line% MOD256:Y%=line% DIV256
  650CALL&FFF7
  660ENDPROC
  670:
  680:
  690:
  700REM"�***�Check CRC�***
  710DEFPROCcheck_CRC(start%)
  720A%=&7A
  730DIM line% 4
  740X%=line% MOD256:Y%=line% DIV256
  750line%?0=23
  760line%?1=(start%) MOD256
  770line%?2=(start%) DIV256
  780CALL&FFF1
  790answer%=line%?3
  800IF answer%=&FF PRINTTAB(0,24)CHR$129;"CRC ERROR�";
  810IF answer%=&0 PRINTTAB(0,24)CHR$131;"No CRC Sent�";
  820IF answer%=&1 PRINTTAB(0,24)CHR$136;"CRC Correct";CHR$137;
  830ENDPROC
  840:
  850:
  860REM"�***�Find sub-page number�***
  870DEFFNsub_page(start%)
  880sub%=((start%?3)*256)+start%?4
  890sub$=RIGHT$("0000"+STR$~sub%,4)
  900IFsub$="3F7F" sub$="0000"
  910=sub$

�"�ATS07
$�"�*****************************
$�"�*�ATS�Routine to capture  � *
($�"�*�Teletext page, and check �*
2$�"�*�the integrity of the data�*
<$�"�*�by checking the CRC, then�*
F$�"�*�calculates the sub-page  �*
P$�"�*�number of the display.   �*
Z$�"�*****************************
d$�"�*�(C)�J.J.Brayshaw�May 1986�*
n$�"�*****************************
x$�"�*�Lines following�GREEN�REM�*
�$�"�*�statements to be adjusted�*
�$�"�*�as required.             �*
�$�"�*�REM's in�YELLOW�for info.�*
�$�"�*�only.                    �*
�$�"�*****************************
�$�"�*�The procedure required is�*
�$�"�*�PROCcheck_CRC(pagestore%)�*
�$�"�*�followed by              �*
�$�"�*�FNsub_page(pagestore%).  �*
�$�"�*�The rest of the program  �*
�$�"�*�is a demonstration only. �*
�$�"�*****************************
�:
�:
:
�"�Invoke demo routines:
�7
"�set_variables
,!�oscli("DISPLAY "+�~(store%))
6�check_CRC(store%)
@+�20,24)"Sub-page: ";�sub_page(store%);
J
�38,24);
T�
^:
h:
r:
|�"�***�Set up variables�***
���set_variables
�$�"�Start address for page store:
�store%=&6000
��"�Set Channel & page no.:
�
*TTXON
�	*BBC2
�*PAGE711
�*HON
��"�Transfer page to memory:
��"�Note: Use *DATA for the
��"�Full Level One Teletext
� �"�Page. *TRANSFER will only
�!�"�select first 24 lines. The
 �"�CRC is carried in row 27.
!�"�This requires 2k of space.
�oscli("DATA "+�~(store%))
&	*HOFF
0�
::
D:
N:
X�"�***�OSCLI SIMULATION�***
b��oscli(command$)
l� line% 20
v$line%=command$
�X%=line% �256:Y%=line% �256
�
�&FFF7
��
�:
�:
�:
��"�***�Check CRC�***
���check_CRC(start%)
�
A%=&7A
�
� line% 4
�X%=line% �256:Y%=line% �256
�line%?0=23
�line%?1=(start%) �256
line%?2=(start%) �256

�&FFF1
answer%=line%?3
 +� answer%=&FF �0,24)�129;"CRC ERROR�";
*,� answer%=&0 �0,24)�131;"No CRC Sent�";
40� answer%=&1 �0,24)�136;"CRC Correct";�137;
>�
H:
R:
\#�"�***�Find sub-page number�***
fݤsub_page(start%)
p"sub%=((start%?3)*256)+start%?4
zsub$=�"0000"+�~sub%,4)
��sub$="3F7F" sub$="0000"
�	=sub$
�
00000000  0d 00 0a 0c f4 22 85 41  54 53 30 37 0d 00 14 24  |.....".ATS07...$|
00000010  f4 22 81 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.".*************|
00000020  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000030  0d 00 1e 24 f4 22 81 2a  86 41 54 53 83 52 6f 75  |...$.".*.ATS.Rou|
00000040  74 69 6e 65 20 74 6f 20  63 61 70 74 75 72 65 20  |tine to capture |
00000050  20 81 20 2a 0d 00 28 24  f4 22 81 2a 83 54 65 6c  | . *..($.".*.Tel|
00000060  65 74 65 78 74 20 70 61  67 65 2c 20 61 6e 64 20  |etext page, and |
00000070  63 68 65 63 6b 20 81 2a  0d 00 32 24 f4 22 81 2a  |check .*..2$.".*|
00000080  83 74 68 65 20 69 6e 74  65 67 72 69 74 79 20 6f  |.the integrity o|
00000090  66 20 74 68 65 20 64 61  74 61 81 2a 0d 00 3c 24  |f the data.*..<$|
000000a0  f4 22 81 2a 83 62 79 20  63 68 65 63 6b 69 6e 67  |.".*.by checking|
000000b0  20 74 68 65 20 43 52 43  2c 20 74 68 65 6e 81 2a  | the CRC, then.*|
000000c0  0d 00 46 24 f4 22 81 2a  83 63 61 6c 63 75 6c 61  |..F$.".*.calcula|
000000d0  74 65 73 20 74 68 65 20  73 75 62 2d 70 61 67 65  |tes the sub-page|
000000e0  20 20 81 2a 0d 00 50 24  f4 22 81 2a 83 6e 75 6d  |  .*..P$.".*.num|
000000f0  62 65 72 20 6f 66 20 74  68 65 20 64 69 73 70 6c  |ber of the displ|
00000100  61 79 2e 20 20 20 81 2a  0d 00 5a 24 f4 22 81 2a  |ay.   .*..Z$.".*|
00000110  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000120  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 00 64 24  |************..d$|
00000130  f4 22 81 2a 82 28 43 29  87 4a 2e 4a 2e 42 72 61  |.".*.(C).J.J.Bra|
00000140  79 73 68 61 77 85 4d 61  79 20 31 39 38 36 81 2a  |yshaw.May 1986.*|
00000150  0d 00 6e 24 f4 22 81 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..n$.".*********|
00000160  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000170  2a 2a 2a 2a 0d 00 78 24  f4 22 81 2a 87 4c 69 6e  |****..x$.".*.Lin|
00000180  65 73 20 66 6f 6c 6c 6f  77 69 6e 67 82 47 52 45  |es following.GRE|
00000190  45 4e 87 52 45 4d 81 2a  0d 00 82 24 f4 22 81 2a  |EN.REM.*...$.".*|
000001a0  87 73 74 61 74 65 6d 65  6e 74 73 20 74 6f 20 62  |.statements to b|
000001b0  65 20 61 64 6a 75 73 74  65 64 81 2a 0d 00 8c 24  |e adjusted.*...$|
000001c0  f4 22 81 2a 87 61 73 20  72 65 71 75 69 72 65 64  |.".*.as required|
000001d0  2e 20 20 20 20 20 20 20  20 20 20 20 20 20 81 2a  |.             .*|
000001e0  0d 00 96 24 f4 22 81 2a  87 52 45 4d 27 73 20 69  |...$.".*.REM's i|
000001f0  6e 83 59 45 4c 4c 4f 57  87 66 6f 72 20 69 6e 66  |n.YELLOW.for inf|
00000200  6f 2e 81 2a 0d 00 a0 24  f4 22 81 2a 87 6f 6e 6c  |o..*...$.".*.onl|
00000210  79 2e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |y.              |
00000220  20 20 20 20 20 20 81 2a  0d 00 aa 24 f4 22 81 2a  |      .*...$.".*|
00000230  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000240  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 00 b4 24  |************...$|
00000250  f4 22 81 2a 87 54 68 65  20 70 72 6f 63 65 64 75  |.".*.The procedu|
00000260  72 65 20 72 65 71 75 69  72 65 64 20 69 73 81 2a  |re required is.*|
00000270  0d 00 be 24 f4 22 81 2a  85 50 52 4f 43 63 68 65  |...$.".*.PROCche|
00000280  63 6b 5f 43 52 43 28 70  61 67 65 73 74 6f 72 65  |ck_CRC(pagestore|
00000290  25 29 81 2a 0d 00 c3 24  f4 22 81 2a 87 66 6f 6c  |%).*...$.".*.fol|
000002a0  6c 6f 77 65 64 20 62 79  20 20 20 20 20 20 20 20  |lowed by        |
000002b0  20 20 20 20 20 20 81 2a  0d 00 c8 24 f4 22 81 2a  |      .*...$.".*|
000002c0  85 46 4e 73 75 62 5f 70  61 67 65 28 70 61 67 65  |.FNsub_page(page|
000002d0  73 74 6f 72 65 25 29 2e  20 20 81 2a 0d 00 d2 24  |store%).  .*...$|
000002e0  f4 22 81 2a 87 54 68 65  20 72 65 73 74 20 6f 66  |.".*.The rest of|
000002f0  20 74 68 65 20 70 72 6f  67 72 61 6d 20 20 81 2a  | the program  .*|
00000300  0d 00 dc 24 f4 22 81 2a  87 69 73 20 61 20 64 65  |...$.".*.is a de|
00000310  6d 6f 6e 73 74 72 61 74  69 6f 6e 20 6f 6e 6c 79  |monstration only|
00000320  2e 20 81 2a 0d 00 e6 24  f4 22 81 2a 2a 2a 2a 2a  |. .*...$.".*****|
00000330  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000340  2a 2a 2a 2a 2a 2a 2a 2a  0d 00 f0 05 3a 0d 00 fa  |********....:...|
00000350  05 3a 0d 01 04 05 3a 0d  01 0e 1c f4 22 83 49 6e  |.:....:.....".In|
00000360  76 6f 6b 65 20 64 65 6d  6f 20 72 6f 75 74 69 6e  |voke demo routin|
00000370  65 73 3a 0d 01 18 06 eb  37 0d 01 22 12 f2 73 65  |es:.....7.."..se|
00000380  74 5f 76 61 72 69 61 62  6c 65 73 0d 01 2c 21 f2  |t_variables..,!.|
00000390  6f 73 63 6c 69 28 22 44  49 53 50 4c 41 59 20 22  |oscli("DISPLAY "|
000003a0  2b c3 7e 28 73 74 6f 72  65 25 29 29 0d 01 36 16  |+.~(store%))..6.|
000003b0  f2 63 68 65 63 6b 5f 43  52 43 28 73 74 6f 72 65  |.check_CRC(store|
000003c0  25 29 0d 01 40 2b f1 8a  32 30 2c 32 34 29 22 53  |%)..@+..20,24)"S|
000003d0  75 62 2d 70 61 67 65 3a  20 22 3b a4 73 75 62 5f  |ub-page: ";.sub_|
000003e0  70 61 67 65 28 73 74 6f  72 65 25 29 3b 0d 01 4a  |page(store%);..J|
000003f0  0d f1 8a 33 38 2c 32 34  29 3b 0d 01 54 05 e0 0d  |...38,24);..T...|
00000400  01 5e 05 3a 0d 01 68 05  3a 0d 01 72 05 3a 0d 01  |.^.:..h.:..r.:..|
00000410  7c 1f f4 22 81 2a 2a 2a  86 53 65 74 20 75 70 20  ||..".***.Set up |
00000420  76 61 72 69 61 62 6c 65  73 81 2a 2a 2a 0d 01 86  |variables.***...|
00000430  13 dd f2 73 65 74 5f 76  61 72 69 61 62 6c 65 73  |...set_variables|
00000440  0d 01 90 24 f4 22 82 53  74 61 72 74 20 61 64 64  |...$.".Start add|
00000450  72 65 73 73 20 66 6f 72  20 70 61 67 65 20 73 74  |ress for page st|
00000460  6f 72 65 3a 0d 01 9a 10  73 74 6f 72 65 25 3d 26  |ore:....store%=&|
00000470  36 30 30 30 0d 01 a4 1e  f4 22 82 53 65 74 20 43  |6000.....".Set C|
00000480  68 61 6e 6e 65 6c 20 26  20 70 61 67 65 20 6e 6f  |hannel & page no|
00000490  2e 3a 0d 01 ae 0a 2a 54  54 58 4f 4e 0d 01 b8 09  |.:....*TTXON....|
000004a0  2a 42 42 43 32 0d 01 c2  0c 2a 50 41 47 45 37 31  |*BBC2....*PAGE71|
000004b0  31 0d 01 cc 08 2a 48 4f  4e 0d 01 d6 1f f4 22 83  |1....*HON.....".|
000004c0  54 72 61 6e 73 66 65 72  20 70 61 67 65 20 74 6f  |Transfer page to|
000004d0  20 6d 65 6d 6f 72 79 3a  0d 01 e0 1e f4 22 83 4e  | memory:.....".N|
000004e0  6f 74 65 3a 20 55 73 65  20 2a 44 41 54 41 20 66  |ote: Use *DATA f|
000004f0  6f 72 20 74 68 65 0d 01  ea 1e f4 22 83 46 75 6c  |or the.....".Ful|
00000500  6c 20 4c 65 76 65 6c 20  4f 6e 65 20 54 65 6c 65  |l Level One Tele|
00000510  74 65 78 74 0d 01 f4 20  f4 22 83 50 61 67 65 2e  |text... .".Page.|
00000520  20 2a 54 52 41 4e 53 46  45 52 20 77 69 6c 6c 20  | *TRANSFER will |
00000530  6f 6e 6c 79 0d 01 fe 21  f4 22 83 73 65 6c 65 63  |only...!.".selec|
00000540  74 20 66 69 72 73 74 20  32 34 20 6c 69 6e 65 73  |t first 24 lines|
00000550  2e 20 54 68 65 0d 02 08  20 f4 22 83 43 52 43 20  |. The... .".CRC |
00000560  69 73 20 63 61 72 72 69  65 64 20 69 6e 20 72 6f  |is carried in ro|
00000570  77 20 32 37 2e 0d 02 12  21 f4 22 83 54 68 69 73  |w 27....!.".This|
00000580  20 72 65 71 75 69 72 65  73 20 32 6b 20 6f 66 20  | requires 2k of |
00000590  73 70 61 63 65 2e 0d 02  1c 1e f2 6f 73 63 6c 69  |space......oscli|
000005a0  28 22 44 41 54 41 20 22  2b c3 7e 28 73 74 6f 72  |("DATA "+.~(stor|
000005b0  65 25 29 29 0d 02 26 09  2a 48 4f 46 46 0d 02 30  |e%))..&.*HOFF..0|
000005c0  05 e1 0d 02 3a 05 3a 0d  02 44 05 3a 0d 02 4e 05  |....:.:..D.:..N.|
000005d0  3a 0d 02 58 1f f4 22 81  2a 2a 2a 86 4f 53 43 4c  |:..X..".***.OSCL|
000005e0  49 20 53 49 4d 55 4c 41  54 49 4f 4e 81 2a 2a 2a  |I SIMULATION.***|
000005f0  0d 02 62 15 dd f2 6f 73  63 6c 69 28 63 6f 6d 6d  |..b...oscli(comm|
00000600  61 6e 64 24 29 0d 02 6c  0e de 20 6c 69 6e 65 25  |and$)..l.. line%|
00000610  20 32 30 0d 02 76 13 24  6c 69 6e 65 25 3d 63 6f  | 20..v.$line%=co|
00000620  6d 6d 61 6e 64 24 0d 02  80 1f 58 25 3d 6c 69 6e  |mmand$....X%=lin|
00000630  65 25 20 83 32 35 36 3a  59 25 3d 6c 69 6e 65 25  |e% .256:Y%=line%|
00000640  20 81 32 35 36 0d 02 8a  0a d6 26 46 46 46 37 0d  | .256.....&FFF7.|
00000650  02 94 05 e1 0d 02 9e 05  3a 0d 02 a8 05 3a 0d 02  |........:....:..|
00000660  b2 05 3a 0d 02 bc 18 f4  22 81 2a 2a 2a 86 43 68  |..:.....".***.Ch|
00000670  65 63 6b 20 43 52 43 81  2a 2a 2a 0d 02 c6 17 dd  |eck CRC.***.....|
00000680  f2 63 68 65 63 6b 5f 43  52 43 28 73 74 61 72 74  |.check_CRC(start|
00000690  25 29 0d 02 d0 0a 41 25  3d 26 37 41 0d 02 da 0d  |%)....A%=&7A....|
000006a0  de 20 6c 69 6e 65 25 20  34 0d 02 e4 1f 58 25 3d  |. line% 4....X%=|
000006b0  6c 69 6e 65 25 20 83 32  35 36 3a 59 25 3d 6c 69  |line% .256:Y%=li|
000006c0  6e 65 25 20 81 32 35 36  0d 02 ee 0e 6c 69 6e 65  |ne% .256....line|
000006d0  25 3f 30 3d 32 33 0d 02  f8 19 6c 69 6e 65 25 3f  |%?0=23....line%?|
000006e0  31 3d 28 73 74 61 72 74  25 29 20 83 32 35 36 0d  |1=(start%) .256.|
000006f0  03 02 19 6c 69 6e 65 25  3f 32 3d 28 73 74 61 72  |...line%?2=(star|
00000700  74 25 29 20 81 32 35 36  0d 03 0c 0a d6 26 46 46  |t%) .256.....&FF|
00000710  46 31 0d 03 16 13 61 6e  73 77 65 72 25 3d 6c 69  |F1....answer%=li|
00000720  6e 65 25 3f 33 0d 03 20  2b e7 20 61 6e 73 77 65  |ne%?3.. +. answe|
00000730  72 25 3d 26 46 46 20 f1  8a 30 2c 32 34 29 bd 31  |r%=&FF ..0,24).1|
00000740  32 39 3b 22 43 52 43 20  45 52 52 4f 52 87 22 3b  |29;"CRC ERROR.";|
00000750  0d 03 2a 2c e7 20 61 6e  73 77 65 72 25 3d 26 30  |..*,. answer%=&0|
00000760  20 f1 8a 30 2c 32 34 29  bd 31 33 31 3b 22 4e 6f  | ..0,24).131;"No|
00000770  20 43 52 43 20 53 65 6e  74 87 22 3b 0d 03 34 30  | CRC Sent.";..40|
00000780  e7 20 61 6e 73 77 65 72  25 3d 26 31 20 f1 8a 30  |. answer%=&1 ..0|
00000790  2c 32 34 29 bd 31 33 36  3b 22 43 52 43 20 43 6f  |,24).136;"CRC Co|
000007a0  72 72 65 63 74 22 3b bd  31 33 37 3b 0d 03 3e 05  |rrect";.137;..>.|
000007b0  e1 0d 03 48 05 3a 0d 03  52 05 3a 0d 03 5c 23 f4  |...H.:..R.:..\#.|
000007c0  22 81 2a 2a 2a 86 46 69  6e 64 20 73 75 62 2d 70  |".***.Find sub-p|
000007d0  61 67 65 20 6e 75 6d 62  65 72 81 2a 2a 2a 0d 03  |age number.***..|
000007e0  66 16 dd a4 73 75 62 5f  70 61 67 65 28 73 74 61  |f...sub_page(sta|
000007f0  72 74 25 29 0d 03 70 22  73 75 62 25 3d 28 28 73  |rt%)..p"sub%=((s|
00000800  74 61 72 74 25 3f 33 29  2a 32 35 36 29 2b 73 74  |tart%?3)*256)+st|
00000810  61 72 74 25 3f 34 0d 03  7a 1a 73 75 62 24 3d c2  |art%?4..z.sub$=.|
00000820  22 30 30 30 30 22 2b c3  7e 73 75 62 25 2c 34 29  |"0000"+.~sub%,4)|
00000830  0d 03 84 1c e7 73 75 62  24 3d 22 33 46 37 46 22  |.....sub$="3F7F"|
00000840  20 73 75 62 24 3d 22 30  30 30 30 22 0d 03 8e 09  | sub$="0000"....|
00000850  3d 73 75 62 24 0d ff                              |=sub$..|
00000857
ATS/B\ATS07.m0
ATS/B\ATS07.m1
ATS/B\ATS07.m2
ATS/B\ATS07.m4
ATS/B\ATS07.m5