Home » Archimedes archive » Acorn User » AU 1993-06.adf » !ArmCode_ArmCode » Arm1

Arm1

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-06.adf » !ArmCode_ArmCode
Filename: Arm1
Read OK:
File size: 0184 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     >Arm1
   20REM By  Dave Lawrence
   30REM For 32-bit machines
   40REM (c) BAU June 1993
   50:
   60bits=8
   70mult=1<<bits
   80:
   90DIM code 1000
  100link=14:pc=15
  110FOR pass=0 TO 2 STEP 2
  120P%=code
  130[OPT pass
  140        MUL     R0,R1,R0
  150        MOV     R0,R0,ASR #bits
  160        MOV     pc,link
  170]
  180NEXT
  190REPEAT
  200 INPUT "Two numbers: "A,B
  210 A%=A*mult
  220 B%=B*mult
  230 PRINT USR(code)/mult,A*B
  240UNTIL FALSE

�     >Arm1
� By  Dave Lawrence
� For 32-bit machines
(� (c) BAU June 1993
2:
<
bits=8
Fmult=1<<bits
P:
Z� code 1000
dlink=14:pc=15
n� pass=0 � 2 � 2
xP%=code
�
[OPT pass
�        MUL     R0,R1,R0
�#        MOV     R0,R0,ASR #bits
�        MOV     pc,link
�]
��
��
� � "Two numbers: "A,B
� A%=A*mult
� B%=B*mult
� � �(code)/mult,A*B
�� �
�
00000000  0d 00 0a 0f f4 20 20 20  20 20 3e 41 72 6d 31 0d  |.....     >Arm1.|
00000010  00 14 17 f4 20 42 79 20  20 44 61 76 65 20 4c 61  |.... By  Dave La|
00000020  77 72 65 6e 63 65 0d 00  1e 19 f4 20 46 6f 72 20  |wrence..... For |
00000030  33 32 2d 62 69 74 20 6d  61 63 68 69 6e 65 73 0d  |32-bit machines.|
00000040  00 28 17 f4 20 28 63 29  20 42 41 55 20 4a 75 6e  |.(.. (c) BAU Jun|
00000050  65 20 31 39 39 33 0d 00  32 05 3a 0d 00 3c 0a 62  |e 1993..2.:..<.b|
00000060  69 74 73 3d 38 0d 00 46  10 6d 75 6c 74 3d 31 3c  |its=8..F.mult=1<|
00000070  3c 62 69 74 73 0d 00 50  05 3a 0d 00 5a 0f de 20  |<bits..P.:..Z.. |
00000080  63 6f 64 65 20 31 30 30  30 0d 00 64 11 6c 69 6e  |code 1000..d.lin|
00000090  6b 3d 31 34 3a 70 63 3d  31 35 0d 00 6e 14 e3 20  |k=14:pc=15..n.. |
000000a0  70 61 73 73 3d 30 20 b8  20 32 20 88 20 32 0d 00  |pass=0 . 2 . 2..|
000000b0  78 0b 50 25 3d 63 6f 64  65 0d 00 82 0d 5b 4f 50  |x.P%=code....[OP|
000000c0  54 20 70 61 73 73 0d 00  8c 1c 20 20 20 20 20 20  |T pass....      |
000000d0  20 20 4d 55 4c 20 20 20  20 20 52 30 2c 52 31 2c  |  MUL     R0,R1,|
000000e0  52 30 0d 00 96 23 20 20  20 20 20 20 20 20 4d 4f  |R0...#        MO|
000000f0  56 20 20 20 20 20 52 30  2c 52 30 2c 41 53 52 20  |V     R0,R0,ASR |
00000100  23 62 69 74 73 0d 00 a0  1b 20 20 20 20 20 20 20  |#bits....       |
00000110  20 4d 4f 56 20 20 20 20  20 70 63 2c 6c 69 6e 6b  | MOV     pc,link|
00000120  0d 00 aa 05 5d 0d 00 b4  05 ed 0d 00 be 05 f5 0d  |....]...........|
00000130  00 c8 19 20 e8 20 22 54  77 6f 20 6e 75 6d 62 65  |... . "Two numbe|
00000140  72 73 3a 20 22 41 2c 42  0d 00 d2 0e 20 41 25 3d  |rs: "A,B.... A%=|
00000150  41 2a 6d 75 6c 74 0d 00  dc 0e 20 42 25 3d 42 2a  |A*mult.... B%=B*|
00000160  6d 75 6c 74 0d 00 e6 17  20 f1 20 ba 28 63 6f 64  |mult.... . .(cod|
00000170  65 29 2f 6d 75 6c 74 2c  41 2a 42 0d 00 f0 07 fd  |e)/mult,A*B.....|
00000180  20 a3 0d ff                                       | ...|
00000184