Home » Archimedes archive » Archimedes World » AW-1996-09.adf » !AcornAns_AcornAns » Gaussian

Gaussian

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 » Archimedes World » AW-1996-09.adf » !AcornAns_AcornAns
Filename: Gaussian
Read OK:
File size: 0B60 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM Demo of pseudo random number generation for a random variable
   20REM with gaussian distribution.
   30:
   40PROCreadmonitortype
   50MODE mo%
   60PROCass
   70:
   80!seed%=-TIME
   90A%=640
  100DIM sum%(A%-1)
  110scale=2
  120REPEAT
  130 r% = USR rnd_gauss%
  140 x% = (r%+321060)/1003
  150 IF x%>=0 AND x%<=639 THEN
  160  sum%(x%) += 1
  170  y%=sum%(x%)*scale
  180  IF y%<1024 THEN
  190   PLOT 69, x%*2, y%
  200  ELSE
  210   scale=scale/2
  220   CLS
  230   FOR i%=0 TO A%-1
  240    IF sum%(i%) LINE i%*2, 0, i%*2, sum%(i%)*scale
  250   NEXT
  260  ENDIF
  270 ENDIF
  280UNTIL FALSE
  290:
  300END
  310:
  320:
  330DEF PROCass
  340DIM code% 1024
  350FOR pass%=0 TO 2 STEP 2
  360P%=code%
  370[OPT pass%
  380:
  390.seed%
  400DCD       -1        ;bits b0-b31 of seed
  410DCD       -1        ;bit  b32 of seed (in lsb of word)
  420:
  430.rnd_gauss%         ;Returns 65536 * ( pseudo randon variable with
  440:                   ;                 approx distribution N(0,1) )
  450:
  460:                   ;NB The approx gaussian distn is achieved via
  470:                   ;   the sum of n pseudo U[0,65535] random
  480:                   ;   variables & application of the central
  490:                   ;   limit theorem.
  500:                   ;   Here we use n=8, giving an actual range of
  510:                   ;   -(sqrt24)*65536 to +(sqrt24)*65536.
  520:                   ;   For general n, recall we need to return
  530:                   ;    (sum n U[0,65535] random variables) *
  540:                   ;     2sqrt(3n)*65536/(65535n)           -
  550:                   ;     sqrt(3n)*65536
  560:
  570ADR       0, seed%
  580LDMIA     0, {1, 2}
  590:
  600MOVS      2, 2, LSR #1
  610MOVS      3, 1, RRX
  620ADC       2, 2, 2
  630EOR       3, 3, 1, LSL #12
  640EOR       1, 3, 3, LSR #20
  650MOV       4, 1, LSR #16
  660MOV       3, 1, LSL #16
  670ADD       4, 4, 3, LSR #16
  680:
  690MOVS      2, 2, LSR #1
  700MOVS      3, 1, RRX
  710ADC       2, 2, 2
  720EOR       3, 3, 1, LSL #12
  730EOR       1, 3, 3, LSR #20
  740ADD       4, 4, 1, LSR #16
  750MOV       3, 1, LSL #16
  760ADD       4, 4, 3, LSR #16
  770:
  780MOVS      2, 2, LSR #1
  790MOVS      3, 1, RRX
  800ADC       2, 2, 2
  810EOR       3, 3, 1, LSL #12
  820EOR       1, 3, 3, LSR #20
  830ADD       4, 4, 1, LSR #16
  840MOV       3, 1, LSL #16
  850ADD       4, 4, 3, LSR #16
  860:
  870MOVS      2, 2, LSR #1
  880MOVS      3, 1, RRX
  890ADC       2, 2, 2
  900EOR       3, 3, 1, LSL #12
  910EOR       1, 3, 3, LSR #20
  920ADD       4, 4, 1, LSR #16
  930MOV       3, 1, LSL #16
  940ADD       4, 4, 3, LSR #16    ;sum now in 4
  950:
  960STMIA     0, {1, 2}
  970:
  980RSB       0, 4, 4, ASL #3
  990RSB       1, 4, 4, ASL #2
 1000ADD       0, 1, 0, ASL #4
 1010ADD       0, 0, 4, ASL #9
 1020ADD       1, 4, 4, ASL #4
 1030ADD       1, 1, 4, ASL #6
 1040ADD       0, 0, 1, LSR #10
 1050MOV       0, 0, LSR #9
 1060SUB       0, 0, #&4E000
 1070SUB       0, 0, #&00620
 1080SUB       0, 0, #&00004
 1090:
 1100MOVS      PC, 14
 1110:
 1120]
 1130NEXT
 1140ENDPROC
 1150:
 1160DEF PROCreadmonitortype
 1170SYS "OS_Byte",161,133 TO ,,type%
 1180type%=(type% AND 12) DIV 4
 1190IF type%=1 mo%=18 ELSE mo%=0
 1200ENDPROC

C� Demo of pseudo random number generation for a random variable
!� with gaussian distribution.
:
(�readmonitortype
2	� mo%
<�ass
F:
P
!seed%=-�
Z
A%=640
d� sum%(A%-1)
nscale=2
x�
� r% = � rnd_gauss%
� x% = (r%+321060)/1003
� � x%>=0 � x%<=639 �
�  sum%(x%) += 1
�  y%=sum%(x%)*scale
�  � y%<1024 �
�   � 69, x%*2, y%
�  �
�   scale=scale/2
�   �
�   � i%=0 � A%-1
�2    � sum%(i%) � i%*2, 0, i%*2, sum%(i%)*scale
�   �
  �
 �
� �
":
,�
6:
@:
J
� �ass
T� code% 1024
^� pass%=0 � 2 � 2
hP%=code%
r[OPT pass%
|:
�
.seed%
�,DCD       -1        ;bits b0-b31 of seed
�:DCD       -1        ;bit  b32 of seed (in lsb of word)
�:
�F.rnd_gauss%         ;Returns 65536 * ( pseudo randon variable with
�F:                   ;                 approx distribution N(0,1) )
�:
�E:                   ;NB The approx gaussian distn is achieved via
�A:                   ;   the sum of n pseudo U[0,65535] random
�B:                   ;   variables & application of the central
�*:                   ;   limit theorem.
�F:                   ;   Here we use n=8, giving an actual range of
�?:                   ;   -(sqrt24)*65536 to +(sqrt24)*65536.
C:                   ;   For general n, recall we need to return
B:                   ;    (sum n U[0,65535] random variables) *
B:                   ;     2sqrt(3n)*65536/(65535n)           -
&,:                   ;     sqrt(3n)*65536
0:
:ADR       0, seed%
DLDMIA     0, {1, 2}
N:
XMOVS      2, 2, LSR #1
bMOVS      3, 1, RRX
lADC       2, 2, 2
v�       3, 3, 1, LSL #12
��       1, 3, 3, LSR #20
�MOV       4, 1, LSR #16
�MOV       3, 1, LSL #16
�ADD       4, 4, 3, LSR #16
�:
�MOVS      2, 2, LSR #1
�MOVS      3, 1, RRX
�ADC       2, 2, 2
��       3, 3, 1, LSL #12
��       1, 3, 3, LSR #20
�ADD       4, 4, 1, LSR #16
�MOV       3, 1, LSL #16
�ADD       4, 4, 3, LSR #16
:
MOVS      2, 2, LSR #1
MOVS      3, 1, RRX
 ADC       2, 2, 2
*�       3, 3, 1, LSL #12
4�       1, 3, 3, LSR #20
>ADD       4, 4, 1, LSR #16
HMOV       3, 1, LSL #16
RADD       4, 4, 3, LSR #16
\:
fMOVS      2, 2, LSR #1
pMOVS      3, 1, RRX
zADC       2, 2, 2
��       3, 3, 1, LSL #12
��       1, 3, 3, LSR #20
�ADD       4, 4, 1, LSR #16
�MOV       3, 1, LSL #16
�/ADD       4, 4, 3, LSR #16    ;sum now in 4
�:
�STMIA     0, {1, 2}
�:
�RSB       0, 4, 4, ASL #3
�RSB       1, 4, 4, ASL #2
�ADD       0, 1, 0, ASL #4
�ADD       0, 0, 4, ASL #9
�ADD       1, 4, 4, ASL #4
ADD       1, 1, 4, ASL #6
ADD       0, 0, 1, LSR #10
MOV       0, 0, LSR #9
$SUB       0, 0, #&4E000
.SUB       0, 0, #&00620
8SUB       0, 0, #&00004
B:
LMOVS      PC, 14
V:
`]
j�
t�
~:
�� �readmonitortype
�"ș "OS_Byte",161,133 � ,,type%
�type%=(type% � 12) � 4
�� type%=1 mo%=18 � mo%=0
��
�
00000000  0d 00 0a 43 f4 20 44 65  6d 6f 20 6f 66 20 70 73  |...C. Demo of ps|
00000010  65 75 64 6f 20 72 61 6e  64 6f 6d 20 6e 75 6d 62  |eudo random numb|
00000020  65 72 20 67 65 6e 65 72  61 74 69 6f 6e 20 66 6f  |er generation fo|
00000030  72 20 61 20 72 61 6e 64  6f 6d 20 76 61 72 69 61  |r a random varia|
00000040  62 6c 65 0d 00 14 21 f4  20 77 69 74 68 20 67 61  |ble...!. with ga|
00000050  75 73 73 69 61 6e 20 64  69 73 74 72 69 62 75 74  |ussian distribut|
00000060  69 6f 6e 2e 0d 00 1e 05  3a 0d 00 28 14 f2 72 65  |ion.....:..(..re|
00000070  61 64 6d 6f 6e 69 74 6f  72 74 79 70 65 0d 00 32  |admonitortype..2|
00000080  09 eb 20 6d 6f 25 0d 00  3c 08 f2 61 73 73 0d 00  |.. mo%..<..ass..|
00000090  46 05 3a 0d 00 50 0d 21  73 65 65 64 25 3d 2d 91  |F.:..P.!seed%=-.|
000000a0  0d 00 5a 0a 41 25 3d 36  34 30 0d 00 64 10 de 20  |..Z.A%=640..d.. |
000000b0  73 75 6d 25 28 41 25 2d  31 29 0d 00 6e 0b 73 63  |sum%(A%-1)..n.sc|
000000c0  61 6c 65 3d 32 0d 00 78  05 f5 0d 00 82 16 20 72  |ale=2..x...... r|
000000d0  25 20 3d 20 ba 20 72 6e  64 5f 67 61 75 73 73 25  |% = . rnd_gauss%|
000000e0  0d 00 8c 1a 20 78 25 20  3d 20 28 72 25 2b 33 32  |.... x% = (r%+32|
000000f0  31 30 36 30 29 2f 31 30  30 33 0d 00 96 18 20 e7  |1060)/1003.... .|
00000100  20 78 25 3e 3d 30 20 80  20 78 25 3c 3d 36 33 39  | x%>=0 . x%<=639|
00000110  20 8c 0d 00 a0 13 20 20  73 75 6d 25 28 78 25 29  | .....  sum%(x%)|
00000120  20 2b 3d 20 31 0d 00 aa  17 20 20 79 25 3d 73 75  | += 1....  y%=su|
00000130  6d 25 28 78 25 29 2a 73  63 61 6c 65 0d 00 b4 11  |m%(x%)*scale....|
00000140  20 20 e7 20 79 25 3c 31  30 32 34 20 8c 0d 00 be  |  . y%<1024 ....|
00000150  15 20 20 20 f0 20 36 39  2c 20 78 25 2a 32 2c 20  |.   . 69, x%*2, |
00000160  79 25 0d 00 c8 07 20 20  cc 0d 00 d2 14 20 20 20  |y%....  .....   |
00000170  73 63 61 6c 65 3d 73 63  61 6c 65 2f 32 0d 00 dc  |scale=scale/2...|
00000180  08 20 20 20 db 0d 00 e6  14 20 20 20 e3 20 69 25  |.   .....   . i%|
00000190  3d 30 20 b8 20 41 25 2d  31 0d 00 f0 32 20 20 20  |=0 . A%-1...2   |
000001a0  20 e7 20 73 75 6d 25 28  69 25 29 20 86 20 69 25  | . sum%(i%) . i%|
000001b0  2a 32 2c 20 30 2c 20 69  25 2a 32 2c 20 73 75 6d  |*2, 0, i%*2, sum|
000001c0  25 28 69 25 29 2a 73 63  61 6c 65 0d 00 fa 08 20  |%(i%)*scale.... |
000001d0  20 20 ed 0d 01 04 07 20  20 cd 0d 01 0e 06 20 cd  |  .....  ..... .|
000001e0  0d 01 18 07 fd 20 a3 0d  01 22 05 3a 0d 01 2c 05  |..... ...".:..,.|
000001f0  e0 0d 01 36 05 3a 0d 01  40 05 3a 0d 01 4a 0a dd  |...6.:..@.:..J..|
00000200  20 f2 61 73 73 0d 01 54  10 de 20 63 6f 64 65 25  | .ass..T.. code%|
00000210  20 31 30 32 34 0d 01 5e  15 e3 20 70 61 73 73 25  | 1024..^.. pass%|
00000220  3d 30 20 b8 20 32 20 88  20 32 0d 01 68 0c 50 25  |=0 . 2 . 2..h.P%|
00000230  3d 63 6f 64 65 25 0d 01  72 0e 5b 4f 50 54 20 70  |=code%..r.[OPT p|
00000240  61 73 73 25 0d 01 7c 05  3a 0d 01 86 0a 2e 73 65  |ass%..|.:.....se|
00000250  65 64 25 0d 01 90 2c 44  43 44 20 20 20 20 20 20  |ed%...,DCD      |
00000260  20 2d 31 20 20 20 20 20  20 20 20 3b 62 69 74 73  | -1        ;bits|
00000270  20 62 30 2d 62 33 31 20  6f 66 20 73 65 65 64 0d  | b0-b31 of seed.|
00000280  01 9a 3a 44 43 44 20 20  20 20 20 20 20 2d 31 20  |..:DCD       -1 |
00000290  20 20 20 20 20 20 20 3b  62 69 74 20 20 62 33 32  |       ;bit  b32|
000002a0  20 6f 66 20 73 65 65 64  20 28 69 6e 20 6c 73 62  | of seed (in lsb|
000002b0  20 6f 66 20 77 6f 72 64  29 0d 01 a4 05 3a 0d 01  | of word)....:..|
000002c0  ae 46 2e 72 6e 64 5f 67  61 75 73 73 25 20 20 20  |.F.rnd_gauss%   |
000002d0  20 20 20 20 20 20 3b 52  65 74 75 72 6e 73 20 36  |      ;Returns 6|
000002e0  35 35 33 36 20 2a 20 28  20 70 73 65 75 64 6f 20  |5536 * ( pseudo |
000002f0  72 61 6e 64 6f 6e 20 76  61 72 69 61 62 6c 65 20  |randon variable |
00000300  77 69 74 68 0d 01 b8 46  3a 20 20 20 20 20 20 20  |with...F:       |
00000310  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 20 20  |            ;   |
00000320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 61 70  |              ap|
00000330  70 72 6f 78 20 64 69 73  74 72 69 62 75 74 69 6f  |prox distributio|
00000340  6e 20 4e 28 30 2c 31 29  20 29 0d 01 c2 05 3a 0d  |n N(0,1) )....:.|
00000350  01 cc 45 3a 20 20 20 20  20 20 20 20 20 20 20 20  |..E:            |
00000360  20 20 20 20 20 20 20 3b  4e 42 20 54 68 65 20 61  |       ;NB The a|
00000370  70 70 72 6f 78 20 67 61  75 73 73 69 61 6e 20 64  |pprox gaussian d|
00000380  69 73 74 6e 20 69 73 20  61 63 68 69 65 76 65 64  |istn is achieved|
00000390  20 76 69 61 0d 01 d6 41  3a 20 20 20 20 20 20 20  | via...A:       |
000003a0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 20 20  |            ;   |
000003b0  74 68 65 20 73 75 6d 20  6f 66 20 6e 20 70 73 65  |the sum of n pse|
000003c0  75 64 6f 20 55 5b 30 2c  36 35 35 33 35 5d 20 72  |udo U[0,65535] r|
000003d0  61 6e 64 6f 6d 0d 01 e0  42 3a 20 20 20 20 20 20  |andom...B:      |
000003e0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 20  |             ;  |
000003f0  20 76 61 72 69 61 62 6c  65 73 20 26 20 61 70 70  | variables & app|
00000400  6c 69 63 61 74 69 6f 6e  20 6f 66 20 74 68 65 20  |lication of the |
00000410  63 65 6e 74 72 61 6c 0d  01 ea 2a 3a 20 20 20 20  |central...*:    |
00000420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00000430  20 20 20 6c 69 6d 69 74  20 74 68 65 6f 72 65 6d  |   limit theorem|
00000440  2e 0d 01 f4 46 3a 20 20  20 20 20 20 20 20 20 20  |....F:          |
00000450  20 20 20 20 20 20 20 20  20 3b 20 20 20 48 65 72  |         ;   Her|
00000460  65 20 77 65 20 75 73 65  20 6e 3d 38 2c 20 67 69  |e we use n=8, gi|
00000470  76 69 6e 67 20 61 6e 20  61 63 74 75 61 6c 20 72  |ving an actual r|
00000480  61 6e 67 65 20 6f 66 0d  01 fe 3f 3a 20 20 20 20  |ange of...?:    |
00000490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000004a0  20 20 20 2d 28 73 71 72  74 32 34 29 2a 36 35 35  |   -(sqrt24)*655|
000004b0  33 36 20 74 6f 20 2b 28  73 71 72 74 32 34 29 2a  |36 to +(sqrt24)*|
000004c0  36 35 35 33 36 2e 0d 02  08 43 3a 20 20 20 20 20  |65536....C:     |
000004d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000004e0  20 20 46 6f 72 20 67 65  6e 65 72 61 6c 20 6e 2c  |  For general n,|
000004f0  20 72 65 63 61 6c 6c 20  77 65 20 6e 65 65 64 20  | recall we need |
00000500  74 6f 20 72 65 74 75 72  6e 0d 02 12 42 3a 20 20  |to return...B:  |
00000510  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000520  20 3b 20 20 20 20 28 73  75 6d 20 6e 20 55 5b 30  | ;    (sum n U[0|
00000530  2c 36 35 35 33 35 5d 20  72 61 6e 64 6f 6d 20 76  |,65535] random v|
00000540  61 72 69 61 62 6c 65 73  29 20 2a 0d 02 1c 42 3a  |ariables) *...B:|
00000550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000560  20 20 20 3b 20 20 20 20  20 32 73 71 72 74 28 33  |   ;     2sqrt(3|
00000570  6e 29 2a 36 35 35 33 36  2f 28 36 35 35 33 35 6e  |n)*65536/(65535n|
00000580  29 20 20 20 20 20 20 20  20 20 20 20 2d 0d 02 26  |)           -..&|
00000590  2c 3a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |,:              |
000005a0  20 20 20 20 20 3b 20 20  20 20 20 73 71 72 74 28  |     ;     sqrt(|
000005b0  33 6e 29 2a 36 35 35 33  36 0d 02 30 05 3a 0d 02  |3n)*65536..0.:..|
000005c0  3a 16 41 44 52 20 20 20  20 20 20 20 30 2c 20 73  |:.ADR       0, s|
000005d0  65 65 64 25 0d 02 44 17  4c 44 4d 49 41 20 20 20  |eed%..D.LDMIA   |
000005e0  20 20 30 2c 20 7b 31 2c  20 32 7d 0d 02 4e 05 3a  |  0, {1, 2}..N.:|
000005f0  0d 02 58 1a 4d 4f 56 53  20 20 20 20 20 20 32 2c  |..X.MOVS      2,|
00000600  20 32 2c 20 4c 53 52 20  23 31 0d 02 62 17 4d 4f  | 2, LSR #1..b.MO|
00000610  56 53 20 20 20 20 20 20  33 2c 20 31 2c 20 52 52  |VS      3, 1, RR|
00000620  58 0d 02 6c 15 41 44 43  20 20 20 20 20 20 20 32  |X..l.ADC       2|
00000630  2c 20 32 2c 20 32 0d 02  76 1c 82 20 20 20 20 20  |, 2, 2..v..     |
00000640  20 20 33 2c 20 33 2c 20  31 2c 20 4c 53 4c 20 23  |  3, 3, 1, LSL #|
00000650  31 32 0d 02 80 1c 82 20  20 20 20 20 20 20 31 2c  |12.....       1,|
00000660  20 33 2c 20 33 2c 20 4c  53 52 20 23 32 30 0d 02  | 3, 3, LSR #20..|
00000670  8a 1b 4d 4f 56 20 20 20  20 20 20 20 34 2c 20 31  |..MOV       4, 1|
00000680  2c 20 4c 53 52 20 23 31  36 0d 02 94 1b 4d 4f 56  |, LSR #16....MOV|
00000690  20 20 20 20 20 20 20 33  2c 20 31 2c 20 4c 53 4c  |       3, 1, LSL|
000006a0  20 23 31 36 0d 02 9e 1e  41 44 44 20 20 20 20 20  | #16....ADD     |
000006b0  20 20 34 2c 20 34 2c 20  33 2c 20 4c 53 52 20 23  |  4, 4, 3, LSR #|
000006c0  31 36 0d 02 a8 05 3a 0d  02 b2 1a 4d 4f 56 53 20  |16....:....MOVS |
000006d0  20 20 20 20 20 32 2c 20  32 2c 20 4c 53 52 20 23  |     2, 2, LSR #|
000006e0  31 0d 02 bc 17 4d 4f 56  53 20 20 20 20 20 20 33  |1....MOVS      3|
000006f0  2c 20 31 2c 20 52 52 58  0d 02 c6 15 41 44 43 20  |, 1, RRX....ADC |
00000700  20 20 20 20 20 20 32 2c  20 32 2c 20 32 0d 02 d0  |      2, 2, 2...|
00000710  1c 82 20 20 20 20 20 20  20 33 2c 20 33 2c 20 31  |..       3, 3, 1|
00000720  2c 20 4c 53 4c 20 23 31  32 0d 02 da 1c 82 20 20  |, LSL #12.....  |
00000730  20 20 20 20 20 31 2c 20  33 2c 20 33 2c 20 4c 53  |     1, 3, 3, LS|
00000740  52 20 23 32 30 0d 02 e4  1e 41 44 44 20 20 20 20  |R #20....ADD    |
00000750  20 20 20 34 2c 20 34 2c  20 31 2c 20 4c 53 52 20  |   4, 4, 1, LSR |
00000760  23 31 36 0d 02 ee 1b 4d  4f 56 20 20 20 20 20 20  |#16....MOV      |
00000770  20 33 2c 20 31 2c 20 4c  53 4c 20 23 31 36 0d 02  | 3, 1, LSL #16..|
00000780  f8 1e 41 44 44 20 20 20  20 20 20 20 34 2c 20 34  |..ADD       4, 4|
00000790  2c 20 33 2c 20 4c 53 52  20 23 31 36 0d 03 02 05  |, 3, LSR #16....|
000007a0  3a 0d 03 0c 1a 4d 4f 56  53 20 20 20 20 20 20 32  |:....MOVS      2|
000007b0  2c 20 32 2c 20 4c 53 52  20 23 31 0d 03 16 17 4d  |, 2, LSR #1....M|
000007c0  4f 56 53 20 20 20 20 20  20 33 2c 20 31 2c 20 52  |OVS      3, 1, R|
000007d0  52 58 0d 03 20 15 41 44  43 20 20 20 20 20 20 20  |RX.. .ADC       |
000007e0  32 2c 20 32 2c 20 32 0d  03 2a 1c 82 20 20 20 20  |2, 2, 2..*..    |
000007f0  20 20 20 33 2c 20 33 2c  20 31 2c 20 4c 53 4c 20  |   3, 3, 1, LSL |
00000800  23 31 32 0d 03 34 1c 82  20 20 20 20 20 20 20 31  |#12..4..       1|
00000810  2c 20 33 2c 20 33 2c 20  4c 53 52 20 23 32 30 0d  |, 3, 3, LSR #20.|
00000820  03 3e 1e 41 44 44 20 20  20 20 20 20 20 34 2c 20  |.>.ADD       4, |
00000830  34 2c 20 31 2c 20 4c 53  52 20 23 31 36 0d 03 48  |4, 1, LSR #16..H|
00000840  1b 4d 4f 56 20 20 20 20  20 20 20 33 2c 20 31 2c  |.MOV       3, 1,|
00000850  20 4c 53 4c 20 23 31 36  0d 03 52 1e 41 44 44 20  | LSL #16..R.ADD |
00000860  20 20 20 20 20 20 34 2c  20 34 2c 20 33 2c 20 4c  |      4, 4, 3, L|
00000870  53 52 20 23 31 36 0d 03  5c 05 3a 0d 03 66 1a 4d  |SR #16..\.:..f.M|
00000880  4f 56 53 20 20 20 20 20  20 32 2c 20 32 2c 20 4c  |OVS      2, 2, L|
00000890  53 52 20 23 31 0d 03 70  17 4d 4f 56 53 20 20 20  |SR #1..p.MOVS   |
000008a0  20 20 20 33 2c 20 31 2c  20 52 52 58 0d 03 7a 15  |   3, 1, RRX..z.|
000008b0  41 44 43 20 20 20 20 20  20 20 32 2c 20 32 2c 20  |ADC       2, 2, |
000008c0  32 0d 03 84 1c 82 20 20  20 20 20 20 20 33 2c 20  |2.....       3, |
000008d0  33 2c 20 31 2c 20 4c 53  4c 20 23 31 32 0d 03 8e  |3, 1, LSL #12...|
000008e0  1c 82 20 20 20 20 20 20  20 31 2c 20 33 2c 20 33  |..       1, 3, 3|
000008f0  2c 20 4c 53 52 20 23 32  30 0d 03 98 1e 41 44 44  |, LSR #20....ADD|
00000900  20 20 20 20 20 20 20 34  2c 20 34 2c 20 31 2c 20  |       4, 4, 1, |
00000910  4c 53 52 20 23 31 36 0d  03 a2 1b 4d 4f 56 20 20  |LSR #16....MOV  |
00000920  20 20 20 20 20 33 2c 20  31 2c 20 4c 53 4c 20 23  |     3, 1, LSL #|
00000930  31 36 0d 03 ac 2f 41 44  44 20 20 20 20 20 20 20  |16.../ADD       |
00000940  34 2c 20 34 2c 20 33 2c  20 4c 53 52 20 23 31 36  |4, 4, 3, LSR #16|
00000950  20 20 20 20 3b 73 75 6d  20 6e 6f 77 20 69 6e 20  |    ;sum now in |
00000960  34 0d 03 b6 05 3a 0d 03  c0 17 53 54 4d 49 41 20  |4....:....STMIA |
00000970  20 20 20 20 30 2c 20 7b  31 2c 20 32 7d 0d 03 ca  |    0, {1, 2}...|
00000980  05 3a 0d 03 d4 1d 52 53  42 20 20 20 20 20 20 20  |.:....RSB       |
00000990  30 2c 20 34 2c 20 34 2c  20 41 53 4c 20 23 33 0d  |0, 4, 4, ASL #3.|
000009a0  03 de 1d 52 53 42 20 20  20 20 20 20 20 31 2c 20  |...RSB       1, |
000009b0  34 2c 20 34 2c 20 41 53  4c 20 23 32 0d 03 e8 1d  |4, 4, ASL #2....|
000009c0  41 44 44 20 20 20 20 20  20 20 30 2c 20 31 2c 20  |ADD       0, 1, |
000009d0  30 2c 20 41 53 4c 20 23  34 0d 03 f2 1d 41 44 44  |0, ASL #4....ADD|
000009e0  20 20 20 20 20 20 20 30  2c 20 30 2c 20 34 2c 20  |       0, 0, 4, |
000009f0  41 53 4c 20 23 39 0d 03  fc 1d 41 44 44 20 20 20  |ASL #9....ADD   |
00000a00  20 20 20 20 31 2c 20 34  2c 20 34 2c 20 41 53 4c  |    1, 4, 4, ASL|
00000a10  20 23 34 0d 04 06 1d 41  44 44 20 20 20 20 20 20  | #4....ADD      |
00000a20  20 31 2c 20 31 2c 20 34  2c 20 41 53 4c 20 23 36  | 1, 1, 4, ASL #6|
00000a30  0d 04 10 1e 41 44 44 20  20 20 20 20 20 20 30 2c  |....ADD       0,|
00000a40  20 30 2c 20 31 2c 20 4c  53 52 20 23 31 30 0d 04  | 0, 1, LSR #10..|
00000a50  1a 1a 4d 4f 56 20 20 20  20 20 20 20 30 2c 20 30  |..MOV       0, 0|
00000a60  2c 20 4c 53 52 20 23 39  0d 04 24 1b 53 55 42 20  |, LSR #9..$.SUB |
00000a70  20 20 20 20 20 20 30 2c  20 30 2c 20 23 26 34 45  |      0, 0, #&4E|
00000a80  30 30 30 0d 04 2e 1b 53  55 42 20 20 20 20 20 20  |000....SUB      |
00000a90  20 30 2c 20 30 2c 20 23  26 30 30 36 32 30 0d 04  | 0, 0, #&00620..|
00000aa0  38 1b 53 55 42 20 20 20  20 20 20 20 30 2c 20 30  |8.SUB       0, 0|
00000ab0  2c 20 23 26 30 30 30 30  34 0d 04 42 05 3a 0d 04  |, #&00004..B.:..|
00000ac0  4c 14 4d 4f 56 53 20 20  20 20 20 20 50 43 2c 20  |L.MOVS      PC, |
00000ad0  31 34 0d 04 56 05 3a 0d  04 60 05 5d 0d 04 6a 05  |14..V.:..`.]..j.|
00000ae0  ed 0d 04 74 05 e1 0d 04  7e 05 3a 0d 04 88 16 dd  |...t....~.:.....|
00000af0  20 f2 72 65 61 64 6d 6f  6e 69 74 6f 72 74 79 70  | .readmonitortyp|
00000b00  65 0d 04 92 22 c8 99 20  22 4f 53 5f 42 79 74 65  |e...".. "OS_Byte|
00000b10  22 2c 31 36 31 2c 31 33  33 20 b8 20 2c 2c 74 79  |",161,133 . ,,ty|
00000b20  70 65 25 0d 04 9c 1a 74  79 70 65 25 3d 28 74 79  |pe%....type%=(ty|
00000b30  70 65 25 20 80 20 31 32  29 20 81 20 34 0d 04 a6  |pe% . 12) . 4...|
00000b40  1c e7 20 74 79 70 65 25  3d 31 20 6d 6f 25 3d 31  |.. type%=1 mo%=1|
00000b50  38 20 8b 20 6d 6f 25 3d  30 0d 04 b0 05 e1 0d ff  |8 . mo%=0.......|
00000b60