Home » CEEFAX disks » telesoftware3.adl » 21_11_87/B\OSB05

21_11_87/B\OSB05

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 » telesoftware3.adl
Filename: 21_11_87/B\OSB05
Read OK:
File size: 04FA bytes
Load address: 1900
Exec address: 8023
File contents
   10REM OSBITS Module B/osb05
   20REM OSBYTE and OSWORD
   30REM Version 1.2 1.2.87
   40 
   50*KEY1MO.3|M|NL.|M
   60DIM code% 200
   70osbyte=&FFF4
   80osword=&FFF1
   90 
  100FOR pass%=0 TO 3 STEP 3
  110P%=code%
  120 
  130[OPT pass%
  140LDA #121                       \ Keyboard scan OSBYTE
  150LDX #16                        \ Scan all keyboard but not links
  160JSR osbyte                     \ Pressed key returned in X
  170 
  180CPX #&FF                       \ &FF if no key pressed
  190BEQ flush                      \ Clear sound buffer if no key pressed
  200 
  210STX osword_block+4             \ Put pitch into sound OSWORD call
  220LDA #7
  230LDX #(osword_block MOD 256)
  240LDY #(osword_block DIV 256)
  250JSR osword                     \ Make sound
  260 
  270RTS
  280 
  290.flush
  300LDA #21                        \ OSBYTE 21 flushes selected buffer
  310LDX #5                         \ Clears sound channel 1
  320JSR osbyte
  330 
  340RTS
  350 
  360.osword_block  OPT FNEQUW(1)   \ Channel number 1
  370               OPT FNEQUW(-15) \ Amplitude
  380               OPT FNEQUW(0)   \ Pitch
  390               OPT FNEQUW(1)   \ Duration
  400]
  410NEXT
  420REPEAT
  430CALL code%
  440UNTIL0
  450END
  460 
  470**** EQUate a Word (2 bytes) ****
  480DEF FNEQUW(N%)
  490?P%=N% MOD 256
  500P%?1=N% DIV 256
  510IF (pass% AND 3) = 3 THEN PRINT ~?P%,~?(P%+1)
  520P%=P%+2
  530=pass%

� OSBITS Module B/osb05
� OSBYTE and OSWORD
� Version 1.2 1.2.87
( 
2*KEY1MO.3|M|NL.|M
<� code% 200
Fosbyte=&FFF4
Posword=&FFF1
Z 
d� pass%=0 � 3 � 3
nP%=code%
x 
�[OPT pass%
�9LDA #121                       \ Keyboard scan OSBYTE
�DLDX #16                        \ Scan all keyboard but not links
�>JSR osbyte                     \ Pressed key returned in X
� 
�:CPX #&FF                       \ &FF if no key pressed
�IBEQ flush                      \ Clear sound buffer if no key pressed
� 
�ESTX osword_block+4             \ Put pitch into sound OSWORD call
�
LDA #7
�LDX #(osword_block � 256)
�LDY #(osword_block � 256)
�/JSR osword                     \ Make sound
 
RTS
 
"
.flush
,FLDA #21                        \ OSBYTE 21 flushes selected buffer
6;LDX #5                         \ Clears sound channel 1
@JSR osbyte
J 
TRTS
^ 
h4.osword_block  OPT �EQUW(1)   \ Channel number 1
r-               OPT �EQUW(-15) \ Amplitude
|)               OPT �EQUW(0)   \ Pitch
�,               OPT �EQUW(1)   \ Duration
�]
��
��
�� code%
��0
��
� 
�%**** EQUate a Word (2 bytes) ****
�� �EQUW(N%)
�?P%=N% � 256
�P%?1=N% � 256
�'� (pass% � 3) = 3 � � ~?P%,~?(P%+1)
P%=P%+2

=pass%
�
00000000  0d 00 0a 1b f4 20 4f 53  42 49 54 53 20 4d 6f 64  |..... OSBITS Mod|
00000010  75 6c 65 20 42 2f 6f 73  62 30 35 0d 00 14 17 f4  |ule B/osb05.....|
00000020  20 4f 53 42 59 54 45 20  61 6e 64 20 4f 53 57 4f  | OSBYTE and OSWO|
00000030  52 44 0d 00 1e 18 f4 20  56 65 72 73 69 6f 6e 20  |RD..... Version |
00000040  31 2e 32 20 31 2e 32 2e  38 37 0d 00 28 05 20 0d  |1.2 1.2.87..(. .|
00000050  00 32 15 2a 4b 45 59 31  4d 4f 2e 33 7c 4d 7c 4e  |.2.*KEY1MO.3|M|N|
00000060  4c 2e 7c 4d 0d 00 3c 0f  de 20 63 6f 64 65 25 20  |L.|M..<.. code% |
00000070  32 30 30 0d 00 46 10 6f  73 62 79 74 65 3d 26 46  |200..F.osbyte=&F|
00000080  46 46 34 0d 00 50 10 6f  73 77 6f 72 64 3d 26 46  |FF4..P.osword=&F|
00000090  46 46 31 0d 00 5a 05 20  0d 00 64 15 e3 20 70 61  |FF1..Z. ..d.. pa|
000000a0  73 73 25 3d 30 20 b8 20  33 20 88 20 33 0d 00 6e  |ss%=0 . 3 . 3..n|
000000b0  0c 50 25 3d 63 6f 64 65  25 0d 00 78 05 20 0d 00  |.P%=code%..x. ..|
000000c0  82 0e 5b 4f 50 54 20 70  61 73 73 25 0d 00 8c 39  |..[OPT pass%...9|
000000d0  4c 44 41 20 23 31 32 31  20 20 20 20 20 20 20 20  |LDA #121        |
000000e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
000000f0  20 4b 65 79 62 6f 61 72  64 20 73 63 61 6e 20 4f  | Keyboard scan O|
00000100  53 42 59 54 45 0d 00 96  44 4c 44 58 20 23 31 36  |SBYTE...DLDX #16|
00000110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000120  20 20 20 20 20 20 20 20  5c 20 53 63 61 6e 20 61  |        \ Scan a|
00000130  6c 6c 20 6b 65 79 62 6f  61 72 64 20 62 75 74 20  |ll keyboard but |
00000140  6e 6f 74 20 6c 69 6e 6b  73 0d 00 a0 3e 4a 53 52  |not links...>JSR|
00000150  20 6f 73 62 79 74 65 20  20 20 20 20 20 20 20 20  | osbyte         |
00000160  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 50 72  |            \ Pr|
00000170  65 73 73 65 64 20 6b 65  79 20 72 65 74 75 72 6e  |essed key return|
00000180  65 64 20 69 6e 20 58 0d  00 aa 05 20 0d 00 b4 3a  |ed in X.... ...:|
00000190  43 50 58 20 23 26 46 46  20 20 20 20 20 20 20 20  |CPX #&FF        |
000001a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
000001b0  20 26 46 46 20 69 66 20  6e 6f 20 6b 65 79 20 70  | &FF if no key p|
000001c0  72 65 73 73 65 64 0d 00  be 49 42 45 51 20 66 6c  |ressed...IBEQ fl|
000001d0  75 73 68 20 20 20 20 20  20 20 20 20 20 20 20 20  |ush             |
000001e0  20 20 20 20 20 20 20 20  20 5c 20 43 6c 65 61 72  |         \ Clear|
000001f0  20 73 6f 75 6e 64 20 62  75 66 66 65 72 20 69 66  | sound buffer if|
00000200  20 6e 6f 20 6b 65 79 20  70 72 65 73 73 65 64 0d  | no key pressed.|
00000210  00 c8 05 20 0d 00 d2 45  53 54 58 20 6f 73 77 6f  |... ...ESTX oswo|
00000220  72 64 5f 62 6c 6f 63 6b  2b 34 20 20 20 20 20 20  |rd_block+4      |
00000230  20 20 20 20 20 20 20 5c  20 50 75 74 20 70 69 74  |       \ Put pit|
00000240  63 68 20 69 6e 74 6f 20  73 6f 75 6e 64 20 4f 53  |ch into sound OS|
00000250  57 4f 52 44 20 63 61 6c  6c 0d 00 dc 0a 4c 44 41  |WORD call....LDA|
00000260  20 23 37 0d 00 e6 1d 4c  44 58 20 23 28 6f 73 77  | #7....LDX #(osw|
00000270  6f 72 64 5f 62 6c 6f 63  6b 20 83 20 32 35 36 29  |ord_block . 256)|
00000280  0d 00 f0 1d 4c 44 59 20  23 28 6f 73 77 6f 72 64  |....LDY #(osword|
00000290  5f 62 6c 6f 63 6b 20 81  20 32 35 36 29 0d 00 fa  |_block . 256)...|
000002a0  2f 4a 53 52 20 6f 73 77  6f 72 64 20 20 20 20 20  |/JSR osword     |
000002b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000002c0  5c 20 4d 61 6b 65 20 73  6f 75 6e 64 0d 01 04 05  |\ Make sound....|
000002d0  20 0d 01 0e 07 52 54 53  0d 01 18 05 20 0d 01 22  | ....RTS.... .."|
000002e0  0a 2e 66 6c 75 73 68 0d  01 2c 46 4c 44 41 20 23  |..flush..,FLDA #|
000002f0  32 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |21              |
00000300  20 20 20 20 20 20 20 20  20 20 5c 20 4f 53 42 59  |          \ OSBY|
00000310  54 45 20 32 31 20 66 6c  75 73 68 65 73 20 73 65  |TE 21 flushes se|
00000320  6c 65 63 74 65 64 20 62  75 66 66 65 72 0d 01 36  |lected buffer..6|
00000330  3b 4c 44 58 20 23 35 20  20 20 20 20 20 20 20 20  |;LDX #5         |
00000340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000350  5c 20 43 6c 65 61 72 73  20 73 6f 75 6e 64 20 63  |\ Clears sound c|
00000360  68 61 6e 6e 65 6c 20 31  0d 01 40 0e 4a 53 52 20  |hannel 1..@.JSR |
00000370  6f 73 62 79 74 65 0d 01  4a 05 20 0d 01 54 07 52  |osbyte..J. ..T.R|
00000380  54 53 0d 01 5e 05 20 0d  01 68 34 2e 6f 73 77 6f  |TS..^. ..h4.oswo|
00000390  72 64 5f 62 6c 6f 63 6b  20 20 4f 50 54 20 a4 45  |rd_block  OPT .E|
000003a0  51 55 57 28 31 29 20 20  20 5c 20 43 68 61 6e 6e  |QUW(1)   \ Chann|
000003b0  65 6c 20 6e 75 6d 62 65  72 20 31 0d 01 72 2d 20  |el number 1..r- |
000003c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4f 50  |              OP|
000003d0  54 20 a4 45 51 55 57 28  2d 31 35 29 20 5c 20 41  |T .EQUW(-15) \ A|
000003e0  6d 70 6c 69 74 75 64 65  0d 01 7c 29 20 20 20 20  |mplitude..|)    |
000003f0  20 20 20 20 20 20 20 20  20 20 20 4f 50 54 20 a4  |           OPT .|
00000400  45 51 55 57 28 30 29 20  20 20 5c 20 50 69 74 63  |EQUW(0)   \ Pitc|
00000410  68 0d 01 86 2c 20 20 20  20 20 20 20 20 20 20 20  |h...,           |
00000420  20 20 20 20 4f 50 54 20  a4 45 51 55 57 28 31 29  |    OPT .EQUW(1)|
00000430  20 20 20 5c 20 44 75 72  61 74 69 6f 6e 0d 01 90  |   \ Duration...|
00000440  05 5d 0d 01 9a 05 ed 0d  01 a4 05 f5 0d 01 ae 0b  |.]..............|
00000450  d6 20 63 6f 64 65 25 0d  01 b8 06 fd 30 0d 01 c2  |. code%.....0...|
00000460  05 e0 0d 01 cc 05 20 0d  01 d6 25 2a 2a 2a 2a 20  |...... ...%**** |
00000470  45 51 55 61 74 65 20 61  20 57 6f 72 64 20 28 32  |EQUate a Word (2|
00000480  20 62 79 74 65 73 29 20  2a 2a 2a 2a 0d 01 e0 0f  | bytes) ****....|
00000490  dd 20 a4 45 51 55 57 28  4e 25 29 0d 01 ea 10 3f  |. .EQUW(N%)....?|
000004a0  50 25 3d 4e 25 20 83 20  32 35 36 0d 01 f4 11 50  |P%=N% . 256....P|
000004b0  25 3f 31 3d 4e 25 20 81  20 32 35 36 0d 01 fe 27  |%?1=N% . 256...'|
000004c0  e7 20 28 70 61 73 73 25  20 80 20 33 29 20 3d 20  |. (pass% . 3) = |
000004d0  33 20 8c 20 f1 20 7e 3f  50 25 2c 7e 3f 28 50 25  |3 . . ~?P%,~?(P%|
000004e0  2b 31 29 0d 02 08 0b 50  25 3d 50 25 2b 32 0d 02  |+1)....P%=P%+2..|
000004f0  12 0a 3d 70 61 73 73 25  0d ff                    |..=pass%..|
000004fa
21_11_87/B\OSB05.m0
21_11_87/B\OSB05.m1
21_11_87/B\OSB05.m2
21_11_87/B\OSB05.m4
21_11_87/B\OSB05.m5