Home » CEEFAX disks » telesoftware6.adl » 04-04-88/B\OSB20
04-04-88/B\OSB20
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 » telesoftware6.adl |
Filename: | 04-04-88/B\OSB20 |
Read OK: | ✔ |
File size: | 0384 bytes |
Load address: | 0800 |
Exec address: | 8023 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- CEEFAX disks » telesoftware6.adl » 04-04-88/B\OSB20
- CEEFAX disks » telesoftware2.adl » OS\BITS/B\OSB20
File contents
10REM B/osb20 20REM Illustration of fixed v fixed point speed 30REM Version 1.2 3.5.87 40 50*KEY1MO.3|M|NL.|M 60 70PRINT"Fixed Point Arithmetic ...."' 80INPUT "First number ",A 90INPUT "Second number ",B 100A%=A*10000 110B%=B*10000 120 130PRINT'' "Working using BASIC integer routines" 140TIME=0 150FOR N%=0 TO 999 160X%=A%*B% 170NEXT 180PRINT "One thousand multiplications takes ";TIME;" centiseconds" 190PRINT' "Fixed point sum : ";(A%+B%)/10000 200PRINT "Fixed point difference : ";(A%-B%)/10000 210PRINT "Fixed point product : ";A%*B%/100000000 220PRINT "Fixed point quotient : ";((A%*10000) DIV B%)/10000 230PRINT 240 250PRINT "Working using BASIC floating point routines" 260TIME=0 270FOR N%=0 TO 999 280X=A*B 290NEXT 300PRINT "One thousand multiplications takes ";TIME;" centiseconds" 310PRINT' "Floating point sum : ";A+B 320PRINT "Floating point difference : ";A-B 330PRINT "Floating point product : ";A*B 340PRINT "Floating point quotient : ";A/B
� B/osb20 /� Illustration of fixed v fixed point speed � Version 1.2 3.5.87 ( 2*KEY1MO.3|M|NL.|M < F#�"Fixed Point Arithmetic ...."' P� "First number ",A Z� "Second number ",B dA%=A*10000 nB%=B*10000 x �.�'' "Working using BASIC integer routines" ��=0 �� N%=0 � 999 �X%=A%*B% �� �=� "One thousand multiplications takes ";�;" centiseconds" �0�' "Fixed point sum : ";(A%+B%)/10000 �/� "Fixed point difference : ";(A%-B%)/10000 �1� "Fixed point product : ";A%*B%/100000000 �9� "Fixed point quotient : ";((A%*10000) � B%)/10000 �� � �3� "Working using BASIC floating point routines" �=0 � N%=0 � 999 X=A*B "� ,=� "One thousand multiplications takes ";�;" centiseconds" 6)�' "Floating point sum : ";A+B @(� "Floating point difference : ";A-B J(� "Floating point product : ";A*B T(� "Floating point quotient : ";A/B �
00000000 0d 00 0a 0d f4 20 42 2f 6f 73 62 32 30 0d 00 14 |..... B/osb20...| 00000010 2f f4 20 49 6c 6c 75 73 74 72 61 74 69 6f 6e 20 |/. Illustration | 00000020 6f 66 20 66 69 78 65 64 20 76 20 66 69 78 65 64 |of fixed v fixed| 00000030 20 70 6f 69 6e 74 20 73 70 65 65 64 0d 00 1e 18 | point speed....| 00000040 f4 20 56 65 72 73 69 6f 6e 20 31 2e 32 20 33 2e |. Version 1.2 3.| 00000050 35 2e 38 37 0d 00 28 05 20 0d 00 32 15 2a 4b 45 |5.87..(. ..2.*KE| 00000060 59 31 4d 4f 2e 33 7c 4d 7c 4e 4c 2e 7c 4d 0d 00 |Y1MO.3|M|NL.|M..| 00000070 3c 05 20 0d 00 46 23 f1 22 46 69 78 65 64 20 50 |<. ..F#."Fixed P| 00000080 6f 69 6e 74 20 41 72 69 74 68 6d 65 74 69 63 20 |oint Arithmetic | 00000090 2e 2e 2e 2e 22 27 0d 00 50 17 e8 20 22 46 69 72 |...."'..P.. "Fir| 000000a0 73 74 20 6e 75 6d 62 65 72 20 22 2c 41 0d 00 5a |st number ",A..Z| 000000b0 18 e8 20 22 53 65 63 6f 6e 64 20 6e 75 6d 62 65 |.. "Second numbe| 000000c0 72 20 22 2c 42 0d 00 64 0e 41 25 3d 41 2a 31 30 |r ",B..d.A%=A*10| 000000d0 30 30 30 0d 00 6e 0e 42 25 3d 42 2a 31 30 30 30 |000..n.B%=B*1000| 000000e0 30 0d 00 78 05 20 0d 00 82 2e f1 27 27 20 22 57 |0..x. .....'' "W| 000000f0 6f 72 6b 69 6e 67 20 75 73 69 6e 67 20 42 41 53 |orking using BAS| 00000100 49 43 20 69 6e 74 65 67 65 72 20 72 6f 75 74 69 |IC integer routi| 00000110 6e 65 73 22 0d 00 8c 07 d1 3d 30 0d 00 96 10 e3 |nes".....=0.....| 00000120 20 4e 25 3d 30 20 b8 20 39 39 39 0d 00 a0 0c 58 | N%=0 . 999....X| 00000130 25 3d 41 25 2a 42 25 0d 00 aa 05 ed 0d 00 b4 3d |%=A%*B%........=| 00000140 f1 20 22 4f 6e 65 20 74 68 6f 75 73 61 6e 64 20 |. "One thousand | 00000150 6d 75 6c 74 69 70 6c 69 63 61 74 69 6f 6e 73 20 |multiplications | 00000160 74 61 6b 65 73 20 22 3b 91 3b 22 20 63 65 6e 74 |takes ";.;" cent| 00000170 69 73 65 63 6f 6e 64 73 22 0d 00 be 30 f1 27 20 |iseconds"...0.' | 00000180 22 46 69 78 65 64 20 70 6f 69 6e 74 20 73 75 6d |"Fixed point sum| 00000190 20 20 20 20 20 20 20 20 3a 20 22 3b 28 41 25 2b | : ";(A%+| 000001a0 42 25 29 2f 31 30 30 30 30 0d 00 c8 2f f1 20 22 |B%)/10000.../. "| 000001b0 46 69 78 65 64 20 70 6f 69 6e 74 20 64 69 66 66 |Fixed point diff| 000001c0 65 72 65 6e 63 65 20 3a 20 22 3b 28 41 25 2d 42 |erence : ";(A%-B| 000001d0 25 29 2f 31 30 30 30 30 0d 00 d2 31 f1 20 22 46 |%)/10000...1. "F| 000001e0 69 78 65 64 20 70 6f 69 6e 74 20 70 72 6f 64 75 |ixed point produ| 000001f0 63 74 20 20 20 20 3a 20 22 3b 41 25 2a 42 25 2f |ct : ";A%*B%/| 00000200 31 30 30 30 30 30 30 30 30 0d 00 dc 39 f1 20 22 |100000000...9. "| 00000210 46 69 78 65 64 20 70 6f 69 6e 74 20 71 75 6f 74 |Fixed point quot| 00000220 69 65 6e 74 20 20 20 3a 20 22 3b 28 28 41 25 2a |ient : ";((A%*| 00000230 31 30 30 30 30 29 20 81 20 42 25 29 2f 31 30 30 |10000) . B%)/100| 00000240 30 30 0d 00 e6 05 f1 0d 00 f0 05 20 0d 00 fa 33 |00......... ...3| 00000250 f1 20 22 57 6f 72 6b 69 6e 67 20 75 73 69 6e 67 |. "Working using| 00000260 20 42 41 53 49 43 20 66 6c 6f 61 74 69 6e 67 20 | BASIC floating | 00000270 70 6f 69 6e 74 20 72 6f 75 74 69 6e 65 73 22 0d |point routines".| 00000280 01 04 07 d1 3d 30 0d 01 0e 10 e3 20 4e 25 3d 30 |....=0..... N%=0| 00000290 20 b8 20 39 39 39 0d 01 18 09 58 3d 41 2a 42 0d | . 999....X=A*B.| 000002a0 01 22 05 ed 0d 01 2c 3d f1 20 22 4f 6e 65 20 74 |."....,=. "One t| 000002b0 68 6f 75 73 61 6e 64 20 6d 75 6c 74 69 70 6c 69 |housand multipli| 000002c0 63 61 74 69 6f 6e 73 20 74 61 6b 65 73 20 22 3b |cations takes ";| 000002d0 91 3b 22 20 63 65 6e 74 69 73 65 63 6f 6e 64 73 |.;" centiseconds| 000002e0 22 0d 01 36 29 f1 27 20 22 46 6c 6f 61 74 69 6e |"..6).' "Floatin| 000002f0 67 20 70 6f 69 6e 74 20 73 75 6d 20 20 20 20 20 |g point sum | 00000300 20 20 20 3a 20 22 3b 41 2b 42 0d 01 40 28 f1 20 | : ";A+B..@(. | 00000310 22 46 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74 20 |"Floating point | 00000320 64 69 66 66 65 72 65 6e 63 65 20 3a 20 22 3b 41 |difference : ";A| 00000330 2d 42 0d 01 4a 28 f1 20 22 46 6c 6f 61 74 69 6e |-B..J(. "Floatin| 00000340 67 20 70 6f 69 6e 74 20 70 72 6f 64 75 63 74 20 |g point product | 00000350 20 20 20 3a 20 22 3b 41 2a 42 0d 01 54 28 f1 20 | : ";A*B..T(. | 00000360 22 46 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74 20 |"Floating point | 00000370 71 75 6f 74 69 65 6e 74 20 20 20 3a 20 22 3b 41 |quotient : ";A| 00000380 2f 42 0d ff |/B..| 00000384