Home » CEEFAX disks » telesoftware5.adl » 22-01-88/B\OSB11

22-01-88/B\OSB11

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 » telesoftware5.adl
Filename: 22-01-88/B\OSB11
Read OK:
File size: 0DF1 bytes
Load address: FFFF1900
Exec address: FFFF8023
File contents
   10REM OSbits Module B/osb11
   20REM Input routine
   30REM Decimal only
   40REM Version 1.1 25.1.87
   50 
   60*KEY1MODE3|M|NLIST|M
   70 
   80REM : Set routine addresses
   90osbyte = &FFF4
  100osrdch = &FFE0
  110oswrch = &FFEE
  120 
  130DIM code% 120
  140 
  150FOR pass% = 0 TO 3 STEP 3
  160P% = code%
  170[OPT pass%
  180 
  190.input_character
  200 
  210LDY #0                        \ We use Y as a counter along the string
  220 
  230.input_character_loop
  240 
  250JSR osrdch
  260BCS input_error              \ If C set after OSRDCH then an error
  270CMP #13                      \ Check for carriage return
  280BEQ input_character_exit
  290CMP #127                     \ Check for delete
  300BEQ delete
  310CPY buffer_size              \ Check that we have room in the buffer
  320BEQ buffer_full
  330JSR check_character          \ See if character is valid
  340CMP #0                       \ A is null if character is invalid
  350BEQ input_character_loop
  360JSR oswrch
  370STA input_buffer, Y          \ Add to the input buffer
  380INY
  390JMP input_character_loop
  400 
  410.input_character_exit
  420 
  430\  We come here after a carriage return, which terminates the string
  440\  The CR is tagged onto the end of the string, we store the string
  450\  length and then exit
  460 
  470STA input_buffer, Y
  480STY string_length
  490CLC                          \ Clear carry on exit
  500RTS
  510 
  520.input_error
  530 
  540\  We come here if an error is detected during OSRDCH.  For the moment
  550\  we'll just exit the routine and let BASIC report the error
  560\  The input buffer may well have characters in it at this point
  570\  Note that Carry is set.  We can use C to check termination.
  580 
  590RTS
  600 
  610.buffer_full
  620 
  630\  If the buffer is full send a beep and wait for the next character
  640\  which could be a carriage return or a delete, so it could be valid
  650 
  660LDA #7
  670JSR oswrch
  680JMP input_character_loop
  690 
  700.delete
  710 
  720CPY #0                       \ Don't delete past start of string
  730BEQ input_character_loop
  740JSR oswrch
  750DEY                          \ Character deleted so decrease Y
  760JMP input_character_loop
  770 
  780.check_character
  790 
  800\  This routine takes a new character in A and checks it against
  810\  the valid list.  Invalid characters are replaced by a null (0)
  820\  in A at the routine's exit
  830\  Y is not affected but X is destroyed
  840 
  850LDX #0
  860 
  870.check_loop
  880 
  890PHA
  900LDA valid_list, X            \ If Xth character is 0 check is finished
  910BEQ invalid
  920PLA
  930CMP valid_list, X            \ Compare A with Xth character in valid list
  940BEQ valid
  950INX
  960JMP check_loop
  970 
  980.invalid
  990 
 1000PLA
 1010LDA #0                       \ If character was invalid replace by 0
 1020 
 1030.valid
 1040 
 1050RTS
 1060 
 1070.valid_list    OPT FNEQUS("-0123456789")
 1080               OPT FNEQUB(0)
 1090.input_buffer  OPT FNEQUM(9,255)
 1100.buffer_size   OPT FNEQUB(8)
 1110.string_length OPT FNEQUB(0)
 1120 
 1130]
 1140NEXT
 1150 
 1160REPEAT
 1170CALLcode%
 1180 
 1190PRINT
 1200FOR N%=0 TO ?string_length
 1210PRINT CHR$(input_buffer?N%);
 1220NEXT
 1230PRINT
 1240UNTIL FALSE
 1250 
 1260 
 1270**** EQUate a Byte ****
 1280DEF FNEQUB(N%)
 1290?P%=N% MOD 256
 1300IF (pass% AND 3) = 3 THEN PRINT ~?P%
 1310P%=P%+1
 1320=pass%
 1330 
 1340**** EQUate a String ****
 1350DEF FNEQUS(N$)
 1360LOCAL N%
 1370WIDTH 40
 1380FOR N%=1 TO LEN(N$)
 1390K%=ASC(MID$(N$,N%,1))
 1400P%?(N%-1)=K%
 1410IF (pass% AND 3) = 3 THEN PRINT ~P%?(N%-1);
 1420NEXT
 1430IF (pass% AND 3) = 3 THEN PRINT
 1440P%=P%+LEN(N$)
 1450WIDTH 0
 1460=pass%
 1470 
 1480**** EQUate a section of Memory ****
 1490DEF FNEQUM(number%,byte%)
 1500LOCAL N%
 1510WIDTH 40
 1520FOR N%=0 TO number%-1
 1530P%?N%=byte%
 1540IF (pass% AND 3) = 3 THEN PRINT ~P%?N%;
 1550NEXT
 1560IF (pass% AND 3) = 3 THEN PRINT
 1570P%=P%+number%
 1580WIDTH 0
 1590=pass%

� OSbits Module B/osb11
� Input routine
� Decimal only
(� Version 1.1 25.1.87
2 
<*KEY1MODE3|M|NLIST|M
F 
P� : Set routine addresses
Zosbyte = &FFF4
dosrdch = &FFE0
noswrch = &FFEE
x 
�� code% 120
� 
�� pass% = 0 � 3 � 3
�P% = code%
�[OPT pass%
� 
�.input_character
� 
�JLDY #0                        \ We use Y as a counter along the string
� 
�.input_character_loop
� 
�JSR osrdch
FBCS input_error              \ If C set after OSRDCH then an error
<CMP #13                      \ Check for carriage return
BEQ input_character_exit
"3CMP #127                     \ Check for delete
,BEQ delete
6HCPY buffer_size              \ Check that we have room in the buffer
@BEQ buffer_full
J<JSR check_character          \ See if character is valid
TDCMP #0                       \ A is null if character is invalid
^BEQ input_character_loop
hJSR oswrch
r:STA input_buffer, Y          \ Add to the input buffer
|INY
�JMP input_character_loop
� 
�.input_character_exit
� 
�H\  We come here after a carriage return, which terminates the string
�G\  The CR is tagged onto the end of the string, we store the string
�\  length and then exit
� 
�STA input_buffer, Y
�STY string_length
�6CLC                          \ Clear carry on exit
�RTS
� 
.input_error
 
J\  We come here if an error is detected during OSRDCH.  For the moment
&A\  we'll just exit the routine and let BASIC report the error
0D\  The input buffer may well have characters in it at this point
:B\  Note that Carry is set.  We can use C to check termination.
D 
NRTS
X 
b.buffer_full
l 
vH\  If the buffer is full send a beep and wait for the next character
�I\  which could be a carriage return or a delete, so it could be valid
� 
�
LDA #7
�JSR oswrch
�JMP input_character_loop
� 
�.delete
� 
�DCPY #0                       \ Don't delete past start of string
�BEQ input_character_loop
�JSR oswrch
�BDEY                          \ Character deleted so decrease Y
�JMP input_character_loop
 
.check_character
 
 D\  This routine takes a new character in A and checks it against
*E\  the valid list.  Invalid characters are replaced by a null (0)
4!\  in A at the routine's exit
>+\  Y is not affected but X is destroyed
H 
R
LDX #0
\ 
f.check_loop
p 
zPHA
�JLDA valid_list, X            \ If Xth character is 0 check is finished
�BEQ invalid
�PLA
�MCMP valid_list, X            \ Compare A with Xth character in valid list
�
BEQ valid
�INX
�JMP check_loop
� 
�.invalid
� 
�PLA
�HLDA #0                       \ If character was invalid replace by 0
� 

.valid
 
RTS
$ 
.+.valid_list    OPT �EQUS("-0123456789")
8               OPT �EQUB(0)
B#.input_buffer  OPT �EQUM(9,255)
L.buffer_size   OPT �EQUB(8)
V.string_length OPT �EQUB(0)
` 
j]
t�
~ 
��
�
�code%
� 
��
�� N%=0 � ?string_length
�� �(input_buffer?N%);
��
��
�� �
� 
� 
�**** EQUate a Byte ****
� �EQUB(N%)

?P%=N% � 256
� (pass% � 3) = 3 � � ~?P%
P%=P%+1
(
=pass%
2 
<**** EQUate a String ****
F� �EQUS(N$)
P� N%
Z� 40
d� N%=1 � �(N$)
nK%=�(�N$,N%,1))
xP%?(N%-1)=K%
�%� (pass% � 3) = 3 � � ~P%?(N%-1);
��
�� (pass% � 3) = 3 � �
�P%=P%+�(N$)
�� 0
�
=pass%
� 
�(**** EQUate a section of Memory ****
�� �EQUM(number%,byte%)
�� N%
�� 40
�� N%=0 � number%-1
�P%?N%=byte%
!� (pass% � 3) = 3 � � ~P%?N%;
�
� (pass% � 3) = 3 � �
"P%=P%+number%
,� 0
6
=pass%
�
00000000  0d 00 0a 1b f4 20 4f 53  62 69 74 73 20 4d 6f 64  |..... OSbits Mod|
00000010  75 6c 65 20 42 2f 6f 73  62 31 31 0d 00 14 13 f4  |ule B/osb11.....|
00000020  20 49 6e 70 75 74 20 72  6f 75 74 69 6e 65 0d 00  | Input routine..|
00000030  1e 12 f4 20 44 65 63 69  6d 61 6c 20 6f 6e 6c 79  |... Decimal only|
00000040  0d 00 28 19 f4 20 56 65  72 73 69 6f 6e 20 31 2e  |..(.. Version 1.|
00000050  31 20 32 35 2e 31 2e 38  37 0d 00 32 05 20 0d 00  |1 25.1.87..2. ..|
00000060  3c 18 2a 4b 45 59 31 4d  4f 44 45 33 7c 4d 7c 4e  |<.*KEY1MODE3|M|N|
00000070  4c 49 53 54 7c 4d 0d 00  46 05 20 0d 00 50 1d f4  |LIST|M..F. ..P..|
00000080  20 3a 20 53 65 74 20 72  6f 75 74 69 6e 65 20 61  | : Set routine a|
00000090  64 64 72 65 73 73 65 73  0d 00 5a 12 6f 73 62 79  |ddresses..Z.osby|
000000a0  74 65 20 3d 20 26 46 46  46 34 0d 00 64 12 6f 73  |te = &FFF4..d.os|
000000b0  72 64 63 68 20 3d 20 26  46 46 45 30 0d 00 6e 12  |rdch = &FFE0..n.|
000000c0  6f 73 77 72 63 68 20 3d  20 26 46 46 45 45 0d 00  |oswrch = &FFEE..|
000000d0  78 05 20 0d 00 82 0f de  20 63 6f 64 65 25 20 31  |x. ..... code% 1|
000000e0  32 30 0d 00 8c 05 20 0d  00 96 17 e3 20 70 61 73  |20.... ..... pas|
000000f0  73 25 20 3d 20 30 20 b8  20 33 20 88 20 33 0d 00  |s% = 0 . 3 . 3..|
00000100  a0 0e 50 25 20 3d 20 63  6f 64 65 25 0d 00 aa 0e  |..P% = code%....|
00000110  5b 4f 50 54 20 70 61 73  73 25 0d 00 b4 05 20 0d  |[OPT pass%.... .|
00000120  00 be 14 2e 69 6e 70 75  74 5f 63 68 61 72 61 63  |....input_charac|
00000130  74 65 72 0d 00 c8 05 20  0d 00 d2 4a 4c 44 59 20  |ter.... ...JLDY |
00000140  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
00000150  20 20 20 20 20 20 20 20  20 20 5c 20 57 65 20 75  |          \ We u|
00000160  73 65 20 59 20 61 73 20  61 20 63 6f 75 6e 74 65  |se Y as a counte|
00000170  72 20 61 6c 6f 6e 67 20  74 68 65 20 73 74 72 69  |r along the stri|
00000180  6e 67 0d 00 dc 05 20 0d  00 e6 19 2e 69 6e 70 75  |ng.... .....inpu|
00000190  74 5f 63 68 61 72 61 63  74 65 72 5f 6c 6f 6f 70  |t_character_loop|
000001a0  0d 00 f0 05 20 0d 00 fa  0e 4a 53 52 20 6f 73 72  |.... ....JSR osr|
000001b0  64 63 68 0d 01 04 46 42  43 53 20 69 6e 70 75 74  |dch...FBCS input|
000001c0  5f 65 72 72 6f 72 20 20  20 20 20 20 20 20 20 20  |_error          |
000001d0  20 20 20 20 5c 20 49 66  20 43 20 73 65 74 20 61  |    \ If C set a|
000001e0  66 74 65 72 20 4f 53 52  44 43 48 20 74 68 65 6e  |fter OSRDCH then|
000001f0  20 61 6e 20 65 72 72 6f  72 0d 01 0e 3c 43 4d 50  | an error...<CMP|
00000200  20 23 31 33 20 20 20 20  20 20 20 20 20 20 20 20  | #13            |
00000210  20 20 20 20 20 20 20 20  20 20 5c 20 43 68 65 63  |          \ Chec|
00000220  6b 20 66 6f 72 20 63 61  72 72 69 61 67 65 20 72  |k for carriage r|
00000230  65 74 75 72 6e 0d 01 18  1c 42 45 51 20 69 6e 70  |eturn....BEQ inp|
00000240  75 74 5f 63 68 61 72 61  63 74 65 72 5f 65 78 69  |ut_character_exi|
00000250  74 0d 01 22 33 43 4d 50  20 23 31 32 37 20 20 20  |t.."3CMP #127   |
00000260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000270  20 20 5c 20 43 68 65 63  6b 20 66 6f 72 20 64 65  |  \ Check for de|
00000280  6c 65 74 65 0d 01 2c 0e  42 45 51 20 64 65 6c 65  |lete..,.BEQ dele|
00000290  74 65 0d 01 36 48 43 50  59 20 62 75 66 66 65 72  |te..6HCPY buffer|
000002a0  5f 73 69 7a 65 20 20 20  20 20 20 20 20 20 20 20  |_size           |
000002b0  20 20 20 5c 20 43 68 65  63 6b 20 74 68 61 74 20  |   \ Check that |
000002c0  77 65 20 68 61 76 65 20  72 6f 6f 6d 20 69 6e 20  |we have room in |
000002d0  74 68 65 20 62 75 66 66  65 72 0d 01 40 13 42 45  |the buffer..@.BE|
000002e0  51 20 62 75 66 66 65 72  5f 66 75 6c 6c 0d 01 4a  |Q buffer_full..J|
000002f0  3c 4a 53 52 20 63 68 65  63 6b 5f 63 68 61 72 61  |<JSR check_chara|
00000300  63 74 65 72 20 20 20 20  20 20 20 20 20 20 5c 20  |cter          \ |
00000310  53 65 65 20 69 66 20 63  68 61 72 61 63 74 65 72  |See if character|
00000320  20 69 73 20 76 61 6c 69  64 0d 01 54 44 43 4d 50  | is valid..TDCMP|
00000330  20 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  | #0             |
00000340  20 20 20 20 20 20 20 20  20 20 5c 20 41 20 69 73  |          \ A is|
00000350  20 6e 75 6c 6c 20 69 66  20 63 68 61 72 61 63 74  | null if charact|
00000360  65 72 20 69 73 20 69 6e  76 61 6c 69 64 0d 01 5e  |er is invalid..^|
00000370  1c 42 45 51 20 69 6e 70  75 74 5f 63 68 61 72 61  |.BEQ input_chara|
00000380  63 74 65 72 5f 6c 6f 6f  70 0d 01 68 0e 4a 53 52  |cter_loop..h.JSR|
00000390  20 6f 73 77 72 63 68 0d  01 72 3a 53 54 41 20 69  | oswrch..r:STA i|
000003a0  6e 70 75 74 5f 62 75 66  66 65 72 2c 20 59 20 20  |nput_buffer, Y  |
000003b0  20 20 20 20 20 20 20 20  5c 20 41 64 64 20 74 6f  |        \ Add to|
000003c0  20 74 68 65 20 69 6e 70  75 74 20 62 75 66 66 65  | the input buffe|
000003d0  72 0d 01 7c 07 49 4e 59  0d 01 86 1c 4a 4d 50 20  |r..|.INY....JMP |
000003e0  69 6e 70 75 74 5f 63 68  61 72 61 63 74 65 72 5f  |input_character_|
000003f0  6c 6f 6f 70 0d 01 90 05  20 0d 01 9a 19 2e 69 6e  |loop.... .....in|
00000400  70 75 74 5f 63 68 61 72  61 63 74 65 72 5f 65 78  |put_character_ex|
00000410  69 74 0d 01 a4 05 20 0d  01 ae 48 5c 20 20 57 65  |it.... ...H\  We|
00000420  20 63 6f 6d 65 20 68 65  72 65 20 61 66 74 65 72  | come here after|
00000430  20 61 20 63 61 72 72 69  61 67 65 20 72 65 74 75  | a carriage retu|
00000440  72 6e 2c 20 77 68 69 63  68 20 74 65 72 6d 69 6e  |rn, which termin|
00000450  61 74 65 73 20 74 68 65  20 73 74 72 69 6e 67 0d  |ates the string.|
00000460  01 b8 47 5c 20 20 54 68  65 20 43 52 20 69 73 20  |..G\  The CR is |
00000470  74 61 67 67 65 64 20 6f  6e 74 6f 20 74 68 65 20  |tagged onto the |
00000480  65 6e 64 20 6f 66 20 74  68 65 20 73 74 72 69 6e  |end of the strin|
00000490  67 2c 20 77 65 20 73 74  6f 72 65 20 74 68 65 20  |g, we store the |
000004a0  73 74 72 69 6e 67 0d 01  c2 1b 5c 20 20 6c 65 6e  |string....\  len|
000004b0  67 74 68 20 61 6e 64 20  74 68 65 6e 20 65 78 69  |gth and then exi|
000004c0  74 0d 01 cc 05 20 0d 01  d6 17 53 54 41 20 69 6e  |t.... ....STA in|
000004d0  70 75 74 5f 62 75 66 66  65 72 2c 20 59 0d 01 e0  |put_buffer, Y...|
000004e0  15 53 54 59 20 73 74 72  69 6e 67 5f 6c 65 6e 67  |.STY string_leng|
000004f0  74 68 0d 01 ea 36 43 4c  43 20 20 20 20 20 20 20  |th...6CLC       |
00000500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000510  20 20 20 5c 20 43 6c 65  61 72 20 63 61 72 72 79  |   \ Clear carry|
00000520  20 6f 6e 20 65 78 69 74  0d 01 f4 07 52 54 53 0d  | on exit....RTS.|
00000530  01 fe 05 20 0d 02 08 10  2e 69 6e 70 75 74 5f 65  |... .....input_e|
00000540  72 72 6f 72 0d 02 12 05  20 0d 02 1c 4a 5c 20 20  |rror.... ...J\  |
00000550  57 65 20 63 6f 6d 65 20  68 65 72 65 20 69 66 20  |We come here if |
00000560  61 6e 20 65 72 72 6f 72  20 69 73 20 64 65 74 65  |an error is dete|
00000570  63 74 65 64 20 64 75 72  69 6e 67 20 4f 53 52 44  |cted during OSRD|
00000580  43 48 2e 20 20 46 6f 72  20 74 68 65 20 6d 6f 6d  |CH.  For the mom|
00000590  65 6e 74 0d 02 26 41 5c  20 20 77 65 27 6c 6c 20  |ent..&A\  we'll |
000005a0  6a 75 73 74 20 65 78 69  74 20 74 68 65 20 72 6f  |just exit the ro|
000005b0  75 74 69 6e 65 20 61 6e  64 20 6c 65 74 20 42 41  |utine and let BA|
000005c0  53 49 43 20 72 65 70 6f  72 74 20 74 68 65 20 65  |SIC report the e|
000005d0  72 72 6f 72 0d 02 30 44  5c 20 20 54 68 65 20 69  |rror..0D\  The i|
000005e0  6e 70 75 74 20 62 75 66  66 65 72 20 6d 61 79 20  |nput buffer may |
000005f0  77 65 6c 6c 20 68 61 76  65 20 63 68 61 72 61 63  |well have charac|
00000600  74 65 72 73 20 69 6e 20  69 74 20 61 74 20 74 68  |ters in it at th|
00000610  69 73 20 70 6f 69 6e 74  0d 02 3a 42 5c 20 20 4e  |is point..:B\  N|
00000620  6f 74 65 20 74 68 61 74  20 43 61 72 72 79 20 69  |ote that Carry i|
00000630  73 20 73 65 74 2e 20 20  57 65 20 63 61 6e 20 75  |s set.  We can u|
00000640  73 65 20 43 20 74 6f 20  63 68 65 63 6b 20 74 65  |se C to check te|
00000650  72 6d 69 6e 61 74 69 6f  6e 2e 0d 02 44 05 20 0d  |rmination...D. .|
00000660  02 4e 07 52 54 53 0d 02  58 05 20 0d 02 62 10 2e  |.N.RTS..X. ..b..|
00000670  62 75 66 66 65 72 5f 66  75 6c 6c 0d 02 6c 05 20  |buffer_full..l. |
00000680  0d 02 76 48 5c 20 20 49  66 20 74 68 65 20 62 75  |..vH\  If the bu|
00000690  66 66 65 72 20 69 73 20  66 75 6c 6c 20 73 65 6e  |ffer is full sen|
000006a0  64 20 61 20 62 65 65 70  20 61 6e 64 20 77 61 69  |d a beep and wai|
000006b0  74 20 66 6f 72 20 74 68  65 20 6e 65 78 74 20 63  |t for the next c|
000006c0  68 61 72 61 63 74 65 72  0d 02 80 49 5c 20 20 77  |haracter...I\  w|
000006d0  68 69 63 68 20 63 6f 75  6c 64 20 62 65 20 61 20  |hich could be a |
000006e0  63 61 72 72 69 61 67 65  20 72 65 74 75 72 6e 20  |carriage return |
000006f0  6f 72 20 61 20 64 65 6c  65 74 65 2c 20 73 6f 20  |or a delete, so |
00000700  69 74 20 63 6f 75 6c 64  20 62 65 20 76 61 6c 69  |it could be vali|
00000710  64 0d 02 8a 05 20 0d 02  94 0a 4c 44 41 20 23 37  |d.... ....LDA #7|
00000720  0d 02 9e 0e 4a 53 52 20  6f 73 77 72 63 68 0d 02  |....JSR oswrch..|
00000730  a8 1c 4a 4d 50 20 69 6e  70 75 74 5f 63 68 61 72  |..JMP input_char|
00000740  61 63 74 65 72 5f 6c 6f  6f 70 0d 02 b2 05 20 0d  |acter_loop.... .|
00000750  02 bc 0b 2e 64 65 6c 65  74 65 0d 02 c6 05 20 0d  |....delete.... .|
00000760  02 d0 44 43 50 59 20 23  30 20 20 20 20 20 20 20  |..DCPY #0       |
00000770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000780  5c 20 44 6f 6e 27 74 20  64 65 6c 65 74 65 20 70  |\ Don't delete p|
00000790  61 73 74 20 73 74 61 72  74 20 6f 66 20 73 74 72  |ast start of str|
000007a0  69 6e 67 0d 02 da 1c 42  45 51 20 69 6e 70 75 74  |ing....BEQ input|
000007b0  5f 63 68 61 72 61 63 74  65 72 5f 6c 6f 6f 70 0d  |_character_loop.|
000007c0  02 e4 0e 4a 53 52 20 6f  73 77 72 63 68 0d 02 ee  |...JSR oswrch...|
000007d0  42 44 45 59 20 20 20 20  20 20 20 20 20 20 20 20  |BDEY            |
000007e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
000007f0  43 68 61 72 61 63 74 65  72 20 64 65 6c 65 74 65  |Character delete|
00000800  64 20 73 6f 20 64 65 63  72 65 61 73 65 20 59 0d  |d so decrease Y.|
00000810  02 f8 1c 4a 4d 50 20 69  6e 70 75 74 5f 63 68 61  |...JMP input_cha|
00000820  72 61 63 74 65 72 5f 6c  6f 6f 70 0d 03 02 05 20  |racter_loop.... |
00000830  0d 03 0c 14 2e 63 68 65  63 6b 5f 63 68 61 72 61  |.....check_chara|
00000840  63 74 65 72 0d 03 16 05  20 0d 03 20 44 5c 20 20  |cter.... .. D\  |
00000850  54 68 69 73 20 72 6f 75  74 69 6e 65 20 74 61 6b  |This routine tak|
00000860  65 73 20 61 20 6e 65 77  20 63 68 61 72 61 63 74  |es a new charact|
00000870  65 72 20 69 6e 20 41 20  61 6e 64 20 63 68 65 63  |er in A and chec|
00000880  6b 73 20 69 74 20 61 67  61 69 6e 73 74 0d 03 2a  |ks it against..*|
00000890  45 5c 20 20 74 68 65 20  76 61 6c 69 64 20 6c 69  |E\  the valid li|
000008a0  73 74 2e 20 20 49 6e 76  61 6c 69 64 20 63 68 61  |st.  Invalid cha|
000008b0  72 61 63 74 65 72 73 20  61 72 65 20 72 65 70 6c  |racters are repl|
000008c0  61 63 65 64 20 62 79 20  61 20 6e 75 6c 6c 20 28  |aced by a null (|
000008d0  30 29 0d 03 34 21 5c 20  20 69 6e 20 41 20 61 74  |0)..4!\  in A at|
000008e0  20 74 68 65 20 72 6f 75  74 69 6e 65 27 73 20 65  | the routine's e|
000008f0  78 69 74 0d 03 3e 2b 5c  20 20 59 20 69 73 20 6e  |xit..>+\  Y is n|
00000900  6f 74 20 61 66 66 65 63  74 65 64 20 62 75 74 20  |ot affected but |
00000910  58 20 69 73 20 64 65 73  74 72 6f 79 65 64 0d 03  |X is destroyed..|
00000920  48 05 20 0d 03 52 0a 4c  44 58 20 23 30 0d 03 5c  |H. ..R.LDX #0..\|
00000930  05 20 0d 03 66 0f 2e 63  68 65 63 6b 5f 6c 6f 6f  |. ..f..check_loo|
00000940  70 0d 03 70 05 20 0d 03  7a 07 50 48 41 0d 03 84  |p..p. ..z.PHA...|
00000950  4a 4c 44 41 20 76 61 6c  69 64 5f 6c 69 73 74 2c  |JLDA valid_list,|
00000960  20 58 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  | X            \ |
00000970  49 66 20 58 74 68 20 63  68 61 72 61 63 74 65 72  |If Xth character|
00000980  20 69 73 20 30 20 63 68  65 63 6b 20 69 73 20 66  | is 0 check is f|
00000990  69 6e 69 73 68 65 64 0d  03 8e 0f 42 45 51 20 69  |inished....BEQ i|
000009a0  6e 76 61 6c 69 64 0d 03  98 07 50 4c 41 0d 03 a2  |nvalid....PLA...|
000009b0  4d 43 4d 50 20 76 61 6c  69 64 5f 6c 69 73 74 2c  |MCMP valid_list,|
000009c0  20 58 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  | X            \ |
000009d0  43 6f 6d 70 61 72 65 20  41 20 77 69 74 68 20 58  |Compare A with X|
000009e0  74 68 20 63 68 61 72 61  63 74 65 72 20 69 6e 20  |th character in |
000009f0  76 61 6c 69 64 20 6c 69  73 74 0d 03 ac 0d 42 45  |valid list....BE|
00000a00  51 20 76 61 6c 69 64 0d  03 b6 07 49 4e 58 0d 03  |Q valid....INX..|
00000a10  c0 12 4a 4d 50 20 63 68  65 63 6b 5f 6c 6f 6f 70  |..JMP check_loop|
00000a20  0d 03 ca 05 20 0d 03 d4  0c 2e 69 6e 76 61 6c 69  |.... .....invali|
00000a30  64 0d 03 de 05 20 0d 03  e8 07 50 4c 41 0d 03 f2  |d.... ....PLA...|
00000a40  48 4c 44 41 20 23 30 20  20 20 20 20 20 20 20 20  |HLDA #0         |
00000a50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00000a60  49 66 20 63 68 61 72 61  63 74 65 72 20 77 61 73  |If character was|
00000a70  20 69 6e 76 61 6c 69 64  20 72 65 70 6c 61 63 65  | invalid replace|
00000a80  20 62 79 20 30 0d 03 fc  05 20 0d 04 06 0a 2e 76  | by 0.... .....v|
00000a90  61 6c 69 64 0d 04 10 05  20 0d 04 1a 07 52 54 53  |alid.... ....RTS|
00000aa0  0d 04 24 05 20 0d 04 2e  2b 2e 76 61 6c 69 64 5f  |..$. ...+.valid_|
00000ab0  6c 69 73 74 20 20 20 20  4f 50 54 20 a4 45 51 55  |list    OPT .EQU|
00000ac0  53 28 22 2d 30 31 32 33  34 35 36 37 38 39 22 29  |S("-0123456789")|
00000ad0  0d 04 38 1f 20 20 20 20  20 20 20 20 20 20 20 20  |..8.            |
00000ae0  20 20 20 4f 50 54 20 a4  45 51 55 42 28 30 29 0d  |   OPT .EQUB(0).|
00000af0  04 42 23 2e 69 6e 70 75  74 5f 62 75 66 66 65 72  |.B#.input_buffer|
00000b00  20 20 4f 50 54 20 a4 45  51 55 4d 28 39 2c 32 35  |  OPT .EQUM(9,25|
00000b10  35 29 0d 04 4c 1f 2e 62  75 66 66 65 72 5f 73 69  |5)..L..buffer_si|
00000b20  7a 65 20 20 20 4f 50 54  20 a4 45 51 55 42 28 38  |ze   OPT .EQUB(8|
00000b30  29 0d 04 56 1f 2e 73 74  72 69 6e 67 5f 6c 65 6e  |)..V..string_len|
00000b40  67 74 68 20 4f 50 54 20  a4 45 51 55 42 28 30 29  |gth OPT .EQUB(0)|
00000b50  0d 04 60 05 20 0d 04 6a  05 5d 0d 04 74 05 ed 0d  |..`. ..j.]..t...|
00000b60  04 7e 05 20 0d 04 88 05  f5 0d 04 92 0a d6 63 6f  |.~. ..........co|
00000b70  64 65 25 0d 04 9c 05 20  0d 04 a6 05 f1 0d 04 b0  |de%.... ........|
00000b80  1b e3 20 4e 25 3d 30 20  b8 20 3f 73 74 72 69 6e  |.. N%=0 . ?strin|
00000b90  67 5f 6c 65 6e 67 74 68  0d 04 ba 19 f1 20 bd 28  |g_length..... .(|
00000ba0  69 6e 70 75 74 5f 62 75  66 66 65 72 3f 4e 25 29  |input_buffer?N%)|
00000bb0  3b 0d 04 c4 05 ed 0d 04  ce 05 f1 0d 04 d8 07 fd  |;...............|
00000bc0  20 a3 0d 04 e2 05 20 0d  04 ec 05 20 0d 04 f6 1b  | ..... .... ....|
00000bd0  2a 2a 2a 2a 20 45 51 55  61 74 65 20 61 20 42 79  |**** EQUate a By|
00000be0  74 65 20 2a 2a 2a 2a 0d  05 00 0f dd 20 a4 45 51  |te ****..... .EQ|
00000bf0  55 42 28 4e 25 29 0d 05  0a 10 3f 50 25 3d 4e 25  |UB(N%)....?P%=N%|
00000c00  20 83 20 32 35 36 0d 05  14 1e e7 20 28 70 61 73  | . 256..... (pas|
00000c10  73 25 20 80 20 33 29 20  3d 20 33 20 8c 20 f1 20  |s% . 3) = 3 . . |
00000c20  7e 3f 50 25 0d 05 1e 0b  50 25 3d 50 25 2b 31 0d  |~?P%....P%=P%+1.|
00000c30  05 28 0a 3d 70 61 73 73  25 0d 05 32 05 20 0d 05  |.(.=pass%..2. ..|
00000c40  3c 1d 2a 2a 2a 2a 20 45  51 55 61 74 65 20 61 20  |<.**** EQUate a |
00000c50  53 74 72 69 6e 67 20 2a  2a 2a 2a 0d 05 46 0f dd  |String ****..F..|
00000c60  20 a4 45 51 55 53 28 4e  24 29 0d 05 50 08 ea 20  | .EQUS(N$)..P.. |
00000c70  4e 25 0d 05 5a 08 fe 20  34 30 0d 05 64 12 e3 20  |N%..Z.. 40..d.. |
00000c80  4e 25 3d 31 20 b8 20 a9  28 4e 24 29 0d 05 6e 13  |N%=1 . .(N$)..n.|
00000c90  4b 25 3d 97 28 c1 4e 24  2c 4e 25 2c 31 29 29 0d  |K%=.(.N$,N%,1)).|
00000ca0  05 78 10 50 25 3f 28 4e  25 2d 31 29 3d 4b 25 0d  |.x.P%?(N%-1)=K%.|
00000cb0  05 82 25 e7 20 28 70 61  73 73 25 20 80 20 33 29  |..%. (pass% . 3)|
00000cc0  20 3d 20 33 20 8c 20 f1  20 7e 50 25 3f 28 4e 25  | = 3 . . ~P%?(N%|
00000cd0  2d 31 29 3b 0d 05 8c 05  ed 0d 05 96 19 e7 20 28  |-1);.......... (|
00000ce0  70 61 73 73 25 20 80 20  33 29 20 3d 20 33 20 8c  |pass% . 3) = 3 .|
00000cf0  20 f1 0d 05 a0 0f 50 25  3d 50 25 2b a9 28 4e 24  | .....P%=P%+.(N$|
00000d00  29 0d 05 aa 07 fe 20 30  0d 05 b4 0a 3d 70 61 73  |)..... 0....=pas|
00000d10  73 25 0d 05 be 05 20 0d  05 c8 28 2a 2a 2a 2a 20  |s%.... ...(**** |
00000d20  45 51 55 61 74 65 20 61  20 73 65 63 74 69 6f 6e  |EQUate a section|
00000d30  20 6f 66 20 4d 65 6d 6f  72 79 20 2a 2a 2a 2a 0d  | of Memory ****.|
00000d40  05 d2 1a dd 20 a4 45 51  55 4d 28 6e 75 6d 62 65  |.... .EQUM(numbe|
00000d50  72 25 2c 62 79 74 65 25  29 0d 05 dc 08 ea 20 4e  |r%,byte%)..... N|
00000d60  25 0d 05 e6 08 fe 20 34  30 0d 05 f0 16 e3 20 4e  |%..... 40..... N|
00000d70  25 3d 30 20 b8 20 6e 75  6d 62 65 72 25 2d 31 0d  |%=0 . number%-1.|
00000d80  05 fa 0f 50 25 3f 4e 25  3d 62 79 74 65 25 0d 06  |...P%?N%=byte%..|
00000d90  04 21 e7 20 28 70 61 73  73 25 20 80 20 33 29 20  |.!. (pass% . 3) |
00000da0  3d 20 33 20 8c 20 f1 20  7e 50 25 3f 4e 25 3b 0d  |= 3 . . ~P%?N%;.|
00000db0  06 0e 05 ed 0d 06 18 19  e7 20 28 70 61 73 73 25  |......... (pass%|
00000dc0  20 80 20 33 29 20 3d 20  33 20 8c 20 f1 0d 06 22  | . 3) = 3 . ..."|
00000dd0  11 50 25 3d 50 25 2b 6e  75 6d 62 65 72 25 0d 06  |.P%=P%+number%..|
00000de0  2c 07 fe 20 30 0d 06 36  0a 3d 70 61 73 73 25 0d  |,.. 0..6.=pass%.|
00000df0  ff                                                |.|
00000df1
22-01-88/B\OSB11.m0
22-01-88/B\OSB11.m1
22-01-88/B\OSB11.m2
22-01-88/B\OSB11.m4
22-01-88/B\OSB11.m5