Home » CEEFAX disks » telesoftware1.adl » WOTBAUD

WOTBAUD

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 » telesoftware1.adl
Filename: WOTBAUD
Read OK:
File size: 16F7 bytes
Load address: 1900
Exec address: 8023
File contents
   10REM 'WotBaud'  by Tony Richey and Peter Vince
   20REM Demonstrates procedures to query and set BBC micro baud rates.
   30REM (c)  BBC tv  December 1986
   40 
   50ON ERROR GOTO1680
   60DIM osblock 10
   70 
   80MODE 7
   90FOR I%=1 TO 2
  100PRINTTAB(11,I%)CHR$&8D;CHR$&81;CHR$&9D;CHR$&83;"Query_Baud  ";CHR$&9C
  110NEXT
  120VDU 28,0,24,39,4 : REM Set window to exclude above title.
  130 
  140Y$=CHR$&83 : C$=CHR$&86
  150PRINTTAB(2,4)Y$;"This program demonstrates the use of"
  160PRINT'Y$;"three procedures that find which baud"
  170PRINT'Y$;"rates the RS423 serial port of the BBC"
  180PRINT'Y$;"micro is set to, and how to reset them"
  190PRINT'Y$;"more readably than just *FX7 and *FX8."
  200IF FNwait THEN VDU7:GOTO150
  210 
  220PRINT'C$;"  The first of these procedures is"
  230PRINTC$;"""PROCquerybaud"".  This calls Osbyte 242";
  240PRINTC$;"to read the register in the serial ULA"
  250PRINTC$;"which determines the baud rates."
  260PRINT'C$;"  The BASIC ""USR"" command is used to"
  270PRINTC$;"call the Osbyte routine as it returns"
  280PRINTC$;"the contents of the processor's"
  290PRINTC$;"registers when the routine finishes."
  300PRINT'C$;"  The A, X, and Y registers are set up"
  310PRINTC$;"prior to the call by setting the BASIC"
  320PRINTC$;"variables A%, X%, and Y%.   A% selects"
  330PRINTC$;"which Osbyte is required, while X% and"
  340PRINTC$;"Y% contain parameters that are passed"
  350PRINTC$;"to the Osbyte."
  360IF FNwait THEN 150
  370 
  380PRINTY$;"  In this case, the value in the ULA"
  390PRINTY$;"register is ANDed with Y and Exclusive"
  400PRINTY$;"ORed with X.  As we only want to"
  410PRINTY$;"inspect the contents, not change them,"
  420PRINTY$;"Y must have all bits set (255), and X"
  430PRINTY$;"have all bits clear (0)."
  440PRINT'Y$;"  The processor's registers on exit"
  450PRINTY$;"are packed into a 4 byte integer"
  460PRINTY$;"number, with the Status register in"
  470PRINTY$;"the most significant byte, followed by"
  480PRINTY$;"the Y, X, and finally A registers."
  490PRINT'Y$;"  The value in the ULA register is"
  500PRINTY$;"returned in the X register, and thus"
  510PRINTY$;"we need to mask the result from USR"
  520PRINTY$;"with &0000FF00, and divide it by 256."
  530IF FNwait THEN 220
  540 
  550PRINT'C$;"  Note that it has to be masked before"
  560PRINTC$;"the division,  because if the top bit"
  570PRINTC$;"of the status register were set,  the"
  580PRINTC$;"number would be considered negative,"
  590PRINTC$;"and give the wrong result after the"
  600PRINTC$;"division (plus 1 actually)."
  610PRINT'C$;"  The value returned is passed on to"
  620PRINTC$;"PROCprintbaud which decodes and prints"
  630PRINTC$;"both the baud rate,  and the arguments"
  640PRINTC$;"for *FX7 or 8 which would select that"
  650PRINTC$;"speed."
  660PRINT'C$;"  PROCprintbaud can easily be changed"
  670PRINTC$;"(to a Function if required) to return"
  680PRINTC$;"the values rather than printing them."
  690IF FNwait THEN 380
  700 
  710PRINT'Y$"  FNbaud works in the reverse direct-"
  720PRINTY$"ion,  taking the required baud-rate"
  730PRINTY$"(for example 1200) as an argument, and"
  740PRINTY$"returning a string with the argument"
  750PRINTY$"for *FX7 or *FX8."
  760PRINT'Y$;"  This can be printed, or appended to"
  770PRINTY$;"the string ""*FX7,"" and sent to the"
  780PRINTY$;"Operating System ""Command Line Inter-"
  790PRINTY$;"preter""."
  800PRINT'Y$;"  With BASIC-2 or later, this would be"
  810PRINTY$;"done with the OSCLI command, but for"
  820PRINTY$;"BASIC-1 a ""PROCoscli"" is needed, and"
  830PRINTY$;"so that is used here."
  840IF FNwait THEN 550
  850 
  860PRINT'C$;"  This program now enters a loop in"
  870PRINTC$;"which it repeatedly calls PROCprintbaud";
  880PRINTC$;"to show the current settings of the"
  890PRINTC$;"micro, and then asks for some new baud"
  900PRINTC$;"rates to be entered."
  910PRINT'C$;"  These are input as the variables"
  920PRINTC$;"""rxspeed""  and  ""txspeed""  which are"
  930PRINTC$;"sent to FNbaud,  and then with the"
  940PRINTC$;"""*FX7"" and ""*FX8"" strings to PROCoscli."
  950PRINTC$;"  The program then repeats the loop,"
  960PRINTC$;"showing that the speeds have changed."
  970PRINT'C$;"  As this is an infinite loop, press"
  980PRINT" Escape";C$;"to exit."
  990 
 1000VDU 28,0,24,39,4
 1010PRINTTAB(1,18)CHR$&82;"Press";CHR$&83;"RETURN";CHR$&82;"to start demonstration,"
 1020PRINTTAB(9,19)CHR$&82;"or";CHR$&83;"TAB";CHR$&82;"to go back...";
 1030VDU 23,1,1;0;0;0;   :REM Cursor on
 1040REPEAT response=GET :UNTIL response=9 OR response=13
 1050CLS
 1060IF response=9 THEN 710
 1070 
 1080PRINTTAB(9,19)CHR$&82;"Press";CHR$&87;"Escape";CHR$&82;"to exit"
 1090VDU 28,0,21,39,4
 1100 
 1110REPEAT
 1120PROCquerybaud
 1130INPUT'''"Enter required Receive speed - "rxspeed
 1140INPUT"Enter required Transmit speed - "txspeed
 1150PROCoscli("FX7,"+FNbaud(rxspeed))
 1160PROCoscli("FX8,"+FNbaud(txspeed))
 1170UNTIL FALSE
 1180 
 1190 
 1200DEFFNwait
 1210VDU 26 :REM Restore default full-screen window.
 1220PRINTTAB(6,22)CHR$&82;"Press";CHR$&83;"RETURN";CHR$&82;"to continue,"
 1230PRINTTAB(9,23)CHR$&82;"or";CHR$&83;"TAB";CHR$&82;"to go back...";
 1240VDU 23,1,1;0;0;0;   :REM Cursor on
 1250REPEAT response=GET :UNTIL response=9 OR response=13
 1260VDU 23,1,0;0;0;0;   :REM Cursor off
 1270VDU 28,0,21,39,4    :CLS :REM Reset window, and clear.
 1280IF response=9 THEN =TRUE ELSE =FALSE
 1290 
 1300 
 1310DEFPROCquerybaud
 1320REM Osbyte 242 (&F2) reads the copy of the Serial Processor ULA register
 1330REM see pages 236 and 392 of the Advanced User Guide for the BBC micro.
 1340PRINT'"This computer is now set up to -"'
 1350A% = 242 : X% = 0 : Y% = 255
 1360registercopy% = (USR&FFF4 AND &FF00) DIV&100
 1370PROCprintbaud("Receive ","7",registercopy% DIV 8 AND 7)
 1380PROCprintbaud("Transmit","8",registercopy% AND 7)
 1390ENDPROC
 1400 
 1410 
 1420DEFPROCprintbaud(direction$,fx$,B%)
 1430C% = ( (B%AND1)*4 + (B%AND2) + (B%AND4) DIV4 ) EOR7
 1440PRINT direction$;" at ";75*2^(C%-(C%>2));" BAUD. ( *FX";fx$;",";C%+1;" )"
 1450REM This procedure could return the value, rather than printing it,
 1460REM by adding here:-    baudrate = 75 * 2^ (C% - (C%>2) )
 1470ENDPROC
 1480 
 1490 
 1500DEFFNbaud(speed)
 1510LOCAL I%
 1520IF SGN(speed)<>1 THEN = STR$(0) :REM Trap to prevent 'Log range' error.
 1530I% = LN(speed/37.5)/LN2 + (speed>500)
 1540IF I%<1 OR I%>8 THEN I% = 0
 1550= STR$I%
 1560 
 1570 
 1580DEFPROCoscli(command$)
 1590LOCAL X%,Y%
 1600$osblock=command$
 1610X% = osblock MOD 256
 1620Y% = osblock DIV 256
 1630CALL &FFF7 : REM Operating System 'Command Line Interpreter'
 1640ENDPROC
 1650 
 1660 
 1670REM Error handling routine
 1680VDU 26 :REM Reset default full-screen window.
 1690PRINTTAB(0,22)SPC(119);TAB(0,22);
 1700IF ERR=17 THEN PRINT'"Program aborted." ELSE REPORT:PRINT" at line ";ERL;CHR$7
 1710VDU 23,1,1;0;0;0;   :REM Restore cursor

/� 'WotBaud'  by Tony Richey and Peter Vince
D� Demonstrates procedures to query and set BBC micro baud rates.
 � (c)  BBC tv  December 1986
( 
2
� � �tPF
<� osblock 10
F 
P� 7
Z� I%=1 � 2
d3�11,I%)�&8D;�&81;�&9D;�&83;"Query_Baud  ";�&9C
n�
x9� 28,0,24,39,4 : � Set window to exclude above title.
� 
�Y$=�&83 : C$=�&86
�3�2,4)Y$;"This program demonstrates the use of"
�0�'Y$;"three procedures that find which baud"
�1�'Y$;"rates the RS423 serial port of the BBC"
�1�'Y$;"micro is set to, and how to reset them"
�1�'Y$;"more readably than just *FX7 and *FX8."
�� �wait � �7:�tV@
� 
�-�'C$;"  The first of these procedures is"
�4�C$;"""PROCquerybaud"".  This calls Osbyte 242";
�0�C$;"to read the register in the serial ULA"
�*�C$;"which determines the baud rates."
1�'C$;"  The BASIC ""USR"" command is used to"
/�C$;"call the Osbyte routine as it returns"
)�C$;"the contents of the processor's"
".�C$;"registers when the routine finishes."
,1�'C$;"  The A, X, and Y registers are set up"
60�C$;"prior to the call by setting the BASIC"
@0�C$;"variables A%, X%, and Y%.   A% selects"
J0�C$;"which Osbyte is required, while X% and"
T/�C$;"Y% contain parameters that are passed"
^�C$;"to the Osbyte."
h� �wait � �tV@
r 
|.�Y$;"  In this case, the value in the ULA"
�0�Y$;"register is ANDed with Y and Exclusive"
�*�Y$;"ORed with X.  As we only want to"
�0�Y$;"inspect the contents, not change them,"
�/�Y$;"Y must have all bits set (255), and X"
�"�Y$;"have all bits clear (0)."
�.�'Y$;"  The processor's registers on exit"
�*�Y$;"are packed into a 4 byte integer"
�-�Y$;"number, with the Status register in"
�0�Y$;"the most significant byte, followed by"
�,�Y$;"the Y, X, and finally A registers."
�-�'Y$;"  The value in the ULA register is"
�.�Y$;"returned in the X register, and thus"
�-�Y$;"we need to mask the result from USR"
/�Y$;"with &0000FF00, and divide it by 256."
� �wait � �d\@
 
&1�'C$;"  Note that it has to be masked before"
0/�C$;"the division,  because if the top bit"
:/�C$;"of the status register were set,  the"
D.�C$;"number would be considered negative,"
N-�C$;"and give the wrong result after the"
X%�C$;"division (plus 1 actually)."
b/�'C$;"  The value returned is passed on to"
l0�C$;"PROCprintbaud which decodes and prints"
v0�C$;"both the baud rate,  and the arguments"
�/�C$;"for *FX7 or 8 which would select that"
��C$;"speed."
�0�'C$;"  PROCprintbaud can easily be changed"
�/�C$;"(to a Function if required) to return"
�/�C$;"the values rather than printing them."
�� �wait � �D|A
� 
�/�'Y$"  FNbaud works in the reverse direct-"
�,�Y$"ion,  taking the required baud-rate"
�/�Y$"(for example 1200) as an argument, and"
�-�Y$"returning a string with the argument"
��Y$"for *FX7 or *FX8."
�0�'Y$;"  This can be printed, or appended to"
.�Y$;"the string ""*FX7,"" and sent to the"
0�Y$;"Operating System ""Command Line Inter-"
�Y$;"preter""."
 1�'Y$;"  With BASIC-2 or later, this would be"
*.�Y$;"done with the OSCLI command, but for"
40�Y$;"BASIC-1 a ""PROCoscli"" is needed, and"
>�Y$;"so that is used here."
H� �wait � �TfB
R 
\.�'C$;"  This program now enters a loop in"
f2�C$;"which it repeatedly calls PROCprintbaud";
p-�C$;"to show the current settings of the"
z0�C$;"micro, and then asks for some new baud"
��C$;"rates to be entered."
�-�'C$;"  These are input as the variables"
�2�C$;"""rxspeed""  and  ""txspeed""  which are"
�,�C$;"sent to FNbaud,  and then with the"
�5�C$;"""*FX7"" and ""*FX8"" strings to PROCoscli."
�.�C$;"  The program then repeats the loop,"
�/�C$;"showing that the speeds have changed."
�/�'C$;"  As this is an infinite loop, press"
��" Escape";C$;"to exit."
� 
�� 28,0,24,39,4
�D�1,18)�&82;"Press";�&83;"RETURN";�&82;"to start demonstration,"
�5�9,19)�&82;"or";�&83;"TAB";�&82;"to go back...";
"� 23,1,1;0;0;0;   :� Cursor on
,� response=� :� response=9 � response=13
�
$� response=9 � �dFB
. 
84�9,19)�&82;"Press";�&87;"Escape";�&82;"to exit"
B� 28,0,21,39,4
L 
V�
`�querybaud
j0�'''"Enter required Receive speed - "rxspeed
t.�"Enter required Transmit speed - "txspeed
~!�oscli("FX7,"+�baud(rxspeed))
�!�oscli("FX8,"+�baud(txspeed))
�� �
� 
� 
�
ݤwait
�/� 26 :� Restore default full-screen window.
�9�6,22)�&82;"Press";�&83;"RETURN";�&82;"to continue,"
�5�9,23)�&82;"or";�&83;"TAB";�&82;"to go back...";
�"� 23,1,1;0;0;0;   :� Cursor on
�,� response=� :� response=9 � response=13
�#� 23,1,0;0;0;0;   :� Cursor off
�4� 28,0,21,39,4    :� :� Reset window, and clear.
� response=9 � =� � =�

 
 
��querybaud
(J� Osbyte 242 (&F2) reads the copy of the Serial Processor ULA register
2I� see pages 236 and 392 of the Advanced User Guide for the BBC micro.
<)�'"This computer is now set up to -"'
F A% = 242 : X% = 0 : Y% = 255
P*registercopy% = (�&FFF4 � &FF00) �&100
Z4�printbaud("Receive ","7",registercopy% � 8 � 7)
d0�printbaud("Transmit","8",registercopy% � 7)
n�
x 
� 
�"��printbaud(direction$,fx$,B%)
�-C% = ( (B%�1)*4 + (B%�2) + (B%�4) �4 ) �7
�I� direction$;" at ";75*2^(C%-(C%>2));" BAUD. ( *FX";fx$;",";C%+1;" )"
�E� This procedure could return the value, rather than printing it,
�;� by adding here:-    baudrate = 75 * 2^ (C% - (C%>2) )
��
� 
� 
�ݤbaud(speed)
�� I%
�@� �(speed)<>1 � = �(0) :� Trap to prevent 'Log range' error.
�'I% = �(speed/37.5)/�2 + (speed>500)
� I%<1 � I%>8 � I% = 0
	= �I%
 
" 
,��oscli(command$)
6� X%,Y%
@$osblock=command$
JX% = osblock � 256
TY% = osblock � 256
^;� &FFF7 : � Operating System 'Command Line Interpreter'
h�
r 
| 
�� Error handling routine
�-� 26 :� Reset default full-screen window.
��0,22)�(119);�0,22);
�7� �=17 � �'"Program aborted." � �:�" at line ";�;�7
�'� 23,1,1;0;0;0;   :� Restore cursor
�
00000000  0d 00 0a 2f f4 20 27 57  6f 74 42 61 75 64 27 20  |.../. 'WotBaud' |
00000010  20 62 79 20 54 6f 6e 79  20 52 69 63 68 65 79 20  | by Tony Richey |
00000020  61 6e 64 20 50 65 74 65  72 20 56 69 6e 63 65 0d  |and Peter Vince.|
00000030  00 14 44 f4 20 44 65 6d  6f 6e 73 74 72 61 74 65  |..D. Demonstrate|
00000040  73 20 70 72 6f 63 65 64  75 72 65 73 20 74 6f 20  |s procedures to |
00000050  71 75 65 72 79 20 61 6e  64 20 73 65 74 20 42 42  |query and set BB|
00000060  43 20 6d 69 63 72 6f 20  62 61 75 64 20 72 61 74  |C micro baud rat|
00000070  65 73 2e 0d 00 1e 20 f4  20 28 63 29 20 20 42 42  |es.... . (c)  BB|
00000080  43 20 74 76 20 20 44 65  63 65 6d 62 65 72 20 31  |C tv  December 1|
00000090  39 38 36 0d 00 28 05 20  0d 00 32 0d ee 20 85 20  |986..(. ..2.. . |
000000a0  e5 8d 74 50 46 0d 00 3c  10 de 20 6f 73 62 6c 6f  |..tPF..<.. osblo|
000000b0  63 6b 20 31 30 0d 00 46  05 20 0d 00 50 07 eb 20  |ck 10..F. ..P.. |
000000c0  37 0d 00 5a 0e e3 20 49  25 3d 31 20 b8 20 32 0d  |7..Z.. I%=1 . 2.|
000000d0  00 64 33 f1 8a 31 31 2c  49 25 29 bd 26 38 44 3b  |.d3..11,I%).&8D;|
000000e0  bd 26 38 31 3b bd 26 39  44 3b bd 26 38 33 3b 22  |.&81;.&9D;.&83;"|
000000f0  51 75 65 72 79 5f 42 61  75 64 20 20 22 3b bd 26  |Query_Baud  ";.&|
00000100  39 43 0d 00 6e 05 ed 0d  00 78 39 ef 20 32 38 2c  |9C..n....x9. 28,|
00000110  30 2c 32 34 2c 33 39 2c  34 20 3a 20 f4 20 53 65  |0,24,39,4 : . Se|
00000120  74 20 77 69 6e 64 6f 77  20 74 6f 20 65 78 63 6c  |t window to excl|
00000130  75 64 65 20 61 62 6f 76  65 20 74 69 74 6c 65 2e  |ude above title.|
00000140  0d 00 82 05 20 0d 00 8c  15 59 24 3d bd 26 38 33  |.... ....Y$=.&83|
00000150  20 3a 20 43 24 3d bd 26  38 36 0d 00 96 33 f1 8a  | : C$=.&86...3..|
00000160  32 2c 34 29 59 24 3b 22  54 68 69 73 20 70 72 6f  |2,4)Y$;"This pro|
00000170  67 72 61 6d 20 64 65 6d  6f 6e 73 74 72 61 74 65  |gram demonstrate|
00000180  73 20 74 68 65 20 75 73  65 20 6f 66 22 0d 00 a0  |s the use of"...|
00000190  30 f1 27 59 24 3b 22 74  68 72 65 65 20 70 72 6f  |0.'Y$;"three pro|
000001a0  63 65 64 75 72 65 73 20  74 68 61 74 20 66 69 6e  |cedures that fin|
000001b0  64 20 77 68 69 63 68 20  62 61 75 64 22 0d 00 aa  |d which baud"...|
000001c0  31 f1 27 59 24 3b 22 72  61 74 65 73 20 74 68 65  |1.'Y$;"rates the|
000001d0  20 52 53 34 32 33 20 73  65 72 69 61 6c 20 70 6f  | RS423 serial po|
000001e0  72 74 20 6f 66 20 74 68  65 20 42 42 43 22 0d 00  |rt of the BBC"..|
000001f0  b4 31 f1 27 59 24 3b 22  6d 69 63 72 6f 20 69 73  |.1.'Y$;"micro is|
00000200  20 73 65 74 20 74 6f 2c  20 61 6e 64 20 68 6f 77  | set to, and how|
00000210  20 74 6f 20 72 65 73 65  74 20 74 68 65 6d 22 0d  | to reset them".|
00000220  00 be 31 f1 27 59 24 3b  22 6d 6f 72 65 20 72 65  |..1.'Y$;"more re|
00000230  61 64 61 62 6c 79 20 74  68 61 6e 20 6a 75 73 74  |adably than just|
00000240  20 2a 46 58 37 20 61 6e  64 20 2a 46 58 38 2e 22  | *FX7 and *FX8."|
00000250  0d 00 c8 16 e7 20 a4 77  61 69 74 20 8c 20 ef 37  |..... .wait . .7|
00000260  3a e5 8d 74 56 40 0d 00  d2 05 20 0d 00 dc 2d f1  |:..tV@.... ...-.|
00000270  27 43 24 3b 22 20 20 54  68 65 20 66 69 72 73 74  |'C$;"  The first|
00000280  20 6f 66 20 74 68 65 73  65 20 70 72 6f 63 65 64  | of these proced|
00000290  75 72 65 73 20 69 73 22  0d 00 e6 34 f1 43 24 3b  |ures is"...4.C$;|
000002a0  22 22 22 50 52 4f 43 71  75 65 72 79 62 61 75 64  |"""PROCquerybaud|
000002b0  22 22 2e 20 20 54 68 69  73 20 63 61 6c 6c 73 20  |"".  This calls |
000002c0  4f 73 62 79 74 65 20 32  34 32 22 3b 0d 00 f0 30  |Osbyte 242";...0|
000002d0  f1 43 24 3b 22 74 6f 20  72 65 61 64 20 74 68 65  |.C$;"to read the|
000002e0  20 72 65 67 69 73 74 65  72 20 69 6e 20 74 68 65  | register in the|
000002f0  20 73 65 72 69 61 6c 20  55 4c 41 22 0d 00 fa 2a  | serial ULA"...*|
00000300  f1 43 24 3b 22 77 68 69  63 68 20 64 65 74 65 72  |.C$;"which deter|
00000310  6d 69 6e 65 73 20 74 68  65 20 62 61 75 64 20 72  |mines the baud r|
00000320  61 74 65 73 2e 22 0d 01  04 31 f1 27 43 24 3b 22  |ates."...1.'C$;"|
00000330  20 20 54 68 65 20 42 41  53 49 43 20 22 22 55 53  |  The BASIC ""US|
00000340  52 22 22 20 63 6f 6d 6d  61 6e 64 20 69 73 20 75  |R"" command is u|
00000350  73 65 64 20 74 6f 22 0d  01 0e 2f f1 43 24 3b 22  |sed to".../.C$;"|
00000360  63 61 6c 6c 20 74 68 65  20 4f 73 62 79 74 65 20  |call the Osbyte |
00000370  72 6f 75 74 69 6e 65 20  61 73 20 69 74 20 72 65  |routine as it re|
00000380  74 75 72 6e 73 22 0d 01  18 29 f1 43 24 3b 22 74  |turns"...).C$;"t|
00000390  68 65 20 63 6f 6e 74 65  6e 74 73 20 6f 66 20 74  |he contents of t|
000003a0  68 65 20 70 72 6f 63 65  73 73 6f 72 27 73 22 0d  |he processor's".|
000003b0  01 22 2e f1 43 24 3b 22  72 65 67 69 73 74 65 72  |."..C$;"register|
000003c0  73 20 77 68 65 6e 20 74  68 65 20 72 6f 75 74 69  |s when the routi|
000003d0  6e 65 20 66 69 6e 69 73  68 65 73 2e 22 0d 01 2c  |ne finishes."..,|
000003e0  31 f1 27 43 24 3b 22 20  20 54 68 65 20 41 2c 20  |1.'C$;"  The A, |
000003f0  58 2c 20 61 6e 64 20 59  20 72 65 67 69 73 74 65  |X, and Y registe|
00000400  72 73 20 61 72 65 20 73  65 74 20 75 70 22 0d 01  |rs are set up"..|
00000410  36 30 f1 43 24 3b 22 70  72 69 6f 72 20 74 6f 20  |60.C$;"prior to |
00000420  74 68 65 20 63 61 6c 6c  20 62 79 20 73 65 74 74  |the call by sett|
00000430  69 6e 67 20 74 68 65 20  42 41 53 49 43 22 0d 01  |ing the BASIC"..|
00000440  40 30 f1 43 24 3b 22 76  61 72 69 61 62 6c 65 73  |@0.C$;"variables|
00000450  20 41 25 2c 20 58 25 2c  20 61 6e 64 20 59 25 2e  | A%, X%, and Y%.|
00000460  20 20 20 41 25 20 73 65  6c 65 63 74 73 22 0d 01  |   A% selects"..|
00000470  4a 30 f1 43 24 3b 22 77  68 69 63 68 20 4f 73 62  |J0.C$;"which Osb|
00000480  79 74 65 20 69 73 20 72  65 71 75 69 72 65 64 2c  |yte is required,|
00000490  20 77 68 69 6c 65 20 58  25 20 61 6e 64 22 0d 01  | while X% and"..|
000004a0  54 2f f1 43 24 3b 22 59  25 20 63 6f 6e 74 61 69  |T/.C$;"Y% contai|
000004b0  6e 20 70 61 72 61 6d 65  74 65 72 73 20 74 68 61  |n parameters tha|
000004c0  74 20 61 72 65 20 70 61  73 73 65 64 22 0d 01 5e  |t are passed"..^|
000004d0  18 f1 43 24 3b 22 74 6f  20 74 68 65 20 4f 73 62  |..C$;"to the Osb|
000004e0  79 74 65 2e 22 0d 01 68  12 e7 20 a4 77 61 69 74  |yte."..h.. .wait|
000004f0  20 8c 20 8d 74 56 40 0d  01 72 05 20 0d 01 7c 2e  | . .tV@..r. ..|.|
00000500  f1 59 24 3b 22 20 20 49  6e 20 74 68 69 73 20 63  |.Y$;"  In this c|
00000510  61 73 65 2c 20 74 68 65  20 76 61 6c 75 65 20 69  |ase, the value i|
00000520  6e 20 74 68 65 20 55 4c  41 22 0d 01 86 30 f1 59  |n the ULA"...0.Y|
00000530  24 3b 22 72 65 67 69 73  74 65 72 20 69 73 20 41  |$;"register is A|
00000540  4e 44 65 64 20 77 69 74  68 20 59 20 61 6e 64 20  |NDed with Y and |
00000550  45 78 63 6c 75 73 69 76  65 22 0d 01 90 2a f1 59  |Exclusive"...*.Y|
00000560  24 3b 22 4f 52 65 64 20  77 69 74 68 20 58 2e 20  |$;"ORed with X. |
00000570  20 41 73 20 77 65 20 6f  6e 6c 79 20 77 61 6e 74  | As we only want|
00000580  20 74 6f 22 0d 01 9a 30  f1 59 24 3b 22 69 6e 73  | to"...0.Y$;"ins|
00000590  70 65 63 74 20 74 68 65  20 63 6f 6e 74 65 6e 74  |pect the content|
000005a0  73 2c 20 6e 6f 74 20 63  68 61 6e 67 65 20 74 68  |s, not change th|
000005b0  65 6d 2c 22 0d 01 a4 2f  f1 59 24 3b 22 59 20 6d  |em,".../.Y$;"Y m|
000005c0  75 73 74 20 68 61 76 65  20 61 6c 6c 20 62 69 74  |ust have all bit|
000005d0  73 20 73 65 74 20 28 32  35 35 29 2c 20 61 6e 64  |s set (255), and|
000005e0  20 58 22 0d 01 ae 22 f1  59 24 3b 22 68 61 76 65  | X"...".Y$;"have|
000005f0  20 61 6c 6c 20 62 69 74  73 20 63 6c 65 61 72 20  | all bits clear |
00000600  28 30 29 2e 22 0d 01 b8  2e f1 27 59 24 3b 22 20  |(0).".....'Y$;" |
00000610  20 54 68 65 20 70 72 6f  63 65 73 73 6f 72 27 73  | The processor's|
00000620  20 72 65 67 69 73 74 65  72 73 20 6f 6e 20 65 78  | registers on ex|
00000630  69 74 22 0d 01 c2 2a f1  59 24 3b 22 61 72 65 20  |it"...*.Y$;"are |
00000640  70 61 63 6b 65 64 20 69  6e 74 6f 20 61 20 34 20  |packed into a 4 |
00000650  62 79 74 65 20 69 6e 74  65 67 65 72 22 0d 01 cc  |byte integer"...|
00000660  2d f1 59 24 3b 22 6e 75  6d 62 65 72 2c 20 77 69  |-.Y$;"number, wi|
00000670  74 68 20 74 68 65 20 53  74 61 74 75 73 20 72 65  |th the Status re|
00000680  67 69 73 74 65 72 20 69  6e 22 0d 01 d6 30 f1 59  |gister in"...0.Y|
00000690  24 3b 22 74 68 65 20 6d  6f 73 74 20 73 69 67 6e  |$;"the most sign|
000006a0  69 66 69 63 61 6e 74 20  62 79 74 65 2c 20 66 6f  |ificant byte, fo|
000006b0  6c 6c 6f 77 65 64 20 62  79 22 0d 01 e0 2c f1 59  |llowed by"...,.Y|
000006c0  24 3b 22 74 68 65 20 59  2c 20 58 2c 20 61 6e 64  |$;"the Y, X, and|
000006d0  20 66 69 6e 61 6c 6c 79  20 41 20 72 65 67 69 73  | finally A regis|
000006e0  74 65 72 73 2e 22 0d 01  ea 2d f1 27 59 24 3b 22  |ters."...-.'Y$;"|
000006f0  20 20 54 68 65 20 76 61  6c 75 65 20 69 6e 20 74  |  The value in t|
00000700  68 65 20 55 4c 41 20 72  65 67 69 73 74 65 72 20  |he ULA register |
00000710  69 73 22 0d 01 f4 2e f1  59 24 3b 22 72 65 74 75  |is".....Y$;"retu|
00000720  72 6e 65 64 20 69 6e 20  74 68 65 20 58 20 72 65  |rned in the X re|
00000730  67 69 73 74 65 72 2c 20  61 6e 64 20 74 68 75 73  |gister, and thus|
00000740  22 0d 01 fe 2d f1 59 24  3b 22 77 65 20 6e 65 65  |"...-.Y$;"we nee|
00000750  64 20 74 6f 20 6d 61 73  6b 20 74 68 65 20 72 65  |d to mask the re|
00000760  73 75 6c 74 20 66 72 6f  6d 20 55 53 52 22 0d 02  |sult from USR"..|
00000770  08 2f f1 59 24 3b 22 77  69 74 68 20 26 30 30 30  |./.Y$;"with &000|
00000780  30 46 46 30 30 2c 20 61  6e 64 20 64 69 76 69 64  |0FF00, and divid|
00000790  65 20 69 74 20 62 79 20  32 35 36 2e 22 0d 02 12  |e it by 256."...|
000007a0  12 e7 20 a4 77 61 69 74  20 8c 20 8d 64 5c 40 0d  |.. .wait . .d\@.|
000007b0  02 1c 05 20 0d 02 26 31  f1 27 43 24 3b 22 20 20  |... ..&1.'C$;"  |
000007c0  4e 6f 74 65 20 74 68 61  74 20 69 74 20 68 61 73  |Note that it has|
000007d0  20 74 6f 20 62 65 20 6d  61 73 6b 65 64 20 62 65  | to be masked be|
000007e0  66 6f 72 65 22 0d 02 30  2f f1 43 24 3b 22 74 68  |fore"..0/.C$;"th|
000007f0  65 20 64 69 76 69 73 69  6f 6e 2c 20 20 62 65 63  |e division,  bec|
00000800  61 75 73 65 20 69 66 20  74 68 65 20 74 6f 70 20  |ause if the top |
00000810  62 69 74 22 0d 02 3a 2f  f1 43 24 3b 22 6f 66 20  |bit"..:/.C$;"of |
00000820  74 68 65 20 73 74 61 74  75 73 20 72 65 67 69 73  |the status regis|
00000830  74 65 72 20 77 65 72 65  20 73 65 74 2c 20 20 74  |ter were set,  t|
00000840  68 65 22 0d 02 44 2e f1  43 24 3b 22 6e 75 6d 62  |he"..D..C$;"numb|
00000850  65 72 20 77 6f 75 6c 64  20 62 65 20 63 6f 6e 73  |er would be cons|
00000860  69 64 65 72 65 64 20 6e  65 67 61 74 69 76 65 2c  |idered negative,|
00000870  22 0d 02 4e 2d f1 43 24  3b 22 61 6e 64 20 67 69  |"..N-.C$;"and gi|
00000880  76 65 20 74 68 65 20 77  72 6f 6e 67 20 72 65 73  |ve the wrong res|
00000890  75 6c 74 20 61 66 74 65  72 20 74 68 65 22 0d 02  |ult after the"..|
000008a0  58 25 f1 43 24 3b 22 64  69 76 69 73 69 6f 6e 20  |X%.C$;"division |
000008b0  28 70 6c 75 73 20 31 20  61 63 74 75 61 6c 6c 79  |(plus 1 actually|
000008c0  29 2e 22 0d 02 62 2f f1  27 43 24 3b 22 20 20 54  |)."..b/.'C$;"  T|
000008d0  68 65 20 76 61 6c 75 65  20 72 65 74 75 72 6e 65  |he value returne|
000008e0  64 20 69 73 20 70 61 73  73 65 64 20 6f 6e 20 74  |d is passed on t|
000008f0  6f 22 0d 02 6c 30 f1 43  24 3b 22 50 52 4f 43 70  |o"..l0.C$;"PROCp|
00000900  72 69 6e 74 62 61 75 64  20 77 68 69 63 68 20 64  |rintbaud which d|
00000910  65 63 6f 64 65 73 20 61  6e 64 20 70 72 69 6e 74  |ecodes and print|
00000920  73 22 0d 02 76 30 f1 43  24 3b 22 62 6f 74 68 20  |s"..v0.C$;"both |
00000930  74 68 65 20 62 61 75 64  20 72 61 74 65 2c 20 20  |the baud rate,  |
00000940  61 6e 64 20 74 68 65 20  61 72 67 75 6d 65 6e 74  |and the argument|
00000950  73 22 0d 02 80 2f f1 43  24 3b 22 66 6f 72 20 2a  |s".../.C$;"for *|
00000960  46 58 37 20 6f 72 20 38  20 77 68 69 63 68 20 77  |FX7 or 8 which w|
00000970  6f 75 6c 64 20 73 65 6c  65 63 74 20 74 68 61 74  |ould select that|
00000980  22 0d 02 8a 10 f1 43 24  3b 22 73 70 65 65 64 2e  |".....C$;"speed.|
00000990  22 0d 02 94 30 f1 27 43  24 3b 22 20 20 50 52 4f  |"...0.'C$;"  PRO|
000009a0  43 70 72 69 6e 74 62 61  75 64 20 63 61 6e 20 65  |Cprintbaud can e|
000009b0  61 73 69 6c 79 20 62 65  20 63 68 61 6e 67 65 64  |asily be changed|
000009c0  22 0d 02 9e 2f f1 43 24  3b 22 28 74 6f 20 61 20  |".../.C$;"(to a |
000009d0  46 75 6e 63 74 69 6f 6e  20 69 66 20 72 65 71 75  |Function if requ|
000009e0  69 72 65 64 29 20 74 6f  20 72 65 74 75 72 6e 22  |ired) to return"|
000009f0  0d 02 a8 2f f1 43 24 3b  22 74 68 65 20 76 61 6c  |.../.C$;"the val|
00000a00  75 65 73 20 72 61 74 68  65 72 20 74 68 61 6e 20  |ues rather than |
00000a10  70 72 69 6e 74 69 6e 67  20 74 68 65 6d 2e 22 0d  |printing them.".|
00000a20  02 b2 12 e7 20 a4 77 61  69 74 20 8c 20 8d 44 7c  |.... .wait . .D||
00000a30  41 0d 02 bc 05 20 0d 02  c6 2f f1 27 59 24 22 20  |A.... .../.'Y$" |
00000a40  20 46 4e 62 61 75 64 20  77 6f 72 6b 73 20 69 6e  | FNbaud works in|
00000a50  20 74 68 65 20 72 65 76  65 72 73 65 20 64 69 72  | the reverse dir|
00000a60  65 63 74 2d 22 0d 02 d0  2c f1 59 24 22 69 6f 6e  |ect-"...,.Y$"ion|
00000a70  2c 20 20 74 61 6b 69 6e  67 20 74 68 65 20 72 65  |,  taking the re|
00000a80  71 75 69 72 65 64 20 62  61 75 64 2d 72 61 74 65  |quired baud-rate|
00000a90  22 0d 02 da 2f f1 59 24  22 28 66 6f 72 20 65 78  |".../.Y$"(for ex|
00000aa0  61 6d 70 6c 65 20 31 32  30 30 29 20 61 73 20 61  |ample 1200) as a|
00000ab0  6e 20 61 72 67 75 6d 65  6e 74 2c 20 61 6e 64 22  |n argument, and"|
00000ac0  0d 02 e4 2d f1 59 24 22  72 65 74 75 72 6e 69 6e  |...-.Y$"returnin|
00000ad0  67 20 61 20 73 74 72 69  6e 67 20 77 69 74 68 20  |g a string with |
00000ae0  74 68 65 20 61 72 67 75  6d 65 6e 74 22 0d 02 ee  |the argument"...|
00000af0  1a f1 59 24 22 66 6f 72  20 2a 46 58 37 20 6f 72  |..Y$"for *FX7 or|
00000b00  20 2a 46 58 38 2e 22 0d  02 f8 30 f1 27 59 24 3b  | *FX8."...0.'Y$;|
00000b10  22 20 20 54 68 69 73 20  63 61 6e 20 62 65 20 70  |"  This can be p|
00000b20  72 69 6e 74 65 64 2c 20  6f 72 20 61 70 70 65 6e  |rinted, or appen|
00000b30  64 65 64 20 74 6f 22 0d  03 02 2e f1 59 24 3b 22  |ded to".....Y$;"|
00000b40  74 68 65 20 73 74 72 69  6e 67 20 22 22 2a 46 58  |the string ""*FX|
00000b50  37 2c 22 22 20 61 6e 64  20 73 65 6e 74 20 74 6f  |7,"" and sent to|
00000b60  20 74 68 65 22 0d 03 0c  30 f1 59 24 3b 22 4f 70  | the"...0.Y$;"Op|
00000b70  65 72 61 74 69 6e 67 20  53 79 73 74 65 6d 20 22  |erating System "|
00000b80  22 43 6f 6d 6d 61 6e 64  20 4c 69 6e 65 20 49 6e  |"Command Line In|
00000b90  74 65 72 2d 22 0d 03 16  13 f1 59 24 3b 22 70 72  |ter-".....Y$;"pr|
00000ba0  65 74 65 72 22 22 2e 22  0d 03 20 31 f1 27 59 24  |eter"".".. 1.'Y$|
00000bb0  3b 22 20 20 57 69 74 68  20 42 41 53 49 43 2d 32  |;"  With BASIC-2|
00000bc0  20 6f 72 20 6c 61 74 65  72 2c 20 74 68 69 73 20  | or later, this |
00000bd0  77 6f 75 6c 64 20 62 65  22 0d 03 2a 2e f1 59 24  |would be"..*..Y$|
00000be0  3b 22 64 6f 6e 65 20 77  69 74 68 20 74 68 65 20  |;"done with the |
00000bf0  4f 53 43 4c 49 20 63 6f  6d 6d 61 6e 64 2c 20 62  |OSCLI command, b|
00000c00  75 74 20 66 6f 72 22 0d  03 34 30 f1 59 24 3b 22  |ut for"..40.Y$;"|
00000c10  42 41 53 49 43 2d 31 20  61 20 22 22 50 52 4f 43  |BASIC-1 a ""PROC|
00000c20  6f 73 63 6c 69 22 22 20  69 73 20 6e 65 65 64 65  |oscli"" is neede|
00000c30  64 2c 20 61 6e 64 22 0d  03 3e 1f f1 59 24 3b 22  |d, and"..>..Y$;"|
00000c40  73 6f 20 74 68 61 74 20  69 73 20 75 73 65 64 20  |so that is used |
00000c50  68 65 72 65 2e 22 0d 03  48 12 e7 20 a4 77 61 69  |here."..H.. .wai|
00000c60  74 20 8c 20 8d 54 66 42  0d 03 52 05 20 0d 03 5c  |t . .TfB..R. ..\|
00000c70  2e f1 27 43 24 3b 22 20  20 54 68 69 73 20 70 72  |..'C$;"  This pr|
00000c80  6f 67 72 61 6d 20 6e 6f  77 20 65 6e 74 65 72 73  |ogram now enters|
00000c90  20 61 20 6c 6f 6f 70 20  69 6e 22 0d 03 66 32 f1  | a loop in"..f2.|
00000ca0  43 24 3b 22 77 68 69 63  68 20 69 74 20 72 65 70  |C$;"which it rep|
00000cb0  65 61 74 65 64 6c 79 20  63 61 6c 6c 73 20 50 52  |eatedly calls PR|
00000cc0  4f 43 70 72 69 6e 74 62  61 75 64 22 3b 0d 03 70  |OCprintbaud";..p|
00000cd0  2d f1 43 24 3b 22 74 6f  20 73 68 6f 77 20 74 68  |-.C$;"to show th|
00000ce0  65 20 63 75 72 72 65 6e  74 20 73 65 74 74 69 6e  |e current settin|
00000cf0  67 73 20 6f 66 20 74 68  65 22 0d 03 7a 30 f1 43  |gs of the"..z0.C|
00000d00  24 3b 22 6d 69 63 72 6f  2c 20 61 6e 64 20 74 68  |$;"micro, and th|
00000d10  65 6e 20 61 73 6b 73 20  66 6f 72 20 73 6f 6d 65  |en asks for some|
00000d20  20 6e 65 77 20 62 61 75  64 22 0d 03 84 1e f1 43  | new baud".....C|
00000d30  24 3b 22 72 61 74 65 73  20 74 6f 20 62 65 20 65  |$;"rates to be e|
00000d40  6e 74 65 72 65 64 2e 22  0d 03 8e 2d f1 27 43 24  |ntered."...-.'C$|
00000d50  3b 22 20 20 54 68 65 73  65 20 61 72 65 20 69 6e  |;"  These are in|
00000d60  70 75 74 20 61 73 20 74  68 65 20 76 61 72 69 61  |put as the varia|
00000d70  62 6c 65 73 22 0d 03 98  32 f1 43 24 3b 22 22 22  |bles"...2.C$;"""|
00000d80  72 78 73 70 65 65 64 22  22 20 20 61 6e 64 20 20  |rxspeed""  and  |
00000d90  22 22 74 78 73 70 65 65  64 22 22 20 20 77 68 69  |""txspeed""  whi|
00000da0  63 68 20 61 72 65 22 0d  03 a2 2c f1 43 24 3b 22  |ch are"...,.C$;"|
00000db0  73 65 6e 74 20 74 6f 20  46 4e 62 61 75 64 2c 20  |sent to FNbaud, |
00000dc0  20 61 6e 64 20 74 68 65  6e 20 77 69 74 68 20 74  | and then with t|
00000dd0  68 65 22 0d 03 ac 35 f1  43 24 3b 22 22 22 2a 46  |he"...5.C$;"""*F|
00000de0  58 37 22 22 20 61 6e 64  20 22 22 2a 46 58 38 22  |X7"" and ""*FX8"|
00000df0  22 20 73 74 72 69 6e 67  73 20 74 6f 20 50 52 4f  |" strings to PRO|
00000e00  43 6f 73 63 6c 69 2e 22  0d 03 b6 2e f1 43 24 3b  |Coscli.".....C$;|
00000e10  22 20 20 54 68 65 20 70  72 6f 67 72 61 6d 20 74  |"  The program t|
00000e20  68 65 6e 20 72 65 70 65  61 74 73 20 74 68 65 20  |hen repeats the |
00000e30  6c 6f 6f 70 2c 22 0d 03  c0 2f f1 43 24 3b 22 73  |loop,".../.C$;"s|
00000e40  68 6f 77 69 6e 67 20 74  68 61 74 20 74 68 65 20  |howing that the |
00000e50  73 70 65 65 64 73 20 68  61 76 65 20 63 68 61 6e  |speeds have chan|
00000e60  67 65 64 2e 22 0d 03 ca  2f f1 27 43 24 3b 22 20  |ged.".../.'C$;" |
00000e70  20 41 73 20 74 68 69 73  20 69 73 20 61 6e 20 69  | As this is an i|
00000e80  6e 66 69 6e 69 74 65 20  6c 6f 6f 70 2c 20 70 72  |nfinite loop, pr|
00000e90  65 73 73 22 0d 03 d4 1c  f1 22 20 45 73 63 61 70  |ess"....." Escap|
00000ea0  65 22 3b 43 24 3b 22 74  6f 20 65 78 69 74 2e 22  |e";C$;"to exit."|
00000eb0  0d 03 de 05 20 0d 03 e8  12 ef 20 32 38 2c 30 2c  |.... ..... 28,0,|
00000ec0  32 34 2c 33 39 2c 34 0d  03 f2 44 f1 8a 31 2c 31  |24,39,4...D..1,1|
00000ed0  38 29 bd 26 38 32 3b 22  50 72 65 73 73 22 3b bd  |8).&82;"Press";.|
00000ee0  26 38 33 3b 22 52 45 54  55 52 4e 22 3b bd 26 38  |&83;"RETURN";.&8|
00000ef0  32 3b 22 74 6f 20 73 74  61 72 74 20 64 65 6d 6f  |2;"to start demo|
00000f00  6e 73 74 72 61 74 69 6f  6e 2c 22 0d 03 fc 35 f1  |nstration,"...5.|
00000f10  8a 39 2c 31 39 29 bd 26  38 32 3b 22 6f 72 22 3b  |.9,19).&82;"or";|
00000f20  bd 26 38 33 3b 22 54 41  42 22 3b bd 26 38 32 3b  |.&83;"TAB";.&82;|
00000f30  22 74 6f 20 67 6f 20 62  61 63 6b 2e 2e 2e 22 3b  |"to go back...";|
00000f40  0d 04 06 22 ef 20 32 33  2c 31 2c 31 3b 30 3b 30  |...". 23,1,1;0;0|
00000f50  3b 30 3b 20 20 20 3a f4  20 43 75 72 73 6f 72 20  |;0;   :. Cursor |
00000f60  6f 6e 0d 04 10 2c f5 20  72 65 73 70 6f 6e 73 65  |on...,. response|
00000f70  3d a5 20 3a fd 20 72 65  73 70 6f 6e 73 65 3d 39  |=. :. response=9|
00000f80  20 84 20 72 65 73 70 6f  6e 73 65 3d 31 33 0d 04  | . response=13..|
00000f90  1a 05 db 0d 04 24 17 e7  20 72 65 73 70 6f 6e 73  |.....$.. respons|
00000fa0  65 3d 39 20 8c 20 8d 64  46 42 0d 04 2e 05 20 0d  |e=9 . .dFB.... .|
00000fb0  04 38 34 f1 8a 39 2c 31  39 29 bd 26 38 32 3b 22  |.84..9,19).&82;"|
00000fc0  50 72 65 73 73 22 3b bd  26 38 37 3b 22 45 73 63  |Press";.&87;"Esc|
00000fd0  61 70 65 22 3b bd 26 38  32 3b 22 74 6f 20 65 78  |ape";.&82;"to ex|
00000fe0  69 74 22 0d 04 42 12 ef  20 32 38 2c 30 2c 32 31  |it"..B.. 28,0,21|
00000ff0  2c 33 39 2c 34 0d 04 4c  05 20 0d 04 56 05 f5 0d  |,39,4..L. ..V...|
00001000  04 60 0e f2 71 75 65 72  79 62 61 75 64 0d 04 6a  |.`..querybaud..j|
00001010  30 e8 27 27 27 22 45 6e  74 65 72 20 72 65 71 75  |0.'''"Enter requ|
00001020  69 72 65 64 20 52 65 63  65 69 76 65 20 73 70 65  |ired Receive spe|
00001030  65 64 20 2d 20 22 72 78  73 70 65 65 64 0d 04 74  |ed - "rxspeed..t|
00001040  2e e8 22 45 6e 74 65 72  20 72 65 71 75 69 72 65  |.."Enter require|
00001050  64 20 54 72 61 6e 73 6d  69 74 20 73 70 65 65 64  |d Transmit speed|
00001060  20 2d 20 22 74 78 73 70  65 65 64 0d 04 7e 21 f2  | - "txspeed..~!.|
00001070  6f 73 63 6c 69 28 22 46  58 37 2c 22 2b a4 62 61  |oscli("FX7,"+.ba|
00001080  75 64 28 72 78 73 70 65  65 64 29 29 0d 04 88 21  |ud(rxspeed))...!|
00001090  f2 6f 73 63 6c 69 28 22  46 58 38 2c 22 2b a4 62  |.oscli("FX8,"+.b|
000010a0  61 75 64 28 74 78 73 70  65 65 64 29 29 0d 04 92  |aud(txspeed))...|
000010b0  07 fd 20 a3 0d 04 9c 05  20 0d 04 a6 05 20 0d 04  |.. ..... .... ..|
000010c0  b0 0a dd a4 77 61 69 74  0d 04 ba 2f ef 20 32 36  |....wait.../. 26|
000010d0  20 3a f4 20 52 65 73 74  6f 72 65 20 64 65 66 61  | :. Restore defa|
000010e0  75 6c 74 20 66 75 6c 6c  2d 73 63 72 65 65 6e 20  |ult full-screen |
000010f0  77 69 6e 64 6f 77 2e 0d  04 c4 39 f1 8a 36 2c 32  |window....9..6,2|
00001100  32 29 bd 26 38 32 3b 22  50 72 65 73 73 22 3b bd  |2).&82;"Press";.|
00001110  26 38 33 3b 22 52 45 54  55 52 4e 22 3b bd 26 38  |&83;"RETURN";.&8|
00001120  32 3b 22 74 6f 20 63 6f  6e 74 69 6e 75 65 2c 22  |2;"to continue,"|
00001130  0d 04 ce 35 f1 8a 39 2c  32 33 29 bd 26 38 32 3b  |...5..9,23).&82;|
00001140  22 6f 72 22 3b bd 26 38  33 3b 22 54 41 42 22 3b  |"or";.&83;"TAB";|
00001150  bd 26 38 32 3b 22 74 6f  20 67 6f 20 62 61 63 6b  |.&82;"to go back|
00001160  2e 2e 2e 22 3b 0d 04 d8  22 ef 20 32 33 2c 31 2c  |...";...". 23,1,|
00001170  31 3b 30 3b 30 3b 30 3b  20 20 20 3a f4 20 43 75  |1;0;0;0;   :. Cu|
00001180  72 73 6f 72 20 6f 6e 0d  04 e2 2c f5 20 72 65 73  |rsor on...,. res|
00001190  70 6f 6e 73 65 3d a5 20  3a fd 20 72 65 73 70 6f  |ponse=. :. respo|
000011a0  6e 73 65 3d 39 20 84 20  72 65 73 70 6f 6e 73 65  |nse=9 . response|
000011b0  3d 31 33 0d 04 ec 23 ef  20 32 33 2c 31 2c 30 3b  |=13...#. 23,1,0;|
000011c0  30 3b 30 3b 30 3b 20 20  20 3a f4 20 43 75 72 73  |0;0;0;   :. Curs|
000011d0  6f 72 20 6f 66 66 0d 04  f6 34 ef 20 32 38 2c 30  |or off...4. 28,0|
000011e0  2c 32 31 2c 33 39 2c 34  20 20 20 20 3a db 20 3a  |,21,39,4    :. :|
000011f0  f4 20 52 65 73 65 74 20  77 69 6e 64 6f 77 2c 20  |. Reset window, |
00001200  61 6e 64 20 63 6c 65 61  72 2e 0d 05 00 1a e7 20  |and clear...... |
00001210  72 65 73 70 6f 6e 73 65  3d 39 20 8c 20 3d b9 20  |response=9 . =. |
00001220  8b 20 3d a3 0d 05 0a 05  20 0d 05 14 05 20 0d 05  |. =..... .... ..|
00001230  1e 0f dd f2 71 75 65 72  79 62 61 75 64 0d 05 28  |....querybaud..(|
00001240  4a f4 20 4f 73 62 79 74  65 20 32 34 32 20 28 26  |J. Osbyte 242 (&|
00001250  46 32 29 20 72 65 61 64  73 20 74 68 65 20 63 6f  |F2) reads the co|
00001260  70 79 20 6f 66 20 74 68  65 20 53 65 72 69 61 6c  |py of the Serial|
00001270  20 50 72 6f 63 65 73 73  6f 72 20 55 4c 41 20 72  | Processor ULA r|
00001280  65 67 69 73 74 65 72 0d  05 32 49 f4 20 73 65 65  |egister..2I. see|
00001290  20 70 61 67 65 73 20 32  33 36 20 61 6e 64 20 33  | pages 236 and 3|
000012a0  39 32 20 6f 66 20 74 68  65 20 41 64 76 61 6e 63  |92 of the Advanc|
000012b0  65 64 20 55 73 65 72 20  47 75 69 64 65 20 66 6f  |ed User Guide fo|
000012c0  72 20 74 68 65 20 42 42  43 20 6d 69 63 72 6f 2e  |r the BBC micro.|
000012d0  0d 05 3c 29 f1 27 22 54  68 69 73 20 63 6f 6d 70  |..<).'"This comp|
000012e0  75 74 65 72 20 69 73 20  6e 6f 77 20 73 65 74 20  |uter is now set |
000012f0  75 70 20 74 6f 20 2d 22  27 0d 05 46 20 41 25 20  |up to -"'..F A% |
00001300  3d 20 32 34 32 20 3a 20  58 25 20 3d 20 30 20 3a  |= 242 : X% = 0 :|
00001310  20 59 25 20 3d 20 32 35  35 0d 05 50 2a 72 65 67  | Y% = 255..P*reg|
00001320  69 73 74 65 72 63 6f 70  79 25 20 3d 20 28 ba 26  |istercopy% = (.&|
00001330  46 46 46 34 20 80 20 26  46 46 30 30 29 20 81 26  |FFF4 . &FF00) .&|
00001340  31 30 30 0d 05 5a 34 f2  70 72 69 6e 74 62 61 75  |100..Z4.printbau|
00001350  64 28 22 52 65 63 65 69  76 65 20 22 2c 22 37 22  |d("Receive ","7"|
00001360  2c 72 65 67 69 73 74 65  72 63 6f 70 79 25 20 81  |,registercopy% .|
00001370  20 38 20 80 20 37 29 0d  05 64 30 f2 70 72 69 6e  | 8 . 7)..d0.prin|
00001380  74 62 61 75 64 28 22 54  72 61 6e 73 6d 69 74 22  |tbaud("Transmit"|
00001390  2c 22 38 22 2c 72 65 67  69 73 74 65 72 63 6f 70  |,"8",registercop|
000013a0  79 25 20 80 20 37 29 0d  05 6e 05 e1 0d 05 78 05  |y% . 7)..n....x.|
000013b0  20 0d 05 82 05 20 0d 05  8c 22 dd f2 70 72 69 6e  | .... ..."..prin|
000013c0  74 62 61 75 64 28 64 69  72 65 63 74 69 6f 6e 24  |tbaud(direction$|
000013d0  2c 66 78 24 2c 42 25 29  0d 05 96 2d 43 25 20 3d  |,fx$,B%)...-C% =|
000013e0  20 28 20 28 42 25 80 31  29 2a 34 20 2b 20 28 42  | ( (B%.1)*4 + (B|
000013f0  25 80 32 29 20 2b 20 28  42 25 80 34 29 20 81 34  |%.2) + (B%.4) .4|
00001400  20 29 20 82 37 0d 05 a0  49 f1 20 64 69 72 65 63  | ) .7...I. direc|
00001410  74 69 6f 6e 24 3b 22 20  61 74 20 22 3b 37 35 2a  |tion$;" at ";75*|
00001420  32 5e 28 43 25 2d 28 43  25 3e 32 29 29 3b 22 20  |2^(C%-(C%>2));" |
00001430  42 41 55 44 2e 20 28 20  2a 46 58 22 3b 66 78 24  |BAUD. ( *FX";fx$|
00001440  3b 22 2c 22 3b 43 25 2b  31 3b 22 20 29 22 0d 05  |;",";C%+1;" )"..|
00001450  aa 45 f4 20 54 68 69 73  20 70 72 6f 63 65 64 75  |.E. This procedu|
00001460  72 65 20 63 6f 75 6c 64  20 72 65 74 75 72 6e 20  |re could return |
00001470  74 68 65 20 76 61 6c 75  65 2c 20 72 61 74 68 65  |the value, rathe|
00001480  72 20 74 68 61 6e 20 70  72 69 6e 74 69 6e 67 20  |r than printing |
00001490  69 74 2c 0d 05 b4 3b f4  20 62 79 20 61 64 64 69  |it,...;. by addi|
000014a0  6e 67 20 68 65 72 65 3a  2d 20 20 20 20 62 61 75  |ng here:-    bau|
000014b0  64 72 61 74 65 20 3d 20  37 35 20 2a 20 32 5e 20  |drate = 75 * 2^ |
000014c0  28 43 25 20 2d 20 28 43  25 3e 32 29 20 29 0d 05  |(C% - (C%>2) )..|
000014d0  be 05 e1 0d 05 c8 05 20  0d 05 d2 05 20 0d 05 dc  |....... .... ...|
000014e0  11 dd a4 62 61 75 64 28  73 70 65 65 64 29 0d 05  |...baud(speed)..|
000014f0  e6 08 ea 20 49 25 0d 05  f0 40 e7 20 b4 28 73 70  |... I%...@. .(sp|
00001500  65 65 64 29 3c 3e 31 20  8c 20 3d 20 c3 28 30 29  |eed)<>1 . = .(0)|
00001510  20 3a f4 20 54 72 61 70  20 74 6f 20 70 72 65 76  | :. Trap to prev|
00001520  65 6e 74 20 27 4c 6f 67  20 72 61 6e 67 65 27 20  |ent 'Log range' |
00001530  65 72 72 6f 72 2e 0d 05  fa 27 49 25 20 3d 20 aa  |error....'I% = .|
00001540  28 73 70 65 65 64 2f 33  37 2e 35 29 2f aa 32 20  |(speed/37.5)/.2 |
00001550  2b 20 28 73 70 65 65 64  3e 35 30 30 29 0d 06 04  |+ (speed>500)...|
00001560  1a e7 20 49 25 3c 31 20  84 20 49 25 3e 38 20 8c  |.. I%<1 . I%>8 .|
00001570  20 49 25 20 3d 20 30 0d  06 0e 09 3d 20 c3 49 25  | I% = 0....= .I%|
00001580  0d 06 18 05 20 0d 06 22  05 20 0d 06 2c 15 dd f2  |.... ..". ..,...|
00001590  6f 73 63 6c 69 28 63 6f  6d 6d 61 6e 64 24 29 0d  |oscli(command$).|
000015a0  06 36 0b ea 20 58 25 2c  59 25 0d 06 40 15 24 6f  |.6.. X%,Y%..@.$o|
000015b0  73 62 6c 6f 63 6b 3d 63  6f 6d 6d 61 6e 64 24 0d  |sblock=command$.|
000015c0  06 4a 16 58 25 20 3d 20  6f 73 62 6c 6f 63 6b 20  |.J.X% = osblock |
000015d0  83 20 32 35 36 0d 06 54  16 59 25 20 3d 20 6f 73  |. 256..T.Y% = os|
000015e0  62 6c 6f 63 6b 20 81 20  32 35 36 0d 06 5e 3b d6  |block . 256..^;.|
000015f0  20 26 46 46 46 37 20 3a  20 f4 20 4f 70 65 72 61  | &FFF7 : . Opera|
00001600  74 69 6e 67 20 53 79 73  74 65 6d 20 27 43 6f 6d  |ting System 'Com|
00001610  6d 61 6e 64 20 4c 69 6e  65 20 49 6e 74 65 72 70  |mand Line Interp|
00001620  72 65 74 65 72 27 0d 06  68 05 e1 0d 06 72 05 20  |reter'..h....r. |
00001630  0d 06 7c 05 20 0d 06 86  1c f4 20 45 72 72 6f 72  |..|. ..... Error|
00001640  20 68 61 6e 64 6c 69 6e  67 20 72 6f 75 74 69 6e  | handling routin|
00001650  65 0d 06 90 2d ef 20 32  36 20 3a f4 20 52 65 73  |e...-. 26 :. Res|
00001660  65 74 20 64 65 66 61 75  6c 74 20 66 75 6c 6c 2d  |et default full-|
00001670  73 63 72 65 65 6e 20 77  69 6e 64 6f 77 2e 0d 06  |screen window...|
00001680  9a 19 f1 8a 30 2c 32 32  29 89 28 31 31 39 29 3b  |....0,22).(119);|
00001690  8a 30 2c 32 32 29 3b 0d  06 a4 37 e7 20 9f 3d 31  |.0,22);...7. .=1|
000016a0  37 20 8c 20 f1 27 22 50  72 6f 67 72 61 6d 20 61  |7 . .'"Program a|
000016b0  62 6f 72 74 65 64 2e 22  20 8b 20 f6 3a f1 22 20  |borted." . .:." |
000016c0  61 74 20 6c 69 6e 65 20  22 3b 9e 3b bd 37 0d 06  |at line ";.;.7..|
000016d0  ae 27 ef 20 32 33 2c 31  2c 31 3b 30 3b 30 3b 30  |.'. 23,1,1;0;0;0|
000016e0  3b 20 20 20 3a f4 20 52  65 73 74 6f 72 65 20 63  |;   :. Restore c|
000016f0  75 72 73 6f 72 0d ff                              |ursor..|
000016f7
WOTBAUD.m0
WOTBAUD.m1
WOTBAUD.m2
WOTBAUD.m4
WOTBAUD.m5