Home » Archimedes archive » Acorn User » AU 1993-09.adf » !StarInfo_StarInfo » ElasticNet

ElasticNet

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 1993-09.adf » !StarInfo_StarInfo
Filename: ElasticNet
Read OK:
File size: 0E5C bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     >ElasticNet (Info1)
   20REM By  Mike Tipping
   30REM For 32-bit machines
   40REM (c) BAU September 1993
   50:
   60multiscan=FALSE
   70:
   80PROCinitialise
   90PROCassemble
  100PROCcycle
  110END
  120:
  130DEF PROCcycle
  140*POINTER 1
  150mouse=FALSE
  160REPEAT
  170 MOUSE mx,my,mz
  180 IF mz AND 4 THEN
  190  F%=mx
  200  G%=my
  210 ELSE
  220  F%=RND(1024)
  230  G%=RND(1024)
  240 ENDIF
  250 CALL network
  260UNTIL FALSE
  270ENDPROC
  280:
  290DEF PROCinitialise
  300size%  = 8
  310sigma2 = 4
  320eta    = 0.05
  330IF multiscan THEN
  340 MODE 28:MODE 27
  350ELSE
  360 MODE 15:MODE 12
  370ENDIF
  380ORIGIN 128,0
  390PRINT "Please Wait ...."
  400OFF
  410outputs% = size%^2
  420DIM weights% 4*outputs%*2
  430DIM metrics% 4*outputs%^2
  440FOR i%=0 TO 1
  450 FOR o%=0 TO outputs%-1
  460  weights%!(4*(o%+outputs%*i%)) = 26268+RND(13000)
  470 NEXT
  480NEXT
  490FOR n%=0 TO outputs%-1
  500 FOR m%=0 TO outputs%-1
  510  lambda = eta * EXP(-(((n% MOD size%)-(m% MOD size%))^2+((n% DIV size%)-(m% DIV size%))^2)/sigma2)
  520  metrics%!(4*(n%*outputs%+m%)) = lambda*65536
  530 NEXT
  540NEXT
  550FOR i%=1 TO 15
  560 COLOUR i%,15+i%*16,15+i%*16,256-i%*16
  570NEXT
  580ENDPROC
  590:
  600DEF PROCassemble
  610x=1
  620y=2
  630dx=3
  640dy=4
  650weight=10
  660index=11
  670metric=7
  680netx=3
  690nety=4
  700closest=1
  710distance=2
  720winner=9
  730input0=5
  740input1=6
  750lambda=12
  760vdu=256
  770:
  780DIM code% 1024
  790FOR pass%=0 TO 2 STEP 2
  800P%=code%
  810[OPT pass%
  820.wptr    EQUD weights%
  830.mptr    EQUD metrics%
  840.bank    EQUD 1
  850.network
  860        LDR    weight,wptr
  870        LDR    metric,mptr
  880        MOV    closest,#&70000000
  890        MOV    index,#(outputs%*2-1)
  900.winner_loop
  910        LDR    dy,[weight,index,LSL#2]
  920        SUB    dy,dy,input1,ASL#6
  930        SUB    index,index,#1
  940        LDR    dx,[weight,index,LSL#2]
  950        SUB    dx,dx,input0,ASL#6
  960        MUL    R12,dx,dx
  970        MOV    R12,R12,ASR#16
  980        MUL    R8,dy,dy
  990        ADD    distance,R12,R8,ASR#16
 1000        CMP    distance,closest
 1010        MOVLE  closest,distance
 1020        MOVLE  winner,index,LSR#1
 1030        SUBS   index,index,#1
 1040        BPL    winner_loop
 1050.draw_net
 1060        MOV    index,#0
 1070        MOV    R0,#112
 1080        LDR    R1,bank
 1090        RSB    R1,R1,#3
 1100        STR    R1,bank
 1110        SWI    "OS_Byte"
 1120        SWI    vdu+12
 1130        MOV    netx,#size%
 1140.loopx  MOV    nety,#size%
 1150.loopy  MOV    R8,#(outputs%/2)
 1160        MLA    R2,index,R8,winner
 1170        LDR    lambda,[metric,R2,LSL#2]
 1180        SWI    vdu+18
 1190        MOV    R0,#0
 1200        SWI    "OS_WriteC"
 1210        ADD    R0,nety,netx
 1220        SWI    "OS_WriteC"
 1230        MOV    R0,#85
 1240        CMP    nety,#size%
 1250        SUBEQ  R0,R0,#17
 1260        LDR    x,[weight,index,LSL#2]
 1270        RSB    R8,x,input0,ASL#6
 1280        MUL    R8,lambda,R8
 1290        ADD    R8,x,R8,ASR#16
 1300        STR    R8,[weight,index,LSL#2]
 1310        ADD    index,index,#1
 1320        LDR    y,[weight,index,LSL#2]
 1330        RSB    R8,y,input1,ASL#6
 1340        MUL    R8,lambda,R8
 1350        ADD    R8,y,R8,ASR#16
 1360        STR    R8,[weight,index,LSL#2]
 1370        CMP    netx,#1
 1380        BEQ    skip
 1390        MOV    x,x,ASR#6
 1400        MOV    y,y,ASR#6
 1410        SWI    "OS_Plot"
 1420        ADD    index,index,#(size%*2-1)
 1430        LDR    x,[weight,index,LSL#2]
 1440        MOV    x,x,ASR#6
 1450        ADD    index,index,#1
 1460        LDR    y,[weight,index,LSL#2]
 1470        MOV    y,y,ASR#6
 1480        SWI    "OS_Plot"
 1490        SUB    index,index,#(size%*2)
 1500.skip   ADD    index,index,#1
 1510        SUBS   nety,nety,#1
 1520        BNE    loopy
 1530        SUBS   netx,netx,#1
 1540        BNE    loopx
 1550
 1560        MOV    R0,#19
 1570        SWI    "OS_Byte"
 1580        MOV    R0,#113
 1590        LDR    R1,bank
 1600        SWI    "OS_Byte"
 1610        MOV    PC,R14
 1620
 1630]
 1640NEXT pass%
 1650ENDPROC

�     >ElasticNet (Info1)
� By  Mike Tipping
� For 32-bit machines
(� (c) BAU September 1993
2:
<multiscan=�
F:
P�initialise
Z
�assemble
d
�cycle
n�
x:
�� �cycle
�*POINTER 1
�mouse=�
��
� ȗ mx,my,mz
� � mz � 4 �
�  F%=mx
�  G%=my
� �
�  F%=�(1024)
�  G%=�(1024)
� �
� � network
� �
�
:
"� �initialise
,size%  = 8
6sigma2 = 4
@eta    = 0.05
J� multiscan �
T � 28:� 27
^�
h � 15:� 12
r�
|ȑ 128,0
�� "Please Wait ...."
��
�outputs% = size%^2
�� weights% 4*outputs%*2
�� metrics% 4*outputs%^2
�� i%=0 � 1
� � o%=0 � outputs%-1
�4  weights%!(4*(o%+outputs%*i%)) = 26268+�(13000)
� �
��
�� n%=0 � outputs%-1
� � m%=0 � outputs%-1
�]  lambda = eta * �(-(((n% � size%)-(m% � size%))^2+((n% � size%)-(m% � size%))^2)/sigma2)
2  metrics%!(4*(n%*outputs%+m%)) = lambda*65536
 �
�
&� i%=1 � 15
0% � i%,15+i%*16,15+i%*16,256-i%*16
:�
D�
N:
X� �assemble
bx=1
ly=2
vdx=3
�dy=4
�
weight=10
�index=11
�metric=7
�
netx=3
�
nety=4
�
closest=1
�distance=2
�winner=9
�input0=5
�input1=6
�
lambda=12
�vdu=256
:
� code% 1024
� pass%=0 � 2 � 2
 P%=code%
*[OPT pass%
4.wptr    EQUD weights%
>.mptr    EQUD metrics%
H.bank    EQUD 1
R.network
\        LDR    weight,wptr
f        LDR    metric,mptr
p%        MOV    closest,#&70000000
z(        MOV    index,#(outputs%*2-1)
�.winner_loop
�*        LDR    dy,[weight,index,LSL#2]
�%        SUB    dy,dy,input1,ASL#6
�!        SUB    index,index,#1
�*        LDR    dx,[weight,index,LSL#2]
�%        SUB    dx,dx,input0,ASL#6
�        MUL    R12,dx,dx
�!        MOV    R12,R12,ASR#16
�        MUL    R8,dy,dy
�)        ADD    distance,R12,R8,ASR#16
�#        CMP    distance,closest
�#        MOVLE  closest,distance
�%        MOVLE  winner,index,LSR#1
!        SUBS   index,index,#1
        BPL    winner_loop

.draw_net
$        MOV    index,#0
.        MOV    R0,#112
8        LDR    R1,bank
B        RSB    R1,R1,#3
L        STR    R1,bank
V        SWI    "OS_Byte"
`        SWI    vdu+12
j        MOV    netx,#size%
t.loopx  MOV    nety,#size%
~#.loopy  MOV    R8,#(outputs%/2)
�%        MLA    R2,index,R8,winner
�+        LDR    lambda,[metric,R2,LSL#2]
�        SWI    vdu+18
�        MOV    R0,#0
�        SWI    "OS_WriteC"
�        ADD    R0,nety,netx
�        SWI    "OS_WriteC"
�        MOV    R0,#85
�        CMP    nety,#size%
�        SUBEQ  R0,R0,#17
�)        LDR    x,[weight,index,LSL#2]
�$        RSB    R8,x,input0,ASL#6
        MUL    R8,lambda,R8

!        ADD    R8,x,R8,ASR#16
*        STR    R8,[weight,index,LSL#2]
!        ADD    index,index,#1
()        LDR    y,[weight,index,LSL#2]
2$        RSB    R8,y,input1,ASL#6
<        MUL    R8,lambda,R8
F!        ADD    R8,y,R8,ASR#16
P*        STR    R8,[weight,index,LSL#2]
Z        CMP    netx,#1
d        BEQ    skip
n        MOV    x,x,ASR#6
x        MOV    y,y,ASR#6
�        SWI    "OS_Plot"
�+        ADD    index,index,#(size%*2-1)
�)        LDR    x,[weight,index,LSL#2]
�        MOV    x,x,ASR#6
�!        ADD    index,index,#1
�)        LDR    y,[weight,index,LSL#2]
�        MOV    y,y,ASR#6
�        SWI    "OS_Plot"
�)        SUB    index,index,#(size%*2)
�!.skip   ADD    index,index,#1
�        SUBS   nety,nety,#1
�        BNE    loopy
�        SUBS   netx,netx,#1
        BNE    loopx

        MOV    R0,#19
"        SWI    "OS_Byte"
,        MOV    R0,#113
6        LDR    R1,bank
@        SWI    "OS_Byte"
J        MOV    PC,R14
T
^]
h� pass%
r�
�
00000000  0d 00 0a 1d f4 20 20 20  20 20 3e 45 6c 61 73 74  |.....     >Elast|
00000010  69 63 4e 65 74 20 28 49  6e 66 6f 31 29 0d 00 14  |icNet (Info1)...|
00000020  16 f4 20 42 79 20 20 4d  69 6b 65 20 54 69 70 70  |.. By  Mike Tipp|
00000030  69 6e 67 0d 00 1e 19 f4  20 46 6f 72 20 33 32 2d  |ing..... For 32-|
00000040  62 69 74 20 6d 61 63 68  69 6e 65 73 0d 00 28 1c  |bit machines..(.|
00000050  f4 20 28 63 29 20 42 41  55 20 53 65 70 74 65 6d  |. (c) BAU Septem|
00000060  62 65 72 20 31 39 39 33  0d 00 32 05 3a 0d 00 3c  |ber 1993..2.:..<|
00000070  0f 6d 75 6c 74 69 73 63  61 6e 3d a3 0d 00 46 05  |.multiscan=...F.|
00000080  3a 0d 00 50 0f f2 69 6e  69 74 69 61 6c 69 73 65  |:..P..initialise|
00000090  0d 00 5a 0d f2 61 73 73  65 6d 62 6c 65 0d 00 64  |..Z..assemble..d|
000000a0  0a f2 63 79 63 6c 65 0d  00 6e 05 e0 0d 00 78 05  |..cycle..n....x.|
000000b0  3a 0d 00 82 0c dd 20 f2  63 79 63 6c 65 0d 00 8c  |:..... .cycle...|
000000c0  0e 2a 50 4f 49 4e 54 45  52 20 31 0d 00 96 0b 6d  |.*POINTER 1....m|
000000d0  6f 75 73 65 3d a3 0d 00  a0 05 f5 0d 00 aa 10 20  |ouse=.......... |
000000e0  c8 97 20 6d 78 2c 6d 79  2c 6d 7a 0d 00 b4 0f 20  |.. mx,my,mz.... |
000000f0  e7 20 6d 7a 20 80 20 34  20 8c 0d 00 be 0b 20 20  |. mz . 4 .....  |
00000100  46 25 3d 6d 78 0d 00 c8  0b 20 20 47 25 3d 6d 79  |F%=mx....  G%=my|
00000110  0d 00 d2 06 20 cc 0d 00  dc 10 20 20 46 25 3d b3  |.... .....  F%=.|
00000120  28 31 30 32 34 29 0d 00  e6 10 20 20 47 25 3d b3  |(1024)....  G%=.|
00000130  28 31 30 32 34 29 0d 00  f0 06 20 cd 0d 00 fa 0e  |(1024).... .....|
00000140  20 d6 20 6e 65 74 77 6f  72 6b 0d 01 04 07 fd 20  | . network..... |
00000150  a3 0d 01 0e 05 e1 0d 01  18 05 3a 0d 01 22 11 dd  |..........:.."..|
00000160  20 f2 69 6e 69 74 69 61  6c 69 73 65 0d 01 2c 0e  | .initialise..,.|
00000170  73 69 7a 65 25 20 20 3d  20 38 0d 01 36 0e 73 69  |size%  = 8..6.si|
00000180  67 6d 61 32 20 3d 20 34  0d 01 40 11 65 74 61 20  |gma2 = 4..@.eta |
00000190  20 20 20 3d 20 30 2e 30  35 0d 01 4a 11 e7 20 6d  |   = 0.05..J.. m|
000001a0  75 6c 74 69 73 63 61 6e  20 8c 0d 01 54 0e 20 eb  |ultiscan ...T. .|
000001b0  20 32 38 3a eb 20 32 37  0d 01 5e 05 cc 0d 01 68  | 28:. 27..^....h|
000001c0  0e 20 eb 20 31 35 3a eb  20 31 32 0d 01 72 05 cd  |. . 15:. 12..r..|
000001d0  0d 01 7c 0c c8 91 20 31  32 38 2c 30 0d 01 86 18  |..|... 128,0....|
000001e0  f1 20 22 50 6c 65 61 73  65 20 57 61 69 74 20 2e  |. "Please Wait .|
000001f0  2e 2e 2e 22 0d 01 90 05  87 0d 01 9a 16 6f 75 74  |...".........out|
00000200  70 75 74 73 25 20 3d 20  73 69 7a 65 25 5e 32 0d  |puts% = size%^2.|
00000210  01 a4 1b de 20 77 65 69  67 68 74 73 25 20 34 2a  |.... weights% 4*|
00000220  6f 75 74 70 75 74 73 25  2a 32 0d 01 ae 1b de 20  |outputs%*2..... |
00000230  6d 65 74 72 69 63 73 25  20 34 2a 6f 75 74 70 75  |metrics% 4*outpu|
00000240  74 73 25 5e 32 0d 01 b8  0e e3 20 69 25 3d 30 20  |ts%^2..... i%=0 |
00000250  b8 20 31 0d 01 c2 18 20  e3 20 6f 25 3d 30 20 b8  |. 1.... . o%=0 .|
00000260  20 6f 75 74 70 75 74 73  25 2d 31 0d 01 cc 34 20  | outputs%-1...4 |
00000270  20 77 65 69 67 68 74 73  25 21 28 34 2a 28 6f 25  | weights%!(4*(o%|
00000280  2b 6f 75 74 70 75 74 73  25 2a 69 25 29 29 20 3d  |+outputs%*i%)) =|
00000290  20 32 36 32 36 38 2b b3  28 31 33 30 30 30 29 0d  | 26268+.(13000).|
000002a0  01 d6 06 20 ed 0d 01 e0  05 ed 0d 01 ea 17 e3 20  |... ........... |
000002b0  6e 25 3d 30 20 b8 20 6f  75 74 70 75 74 73 25 2d  |n%=0 . outputs%-|
000002c0  31 0d 01 f4 18 20 e3 20  6d 25 3d 30 20 b8 20 6f  |1.... . m%=0 . o|
000002d0  75 74 70 75 74 73 25 2d  31 0d 01 fe 5d 20 20 6c  |utputs%-1...]  l|
000002e0  61 6d 62 64 61 20 3d 20  65 74 61 20 2a 20 a1 28  |ambda = eta * .(|
000002f0  2d 28 28 28 6e 25 20 83  20 73 69 7a 65 25 29 2d  |-(((n% . size%)-|
00000300  28 6d 25 20 83 20 73 69  7a 65 25 29 29 5e 32 2b  |(m% . size%))^2+|
00000310  28 28 6e 25 20 81 20 73  69 7a 65 25 29 2d 28 6d  |((n% . size%)-(m|
00000320  25 20 81 20 73 69 7a 65  25 29 29 5e 32 29 2f 73  |% . size%))^2)/s|
00000330  69 67 6d 61 32 29 0d 02  08 32 20 20 6d 65 74 72  |igma2)...2  metr|
00000340  69 63 73 25 21 28 34 2a  28 6e 25 2a 6f 75 74 70  |ics%!(4*(n%*outp|
00000350  75 74 73 25 2b 6d 25 29  29 20 3d 20 6c 61 6d 62  |uts%+m%)) = lamb|
00000360  64 61 2a 36 35 35 33 36  0d 02 12 06 20 ed 0d 02  |da*65536.... ...|
00000370  1c 05 ed 0d 02 26 0f e3  20 69 25 3d 31 20 b8 20  |.....&.. i%=1 . |
00000380  31 35 0d 02 30 25 20 fb  20 69 25 2c 31 35 2b 69  |15..0% . i%,15+i|
00000390  25 2a 31 36 2c 31 35 2b  69 25 2a 31 36 2c 32 35  |%*16,15+i%*16,25|
000003a0  36 2d 69 25 2a 31 36 0d  02 3a 05 ed 0d 02 44 05  |6-i%*16..:....D.|
000003b0  e1 0d 02 4e 05 3a 0d 02  58 0f dd 20 f2 61 73 73  |...N.:..X.. .ass|
000003c0  65 6d 62 6c 65 0d 02 62  07 78 3d 31 0d 02 6c 07  |emble..b.x=1..l.|
000003d0  79 3d 32 0d 02 76 08 64  78 3d 33 0d 02 80 08 64  |y=2..v.dx=3....d|
000003e0  79 3d 34 0d 02 8a 0d 77  65 69 67 68 74 3d 31 30  |y=4....weight=10|
000003f0  0d 02 94 0c 69 6e 64 65  78 3d 31 31 0d 02 9e 0c  |....index=11....|
00000400  6d 65 74 72 69 63 3d 37  0d 02 a8 0a 6e 65 74 78  |metric=7....netx|
00000410  3d 33 0d 02 b2 0a 6e 65  74 79 3d 34 0d 02 bc 0d  |=3....nety=4....|
00000420  63 6c 6f 73 65 73 74 3d  31 0d 02 c6 0e 64 69 73  |closest=1....dis|
00000430  74 61 6e 63 65 3d 32 0d  02 d0 0c 77 69 6e 6e 65  |tance=2....winne|
00000440  72 3d 39 0d 02 da 0c 69  6e 70 75 74 30 3d 35 0d  |r=9....input0=5.|
00000450  02 e4 0c 69 6e 70 75 74  31 3d 36 0d 02 ee 0d 6c  |...input1=6....l|
00000460  61 6d 62 64 61 3d 31 32  0d 02 f8 0b 76 64 75 3d  |ambda=12....vdu=|
00000470  32 35 36 0d 03 02 05 3a  0d 03 0c 10 de 20 63 6f  |256....:..... co|
00000480  64 65 25 20 31 30 32 34  0d 03 16 15 e3 20 70 61  |de% 1024..... pa|
00000490  73 73 25 3d 30 20 b8 20  32 20 88 20 32 0d 03 20  |ss%=0 . 2 . 2.. |
000004a0  0c 50 25 3d 63 6f 64 65  25 0d 03 2a 0e 5b 4f 50  |.P%=code%..*.[OP|
000004b0  54 20 70 61 73 73 25 0d  03 34 1a 2e 77 70 74 72  |T pass%..4..wptr|
000004c0  20 20 20 20 45 51 55 44  20 77 65 69 67 68 74 73  |    EQUD weights|
000004d0  25 0d 03 3e 1a 2e 6d 70  74 72 20 20 20 20 45 51  |%..>..mptr    EQ|
000004e0  55 44 20 6d 65 74 72 69  63 73 25 0d 03 48 13 2e  |UD metrics%..H..|
000004f0  62 61 6e 6b 20 20 20 20  45 51 55 44 20 31 0d 03  |bank    EQUD 1..|
00000500  52 0c 2e 6e 65 74 77 6f  72 6b 0d 03 5c 1e 20 20  |R..network..\.  |
00000510  20 20 20 20 20 20 4c 44  52 20 20 20 20 77 65 69  |      LDR    wei|
00000520  67 68 74 2c 77 70 74 72  0d 03 66 1e 20 20 20 20  |ght,wptr..f.    |
00000530  20 20 20 20 4c 44 52 20  20 20 20 6d 65 74 72 69  |    LDR    metri|
00000540  63 2c 6d 70 74 72 0d 03  70 25 20 20 20 20 20 20  |c,mptr..p%      |
00000550  20 20 4d 4f 56 20 20 20  20 63 6c 6f 73 65 73 74  |  MOV    closest|
00000560  2c 23 26 37 30 30 30 30  30 30 30 0d 03 7a 28 20  |,#&70000000..z( |
00000570  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 69 6e  |       MOV    in|
00000580  64 65 78 2c 23 28 6f 75  74 70 75 74 73 25 2a 32  |dex,#(outputs%*2|
00000590  2d 31 29 0d 03 84 10 2e  77 69 6e 6e 65 72 5f 6c  |-1).....winner_l|
000005a0  6f 6f 70 0d 03 8e 2a 20  20 20 20 20 20 20 20 4c  |oop...*        L|
000005b0  44 52 20 20 20 20 64 79  2c 5b 77 65 69 67 68 74  |DR    dy,[weight|
000005c0  2c 69 6e 64 65 78 2c 4c  53 4c 23 32 5d 0d 03 98  |,index,LSL#2]...|
000005d0  25 20 20 20 20 20 20 20  20 53 55 42 20 20 20 20  |%        SUB    |
000005e0  64 79 2c 64 79 2c 69 6e  70 75 74 31 2c 41 53 4c  |dy,dy,input1,ASL|
000005f0  23 36 0d 03 a2 21 20 20  20 20 20 20 20 20 53 55  |#6...!        SU|
00000600  42 20 20 20 20 69 6e 64  65 78 2c 69 6e 64 65 78  |B    index,index|
00000610  2c 23 31 0d 03 ac 2a 20  20 20 20 20 20 20 20 4c  |,#1...*        L|
00000620  44 52 20 20 20 20 64 78  2c 5b 77 65 69 67 68 74  |DR    dx,[weight|
00000630  2c 69 6e 64 65 78 2c 4c  53 4c 23 32 5d 0d 03 b6  |,index,LSL#2]...|
00000640  25 20 20 20 20 20 20 20  20 53 55 42 20 20 20 20  |%        SUB    |
00000650  64 78 2c 64 78 2c 69 6e  70 75 74 30 2c 41 53 4c  |dx,dx,input0,ASL|
00000660  23 36 0d 03 c0 1c 20 20  20 20 20 20 20 20 4d 55  |#6....        MU|
00000670  4c 20 20 20 20 52 31 32  2c 64 78 2c 64 78 0d 03  |L    R12,dx,dx..|
00000680  ca 21 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |.!        MOV   |
00000690  20 52 31 32 2c 52 31 32  2c 41 53 52 23 31 36 0d  | R12,R12,ASR#16.|
000006a0  03 d4 1b 20 20 20 20 20  20 20 20 4d 55 4c 20 20  |...        MUL  |
000006b0  20 20 52 38 2c 64 79 2c  64 79 0d 03 de 29 20 20  |  R8,dy,dy...)  |
000006c0  20 20 20 20 20 20 41 44  44 20 20 20 20 64 69 73  |      ADD    dis|
000006d0  74 61 6e 63 65 2c 52 31  32 2c 52 38 2c 41 53 52  |tance,R12,R8,ASR|
000006e0  23 31 36 0d 03 e8 23 20  20 20 20 20 20 20 20 43  |#16...#        C|
000006f0  4d 50 20 20 20 20 64 69  73 74 61 6e 63 65 2c 63  |MP    distance,c|
00000700  6c 6f 73 65 73 74 0d 03  f2 23 20 20 20 20 20 20  |losest...#      |
00000710  20 20 4d 4f 56 4c 45 20  20 63 6c 6f 73 65 73 74  |  MOVLE  closest|
00000720  2c 64 69 73 74 61 6e 63  65 0d 03 fc 25 20 20 20  |,distance...%   |
00000730  20 20 20 20 20 4d 4f 56  4c 45 20 20 77 69 6e 6e  |     MOVLE  winn|
00000740  65 72 2c 69 6e 64 65 78  2c 4c 53 52 23 31 0d 04  |er,index,LSR#1..|
00000750  06 21 20 20 20 20 20 20  20 20 53 55 42 53 20 20  |.!        SUBS  |
00000760  20 69 6e 64 65 78 2c 69  6e 64 65 78 2c 23 31 0d  | index,index,#1.|
00000770  04 10 1e 20 20 20 20 20  20 20 20 42 50 4c 20 20  |...        BPL  |
00000780  20 20 77 69 6e 6e 65 72  5f 6c 6f 6f 70 0d 04 1a  |  winner_loop...|
00000790  0d 2e 64 72 61 77 5f 6e  65 74 0d 04 24 1b 20 20  |..draw_net..$.  |
000007a0  20 20 20 20 20 20 4d 4f  56 20 20 20 20 69 6e 64  |      MOV    ind|
000007b0  65 78 2c 23 30 0d 04 2e  1a 20 20 20 20 20 20 20  |ex,#0....       |
000007c0  20 4d 4f 56 20 20 20 20  52 30 2c 23 31 31 32 0d  | MOV    R0,#112.|
000007d0  04 38 1a 20 20 20 20 20  20 20 20 4c 44 52 20 20  |.8.        LDR  |
000007e0  20 20 52 31 2c 62 61 6e  6b 0d 04 42 1b 20 20 20  |  R1,bank..B.   |
000007f0  20 20 20 20 20 52 53 42  20 20 20 20 52 31 2c 52  |     RSB    R1,R|
00000800  31 2c 23 33 0d 04 4c 1a  20 20 20 20 20 20 20 20  |1,#3..L.        |
00000810  53 54 52 20 20 20 20 52  31 2c 62 61 6e 6b 0d 04  |STR    R1,bank..|
00000820  56 1c 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |V.        SWI   |
00000830  20 22 4f 53 5f 42 79 74  65 22 0d 04 60 19 20 20  | "OS_Byte"..`.  |
00000840  20 20 20 20 20 20 53 57  49 20 20 20 20 76 64 75  |      SWI    vdu|
00000850  2b 31 32 0d 04 6a 1e 20  20 20 20 20 20 20 20 4d  |+12..j.        M|
00000860  4f 56 20 20 20 20 6e 65  74 78 2c 23 73 69 7a 65  |OV    netx,#size|
00000870  25 0d 04 74 1e 2e 6c 6f  6f 70 78 20 20 4d 4f 56  |%..t..loopx  MOV|
00000880  20 20 20 20 6e 65 74 79  2c 23 73 69 7a 65 25 0d  |    nety,#size%.|
00000890  04 7e 23 2e 6c 6f 6f 70  79 20 20 4d 4f 56 20 20  |.~#.loopy  MOV  |
000008a0  20 20 52 38 2c 23 28 6f  75 74 70 75 74 73 25 2f  |  R8,#(outputs%/|
000008b0  32 29 0d 04 88 25 20 20  20 20 20 20 20 20 4d 4c  |2)...%        ML|
000008c0  41 20 20 20 20 52 32 2c  69 6e 64 65 78 2c 52 38  |A    R2,index,R8|
000008d0  2c 77 69 6e 6e 65 72 0d  04 92 2b 20 20 20 20 20  |,winner...+     |
000008e0  20 20 20 4c 44 52 20 20  20 20 6c 61 6d 62 64 61  |   LDR    lambda|
000008f0  2c 5b 6d 65 74 72 69 63  2c 52 32 2c 4c 53 4c 23  |,[metric,R2,LSL#|
00000900  32 5d 0d 04 9c 19 20 20  20 20 20 20 20 20 53 57  |2]....        SW|
00000910  49 20 20 20 20 76 64 75  2b 31 38 0d 04 a6 18 20  |I    vdu+18.... |
00000920  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 52 30  |       MOV    R0|
00000930  2c 23 30 0d 04 b0 1e 20  20 20 20 20 20 20 20 53  |,#0....        S|
00000940  57 49 20 20 20 20 22 4f  53 5f 57 72 69 74 65 43  |WI    "OS_WriteC|
00000950  22 0d 04 ba 1f 20 20 20  20 20 20 20 20 41 44 44  |"....        ADD|
00000960  20 20 20 20 52 30 2c 6e  65 74 79 2c 6e 65 74 78  |    R0,nety,netx|
00000970  0d 04 c4 1e 20 20 20 20  20 20 20 20 53 57 49 20  |....        SWI |
00000980  20 20 20 22 4f 53 5f 57  72 69 74 65 43 22 0d 04  |   "OS_WriteC"..|
00000990  ce 19 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |..        MOV   |
000009a0  20 52 30 2c 23 38 35 0d  04 d8 1e 20 20 20 20 20  | R0,#85....     |
000009b0  20 20 20 43 4d 50 20 20  20 20 6e 65 74 79 2c 23  |   CMP    nety,#|
000009c0  73 69 7a 65 25 0d 04 e2  1c 20 20 20 20 20 20 20  |size%....       |
000009d0  20 53 55 42 45 51 20 20  52 30 2c 52 30 2c 23 31  | SUBEQ  R0,R0,#1|
000009e0  37 0d 04 ec 29 20 20 20  20 20 20 20 20 4c 44 52  |7...)        LDR|
000009f0  20 20 20 20 78 2c 5b 77  65 69 67 68 74 2c 69 6e  |    x,[weight,in|
00000a00  64 65 78 2c 4c 53 4c 23  32 5d 0d 04 f6 24 20 20  |dex,LSL#2]...$  |
00000a10  20 20 20 20 20 20 52 53  42 20 20 20 20 52 38 2c  |      RSB    R8,|
00000a20  78 2c 69 6e 70 75 74 30  2c 41 53 4c 23 36 0d 05  |x,input0,ASL#6..|
00000a30  00 1f 20 20 20 20 20 20  20 20 4d 55 4c 20 20 20  |..        MUL   |
00000a40  20 52 38 2c 6c 61 6d 62  64 61 2c 52 38 0d 05 0a  | R8,lambda,R8...|
00000a50  21 20 20 20 20 20 20 20  20 41 44 44 20 20 20 20  |!        ADD    |
00000a60  52 38 2c 78 2c 52 38 2c  41 53 52 23 31 36 0d 05  |R8,x,R8,ASR#16..|
00000a70  14 2a 20 20 20 20 20 20  20 20 53 54 52 20 20 20  |.*        STR   |
00000a80  20 52 38 2c 5b 77 65 69  67 68 74 2c 69 6e 64 65  | R8,[weight,inde|
00000a90  78 2c 4c 53 4c 23 32 5d  0d 05 1e 21 20 20 20 20  |x,LSL#2]...!    |
00000aa0  20 20 20 20 41 44 44 20  20 20 20 69 6e 64 65 78  |    ADD    index|
00000ab0  2c 69 6e 64 65 78 2c 23  31 0d 05 28 29 20 20 20  |,index,#1..()   |
00000ac0  20 20 20 20 20 4c 44 52  20 20 20 20 79 2c 5b 77  |     LDR    y,[w|
00000ad0  65 69 67 68 74 2c 69 6e  64 65 78 2c 4c 53 4c 23  |eight,index,LSL#|
00000ae0  32 5d 0d 05 32 24 20 20  20 20 20 20 20 20 52 53  |2]..2$        RS|
00000af0  42 20 20 20 20 52 38 2c  79 2c 69 6e 70 75 74 31  |B    R8,y,input1|
00000b00  2c 41 53 4c 23 36 0d 05  3c 1f 20 20 20 20 20 20  |,ASL#6..<.      |
00000b10  20 20 4d 55 4c 20 20 20  20 52 38 2c 6c 61 6d 62  |  MUL    R8,lamb|
00000b20  64 61 2c 52 38 0d 05 46  21 20 20 20 20 20 20 20  |da,R8..F!       |
00000b30  20 41 44 44 20 20 20 20  52 38 2c 79 2c 52 38 2c  | ADD    R8,y,R8,|
00000b40  41 53 52 23 31 36 0d 05  50 2a 20 20 20 20 20 20  |ASR#16..P*      |
00000b50  20 20 53 54 52 20 20 20  20 52 38 2c 5b 77 65 69  |  STR    R8,[wei|
00000b60  67 68 74 2c 69 6e 64 65  78 2c 4c 53 4c 23 32 5d  |ght,index,LSL#2]|
00000b70  0d 05 5a 1a 20 20 20 20  20 20 20 20 43 4d 50 20  |..Z.        CMP |
00000b80  20 20 20 6e 65 74 78 2c  23 31 0d 05 64 17 20 20  |   netx,#1..d.  |
00000b90  20 20 20 20 20 20 42 45  51 20 20 20 20 73 6b 69  |      BEQ    ski|
00000ba0  70 0d 05 6e 1c 20 20 20  20 20 20 20 20 4d 4f 56  |p..n.        MOV|
00000bb0  20 20 20 20 78 2c 78 2c  41 53 52 23 36 0d 05 78  |    x,x,ASR#6..x|
00000bc0  1c 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |.        MOV    |
00000bd0  79 2c 79 2c 41 53 52 23  36 0d 05 82 1c 20 20 20  |y,y,ASR#6....   |
00000be0  20 20 20 20 20 53 57 49  20 20 20 20 22 4f 53 5f  |     SWI    "OS_|
00000bf0  50 6c 6f 74 22 0d 05 8c  2b 20 20 20 20 20 20 20  |Plot"...+       |
00000c00  20 41 44 44 20 20 20 20  69 6e 64 65 78 2c 69 6e  | ADD    index,in|
00000c10  64 65 78 2c 23 28 73 69  7a 65 25 2a 32 2d 31 29  |dex,#(size%*2-1)|
00000c20  0d 05 96 29 20 20 20 20  20 20 20 20 4c 44 52 20  |...)        LDR |
00000c30  20 20 20 78 2c 5b 77 65  69 67 68 74 2c 69 6e 64  |   x,[weight,ind|
00000c40  65 78 2c 4c 53 4c 23 32  5d 0d 05 a0 1c 20 20 20  |ex,LSL#2]....   |
00000c50  20 20 20 20 20 4d 4f 56  20 20 20 20 78 2c 78 2c  |     MOV    x,x,|
00000c60  41 53 52 23 36 0d 05 aa  21 20 20 20 20 20 20 20  |ASR#6...!       |
00000c70  20 41 44 44 20 20 20 20  69 6e 64 65 78 2c 69 6e  | ADD    index,in|
00000c80  64 65 78 2c 23 31 0d 05  b4 29 20 20 20 20 20 20  |dex,#1...)      |
00000c90  20 20 4c 44 52 20 20 20  20 79 2c 5b 77 65 69 67  |  LDR    y,[weig|
00000ca0  68 74 2c 69 6e 64 65 78  2c 4c 53 4c 23 32 5d 0d  |ht,index,LSL#2].|
00000cb0  05 be 1c 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |...        MOV  |
00000cc0  20 20 79 2c 79 2c 41 53  52 23 36 0d 05 c8 1c 20  |  y,y,ASR#6.... |
00000cd0  20 20 20 20 20 20 20 53  57 49 20 20 20 20 22 4f  |       SWI    "O|
00000ce0  53 5f 50 6c 6f 74 22 0d  05 d2 29 20 20 20 20 20  |S_Plot"...)     |
00000cf0  20 20 20 53 55 42 20 20  20 20 69 6e 64 65 78 2c  |   SUB    index,|
00000d00  69 6e 64 65 78 2c 23 28  73 69 7a 65 25 2a 32 29  |index,#(size%*2)|
00000d10  0d 05 dc 21 2e 73 6b 69  70 20 20 20 41 44 44 20  |...!.skip   ADD |
00000d20  20 20 20 69 6e 64 65 78  2c 69 6e 64 65 78 2c 23  |   index,index,#|
00000d30  31 0d 05 e6 1f 20 20 20  20 20 20 20 20 53 55 42  |1....        SUB|
00000d40  53 20 20 20 6e 65 74 79  2c 6e 65 74 79 2c 23 31  |S   nety,nety,#1|
00000d50  0d 05 f0 18 20 20 20 20  20 20 20 20 42 4e 45 20  |....        BNE |
00000d60  20 20 20 6c 6f 6f 70 79  0d 05 fa 1f 20 20 20 20  |   loopy....    |
00000d70  20 20 20 20 53 55 42 53  20 20 20 6e 65 74 78 2c  |    SUBS   netx,|
00000d80  6e 65 74 78 2c 23 31 0d  06 04 18 20 20 20 20 20  |netx,#1....     |
00000d90  20 20 20 42 4e 45 20 20  20 20 6c 6f 6f 70 78 0d  |   BNE    loopx.|
00000da0  06 0e 04 0d 06 18 19 20  20 20 20 20 20 20 20 4d  |.......        M|
00000db0  4f 56 20 20 20 20 52 30  2c 23 31 39 0d 06 22 1c  |OV    R0,#19..".|
00000dc0  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 22  |        SWI    "|
00000dd0  4f 53 5f 42 79 74 65 22  0d 06 2c 1a 20 20 20 20  |OS_Byte"..,.    |
00000de0  20 20 20 20 4d 4f 56 20  20 20 20 52 30 2c 23 31  |    MOV    R0,#1|
00000df0  31 33 0d 06 36 1a 20 20  20 20 20 20 20 20 4c 44  |13..6.        LD|
00000e00  52 20 20 20 20 52 31 2c  62 61 6e 6b 0d 06 40 1c  |R    R1,bank..@.|
00000e10  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 22  |        SWI    "|
00000e20  4f 53 5f 42 79 74 65 22  0d 06 4a 19 20 20 20 20  |OS_Byte"..J.    |
00000e30  20 20 20 20 4d 4f 56 20  20 20 20 50 43 2c 52 31  |    MOV    PC,R1|
00000e40  34 0d 06 54 04 0d 06 5e  05 5d 0d 06 68 0b ed 20  |4..T...^.]..h.. |
00000e50  70 61 73 73 25 0d 06 72  05 e1 0d ff              |pass%..r....|
00000e5c