Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92 » !AWJan92/Goodies/ArcAut/Misc/makecode

!AWJan92/Goodies/ArcAut/Misc/makecode

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 » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92
Filename: !AWJan92/Goodies/ArcAut/Misc/makecode
Read OK:
File size: 0570 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >makecode
   20REM
   30mem%=1024
   40DIM code% mem%
   50L%=code%+mem%
   60FOR pass%=8 TO 10 STEP 2
   70P%=code%
   80[OPT pass%
   90.aseed:EQUD &FFFFFFFF
  100.soup
  110STMFD R13!,{R14}
  120MOV R14,R0:MOV R12,R3
  130ADR R0,arvbl:ADR R1,awvbl
  140SWI "OS_ReadVduVariables"
  150ADR R0,anamesy:ADR R1,asuy:MOV R2,#4:MOV R3,#0:MOV R4,#0
  160SWI "OS_ReadVarVal"
  170ADR R0,anamesx:ADR R1,asux:MOV R2,#4:MOV R3,#0:MOV R4,#0
  180SWI "OS_ReadVarVal"
  190MOV R0,R14:MOV R3,R12
  200LDR R1,awvbl
  210LDR R2,asuy:LDR R4,asux
  220SUB R1,R1,#192
  230ADD R4,R4,#1:ADD R1,R1,R4,ASR #1
  240MOV R5,R2,ASR #1:ADD R5,R5,#128
  250ADD R1,R1,R5,ASL #8:ADD R1,R1,R5,ASL #6
  260SUB R2,R2,#1
  270LDR R5,axor
  280LDR R4,aseed
  290.soupnrow
  300LDR R8,asux:SUB R8,R8,#1
  310.soupncol:]
  320FOR q%=1 TO 16
  330[OPT pass%:MOVS R4,R4,LSL #1:EORCC R4,R4,R5:]
  340NEXT
  350[OPT pass%
  360CMP R6,R4,LSR #16:BLE plotdone:]
  370FOR q%=1 TO 16
  380[OPT pass%:MOVS R4,R4,LSL #1:EORCC R4,R4,R5:]
  390NEXT
  400[OPT pass%
  410MOV R12,R4,LSR #16
  420MUL R12,R0,R12
  430ADD R12,R3,R12,LSR #16
  440STRB R12,[R1]
  450.plotdone
  460SUB R1,R1,#1
  470SUBS R8,R8,#1
  480BPL soupncol
  490SUB R1,R1,#320
  500LDR R14,asux
  510ADD R1,R1,R14
  520SUBS R2,R2,#1
  530BPL soupnrow
  540LDMFD R13!,{PC}
  550.axor:EQUD &ED6AA7
  560.arvbl:EQUD 148:EQUD -1
  570.awvbl:EQUD0
  580.anamesy:EQUS "suy"+CHR$0:ALIGN
  590.anamesx:EQUS "sux"+CHR$0:ALIGN
  600.asuy:EQUD0
  610.asux:EQUD0
  620]
  630NEXT
  640SYS "OS_File",&0A,"<ArcAut$Dir>.code",&FFD,,code%,P%

� >makecode
�

mem%=1024
(� code% mem%
2L%=code%+mem%
<� pass%=8 � 10 � 2
FP%=code%
P[OPT pass%
Z.aseed:EQUD &FFFFFFFF
d	.soup
nSTMFD R13!,{R14}
xMOV R14,R0:MOV R12,R3
�ADR R0,arvbl:ADR R1,awvbl
�SWI "OS_ReadVduVariables"
�<ADR R0,anamesy:ADR R1,asuy:MOV R2,#4:MOV R3,#0:MOV R4,#0
�SWI "OS_ReadVarVal"
�<ADR R0,anamesx:ADR R1,asux:MOV R2,#4:MOV R3,#0:MOV R4,#0
�SWI "OS_ReadVarVal"
�MOV R0,R14:MOV R3,R12
�LDR R1,awvbl
�LDR R2,asuy:LDR R4,asux
�SUB R1,R1,#192
�$ADD R4,R4,#1:ADD R1,R1,R4,ASR #1
�#MOV R5,R2,ASR #1:ADD R5,R5,#128
�+ADD R1,R1,R5,ASL #8:ADD R1,R1,R5,ASL #6
SUB R2,R2,#1
LDR R5,axor
LDR R4,aseed
"
.soupnrow
,LDR R8,asux:SUB R8,R8,#1
6.soupncol:]
@� q%=1 � 16
J/[OPT pass%:MOVS R4,R4,LSL #1:�CC R4,R4,R5:]
T�
^[OPT pass%
h$CMP R6,R4,LSR #16:BLE plotdone:]
r� q%=1 � 16
|/[OPT pass%:MOVS R4,R4,LSL #1:�CC R4,R4,R5:]
��
�[OPT pass%
�MOV R12,R4,LSR #16
�MUL R12,R0,R12
�ADD R12,R3,R12,LSR #16
�STRB R12,[R1]
�
.plotdone
�SUB R1,R1,#1
�SUBS R8,R8,#1
�BPL soupncol
�SUB R1,R1,#320
�LDR R14,asux
�ADD R1,R1,R14
SUBS R2,R2,#1
BPL soupnrow
LDMFD R13!,{PC}
&.axor:EQUD &ED6AA7
0.arvbl:EQUD 148:EQUD -1
:.awvbl:EQUD0
D .anamesy:EQUS "suy"+�0:ALIGN
N .anamesx:EQUS "sux"+�0:ALIGN
X.asuy:EQUD0
b.asux:EQUD0
l]
v�
�7ș "OS_File",&0A,"<ArcAut$Dir>.code",&FFD,,code%,P%
�
00000000  0d 00 0a 0f f4 20 3e 6d  61 6b 65 63 6f 64 65 0d  |..... >makecode.|
00000010  00 14 05 f4 0d 00 1e 0d  6d 65 6d 25 3d 31 30 32  |........mem%=102|
00000020  34 0d 00 28 10 de 20 63  6f 64 65 25 20 6d 65 6d  |4..(.. code% mem|
00000030  25 0d 00 32 11 4c 25 3d  63 6f 64 65 25 2b 6d 65  |%..2.L%=code%+me|
00000040  6d 25 0d 00 3c 16 e3 20  70 61 73 73 25 3d 38 20  |m%..<.. pass%=8 |
00000050  b8 20 31 30 20 88 20 32  0d 00 46 0c 50 25 3d 63  |. 10 . 2..F.P%=c|
00000060  6f 64 65 25 0d 00 50 0e  5b 4f 50 54 20 70 61 73  |ode%..P.[OPT pas|
00000070  73 25 0d 00 5a 19 2e 61  73 65 65 64 3a 45 51 55  |s%..Z..aseed:EQU|
00000080  44 20 26 46 46 46 46 46  46 46 46 0d 00 64 09 2e  |D &FFFFFFFF..d..|
00000090  73 6f 75 70 0d 00 6e 14  53 54 4d 46 44 20 52 31  |soup..n.STMFD R1|
000000a0  33 21 2c 7b 52 31 34 7d  0d 00 78 19 4d 4f 56 20  |3!,{R14}..x.MOV |
000000b0  52 31 34 2c 52 30 3a 4d  4f 56 20 52 31 32 2c 52  |R14,R0:MOV R12,R|
000000c0  33 0d 00 82 1d 41 44 52  20 52 30 2c 61 72 76 62  |3....ADR R0,arvb|
000000d0  6c 3a 41 44 52 20 52 31  2c 61 77 76 62 6c 0d 00  |l:ADR R1,awvbl..|
000000e0  8c 1d 53 57 49 20 22 4f  53 5f 52 65 61 64 56 64  |..SWI "OS_ReadVd|
000000f0  75 56 61 72 69 61 62 6c  65 73 22 0d 00 96 3c 41  |uVariables"...<A|
00000100  44 52 20 52 30 2c 61 6e  61 6d 65 73 79 3a 41 44  |DR R0,anamesy:AD|
00000110  52 20 52 31 2c 61 73 75  79 3a 4d 4f 56 20 52 32  |R R1,asuy:MOV R2|
00000120  2c 23 34 3a 4d 4f 56 20  52 33 2c 23 30 3a 4d 4f  |,#4:MOV R3,#0:MO|
00000130  56 20 52 34 2c 23 30 0d  00 a0 17 53 57 49 20 22  |V R4,#0....SWI "|
00000140  4f 53 5f 52 65 61 64 56  61 72 56 61 6c 22 0d 00  |OS_ReadVarVal"..|
00000150  aa 3c 41 44 52 20 52 30  2c 61 6e 61 6d 65 73 78  |.<ADR R0,anamesx|
00000160  3a 41 44 52 20 52 31 2c  61 73 75 78 3a 4d 4f 56  |:ADR R1,asux:MOV|
00000170  20 52 32 2c 23 34 3a 4d  4f 56 20 52 33 2c 23 30  | R2,#4:MOV R3,#0|
00000180  3a 4d 4f 56 20 52 34 2c  23 30 0d 00 b4 17 53 57  |:MOV R4,#0....SW|
00000190  49 20 22 4f 53 5f 52 65  61 64 56 61 72 56 61 6c  |I "OS_ReadVarVal|
000001a0  22 0d 00 be 19 4d 4f 56  20 52 30 2c 52 31 34 3a  |"....MOV R0,R14:|
000001b0  4d 4f 56 20 52 33 2c 52  31 32 0d 00 c8 10 4c 44  |MOV R3,R12....LD|
000001c0  52 20 52 31 2c 61 77 76  62 6c 0d 00 d2 1b 4c 44  |R R1,awvbl....LD|
000001d0  52 20 52 32 2c 61 73 75  79 3a 4c 44 52 20 52 34  |R R2,asuy:LDR R4|
000001e0  2c 61 73 75 78 0d 00 dc  12 53 55 42 20 52 31 2c  |,asux....SUB R1,|
000001f0  52 31 2c 23 31 39 32 0d  00 e6 24 41 44 44 20 52  |R1,#192...$ADD R|
00000200  34 2c 52 34 2c 23 31 3a  41 44 44 20 52 31 2c 52  |4,R4,#1:ADD R1,R|
00000210  31 2c 52 34 2c 41 53 52  20 23 31 0d 00 f0 23 4d  |1,R4,ASR #1...#M|
00000220  4f 56 20 52 35 2c 52 32  2c 41 53 52 20 23 31 3a  |OV R5,R2,ASR #1:|
00000230  41 44 44 20 52 35 2c 52  35 2c 23 31 32 38 0d 00  |ADD R5,R5,#128..|
00000240  fa 2b 41 44 44 20 52 31  2c 52 31 2c 52 35 2c 41  |.+ADD R1,R1,R5,A|
00000250  53 4c 20 23 38 3a 41 44  44 20 52 31 2c 52 31 2c  |SL #8:ADD R1,R1,|
00000260  52 35 2c 41 53 4c 20 23  36 0d 01 04 10 53 55 42  |R5,ASL #6....SUB|
00000270  20 52 32 2c 52 32 2c 23  31 0d 01 0e 0f 4c 44 52  | R2,R2,#1....LDR|
00000280  20 52 35 2c 61 78 6f 72  0d 01 18 10 4c 44 52 20  | R5,axor....LDR |
00000290  52 34 2c 61 73 65 65 64  0d 01 22 0d 2e 73 6f 75  |R4,aseed.."..sou|
000002a0  70 6e 72 6f 77 0d 01 2c  1c 4c 44 52 20 52 38 2c  |pnrow..,.LDR R8,|
000002b0  61 73 75 78 3a 53 55 42  20 52 38 2c 52 38 2c 23  |asux:SUB R8,R8,#|
000002c0  31 0d 01 36 0f 2e 73 6f  75 70 6e 63 6f 6c 3a 5d  |1..6..soupncol:]|
000002d0  0d 01 40 0f e3 20 71 25  3d 31 20 b8 20 31 36 0d  |..@.. q%=1 . 16.|
000002e0  01 4a 2f 5b 4f 50 54 20  70 61 73 73 25 3a 4d 4f  |.J/[OPT pass%:MO|
000002f0  56 53 20 52 34 2c 52 34  2c 4c 53 4c 20 23 31 3a  |VS R4,R4,LSL #1:|
00000300  82 43 43 20 52 34 2c 52  34 2c 52 35 3a 5d 0d 01  |.CC R4,R4,R5:]..|
00000310  54 05 ed 0d 01 5e 0e 5b  4f 50 54 20 70 61 73 73  |T....^.[OPT pass|
00000320  25 0d 01 68 24 43 4d 50  20 52 36 2c 52 34 2c 4c  |%..h$CMP R6,R4,L|
00000330  53 52 20 23 31 36 3a 42  4c 45 20 70 6c 6f 74 64  |SR #16:BLE plotd|
00000340  6f 6e 65 3a 5d 0d 01 72  0f e3 20 71 25 3d 31 20  |one:]..r.. q%=1 |
00000350  b8 20 31 36 0d 01 7c 2f  5b 4f 50 54 20 70 61 73  |. 16..|/[OPT pas|
00000360  73 25 3a 4d 4f 56 53 20  52 34 2c 52 34 2c 4c 53  |s%:MOVS R4,R4,LS|
00000370  4c 20 23 31 3a 82 43 43  20 52 34 2c 52 34 2c 52  |L #1:.CC R4,R4,R|
00000380  35 3a 5d 0d 01 86 05 ed  0d 01 90 0e 5b 4f 50 54  |5:].........[OPT|
00000390  20 70 61 73 73 25 0d 01  9a 16 4d 4f 56 20 52 31  | pass%....MOV R1|
000003a0  32 2c 52 34 2c 4c 53 52  20 23 31 36 0d 01 a4 12  |2,R4,LSR #16....|
000003b0  4d 55 4c 20 52 31 32 2c  52 30 2c 52 31 32 0d 01  |MUL R12,R0,R12..|
000003c0  ae 1a 41 44 44 20 52 31  32 2c 52 33 2c 52 31 32  |..ADD R12,R3,R12|
000003d0  2c 4c 53 52 20 23 31 36  0d 01 b8 11 53 54 52 42  |,LSR #16....STRB|
000003e0  20 52 31 32 2c 5b 52 31  5d 0d 01 c2 0d 2e 70 6c  | R12,[R1].....pl|
000003f0  6f 74 64 6f 6e 65 0d 01  cc 10 53 55 42 20 52 31  |otdone....SUB R1|
00000400  2c 52 31 2c 23 31 0d 01  d6 11 53 55 42 53 20 52  |,R1,#1....SUBS R|
00000410  38 2c 52 38 2c 23 31 0d  01 e0 10 42 50 4c 20 73  |8,R8,#1....BPL s|
00000420  6f 75 70 6e 63 6f 6c 0d  01 ea 12 53 55 42 20 52  |oupncol....SUB R|
00000430  31 2c 52 31 2c 23 33 32  30 0d 01 f4 10 4c 44 52  |1,R1,#320....LDR|
00000440  20 52 31 34 2c 61 73 75  78 0d 01 fe 11 41 44 44  | R14,asux....ADD|
00000450  20 52 31 2c 52 31 2c 52  31 34 0d 02 08 11 53 55  | R1,R1,R14....SU|
00000460  42 53 20 52 32 2c 52 32  2c 23 31 0d 02 12 10 42  |BS R2,R2,#1....B|
00000470  50 4c 20 73 6f 75 70 6e  72 6f 77 0d 02 1c 13 4c  |PL soupnrow....L|
00000480  44 4d 46 44 20 52 31 33  21 2c 7b 50 43 7d 0d 02  |DMFD R13!,{PC}..|
00000490  26 16 2e 61 78 6f 72 3a  45 51 55 44 20 26 45 44  |&..axor:EQUD &ED|
000004a0  36 41 41 37 0d 02 30 1b  2e 61 72 76 62 6c 3a 45  |6AA7..0..arvbl:E|
000004b0  51 55 44 20 31 34 38 3a  45 51 55 44 20 2d 31 0d  |QUD 148:EQUD -1.|
000004c0  02 3a 10 2e 61 77 76 62  6c 3a 45 51 55 44 30 0d  |.:..awvbl:EQUD0.|
000004d0  02 44 20 2e 61 6e 61 6d  65 73 79 3a 45 51 55 53  |.D .anamesy:EQUS|
000004e0  20 22 73 75 79 22 2b bd  30 3a 41 4c 49 47 4e 0d  | "suy"+.0:ALIGN.|
000004f0  02 4e 20 2e 61 6e 61 6d  65 73 78 3a 45 51 55 53  |.N .anamesx:EQUS|
00000500  20 22 73 75 78 22 2b bd  30 3a 41 4c 49 47 4e 0d  | "sux"+.0:ALIGN.|
00000510  02 58 0f 2e 61 73 75 79  3a 45 51 55 44 30 0d 02  |.X..asuy:EQUD0..|
00000520  62 0f 2e 61 73 75 78 3a  45 51 55 44 30 0d 02 6c  |b..asux:EQUD0..l|
00000530  05 5d 0d 02 76 05 ed 0d  02 80 37 c8 99 20 22 4f  |.]..v.....7.. "O|
00000540  53 5f 46 69 6c 65 22 2c  26 30 41 2c 22 3c 41 72  |S_File",&0A,"<Ar|
00000550  63 41 75 74 24 44 69 72  3e 2e 63 6f 64 65 22 2c  |cAut$Dir>.code",|
00000560  26 46 46 44 2c 2c 63 6f  64 65 25 2c 50 25 0d ff  |&FFD,,code%,P%..|
00000570