Home » Archimedes archive » Acorn User » AU 1998-05 A.adf » Regulars » StarInfo/Reysenbach/sine

StarInfo/Reysenbach/sine

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 » Archimedes archive » Acorn User » AU 1998-05 A.adf » Regulars
Filename: StarInfo/Reysenbach/sine
Read OK:
File size: 025F bytes
Load address: 0000
Exec address: 0000
File contents
   10 REM >sine
   20 REM 0 <= radians <1
   30 REM by A Reysenbach
   40 :
   50 MODE 28
   60 DIM si 68
   70 P%=si
   80 [
   90 DCD &E0878090
  100 DCD &E0868791
  110 DCD &E0868096
  120 SUB 0,0,6,LSR #2
  130 DCD &E0898792
  140 DCD &E0868996
  150 ADD 0,0,6,LSR #6
  160 DCD &E0898793
  170 DCD &E0868996
  180 SUB 0,0,6,LSR #11
  190 DCD &E0898794
  200 DCD &E0868996
  210 ADD 0,0,6,LSR #14
  220 DCD &E0898795
  230 DCD &E0868996
  240 SUB 0,0,6,LSR #20
  250 MOV PC,14
  260 ]
  270 INPUT'"0 <= sine < 1 ";a
  280 A%= (a*2^31)<<1
  290 B%= &AAAAAAAB
  300 C%= &CCCCCCCD
  310 D%= &C30C30C3
  320 E%= &1C71C71D
  330 F%= &94F20950
  340 Z%= USR(si)>>>1
  350 PRINT Z%/(2^31)
  360 PRINT SIN(a)

 � >sine
 � 0 <= radians <1
 � by A Reysenbach
( :
2	 � 28
< � si 68
F
 P%=si
P [
Z DCD &E0878090
d DCD &E0868791
n DCD &E0868096
x SUB 0,0,6,LSR #2
� DCD &E0898792
� DCD &E0868996
� ADD 0,0,6,LSR #6
� DCD &E0898793
� DCD &E0868996
� SUB 0,0,6,LSR #11
� DCD &E0898794
� DCD &E0868996
� ADD 0,0,6,LSR #14
� DCD &E0898795
� DCD &E0868996
� SUB 0,0,6,LSR #20
� MOV PC,14
 ]
 �'"0 <= sine < 1 ";a
 A%= (a*2^31)<<1
" B%= &AAAAAAAB
, C%= &CCCCCCCD
6 D%= &C30C30C3
@ E%= &1C71C71D
J F%= &94F20950
T Z%= �(si)>>>1
^ � Z%/(2^31)
h � �(a)
�
00000000  0d 00 0a 0c 20 f4 20 3e  73 69 6e 65 0d 00 14 16  |.... . >sine....|
00000010  20 f4 20 30 20 3c 3d 20  72 61 64 69 61 6e 73 20  | . 0 <= radians |
00000020  3c 31 0d 00 1e 16 20 f4  20 62 79 20 41 20 52 65  |<1.... . by A Re|
00000030  79 73 65 6e 62 61 63 68  0d 00 28 06 20 3a 0d 00  |ysenbach..(. :..|
00000040  32 09 20 eb 20 32 38 0d  00 3c 0c 20 de 20 73 69  |2. . 28..<. . si|
00000050  20 36 38 0d 00 46 0a 20  50 25 3d 73 69 0d 00 50  | 68..F. P%=si..P|
00000060  06 20 5b 0d 00 5a 12 20  44 43 44 20 26 45 30 38  |. [..Z. DCD &E08|
00000070  37 38 30 39 30 0d 00 64  12 20 44 43 44 20 26 45  |78090..d. DCD &E|
00000080  30 38 36 38 37 39 31 0d  00 6e 12 20 44 43 44 20  |0868791..n. DCD |
00000090  26 45 30 38 36 38 30 39  36 0d 00 78 15 20 53 55  |&E0868096..x. SU|
000000a0  42 20 30 2c 30 2c 36 2c  4c 53 52 20 23 32 0d 00  |B 0,0,6,LSR #2..|
000000b0  82 12 20 44 43 44 20 26  45 30 38 39 38 37 39 32  |.. DCD &E0898792|
000000c0  0d 00 8c 12 20 44 43 44  20 26 45 30 38 36 38 39  |.... DCD &E08689|
000000d0  39 36 0d 00 96 15 20 41  44 44 20 30 2c 30 2c 36  |96.... ADD 0,0,6|
000000e0  2c 4c 53 52 20 23 36 0d  00 a0 12 20 44 43 44 20  |,LSR #6.... DCD |
000000f0  26 45 30 38 39 38 37 39  33 0d 00 aa 12 20 44 43  |&E0898793.... DC|
00000100  44 20 26 45 30 38 36 38  39 39 36 0d 00 b4 16 20  |D &E0868996.... |
00000110  53 55 42 20 30 2c 30 2c  36 2c 4c 53 52 20 23 31  |SUB 0,0,6,LSR #1|
00000120  31 0d 00 be 12 20 44 43  44 20 26 45 30 38 39 38  |1.... DCD &E0898|
00000130  37 39 34 0d 00 c8 12 20  44 43 44 20 26 45 30 38  |794.... DCD &E08|
00000140  36 38 39 39 36 0d 00 d2  16 20 41 44 44 20 30 2c  |68996.... ADD 0,|
00000150  30 2c 36 2c 4c 53 52 20  23 31 34 0d 00 dc 12 20  |0,6,LSR #14.... |
00000160  44 43 44 20 26 45 30 38  39 38 37 39 35 0d 00 e6  |DCD &E0898795...|
00000170  12 20 44 43 44 20 26 45  30 38 36 38 39 39 36 0d  |. DCD &E0868996.|
00000180  00 f0 16 20 53 55 42 20  30 2c 30 2c 36 2c 4c 53  |... SUB 0,0,6,LS|
00000190  52 20 23 32 30 0d 00 fa  0e 20 4d 4f 56 20 50 43  |R #20.... MOV PC|
000001a0  2c 31 34 0d 01 04 06 20  5d 0d 01 0e 19 20 e8 27  |,14.... ].... .'|
000001b0  22 30 20 3c 3d 20 73 69  6e 65 20 3c 20 31 20 22  |"0 <= sine < 1 "|
000001c0  3b 61 0d 01 18 14 20 41  25 3d 20 28 61 2a 32 5e  |;a.... A%= (a*2^|
000001d0  33 31 29 3c 3c 31 0d 01  22 12 20 42 25 3d 20 26  |31)<<1..". B%= &|
000001e0  41 41 41 41 41 41 41 42  0d 01 2c 12 20 43 25 3d  |AAAAAAAB..,. C%=|
000001f0  20 26 43 43 43 43 43 43  43 44 0d 01 36 12 20 44  | &CCCCCCCD..6. D|
00000200  25 3d 20 26 43 33 30 43  33 30 43 33 0d 01 40 12  |%= &C30C30C3..@.|
00000210  20 45 25 3d 20 26 31 43  37 31 43 37 31 44 0d 01  | E%= &1C71C71D..|
00000220  4a 12 20 46 25 3d 20 26  39 34 46 32 30 39 35 30  |J. F%= &94F20950|
00000230  0d 01 54 12 20 5a 25 3d  20 ba 28 73 69 29 3e 3e  |..T. Z%= .(si)>>|
00000240  3e 31 0d 01 5e 10 20 f1  20 5a 25 2f 28 32 5e 33  |>1..^. . Z%/(2^3|
00000250  31 29 0d 01 68 0b 20 f1  20 b5 28 61 29 0d ff     |1)..h. . .(a)..|
0000025f