Home » Archimedes archive » Acorn User » AU 1998-02 B.adf » Regulars » StarInfo/Allcorn/InvSource

StarInfo/Allcorn/InvSource

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-02 B.adf » Regulars
Filename: StarInfo/Allcorn/InvSource
Read OK:
File size: 2030 bytes
Load address: 0000
Exec address: 0000
File contents
   10DIM code &1000
   20L%=code+1024
   30ON ERROR PROCe
   40PROCassemble(2)
   50OSCLI "SAVE Invaders1k "+STR$~code+" "+STR$~O%
   60*SETTYPE Invaders1k ABSOLUTE
   70END
   80
   90
  100DEF PROCassemble(Z%)
  110scr_xhigh  = 39
  120player_y   = 23
  130rate       = 10
  140max_missiles=10
  150OS_WriteI  = &100
  160
  170REM key values for Z X RETURN
  180left       = 97 EOR &80
  190right      = 66 EOR &80
  200fire       = 73 EOR &80
  210
  220pc=15
  230link=14
  240sp=13
  250vaders=12
  260score=11
  270level=10
  280speed=9
  290shipx=8
  300missy=7
  310up_down=6
  320mx=5
  330REM up/down in bits 0-7, bit 31 for left/right movement
  340
  350FOR pass%=12 TO 15 STEP Z%
  360O%=code
  370P%=&8000
  380[OPT pass%
  390;variables overlay inital code
  400
  410.start
  420.seed
  430ADR R0,string
  440.screen
  450MOV R1,#2+free-string
  460.high
  470SWI "OS_WriteN"
  480.seed2
  490SWI "OS_RemoveCursors"
  500.buffer
  510ADR R0,in
  520ADR R1,screen
  530SWI "OS_ReadVduVariables"
  540MOV R2,#0
  550STR R2,high
  560MOV R1,#47
  570MOV R0,#213
  580SWI "OS_Byte"
  590MOV R0,#&70
  600SWI "Sound_Volume"
  610
  620
  630; inital positions
  640.restart
  650SWI "OS_WriteS"
  660EQUB 31
  670EQUB 14
  680EQUB 10
  690EQUS "Press a key"
  700EQUB 31
  710EQUB 14
  720EQUB 12
  730EQUS "Z - Left"
  740EQUB 31
  750EQUB 14
  760EQUB 14
  770EQUS "X - Right"
  780EQUB 31
  790EQUB 12
  800EQUB 16
  810EQUS "Rtn - Fire"
  820EQUB 0
  830ALIGN
  840.wait
  850MOV R0,#15
  860SWI "OS_Byte"
  870MOV R0,#124
  880SWI "OS_Byte"
  890SWI "OS_ReadC"
  900BCS wait
  910MOV score,#0
  920MOV level,#0
  930
  940.new_level
  950MOV missy,#0                 ; zero for no missile
  960MOV up_down,#ASC"M"+128     ; clear pointers
  970MOV shipx,#scr_xhigh/2
  980MOV speed,#rate
  990MOV vaders,#32
 1000MOV R0,#64
 1010ADR R1,x0
 1020.init_vader
 1030SUBS R0,R0,#1<<1                ; we want 31 - 0
 1040AND R2,R0,#3<<1
 1050ADD R2,R2,#2
 1060AND R3,R0,#28<<1
 1070MOV R3,R3,LSR #1
 1080STR R3,[R1],#4   ;xpos
 1090STR R2,[R1],#8   ;ypos   skip missile x pos
 1100STR missy,[R1],#4; convenient zero
 1110BPL init_vader   ; 0 is a valid vader
 1120B draw_screen
 1130
 1140
 1150.main
 1160; test for vader fire
 1170; get random number 0-31 for potential firing vader
 1180MOV R0,#0
 1190MOV R1,#5
 1200LDR R2,seed2
 1210LDR R3,seed
 1220
 1230.rnd
 1240MOVS R2,R2,LSL#1
 1250EORCS R2,R2,R3
 1260ADC R0,R0,R0
 1270SUBS R1,R1,#1
 1280BNE rnd
 1290STR R2,seed2
 1300
 1310;now test upto level+1 slots for free missile
 1320ADD R1,level,#1
 1330CMP R1,#max_missiles
 1340MOVHS R1,#max_missiles
 1350ADR R2,vmy
 1360.test_vader_fire
 1370LDR R3,[R2],#16
 1380CMP R3,#0
 1390; vader_fires
 1400SUBEQ R3,R2,#20       ;R3 now points to x_pos of missile
 1410ADREQ R2,x0
 1420ADDEQ R2,R2,R0,LSL #4 ;R3 now points to x_pos of vader
 1430LDMEQIA R2,{R0,R1}
 1440STMEQIA R3,{R0,R1}    ;copy position across - dead vader will give a dead missile
 1450SUBNES R1,R1,#1
 1460BNE test_vader_fire
 1470
 1480
 1490; update vader missiles
 1500.update
 1510ADR R0,vmy
 1520MOV R2,#max_missiles
 1530.missile
 1540LDR R3,[R0]       ; get y position
 1550CMP R3,#0
 1560ADDNE R3,R3,#1    ;move down if missile present
 1570CMP R3,#player_y
 1580MOVHI R3,#0       ;clear if beyond player
 1590LDREQ R1,[R0,#-4]  ;if on player row, check for hit
 1600CMPEQ R1,shipx
 1610BEQ restart
 1620STR R3,[R0],#16    ; save new y position
 1630SUBS R2,R2,#1
 1640BNE missile
 1650
 1660
 1670.move_vaders
 1680; check speed counter
 1690SUB speed,speed,#1
 1700CMP speed,level
 1710MOVLS speed,#rate
 1720BHI vaders_moved
 1730;only move vaders if speed counter < level (always if level "max_missiles" or higher)
 1740; update vader up/down flag
 1750SWI OS_WriteI+7     ;sound beeper
 1760EOR up_down,up_down,#&1A
 1770TST up_down,#1<<31
 1780mvn r1,#1   ;"addition value"
 1790mvn r4,#0   ;end of line value
 1800MOVeq r1,#1<<1
 1810moveq r4,#40
 1820ADR R0,x0
 1830; bit0 set for end of row
 1840;row adjust for move down routine in remainder
 1850MOV R2,#32
 1860.m_vader
 1870LDR R3,[R0,#4]
 1880CMP R3,#0
 1890BEQ m_v_dead
 1900LDR R3,[R0]
 1910add r3,r3,r1,asr #1
 1920cmp r3,r4
 1930orreq R1,R1,#1   ; flag set for end of screen
 1940.m_v_dead
 1950STR R3,[R0],#16
 1960SUBS R2,R2,#1
 1970BNE m_vader
 1980TST R1,#1
 1990BEQ vaders_moved
 2000
 2010.move_down
 2020ADR R0,x0
 2030BIC R1,R1,#1
 2040MOV R2,#32
 2050.m_down
 2060LDR R4,[R0,#4]
 2070CMP R4,#0
 2080; BEQ m_d_dead
 2090LDR R3,[R0]
 2100sub R3,R3,R1,ASR #1
 2110ADDNE R4,R4,#1
 2120CMP R4,#player_y
 2130ORREQ R1,R1,#1   ; flag set for game_over
 2140STR R4,[R0,#4]
 2150.m_d_dead
 2160STR R3,[R0],#16
 2170SUBS R2,R2,#1
 2180BNE m_down
 2190TST R1,#1
 2200BNE restart
 2210EOR up_down,up_down,#1<<31
 2220
 2230
 2240.vaders_moved
 2250; update player missile
 2260CMP missy,#0           ;no missile
 2270SUBNES missy,missy,#1
 2280BEQ draw_screen
 2290; has player hit a vader
 2300ADR R0,x0
 2310MOV R2,#32
 2320.hit1
 2330LDR R3,[R0],#4    ; x
 2340LDR R1,[R0],#12   ; y
 2350CMP mx,R3
 2360CMPEQ missy,R1    ;since missile's Y pos can't be zero we never hit a dead vader
 2370BEQ hit_it
 2380.hit2
 2390SUBS R2,R2,#1
 2400BNE hit1
 2410B draw_screen
 2420
 2430
 2440.hit_it
 2450MOV missy,#0
 2460ADD score,score,#10
 2470LDR R1,high
 2480CMP score,R1
 2490STRHI score,high
 2500STR missy,[R0,#-12]    ;set Y position to zero for a dead vader
 2510SUBS vaders,vaders,#1
 2520ADDEQ level,level,#1
 2530BEQ new_level
 2540
 2550
 2560.draw_screen
 2570; first wait for 3 vsyncs to occur
 2580MOV R0,#19
 2590SWI "OS_Byte"
 2600SWI "OS_Byte"
 2610SWI "OS_Byte"
 2620; now clear the screen
 2630LDR R0,screen
 2640MOV R1,#15*1024
 2650MOV R2,#0
 2660.cls1
 2670STR R2,[R0],#4
 2680STR R2,[R0],#4
 2690STR R2,[R0],#4
 2700STR R2,[R0],#4
 2710SUBS R1,R1,#16
 2720BNE cls1
 2730
 2740
 2750; now draw vaders
 2760MOV R3,#32
 2770ADR R2,x0
 2780SWI "OS_WriteS"
 2790EQUB 17
 2800EQUB 1
 2810EQUB 0
 2820EQUB 0
 2830.draw
 2840SWI OS_WriteI+31
 2850LDMIA R2!,{R0,R1}
 2860SWI "OS_WriteC"
 2870MOVS R0,R1
 2880SWI "OS_WriteC"
 2890MOV R0,up_down
 2900EOR up_down,up_down,#&1A
 2910SWINE "OS_WriteC"
 2920SWI OS_WriteI+31
 2930LDMIA R2!,{R0,R1}
 2940SWI "OS_WriteC"
 2950MOVS R0,R1
 2960SWI "OS_WriteC"
 2970MOV R0,#ASC"|"
 2980SWINE "OS_WriteC"
 2990SUBS R3,R3,#1
 3000BNE draw
 3010
 3020
 3030; print player
 3040SWI "OS_WriteS"
 3050EQUB 17
 3060EQUB 3
 3070EQUB 31
 3080EQUB 0
 3090MOV R0,shipx
 3100SWI "OS_WriteC"
 3110SWI "OS_WriteS"
 3120EQUB player_y
 3130EQUB ASC"A"+128
 3140; tab character needed bellow
 3150EQUB 31
 3160EQUB 0
 3170
 3180;print player_missile
 3190mov R0,mx
 3200SWI "OS_WriteC"
 3210MOVS R0,missy
 3220SWI "OS_WriteC"
 3230SWINE OS_WriteI+ASC"|"
 3240
 3250
 3260.print_score
 3270MOV R0,score
 3280ADR R1,buffer
 3290MOV R2,#12
 3300SWI "OS_ConvertCardinal4"
 3310SWI "OS_WriteS"
 3320        EQUB 17
 3330        EQUB 3
 3340        EQUB 30
 3350        EQUS "SCORE "
 3360        EQUB 17
 3370        EQUB 2
 3380        EQUB 0
 3390SWI "OS_Write0"
 3400;then high score
 3410ADR R0,hi
 3420MOV R1,#24
 3430SWI "OS_WriteN"
 3440LDR R0,high
 3450ADR R1,buffer
 3460MOV R2,#12
 3470SWI "OS_ConvertCardinal4"
 3480SWI "OS_Write0"
 3490
 3500
 3510;read keyboard
 3520;read left key
 3530MOV R0,#121
 3540MOV R1,#left
 3550SWI "OS_Byte"
 3560CMP R1,#0
 3570;move left
 3580CMPNE shipx,#0
 3590SUBNE shipx,shipx,#1
 3600
 3610
 3620MOV R1,#right
 3630SWI "OS_Byte"
 3640CMP R1,#0
 3650;move_right
 3660CMPNE shipx,#scr_xhigh
 3670ADDNE shipx,shipx,#1
 3680
 3690
 3700CMP missy,#0
 3710BNE test_escape   ; non 0 means missile in flight
 3720MOV R1,#fire
 3730SWI "OS_Byte"
 3740CMP R1,#0
 3750;new missile required
 3760MOVNE missy,#player_y
 3770movNE mx,shipx
 3780
 3790
 3800.test_escape
 3810SWI "OS_ReadEscapeState"
 3820BCC main
 3830
 3840MOV R0,#124
 3850SWI "OS_Byte"
 3860SWI "OS_RestoreCursors"
 3870MOV pc,link
 3880
 3890
 3900; constants
 3910.in     EQUD 148
 3920        EQUD -1
 3930.hi     EQUB 31
 3940        EQUB 14
 3950        EQUB 0
 3960        EQUS "Invaders 1K"
 3970        EQUB 31
 3980        EQUB 30
 3990        EQUB 0
 4000        EQUS "HIGH "
 4010        EQUB 17
 4020        EQUB 3
 4030ALIGN
 4040
 4050; remaining variables
 4060.string
 4070EQUB 22
 4080EQUB 1
 4090EQUB 23
 4100EQUB 128+ASC"M"
 4110EQUB %00111100
 4120EQUB %01011010
 4130EQUB %01011010
 4140EQUB %01111110
 4150EQUB %00011000
 4160EQUB %00100100
 4170EQUB %01000010
 4180EQUB %10000001
 4190EQUB 23
 4200EQUB 128+ASC"W"
 4210EQUB %00111100
 4220EQUB %01011010
 4230
 4240EQUB %01011010
 4250EQUB %01111110
 4260EQUB %00011000
 4270EQUB %00100100
 4280
 4290EQUB %00100100
 4300EQUB %00011000
 4310EQUB 23
 4320EQUB 128+ASC"A"
 4330
 4340EQUB %00011000
 4350EQUB %00111100
 4360EQUB %01111110
 4370EQUB %00111100
 4380
 4390EQUB %00011000
 4400EQUB %00111100
 4410EQUB %01111110
 4420EQUB %11111111
 4430
 4440EQUB 19
 4450EQUB 1
 4460EQUB 2
 4470EQUB 0
 4480.free
 4490]
 4500
 4510
 4520REM "max_missiles" vader missile positions
 4530
 4540x0        = free+4
 4550y0        = x0  +4
 4560vmx       = y0  +4
 4570vmy       = vmx +4     :REM 0 for NO missile in flight
 4580NEXT pass%
 4590ENDPROC
 4600
 4610DEF PROCe
 4620REPORT
 4630PRINT" at line ";ERL/10
 4640END

� code &1000
L%=code+1024

� � �e
(�assemble(2)
2(� "SAVE Invaders1k "+�~code+" "+�~O%
< *SETTYPE Invaders1k ABSOLUTE
F�
P
Z
d� �assemble(Z%)
nscr_xhigh  = 39
xplayer_y   = 23
�rate       = 10
�max_missiles=10
�OS_WriteI  = &100
�
�� key values for Z X RETURN
�left       = 97 � &80
�right      = 66 � &80
�fire       = 73 � &80
�
�	pc=15
�link=14
�	sp=13
�
vaders=12
score=11
level=10
speed=9
"shipx=8
,missy=7
6
up_down=6
@mx=5
J9� up/down in bits 0-7, bit 31 for left/right movement
T
^� pass%=12 � 15 � Z%
hO%=code
rP%=&8000
|[OPT pass%
�";variables overlay inital code
�
�
.start
�	.seed
�ADR R0,string
�.screen
�MOV R1,#2+free-string
�	.high
�SWI "OS_WriteN"
�
.seed2
�SWI "OS_RemoveCursors"
�.buffer
�
ADR R0,in
ADR R1,screen
SWI "OS_ReadVduVariables"

MOV R2,#0
&STR R2,high
0MOV R1,#47
:MOV R0,#213
DSWI "OS_Byte"
NMOV R0,#&70
XSWI "Sound_Volume"
b
l
v; inital positions
�.restart
�SWI "OS_WriteS"
�EQUB 31
�EQUB 14
�EQUB 10
�EQUS "Press a key"
�EQUB 31
�EQUB 14
�EQUB 12
�EQUS "Z - Left"
�EQUB 31
�EQUB 14
�EQUB 14
EQUS "X - Right"
EQUB 31
EQUB 12
 EQUB 16
*EQUS "Rtn - Fire"
4
EQUB 0
>	ALIGN
H	.wait
RMOV R0,#15
\SWI "OS_Byte"
fMOV R0,#124
pSWI "OS_Byte"
zSWI "OS_ReadC"
�BCS wait
�MOV score,#0
�MOV level,#0
�
�.new_level
�6MOV missy,#0                 ; zero for no missile
�.MOV up_down,#�"M"+128     ; clear pointers
�MOV shipx,#scr_xhigh/2
�MOV speed,#rate
�MOV vaders,#32
�MOV R0,#64
�
ADR R1,x0
�.init_vader
4SUBS R0,R0,#1<<1                ; we want 31 - 0
� R2,R0,#3<<1
ADD R2,R2,#2
$� R3,R0,#28<<1
.MOV R3,R3,LSR #1
8STR R3,[R1],#4   ;xpos
B/STR R2,[R1],#8   ;ypos   skip missile x pos
L&STR missy,[R1],#4; convenient zero
V)BPL init_vader   ; 0 is a valid vader
`B draw_screen
j
t
~	.main
�; test for vader fire
�7; get random number 0-31 for potential firing vader
�
MOV R0,#0
�
MOV R1,#5
�LDR R2,seed2
�LDR R3,seed
�
�.rnd
�MOVS R2,R2,LSL#1
��CS R2,R2,R3
�ADC R0,R0,R0
�SUBS R1,R1,#1
BNE rnd

STR R2,seed2

1;now test upto level+1 slots for free missile
(ADD R1,level,#1
2CMP R1,#max_missiles
<MOVHS R1,#max_missiles
FADR R2,vmy
P.test_vader_fire
ZLDR R3,[R2],#16
d
CMP R3,#0
n; vader_fires
x<SUBEQ R3,R2,#20       ;R3 now points to x_pos of missile
�ADREQ R2,x0
�:ADDEQ R2,R2,R0,LSL #4 ;R3 now points to x_pos of vader
�LDMEQIA R2,{R0,R1}
�USTMEQIA R3,{R0,R1}    ;copy position across - dead vader will give a dead missile
�SUBNES R1,R1,#1
�BNE test_vader_fire
�
�
�; update vader missiles
�.update
�ADR R0,vmy
�MOV R2,#max_missiles
�.missile
&LDR R3,[R0]       ; get y position

CMP R3,#0
3ADDNE R3,R3,#1    ;move down if missile present
"CMP R3,#player_y
,-MOVHI R3,#0       ;clear if beyond player
67LDREQ R1,[R0,#-4]  ;if on player row, check for hit
@CMPEQ R1,shipx
JBEQ restart
T,STR R3,[R0],#16    ; save new y position
^SUBS R2,R2,#1
hBNE missile
r
|
�.move_vaders
�; check speed counter
�SUB speed,speed,#1
�CMP speed,level
�MOVLS speed,#rate
�BHI vaders_moved
�Y;only move vaders if speed counter < level (always if level "max_missiles" or higher)
�; update vader up/down flag
�%SWI OS_WriteI+7     ;sound beeper
�� up_down,up_down,#&1A
�TST up_down,#1<<31
�!mvn r1,#1   ;"addition value"
�"mvn r4,#0   ;end of line value
MOVeq r1,#1<<1
moveq r4,#40

ADR R0,x0
&; bit0 set for end of row
02;row adjust for move down routine in remainder
:MOV R2,#32
D.m_vader
NLDR R3,[R0,#4]
X
CMP R3,#0
bBEQ m_v_dead
lLDR R3,[R0]
vadd r3,r3,r1,asr #1
�
cmp r3,r4
�1orreq R1,R1,#1   ; flag set for end of screen
�
.m_v_dead
�STR R3,[R0],#16
�SUBS R2,R2,#1
�BNE m_vader
�
TST R1,#1
�BEQ vaders_moved
�
�.move_down
�
ADR R0,x0
�BIC R1,R1,#1
�MOV R2,#32
.m_down
LDR R4,[R0,#4]

CMP R4,#0
 ; BEQ m_d_dead
*LDR R3,[R0]
4sub R3,R3,R1,ASR #1
>ADDNE R4,R4,#1
HCMP R4,#player_y
R,�REQ R1,R1,#1   ; flag set for game_over
\STR R4,[R0,#4]
f
.m_d_dead
pSTR R3,[R0],#16
zSUBS R2,R2,#1
�BNE m_down
�
TST R1,#1
�BNE restart
�� up_down,up_down,#1<<31
�
�
�.vaders_moved
�; update player missile
�&CMP missy,#0           ;no missile
�SUBNES missy,missy,#1
�BEQ draw_screen
�; has player hit a vader
�
ADR R0,x0
	MOV R2,#32
		.hit1
	LDR R3,[R0],#4    ; x
	$LDR R1,[R0],#12   ; y
	.
CMP mx,R3
	8TCMPEQ missy,R1    ;since missile's Y pos can't be zero we never hit a dead vader
	BBEQ hit_it
	L	.hit2
	VSUBS R2,R2,#1
	`BNE hit1
	jB draw_screen
	t
	~
	�.hit_it
	�MOV missy,#0
	�ADD score,score,#10
	�LDR R1,high
	�CMP score,R1
	�STRHI score,high
	�CSTR missy,[R0,#-12]    ;set Y position to zero for a dead vader
	�SUBS vaders,vaders,#1
	�ADDEQ level,level,#1
	�BEQ new_level
	�
	�
.draw_screen

&; first wait for 3 vsyncs to occur
MOV R0,#19
SWI "OS_Byte"
(SWI "OS_Byte"
2SWI "OS_Byte"
<; now clear the screen
FLDR R0,screen
PMOV R1,#15*1024
Z
MOV R2,#0
d	.cls1
nSTR R2,[R0],#4
xSTR R2,[R0],#4
�STR R2,[R0],#4
�STR R2,[R0],#4
�SUBS R1,R1,#16
�BNE cls1
�
�
�; now draw vaders
�MOV R3,#32
�
ADR R2,x0
�SWI "OS_WriteS"
�EQUB 17
�
EQUB 1
�
EQUB 0

EQUB 0
	.draw
SWI OS_WriteI+31
"LDMIA R2!,{R0,R1}
,SWI "OS_WriteC"
6MOVS R0,R1
@SWI "OS_WriteC"
JMOV R0,up_down
T� up_down,up_down,#&1A
^SWINE "OS_WriteC"
hSWI OS_WriteI+31
rLDMIA R2!,{R0,R1}
|SWI "OS_WriteC"
�MOVS R0,R1
�SWI "OS_WriteC"
�MOV R0,#�"|"
�SWINE "OS_WriteC"
�SUBS R3,R3,#1
�BNE draw
�
�
�; print player
�SWI "OS_WriteS"
�EQUB 17
�
EQUB 3
�EQUB 31

EQUB 0
MOV R0,shipx
SWI "OS_WriteC"
&SWI "OS_WriteS"
0EQUB player_y
:EQUB �"A"+128
D!; tab character needed bellow
NEQUB 31
X
EQUB 0
b
l;print player_missile
v
mov R0,mx
�SWI "OS_WriteC"
�MOVS R0,missy
�SWI "OS_WriteC"
�SWINE OS_WriteI+�"|"
�
�
�.print_score
�MOV R0,score
�ADR R1,buffer
�MOV R2,#12
�SWI "OS_ConvertCardinal4"
�SWI "OS_WriteS"
�        EQUB 17

        EQUB 3

        EQUB 30

        EQUS "SCORE "

         EQUB 17

*        EQUB 2

4        EQUB 0

>SWI "OS_Write0"

H;then high score

R
ADR R0,hi

\MOV R1,#24

fSWI "OS_WriteN"

pLDR R0,high

zADR R1,buffer

�MOV R2,#12

�SWI "OS_ConvertCardinal4"

�SWI "OS_Write0"

�

�

�;read keyboard

�;read left key

�MOV R0,#121

�MOV R1,#left

�SWI "OS_Byte"

�
CMP R1,#0

�;move left

�CMPNE shipx,#0
SUBNE shipx,shipx,#1


$MOV R1,#right
.SWI "OS_Byte"
8
CMP R1,#0
B;move_right
LCMPNE shipx,#scr_xhigh
VADDNE shipx,shipx,#1
`
j
tCMP missy,#0
~5BNE test_escape   ; non 0 means missile in flight
�MOV R1,#fire
�SWI "OS_Byte"
�
CMP R1,#0
�;new missile required
�MOVNE missy,#player_y
�movNE mx,shipx
�
�
�.test_escape
�SWI "OS_ReadEscapeState"
�BCC main
�
MOV R0,#124

SWI "OS_Byte"
SWI "OS_RestoreCursors"
MOV pc,link
(
2
<; constants
F.in     EQUD 148
P        EQUD -1
Z.hi     EQUB 31
d        EQUB 14
n        EQUB 0
x        EQUS "Invaders 1K"
�        EQUB 31
�        EQUB 30
�        EQUB 0
�        EQUS "HIGH "
�        EQUB 17
�        EQUB 3
�	ALIGN
�
�; remaining variables
�.string
�EQUB 22
�
EQUB 1
�EQUB 23
EQUB 128+�"M"
EQUB %00111100
EQUB %01011010
"EQUB %01011010
,EQUB %01111110
6EQUB %00011000
@EQUB %00100100
JEQUB %01000010
TEQUB %10000001
^EQUB 23
hEQUB 128+�"W"
rEQUB %00111100
|EQUB %01011010
�
�EQUB %01011010
�EQUB %01111110
�EQUB %00011000
�EQUB %00100100
�
�EQUB %00100100
�EQUB %00011000
�EQUB 23
�EQUB 128+�"A"
�
�EQUB %00011000
�EQUB %00111100
EQUB %01111110
EQUB %00111100

&EQUB %00011000
0EQUB %00111100
:EQUB %01111110
DEQUB %11111111
N
XEQUB 19
b
EQUB 1
l
EQUB 2
v
EQUB 0
�	.free
�]
�
�
�,� "max_missiles" vader missile positions
�
�x0        = free+4
�y0        = x0  +4
�vmx       = y0  +4
�8vmy       = vmx +4     :� 0 for NO missile in flight
�� pass%
��
�
� �e
�
�" at line ";�/10
 �
�
00000000  0d 00 0a 10 de 20 63 6f  64 65 20 26 31 30 30 30  |..... code &1000|
00000010  0d 00 14 10 4c 25 3d 63  6f 64 65 2b 31 30 32 34  |....L%=code+1024|
00000020  0d 00 1e 0a ee 20 85 20  f2 65 0d 00 28 10 f2 61  |..... . .e..(..a|
00000030  73 73 65 6d 62 6c 65 28  32 29 0d 00 32 28 ff 20  |ssemble(2)..2(. |
00000040  22 53 41 56 45 20 49 6e  76 61 64 65 72 73 31 6b  |"SAVE Invaders1k|
00000050  20 22 2b c3 7e 63 6f 64  65 2b 22 20 22 2b c3 7e  | "+.~code+" "+.~|
00000060  4f 25 0d 00 3c 20 2a 53  45 54 54 59 50 45 20 49  |O%..< *SETTYPE I|
00000070  6e 76 61 64 65 72 73 31  6b 20 41 42 53 4f 4c 55  |nvaders1k ABSOLU|
00000080  54 45 0d 00 46 05 e0 0d  00 50 04 0d 00 5a 04 0d  |TE..F....P...Z..|
00000090  00 64 13 dd 20 f2 61 73  73 65 6d 62 6c 65 28 5a  |.d.. .assemble(Z|
000000a0  25 29 0d 00 6e 13 73 63  72 5f 78 68 69 67 68 20  |%)..n.scr_xhigh |
000000b0  20 3d 20 33 39 0d 00 78  13 70 6c 61 79 65 72 5f  | = 39..x.player_|
000000c0  79 20 20 20 3d 20 32 33  0d 00 82 13 72 61 74 65  |y   = 23....rate|
000000d0  20 20 20 20 20 20 20 3d  20 31 30 0d 00 8c 13 6d  |       = 10....m|
000000e0  61 78 5f 6d 69 73 73 69  6c 65 73 3d 31 30 0d 00  |ax_missiles=10..|
000000f0  96 15 4f 53 5f 57 72 69  74 65 49 20 20 3d 20 26  |..OS_WriteI  = &|
00000100  31 30 30 0d 00 a0 04 0d  00 aa 1f f4 20 6b 65 79  |100......... key|
00000110  20 76 61 6c 75 65 73 20  66 6f 72 20 5a 20 58 20  | values for Z X |
00000120  52 45 54 55 52 4e 0d 00  b4 19 6c 65 66 74 20 20  |RETURN....left  |
00000130  20 20 20 20 20 3d 20 39  37 20 82 20 26 38 30 0d  |     = 97 . &80.|
00000140  00 be 19 72 69 67 68 74  20 20 20 20 20 20 3d 20  |...right      = |
00000150  36 36 20 82 20 26 38 30  0d 00 c8 19 66 69 72 65  |66 . &80....fire|
00000160  20 20 20 20 20 20 20 3d  20 37 33 20 82 20 26 38  |       = 73 . &8|
00000170  30 0d 00 d2 04 0d 00 dc  09 70 63 3d 31 35 0d 00  |0........pc=15..|
00000180  e6 0b 6c 69 6e 6b 3d 31  34 0d 00 f0 09 73 70 3d  |..link=14....sp=|
00000190  31 33 0d 00 fa 0d 76 61  64 65 72 73 3d 31 32 0d  |13....vaders=12.|
000001a0  01 04 0c 73 63 6f 72 65  3d 31 31 0d 01 0e 0c 6c  |...score=11....l|
000001b0  65 76 65 6c 3d 31 30 0d  01 18 0b 73 70 65 65 64  |evel=10....speed|
000001c0  3d 39 0d 01 22 0b 73 68  69 70 78 3d 38 0d 01 2c  |=9..".shipx=8..,|
000001d0  0b 6d 69 73 73 79 3d 37  0d 01 36 0d 75 70 5f 64  |.missy=7..6.up_d|
000001e0  6f 77 6e 3d 36 0d 01 40  08 6d 78 3d 35 0d 01 4a  |own=6..@.mx=5..J|
000001f0  39 f4 20 75 70 2f 64 6f  77 6e 20 69 6e 20 62 69  |9. up/down in bi|
00000200  74 73 20 30 2d 37 2c 20  62 69 74 20 33 31 20 66  |ts 0-7, bit 31 f|
00000210  6f 72 20 6c 65 66 74 2f  72 69 67 68 74 20 6d 6f  |or left/right mo|
00000220  76 65 6d 65 6e 74 0d 01  54 04 0d 01 5e 18 e3 20  |vement..T...^.. |
00000230  70 61 73 73 25 3d 31 32  20 b8 20 31 35 20 88 20  |pass%=12 . 15 . |
00000240  5a 25 0d 01 68 0b 4f 25  3d 63 6f 64 65 0d 01 72  |Z%..h.O%=code..r|
00000250  0c 50 25 3d 26 38 30 30  30 0d 01 7c 0e 5b 4f 50  |.P%=&8000..|.[OP|
00000260  54 20 70 61 73 73 25 0d  01 86 22 3b 76 61 72 69  |T pass%...";vari|
00000270  61 62 6c 65 73 20 6f 76  65 72 6c 61 79 20 69 6e  |ables overlay in|
00000280  69 74 61 6c 20 63 6f 64  65 0d 01 90 04 0d 01 9a  |ital code.......|
00000290  0a 2e 73 74 61 72 74 0d  01 a4 09 2e 73 65 65 64  |..start.....seed|
000002a0  0d 01 ae 11 41 44 52 20  52 30 2c 73 74 72 69 6e  |....ADR R0,strin|
000002b0  67 0d 01 b8 0b 2e 73 63  72 65 65 6e 0d 01 c2 19  |g.....screen....|
000002c0  4d 4f 56 20 52 31 2c 23  32 2b 66 72 65 65 2d 73  |MOV R1,#2+free-s|
000002d0  74 72 69 6e 67 0d 01 cc  09 2e 68 69 67 68 0d 01  |tring.....high..|
000002e0  d6 13 53 57 49 20 22 4f  53 5f 57 72 69 74 65 4e  |..SWI "OS_WriteN|
000002f0  22 0d 01 e0 0a 2e 73 65  65 64 32 0d 01 ea 1a 53  |".....seed2....S|
00000300  57 49 20 22 4f 53 5f 52  65 6d 6f 76 65 43 75 72  |WI "OS_RemoveCur|
00000310  73 6f 72 73 22 0d 01 f4  0b 2e 62 75 66 66 65 72  |sors".....buffer|
00000320  0d 01 fe 0d 41 44 52 20  52 30 2c 69 6e 0d 02 08  |....ADR R0,in...|
00000330  11 41 44 52 20 52 31 2c  73 63 72 65 65 6e 0d 02  |.ADR R1,screen..|
00000340  12 1d 53 57 49 20 22 4f  53 5f 52 65 61 64 56 64  |..SWI "OS_ReadVd|
00000350  75 56 61 72 69 61 62 6c  65 73 22 0d 02 1c 0d 4d  |uVariables"....M|
00000360  4f 56 20 52 32 2c 23 30  0d 02 26 0f 53 54 52 20  |OV R2,#0..&.STR |
00000370  52 32 2c 68 69 67 68 0d  02 30 0e 4d 4f 56 20 52  |R2,high..0.MOV R|
00000380  31 2c 23 34 37 0d 02 3a  0f 4d 4f 56 20 52 30 2c  |1,#47..:.MOV R0,|
00000390  23 32 31 33 0d 02 44 11  53 57 49 20 22 4f 53 5f  |#213..D.SWI "OS_|
000003a0  42 79 74 65 22 0d 02 4e  0f 4d 4f 56 20 52 30 2c  |Byte"..N.MOV R0,|
000003b0  23 26 37 30 0d 02 58 16  53 57 49 20 22 53 6f 75  |#&70..X.SWI "Sou|
000003c0  6e 64 5f 56 6f 6c 75 6d  65 22 0d 02 62 04 0d 02  |nd_Volume"..b...|
000003d0  6c 04 0d 02 76 16 3b 20  69 6e 69 74 61 6c 20 70  |l...v.; inital p|
000003e0  6f 73 69 74 69 6f 6e 73  0d 02 80 0c 2e 72 65 73  |ositions.....res|
000003f0  74 61 72 74 0d 02 8a 13  53 57 49 20 22 4f 53 5f  |tart....SWI "OS_|
00000400  57 72 69 74 65 53 22 0d  02 94 0b 45 51 55 42 20  |WriteS"....EQUB |
00000410  33 31 0d 02 9e 0b 45 51  55 42 20 31 34 0d 02 a8  |31....EQUB 14...|
00000420  0b 45 51 55 42 20 31 30  0d 02 b2 16 45 51 55 53  |.EQUB 10....EQUS|
00000430  20 22 50 72 65 73 73 20  61 20 6b 65 79 22 0d 02  | "Press a key"..|
00000440  bc 0b 45 51 55 42 20 33  31 0d 02 c6 0b 45 51 55  |..EQUB 31....EQU|
00000450  42 20 31 34 0d 02 d0 0b  45 51 55 42 20 31 32 0d  |B 14....EQUB 12.|
00000460  02 da 13 45 51 55 53 20  22 5a 20 2d 20 4c 65 66  |...EQUS "Z - Lef|
00000470  74 22 0d 02 e4 0b 45 51  55 42 20 33 31 0d 02 ee  |t"....EQUB 31...|
00000480  0b 45 51 55 42 20 31 34  0d 02 f8 0b 45 51 55 42  |.EQUB 14....EQUB|
00000490  20 31 34 0d 03 02 14 45  51 55 53 20 22 58 20 2d  | 14....EQUS "X -|
000004a0  20 52 69 67 68 74 22 0d  03 0c 0b 45 51 55 42 20  | Right"....EQUB |
000004b0  33 31 0d 03 16 0b 45 51  55 42 20 31 32 0d 03 20  |31....EQUB 12.. |
000004c0  0b 45 51 55 42 20 31 36  0d 03 2a 15 45 51 55 53  |.EQUB 16..*.EQUS|
000004d0  20 22 52 74 6e 20 2d 20  46 69 72 65 22 0d 03 34  | "Rtn - Fire"..4|
000004e0  0a 45 51 55 42 20 30 0d  03 3e 09 41 4c 49 47 4e  |.EQUB 0..>.ALIGN|
000004f0  0d 03 48 09 2e 77 61 69  74 0d 03 52 0e 4d 4f 56  |..H..wait..R.MOV|
00000500  20 52 30 2c 23 31 35 0d  03 5c 11 53 57 49 20 22  | R0,#15..\.SWI "|
00000510  4f 53 5f 42 79 74 65 22  0d 03 66 0f 4d 4f 56 20  |OS_Byte"..f.MOV |
00000520  52 30 2c 23 31 32 34 0d  03 70 11 53 57 49 20 22  |R0,#124..p.SWI "|
00000530  4f 53 5f 42 79 74 65 22  0d 03 7a 12 53 57 49 20  |OS_Byte"..z.SWI |
00000540  22 4f 53 5f 52 65 61 64  43 22 0d 03 84 0c 42 43  |"OS_ReadC"....BC|
00000550  53 20 77 61 69 74 0d 03  8e 10 4d 4f 56 20 73 63  |S wait....MOV sc|
00000560  6f 72 65 2c 23 30 0d 03  98 10 4d 4f 56 20 6c 65  |ore,#0....MOV le|
00000570  76 65 6c 2c 23 30 0d 03  a2 04 0d 03 ac 0e 2e 6e  |vel,#0.........n|
00000580  65 77 5f 6c 65 76 65 6c  0d 03 b6 36 4d 4f 56 20  |ew_level...6MOV |
00000590  6d 69 73 73 79 2c 23 30  20 20 20 20 20 20 20 20  |missy,#0        |
000005a0  20 20 20 20 20 20 20 20  20 3b 20 7a 65 72 6f 20  |         ; zero |
000005b0  66 6f 72 20 6e 6f 20 6d  69 73 73 69 6c 65 0d 03  |for no missile..|
000005c0  c0 2e 4d 4f 56 20 75 70  5f 64 6f 77 6e 2c 23 97  |..MOV up_down,#.|
000005d0  22 4d 22 2b 31 32 38 20  20 20 20 20 3b 20 63 6c  |"M"+128     ; cl|
000005e0  65 61 72 20 70 6f 69 6e  74 65 72 73 0d 03 ca 1a  |ear pointers....|
000005f0  4d 4f 56 20 73 68 69 70  78 2c 23 73 63 72 5f 78  |MOV shipx,#scr_x|
00000600  68 69 67 68 2f 32 0d 03  d4 13 4d 4f 56 20 73 70  |high/2....MOV sp|
00000610  65 65 64 2c 23 72 61 74  65 0d 03 de 12 4d 4f 56  |eed,#rate....MOV|
00000620  20 76 61 64 65 72 73 2c  23 33 32 0d 03 e8 0e 4d  | vaders,#32....M|
00000630  4f 56 20 52 30 2c 23 36  34 0d 03 f2 0d 41 44 52  |OV R0,#64....ADR|
00000640  20 52 31 2c 78 30 0d 03  fc 0f 2e 69 6e 69 74 5f  | R1,x0.....init_|
00000650  76 61 64 65 72 0d 04 06  34 53 55 42 53 20 52 30  |vader...4SUBS R0|
00000660  2c 52 30 2c 23 31 3c 3c  31 20 20 20 20 20 20 20  |,R0,#1<<1       |
00000670  20 20 20 20 20 20 20 20  20 3b 20 77 65 20 77 61  |         ; we wa|
00000680  6e 74 20 33 31 20 2d 20  30 0d 04 10 11 80 20 52  |nt 31 - 0..... R|
00000690  32 2c 52 30 2c 23 33 3c  3c 31 0d 04 1a 10 41 44  |2,R0,#3<<1....AD|
000006a0  44 20 52 32 2c 52 32 2c  23 32 0d 04 24 12 80 20  |D R2,R2,#2..$.. |
000006b0  52 33 2c 52 30 2c 23 32  38 3c 3c 31 0d 04 2e 14  |R3,R0,#28<<1....|
000006c0  4d 4f 56 20 52 33 2c 52  33 2c 4c 53 52 20 23 31  |MOV R3,R3,LSR #1|
000006d0  0d 04 38 1a 53 54 52 20  52 33 2c 5b 52 31 5d 2c  |..8.STR R3,[R1],|
000006e0  23 34 20 20 20 3b 78 70  6f 73 0d 04 42 2f 53 54  |#4   ;xpos..B/ST|
000006f0  52 20 52 32 2c 5b 52 31  5d 2c 23 38 20 20 20 3b  |R R2,[R1],#8   ;|
00000700  79 70 6f 73 20 20 20 73  6b 69 70 20 6d 69 73 73  |ypos   skip miss|
00000710  69 6c 65 20 78 20 70 6f  73 0d 04 4c 26 53 54 52  |ile x pos..L&STR|
00000720  20 6d 69 73 73 79 2c 5b  52 31 5d 2c 23 34 3b 20  | missy,[R1],#4; |
00000730  63 6f 6e 76 65 6e 69 65  6e 74 20 7a 65 72 6f 0d  |convenient zero.|
00000740  04 56 29 42 50 4c 20 69  6e 69 74 5f 76 61 64 65  |.V)BPL init_vade|
00000750  72 20 20 20 3b 20 30 20  69 73 20 61 20 76 61 6c  |r   ; 0 is a val|
00000760  69 64 20 76 61 64 65 72  0d 04 60 11 42 20 64 72  |id vader..`.B dr|
00000770  61 77 5f 73 63 72 65 65  6e 0d 04 6a 04 0d 04 74  |aw_screen..j...t|
00000780  04 0d 04 7e 09 2e 6d 61  69 6e 0d 04 88 19 3b 20  |...~..main....; |
00000790  74 65 73 74 20 66 6f 72  20 76 61 64 65 72 20 66  |test for vader f|
000007a0  69 72 65 0d 04 92 37 3b  20 67 65 74 20 72 61 6e  |ire...7; get ran|
000007b0  64 6f 6d 20 6e 75 6d 62  65 72 20 30 2d 33 31 20  |dom number 0-31 |
000007c0  66 6f 72 20 70 6f 74 65  6e 74 69 61 6c 20 66 69  |for potential fi|
000007d0  72 69 6e 67 20 76 61 64  65 72 0d 04 9c 0d 4d 4f  |ring vader....MO|
000007e0  56 20 52 30 2c 23 30 0d  04 a6 0d 4d 4f 56 20 52  |V R0,#0....MOV R|
000007f0  31 2c 23 35 0d 04 b0 10  4c 44 52 20 52 32 2c 73  |1,#5....LDR R2,s|
00000800  65 65 64 32 0d 04 ba 0f  4c 44 52 20 52 33 2c 73  |eed2....LDR R3,s|
00000810  65 65 64 0d 04 c4 04 0d  04 ce 08 2e 72 6e 64 0d  |eed.........rnd.|
00000820  04 d8 14 4d 4f 56 53 20  52 32 2c 52 32 2c 4c 53  |...MOVS R2,R2,LS|
00000830  4c 23 31 0d 04 e2 10 82  43 53 20 52 32 2c 52 32  |L#1.....CS R2,R2|
00000840  2c 52 33 0d 04 ec 10 41  44 43 20 52 30 2c 52 30  |,R3....ADC R0,R0|
00000850  2c 52 30 0d 04 f6 11 53  55 42 53 20 52 31 2c 52  |,R0....SUBS R1,R|
00000860  31 2c 23 31 0d 05 00 0b  42 4e 45 20 72 6e 64 0d  |1,#1....BNE rnd.|
00000870  05 0a 10 53 54 52 20 52  32 2c 73 65 65 64 32 0d  |...STR R2,seed2.|
00000880  05 14 04 0d 05 1e 31 3b  6e 6f 77 20 74 65 73 74  |......1;now test|
00000890  20 75 70 74 6f 20 6c 65  76 65 6c 2b 31 20 73 6c  | upto level+1 sl|
000008a0  6f 74 73 20 66 6f 72 20  66 72 65 65 20 6d 69 73  |ots for free mis|
000008b0  73 69 6c 65 0d 05 28 13  41 44 44 20 52 31 2c 6c  |sile..(.ADD R1,l|
000008c0  65 76 65 6c 2c 23 31 0d  05 32 18 43 4d 50 20 52  |evel,#1..2.CMP R|
000008d0  31 2c 23 6d 61 78 5f 6d  69 73 73 69 6c 65 73 0d  |1,#max_missiles.|
000008e0  05 3c 1a 4d 4f 56 48 53  20 52 31 2c 23 6d 61 78  |.<.MOVHS R1,#max|
000008f0  5f 6d 69 73 73 69 6c 65  73 0d 05 46 0e 41 44 52  |_missiles..F.ADR|
00000900  20 52 32 2c 76 6d 79 0d  05 50 14 2e 74 65 73 74  | R2,vmy..P..test|
00000910  5f 76 61 64 65 72 5f 66  69 72 65 0d 05 5a 13 4c  |_vader_fire..Z.L|
00000920  44 52 20 52 33 2c 5b 52  32 5d 2c 23 31 36 0d 05  |DR R3,[R2],#16..|
00000930  64 0d 43 4d 50 20 52 33  2c 23 30 0d 05 6e 11 3b  |d.CMP R3,#0..n.;|
00000940  20 76 61 64 65 72 5f 66  69 72 65 73 0d 05 78 3c  | vader_fires..x<|
00000950  53 55 42 45 51 20 52 33  2c 52 32 2c 23 32 30 20  |SUBEQ R3,R2,#20 |
00000960  20 20 20 20 20 20 3b 52  33 20 6e 6f 77 20 70 6f  |      ;R3 now po|
00000970  69 6e 74 73 20 74 6f 20  78 5f 70 6f 73 20 6f 66  |ints to x_pos of|
00000980  20 6d 69 73 73 69 6c 65  0d 05 82 0f 41 44 52 45  | missile....ADRE|
00000990  51 20 52 32 2c 78 30 0d  05 8c 3a 41 44 44 45 51  |Q R2,x0...:ADDEQ|
000009a0  20 52 32 2c 52 32 2c 52  30 2c 4c 53 4c 20 23 34  | R2,R2,R0,LSL #4|
000009b0  20 3b 52 33 20 6e 6f 77  20 70 6f 69 6e 74 73 20  | ;R3 now points |
000009c0  74 6f 20 78 5f 70 6f 73  20 6f 66 20 76 61 64 65  |to x_pos of vade|
000009d0  72 0d 05 96 16 4c 44 4d  45 51 49 41 20 52 32 2c  |r....LDMEQIA R2,|
000009e0  7b 52 30 2c 52 31 7d 0d  05 a0 55 53 54 4d 45 51  |{R0,R1}...USTMEQ|
000009f0  49 41 20 52 33 2c 7b 52  30 2c 52 31 7d 20 20 20  |IA R3,{R0,R1}   |
00000a00  20 3b 63 6f 70 79 20 70  6f 73 69 74 69 6f 6e 20  | ;copy position |
00000a10  61 63 72 6f 73 73 20 2d  20 64 65 61 64 20 76 61  |across - dead va|
00000a20  64 65 72 20 77 69 6c 6c  20 67 69 76 65 20 61 20  |der will give a |
00000a30  64 65 61 64 20 6d 69 73  73 69 6c 65 0d 05 aa 13  |dead missile....|
00000a40  53 55 42 4e 45 53 20 52  31 2c 52 31 2c 23 31 0d  |SUBNES R1,R1,#1.|
00000a50  05 b4 17 42 4e 45 20 74  65 73 74 5f 76 61 64 65  |...BNE test_vade|
00000a60  72 5f 66 69 72 65 0d 05  be 04 0d 05 c8 04 0d 05  |r_fire..........|
00000a70  d2 1b 3b 20 75 70 64 61  74 65 20 76 61 64 65 72  |..; update vader|
00000a80  20 6d 69 73 73 69 6c 65  73 0d 05 dc 0b 2e 75 70  | missiles.....up|
00000a90  64 61 74 65 0d 05 e6 0e  41 44 52 20 52 30 2c 76  |date....ADR R0,v|
00000aa0  6d 79 0d 05 f0 18 4d 4f  56 20 52 32 2c 23 6d 61  |my....MOV R2,#ma|
00000ab0  78 5f 6d 69 73 73 69 6c  65 73 0d 05 fa 0c 2e 6d  |x_missiles.....m|
00000ac0  69 73 73 69 6c 65 0d 06  04 26 4c 44 52 20 52 33  |issile...&LDR R3|
00000ad0  2c 5b 52 30 5d 20 20 20  20 20 20 20 3b 20 67 65  |,[R0]       ; ge|
00000ae0  74 20 79 20 70 6f 73 69  74 69 6f 6e 0d 06 0e 0d  |t y position....|
00000af0  43 4d 50 20 52 33 2c 23  30 0d 06 18 33 41 44 44  |CMP R3,#0...3ADD|
00000b00  4e 45 20 52 33 2c 52 33  2c 23 31 20 20 20 20 3b  |NE R3,R3,#1    ;|
00000b10  6d 6f 76 65 20 64 6f 77  6e 20 69 66 20 6d 69 73  |move down if mis|
00000b20  73 69 6c 65 20 70 72 65  73 65 6e 74 0d 06 22 14  |sile present..".|
00000b30  43 4d 50 20 52 33 2c 23  70 6c 61 79 65 72 5f 79  |CMP R3,#player_y|
00000b40  0d 06 2c 2d 4d 4f 56 48  49 20 52 33 2c 23 30 20  |..,-MOVHI R3,#0 |
00000b50  20 20 20 20 20 20 3b 63  6c 65 61 72 20 69 66 20  |      ;clear if |
00000b60  62 65 79 6f 6e 64 20 70  6c 61 79 65 72 0d 06 36  |beyond player..6|
00000b70  37 4c 44 52 45 51 20 52  31 2c 5b 52 30 2c 23 2d  |7LDREQ R1,[R0,#-|
00000b80  34 5d 20 20 3b 69 66 20  6f 6e 20 70 6c 61 79 65  |4]  ;if on playe|
00000b90  72 20 72 6f 77 2c 20 63  68 65 63 6b 20 66 6f 72  |r row, check for|
00000ba0  20 68 69 74 0d 06 40 12  43 4d 50 45 51 20 52 31  | hit..@.CMPEQ R1|
00000bb0  2c 73 68 69 70 78 0d 06  4a 0f 42 45 51 20 72 65  |,shipx..J.BEQ re|
00000bc0  73 74 61 72 74 0d 06 54  2c 53 54 52 20 52 33 2c  |start..T,STR R3,|
00000bd0  5b 52 30 5d 2c 23 31 36  20 20 20 20 3b 20 73 61  |[R0],#16    ; sa|
00000be0  76 65 20 6e 65 77 20 79  20 70 6f 73 69 74 69 6f  |ve new y positio|
00000bf0  6e 0d 06 5e 11 53 55 42  53 20 52 32 2c 52 32 2c  |n..^.SUBS R2,R2,|
00000c00  23 31 0d 06 68 0f 42 4e  45 20 6d 69 73 73 69 6c  |#1..h.BNE missil|
00000c10  65 0d 06 72 04 0d 06 7c  04 0d 06 86 10 2e 6d 6f  |e..r...|......mo|
00000c20  76 65 5f 76 61 64 65 72  73 0d 06 90 19 3b 20 63  |ve_vaders....; c|
00000c30  68 65 63 6b 20 73 70 65  65 64 20 63 6f 75 6e 74  |heck speed count|
00000c40  65 72 0d 06 9a 16 53 55  42 20 73 70 65 65 64 2c  |er....SUB speed,|
00000c50  73 70 65 65 64 2c 23 31  0d 06 a4 13 43 4d 50 20  |speed,#1....CMP |
00000c60  73 70 65 65 64 2c 6c 65  76 65 6c 0d 06 ae 15 4d  |speed,level....M|
00000c70  4f 56 4c 53 20 73 70 65  65 64 2c 23 72 61 74 65  |OVLS speed,#rate|
00000c80  0d 06 b8 14 42 48 49 20  76 61 64 65 72 73 5f 6d  |....BHI vaders_m|
00000c90  6f 76 65 64 0d 06 c2 59  3b 6f 6e 6c 79 20 6d 6f  |oved...Y;only mo|
00000ca0  76 65 20 76 61 64 65 72  73 20 69 66 20 73 70 65  |ve vaders if spe|
00000cb0  65 64 20 63 6f 75 6e 74  65 72 20 3c 20 6c 65 76  |ed counter < lev|
00000cc0  65 6c 20 28 61 6c 77 61  79 73 20 69 66 20 6c 65  |el (always if le|
00000cd0  76 65 6c 20 22 6d 61 78  5f 6d 69 73 73 69 6c 65  |vel "max_missile|
00000ce0  73 22 20 6f 72 20 68 69  67 68 65 72 29 0d 06 cc  |s" or higher)...|
00000cf0  1f 3b 20 75 70 64 61 74  65 20 76 61 64 65 72 20  |.; update vader |
00000d00  75 70 2f 64 6f 77 6e 20  66 6c 61 67 0d 06 d6 25  |up/down flag...%|
00000d10  53 57 49 20 4f 53 5f 57  72 69 74 65 49 2b 37 20  |SWI OS_WriteI+7 |
00000d20  20 20 20 20 3b 73 6f 75  6e 64 20 62 65 65 70 65  |    ;sound beepe|
00000d30  72 0d 06 e0 1a 82 20 75  70 5f 64 6f 77 6e 2c 75  |r..... up_down,u|
00000d40  70 5f 64 6f 77 6e 2c 23  26 31 41 0d 06 ea 16 54  |p_down,#&1A....T|
00000d50  53 54 20 75 70 5f 64 6f  77 6e 2c 23 31 3c 3c 33  |ST up_down,#1<<3|
00000d60  31 0d 06 f4 21 6d 76 6e  20 72 31 2c 23 31 20 20  |1...!mvn r1,#1  |
00000d70  20 3b 22 61 64 64 69 74  69 6f 6e 20 76 61 6c 75  | ;"addition valu|
00000d80  65 22 0d 06 fe 22 6d 76  6e 20 72 34 2c 23 30 20  |e"..."mvn r4,#0 |
00000d90  20 20 3b 65 6e 64 20 6f  66 20 6c 69 6e 65 20 76  |  ;end of line v|
00000da0  61 6c 75 65 0d 07 08 12  4d 4f 56 65 71 20 72 31  |alue....MOVeq r1|
00000db0  2c 23 31 3c 3c 31 0d 07  12 10 6d 6f 76 65 71 20  |,#1<<1....moveq |
00000dc0  72 34 2c 23 34 30 0d 07  1c 0d 41 44 52 20 52 30  |r4,#40....ADR R0|
00000dd0  2c 78 30 0d 07 26 1d 3b  20 62 69 74 30 20 73 65  |,x0..&.; bit0 se|
00000de0  74 20 66 6f 72 20 65 6e  64 20 6f 66 20 72 6f 77  |t for end of row|
00000df0  0d 07 30 32 3b 72 6f 77  20 61 64 6a 75 73 74 20  |..02;row adjust |
00000e00  66 6f 72 20 6d 6f 76 65  20 64 6f 77 6e 20 72 6f  |for move down ro|
00000e10  75 74 69 6e 65 20 69 6e  20 72 65 6d 61 69 6e 64  |utine in remaind|
00000e20  65 72 0d 07 3a 0e 4d 4f  56 20 52 32 2c 23 33 32  |er..:.MOV R2,#32|
00000e30  0d 07 44 0c 2e 6d 5f 76  61 64 65 72 0d 07 4e 12  |..D..m_vader..N.|
00000e40  4c 44 52 20 52 33 2c 5b  52 30 2c 23 34 5d 0d 07  |LDR R3,[R0,#4]..|
00000e50  58 0d 43 4d 50 20 52 33  2c 23 30 0d 07 62 10 42  |X.CMP R3,#0..b.B|
00000e60  45 51 20 6d 5f 76 5f 64  65 61 64 0d 07 6c 0f 4c  |EQ m_v_dead..l.L|
00000e70  44 52 20 52 33 2c 5b 52  30 5d 0d 07 76 17 61 64  |DR R3,[R0]..v.ad|
00000e80  64 20 72 33 2c 72 33 2c  72 31 2c 61 73 72 20 23  |d r3,r3,r1,asr #|
00000e90  31 0d 07 80 0d 63 6d 70  20 72 33 2c 72 34 0d 07  |1....cmp r3,r4..|
00000ea0  8a 31 6f 72 72 65 71 20  52 31 2c 52 31 2c 23 31  |.1orreq R1,R1,#1|
00000eb0  20 20 20 3b 20 66 6c 61  67 20 73 65 74 20 66 6f  |   ; flag set fo|
00000ec0  72 20 65 6e 64 20 6f 66  20 73 63 72 65 65 6e 0d  |r end of screen.|
00000ed0  07 94 0d 2e 6d 5f 76 5f  64 65 61 64 0d 07 9e 13  |....m_v_dead....|
00000ee0  53 54 52 20 52 33 2c 5b  52 30 5d 2c 23 31 36 0d  |STR R3,[R0],#16.|
00000ef0  07 a8 11 53 55 42 53 20  52 32 2c 52 32 2c 23 31  |...SUBS R2,R2,#1|
00000f00  0d 07 b2 0f 42 4e 45 20  6d 5f 76 61 64 65 72 0d  |....BNE m_vader.|
00000f10  07 bc 0d 54 53 54 20 52  31 2c 23 31 0d 07 c6 14  |...TST R1,#1....|
00000f20  42 45 51 20 76 61 64 65  72 73 5f 6d 6f 76 65 64  |BEQ vaders_moved|
00000f30  0d 07 d0 04 0d 07 da 0e  2e 6d 6f 76 65 5f 64 6f  |.........move_do|
00000f40  77 6e 0d 07 e4 0d 41 44  52 20 52 30 2c 78 30 0d  |wn....ADR R0,x0.|
00000f50  07 ee 10 42 49 43 20 52  31 2c 52 31 2c 23 31 0d  |...BIC R1,R1,#1.|
00000f60  07 f8 0e 4d 4f 56 20 52  32 2c 23 33 32 0d 08 02  |...MOV R2,#32...|
00000f70  0b 2e 6d 5f 64 6f 77 6e  0d 08 0c 12 4c 44 52 20  |..m_down....LDR |
00000f80  52 34 2c 5b 52 30 2c 23  34 5d 0d 08 16 0d 43 4d  |R4,[R0,#4]....CM|
00000f90  50 20 52 34 2c 23 30 0d  08 20 12 3b 20 42 45 51  |P R4,#0.. .; BEQ|
00000fa0  20 6d 5f 64 5f 64 65 61  64 0d 08 2a 0f 4c 44 52  | m_d_dead..*.LDR|
00000fb0  20 52 33 2c 5b 52 30 5d  0d 08 34 17 73 75 62 20  | R3,[R0]..4.sub |
00000fc0  52 33 2c 52 33 2c 52 31  2c 41 53 52 20 23 31 0d  |R3,R3,R1,ASR #1.|
00000fd0  08 3e 12 41 44 44 4e 45  20 52 34 2c 52 34 2c 23  |.>.ADDNE R4,R4,#|
00000fe0  31 0d 08 48 14 43 4d 50  20 52 34 2c 23 70 6c 61  |1..H.CMP R4,#pla|
00000ff0  79 65 72 5f 79 0d 08 52  2c 84 52 45 51 20 52 31  |yer_y..R,.REQ R1|
00001000  2c 52 31 2c 23 31 20 20  20 3b 20 66 6c 61 67 20  |,R1,#1   ; flag |
00001010  73 65 74 20 66 6f 72 20  67 61 6d 65 5f 6f 76 65  |set for game_ove|
00001020  72 0d 08 5c 12 53 54 52  20 52 34 2c 5b 52 30 2c  |r..\.STR R4,[R0,|
00001030  23 34 5d 0d 08 66 0d 2e  6d 5f 64 5f 64 65 61 64  |#4]..f..m_d_dead|
00001040  0d 08 70 13 53 54 52 20  52 33 2c 5b 52 30 5d 2c  |..p.STR R3,[R0],|
00001050  23 31 36 0d 08 7a 11 53  55 42 53 20 52 32 2c 52  |#16..z.SUBS R2,R|
00001060  32 2c 23 31 0d 08 84 0e  42 4e 45 20 6d 5f 64 6f  |2,#1....BNE m_do|
00001070  77 6e 0d 08 8e 0d 54 53  54 20 52 31 2c 23 31 0d  |wn....TST R1,#1.|
00001080  08 98 0f 42 4e 45 20 72  65 73 74 61 72 74 0d 08  |...BNE restart..|
00001090  a2 1c 82 20 75 70 5f 64  6f 77 6e 2c 75 70 5f 64  |... up_down,up_d|
000010a0  6f 77 6e 2c 23 31 3c 3c  33 31 0d 08 ac 04 0d 08  |own,#1<<31......|
000010b0  b6 04 0d 08 c0 11 2e 76  61 64 65 72 73 5f 6d 6f  |.......vaders_mo|
000010c0  76 65 64 0d 08 ca 1b 3b  20 75 70 64 61 74 65 20  |ved....; update |
000010d0  70 6c 61 79 65 72 20 6d  69 73 73 69 6c 65 0d 08  |player missile..|
000010e0  d4 26 43 4d 50 20 6d 69  73 73 79 2c 23 30 20 20  |.&CMP missy,#0  |
000010f0  20 20 20 20 20 20 20 20  20 3b 6e 6f 20 6d 69 73  |         ;no mis|
00001100  73 69 6c 65 0d 08 de 19  53 55 42 4e 45 53 20 6d  |sile....SUBNES m|
00001110  69 73 73 79 2c 6d 69 73  73 79 2c 23 31 0d 08 e8  |issy,missy,#1...|
00001120  13 42 45 51 20 64 72 61  77 5f 73 63 72 65 65 6e  |.BEQ draw_screen|
00001130  0d 08 f2 1c 3b 20 68 61  73 20 70 6c 61 79 65 72  |....; has player|
00001140  20 68 69 74 20 61 20 76  61 64 65 72 0d 08 fc 0d  | hit a vader....|
00001150  41 44 52 20 52 30 2c 78  30 0d 09 06 0e 4d 4f 56  |ADR R0,x0....MOV|
00001160  20 52 32 2c 23 33 32 0d  09 10 09 2e 68 69 74 31  | R2,#32.....hit1|
00001170  0d 09 1a 19 4c 44 52 20  52 33 2c 5b 52 30 5d 2c  |....LDR R3,[R0],|
00001180  23 34 20 20 20 20 3b 20  78 0d 09 24 19 4c 44 52  |#4    ; x..$.LDR|
00001190  20 52 31 2c 5b 52 30 5d  2c 23 31 32 20 20 20 3b  | R1,[R0],#12   ;|
000011a0  20 79 0d 09 2e 0d 43 4d  50 20 6d 78 2c 52 33 0d  | y....CMP mx,R3.|
000011b0  09 38 54 43 4d 50 45 51  20 6d 69 73 73 79 2c 52  |.8TCMPEQ missy,R|
000011c0  31 20 20 20 20 3b 73 69  6e 63 65 20 6d 69 73 73  |1    ;since miss|
000011d0  69 6c 65 27 73 20 59 20  70 6f 73 20 63 61 6e 27  |ile's Y pos can'|
000011e0  74 20 62 65 20 7a 65 72  6f 20 77 65 20 6e 65 76  |t be zero we nev|
000011f0  65 72 20 68 69 74 20 61  20 64 65 61 64 20 76 61  |er hit a dead va|
00001200  64 65 72 0d 09 42 0e 42  45 51 20 68 69 74 5f 69  |der..B.BEQ hit_i|
00001210  74 0d 09 4c 09 2e 68 69  74 32 0d 09 56 11 53 55  |t..L..hit2..V.SU|
00001220  42 53 20 52 32 2c 52 32  2c 23 31 0d 09 60 0c 42  |BS R2,R2,#1..`.B|
00001230  4e 45 20 68 69 74 31 0d  09 6a 11 42 20 64 72 61  |NE hit1..j.B dra|
00001240  77 5f 73 63 72 65 65 6e  0d 09 74 04 0d 09 7e 04  |w_screen..t...~.|
00001250  0d 09 88 0b 2e 68 69 74  5f 69 74 0d 09 92 10 4d  |.....hit_it....M|
00001260  4f 56 20 6d 69 73 73 79  2c 23 30 0d 09 9c 17 41  |OV missy,#0....A|
00001270  44 44 20 73 63 6f 72 65  2c 73 63 6f 72 65 2c 23  |DD score,score,#|
00001280  31 30 0d 09 a6 0f 4c 44  52 20 52 31 2c 68 69 67  |10....LDR R1,hig|
00001290  68 0d 09 b0 10 43 4d 50  20 73 63 6f 72 65 2c 52  |h....CMP score,R|
000012a0  31 0d 09 ba 14 53 54 52  48 49 20 73 63 6f 72 65  |1....STRHI score|
000012b0  2c 68 69 67 68 0d 09 c4  43 53 54 52 20 6d 69 73  |,high...CSTR mis|
000012c0  73 79 2c 5b 52 30 2c 23  2d 31 32 5d 20 20 20 20  |sy,[R0,#-12]    |
000012d0  3b 73 65 74 20 59 20 70  6f 73 69 74 69 6f 6e 20  |;set Y position |
000012e0  74 6f 20 7a 65 72 6f 20  66 6f 72 20 61 20 64 65  |to zero for a de|
000012f0  61 64 20 76 61 64 65 72  0d 09 ce 19 53 55 42 53  |ad vader....SUBS|
00001300  20 76 61 64 65 72 73 2c  76 61 64 65 72 73 2c 23  | vaders,vaders,#|
00001310  31 0d 09 d8 18 41 44 44  45 51 20 6c 65 76 65 6c  |1....ADDEQ level|
00001320  2c 6c 65 76 65 6c 2c 23  31 0d 09 e2 11 42 45 51  |,level,#1....BEQ|
00001330  20 6e 65 77 5f 6c 65 76  65 6c 0d 09 ec 04 0d 09  | new_level......|
00001340  f6 04 0d 0a 00 10 2e 64  72 61 77 5f 73 63 72 65  |.......draw_scre|
00001350  65 6e 0d 0a 0a 26 3b 20  66 69 72 73 74 20 77 61  |en...&; first wa|
00001360  69 74 20 66 6f 72 20 33  20 76 73 79 6e 63 73 20  |it for 3 vsyncs |
00001370  74 6f 20 6f 63 63 75 72  0d 0a 14 0e 4d 4f 56 20  |to occur....MOV |
00001380  52 30 2c 23 31 39 0d 0a  1e 11 53 57 49 20 22 4f  |R0,#19....SWI "O|
00001390  53 5f 42 79 74 65 22 0d  0a 28 11 53 57 49 20 22  |S_Byte"..(.SWI "|
000013a0  4f 53 5f 42 79 74 65 22  0d 0a 32 11 53 57 49 20  |OS_Byte"..2.SWI |
000013b0  22 4f 53 5f 42 79 74 65  22 0d 0a 3c 1a 3b 20 6e  |"OS_Byte"..<.; n|
000013c0  6f 77 20 63 6c 65 61 72  20 74 68 65 20 73 63 72  |ow clear the scr|
000013d0  65 65 6e 0d 0a 46 11 4c  44 52 20 52 30 2c 73 63  |een..F.LDR R0,sc|
000013e0  72 65 65 6e 0d 0a 50 13  4d 4f 56 20 52 31 2c 23  |reen..P.MOV R1,#|
000013f0  31 35 2a 31 30 32 34 0d  0a 5a 0d 4d 4f 56 20 52  |15*1024..Z.MOV R|
00001400  32 2c 23 30 0d 0a 64 09  2e 63 6c 73 31 0d 0a 6e  |2,#0..d..cls1..n|
00001410  12 53 54 52 20 52 32 2c  5b 52 30 5d 2c 23 34 0d  |.STR R2,[R0],#4.|
00001420  0a 78 12 53 54 52 20 52  32 2c 5b 52 30 5d 2c 23  |.x.STR R2,[R0],#|
00001430  34 0d 0a 82 12 53 54 52  20 52 32 2c 5b 52 30 5d  |4....STR R2,[R0]|
00001440  2c 23 34 0d 0a 8c 12 53  54 52 20 52 32 2c 5b 52  |,#4....STR R2,[R|
00001450  30 5d 2c 23 34 0d 0a 96  12 53 55 42 53 20 52 31  |0],#4....SUBS R1|
00001460  2c 52 31 2c 23 31 36 0d  0a a0 0c 42 4e 45 20 63  |,R1,#16....BNE c|
00001470  6c 73 31 0d 0a aa 04 0d  0a b4 04 0d 0a be 15 3b  |ls1............;|
00001480  20 6e 6f 77 20 64 72 61  77 20 76 61 64 65 72 73  | now draw vaders|
00001490  0d 0a c8 0e 4d 4f 56 20  52 33 2c 23 33 32 0d 0a  |....MOV R3,#32..|
000014a0  d2 0d 41 44 52 20 52 32  2c 78 30 0d 0a dc 13 53  |..ADR R2,x0....S|
000014b0  57 49 20 22 4f 53 5f 57  72 69 74 65 53 22 0d 0a  |WI "OS_WriteS"..|
000014c0  e6 0b 45 51 55 42 20 31  37 0d 0a f0 0a 45 51 55  |..EQUB 17....EQU|
000014d0  42 20 31 0d 0a fa 0a 45  51 55 42 20 30 0d 0b 04  |B 1....EQUB 0...|
000014e0  0a 45 51 55 42 20 30 0d  0b 0e 09 2e 64 72 61 77  |.EQUB 0.....draw|
000014f0  0d 0b 18 14 53 57 49 20  4f 53 5f 57 72 69 74 65  |....SWI OS_Write|
00001500  49 2b 33 31 0d 0b 22 15  4c 44 4d 49 41 20 52 32  |I+31..".LDMIA R2|
00001510  21 2c 7b 52 30 2c 52 31  7d 0d 0b 2c 13 53 57 49  |!,{R0,R1}..,.SWI|
00001520  20 22 4f 53 5f 57 72 69  74 65 43 22 0d 0b 36 0e  | "OS_WriteC"..6.|
00001530  4d 4f 56 53 20 52 30 2c  52 31 0d 0b 40 13 53 57  |MOVS R0,R1..@.SW|
00001540  49 20 22 4f 53 5f 57 72  69 74 65 43 22 0d 0b 4a  |I "OS_WriteC"..J|
00001550  12 4d 4f 56 20 52 30 2c  75 70 5f 64 6f 77 6e 0d  |.MOV R0,up_down.|
00001560  0b 54 1a 82 20 75 70 5f  64 6f 77 6e 2c 75 70 5f  |.T.. up_down,up_|
00001570  64 6f 77 6e 2c 23 26 31  41 0d 0b 5e 15 53 57 49  |down,#&1A..^.SWI|
00001580  4e 45 20 22 4f 53 5f 57  72 69 74 65 43 22 0d 0b  |NE "OS_WriteC"..|
00001590  68 14 53 57 49 20 4f 53  5f 57 72 69 74 65 49 2b  |h.SWI OS_WriteI+|
000015a0  33 31 0d 0b 72 15 4c 44  4d 49 41 20 52 32 21 2c  |31..r.LDMIA R2!,|
000015b0  7b 52 30 2c 52 31 7d 0d  0b 7c 13 53 57 49 20 22  |{R0,R1}..|.SWI "|
000015c0  4f 53 5f 57 72 69 74 65  43 22 0d 0b 86 0e 4d 4f  |OS_WriteC"....MO|
000015d0  56 53 20 52 30 2c 52 31  0d 0b 90 13 53 57 49 20  |VS R0,R1....SWI |
000015e0  22 4f 53 5f 57 72 69 74  65 43 22 0d 0b 9a 10 4d  |"OS_WriteC"....M|
000015f0  4f 56 20 52 30 2c 23 97  22 7c 22 0d 0b a4 15 53  |OV R0,#."|"....S|
00001600  57 49 4e 45 20 22 4f 53  5f 57 72 69 74 65 43 22  |WINE "OS_WriteC"|
00001610  0d 0b ae 11 53 55 42 53  20 52 33 2c 52 33 2c 23  |....SUBS R3,R3,#|
00001620  31 0d 0b b8 0c 42 4e 45  20 64 72 61 77 0d 0b c2  |1....BNE draw...|
00001630  04 0d 0b cc 04 0d 0b d6  12 3b 20 70 72 69 6e 74  |.........; print|
00001640  20 70 6c 61 79 65 72 0d  0b e0 13 53 57 49 20 22  | player....SWI "|
00001650  4f 53 5f 57 72 69 74 65  53 22 0d 0b ea 0b 45 51  |OS_WriteS"....EQ|
00001660  55 42 20 31 37 0d 0b f4  0a 45 51 55 42 20 33 0d  |UB 17....EQUB 3.|
00001670  0b fe 0b 45 51 55 42 20  33 31 0d 0c 08 0a 45 51  |...EQUB 31....EQ|
00001680  55 42 20 30 0d 0c 12 10  4d 4f 56 20 52 30 2c 73  |UB 0....MOV R0,s|
00001690  68 69 70 78 0d 0c 1c 13  53 57 49 20 22 4f 53 5f  |hipx....SWI "OS_|
000016a0  57 72 69 74 65 43 22 0d  0c 26 13 53 57 49 20 22  |WriteC"..&.SWI "|
000016b0  4f 53 5f 57 72 69 74 65  53 22 0d 0c 30 11 45 51  |OS_WriteS"..0.EQ|
000016c0  55 42 20 70 6c 61 79 65  72 5f 79 0d 0c 3a 11 45  |UB player_y..:.E|
000016d0  51 55 42 20 97 22 41 22  2b 31 32 38 0d 0c 44 21  |QUB ."A"+128..D!|
000016e0  3b 20 74 61 62 20 63 68  61 72 61 63 74 65 72 20  |; tab character |
000016f0  6e 65 65 64 65 64 20 62  65 6c 6c 6f 77 0d 0c 4e  |needed bellow..N|
00001700  0b 45 51 55 42 20 33 31  0d 0c 58 0a 45 51 55 42  |.EQUB 31..X.EQUB|
00001710  20 30 0d 0c 62 04 0d 0c  6c 19 3b 70 72 69 6e 74  | 0..b...l.;print|
00001720  20 70 6c 61 79 65 72 5f  6d 69 73 73 69 6c 65 0d  | player_missile.|
00001730  0c 76 0d 6d 6f 76 20 52  30 2c 6d 78 0d 0c 80 13  |.v.mov R0,mx....|
00001740  53 57 49 20 22 4f 53 5f  57 72 69 74 65 43 22 0d  |SWI "OS_WriteC".|
00001750  0c 8a 11 4d 4f 56 53 20  52 30 2c 6d 69 73 73 79  |...MOVS R0,missy|
00001760  0d 0c 94 13 53 57 49 20  22 4f 53 5f 57 72 69 74  |....SWI "OS_Writ|
00001770  65 43 22 0d 0c 9e 18 53  57 49 4e 45 20 4f 53 5f  |eC"....SWINE OS_|
00001780  57 72 69 74 65 49 2b 97  22 7c 22 0d 0c a8 04 0d  |WriteI+."|".....|
00001790  0c b2 04 0d 0c bc 10 2e  70 72 69 6e 74 5f 73 63  |........print_sc|
000017a0  6f 72 65 0d 0c c6 10 4d  4f 56 20 52 30 2c 73 63  |ore....MOV R0,sc|
000017b0  6f 72 65 0d 0c d0 11 41  44 52 20 52 31 2c 62 75  |ore....ADR R1,bu|
000017c0  66 66 65 72 0d 0c da 0e  4d 4f 56 20 52 32 2c 23  |ffer....MOV R2,#|
000017d0  31 32 0d 0c e4 1d 53 57  49 20 22 4f 53 5f 43 6f  |12....SWI "OS_Co|
000017e0  6e 76 65 72 74 43 61 72  64 69 6e 61 6c 34 22 0d  |nvertCardinal4".|
000017f0  0c ee 13 53 57 49 20 22  4f 53 5f 57 72 69 74 65  |...SWI "OS_Write|
00001800  53 22 0d 0c f8 13 20 20  20 20 20 20 20 20 45 51  |S"....        EQ|
00001810  55 42 20 31 37 0d 0d 02  12 20 20 20 20 20 20 20  |UB 17....       |
00001820  20 45 51 55 42 20 33 0d  0d 0c 13 20 20 20 20 20  | EQUB 3....     |
00001830  20 20 20 45 51 55 42 20  33 30 0d 0d 16 19 20 20  |   EQUB 30....  |
00001840  20 20 20 20 20 20 45 51  55 53 20 22 53 43 4f 52  |      EQUS "SCOR|
00001850  45 20 22 0d 0d 20 13 20  20 20 20 20 20 20 20 45  |E ".. .        E|
00001860  51 55 42 20 31 37 0d 0d  2a 12 20 20 20 20 20 20  |QUB 17..*.      |
00001870  20 20 45 51 55 42 20 32  0d 0d 34 12 20 20 20 20  |  EQUB 2..4.    |
00001880  20 20 20 20 45 51 55 42  20 30 0d 0d 3e 13 53 57  |    EQUB 0..>.SW|
00001890  49 20 22 4f 53 5f 57 72  69 74 65 30 22 0d 0d 48  |I "OS_Write0"..H|
000018a0  14 3b 74 68 65 6e 20 68  69 67 68 20 73 63 6f 72  |.;then high scor|
000018b0  65 0d 0d 52 0d 41 44 52  20 52 30 2c 68 69 0d 0d  |e..R.ADR R0,hi..|
000018c0  5c 0e 4d 4f 56 20 52 31  2c 23 32 34 0d 0d 66 13  |\.MOV R1,#24..f.|
000018d0  53 57 49 20 22 4f 53 5f  57 72 69 74 65 4e 22 0d  |SWI "OS_WriteN".|
000018e0  0d 70 0f 4c 44 52 20 52  30 2c 68 69 67 68 0d 0d  |.p.LDR R0,high..|
000018f0  7a 11 41 44 52 20 52 31  2c 62 75 66 66 65 72 0d  |z.ADR R1,buffer.|
00001900  0d 84 0e 4d 4f 56 20 52  32 2c 23 31 32 0d 0d 8e  |...MOV R2,#12...|
00001910  1d 53 57 49 20 22 4f 53  5f 43 6f 6e 76 65 72 74  |.SWI "OS_Convert|
00001920  43 61 72 64 69 6e 61 6c  34 22 0d 0d 98 13 53 57  |Cardinal4"....SW|
00001930  49 20 22 4f 53 5f 57 72  69 74 65 30 22 0d 0d a2  |I "OS_Write0"...|
00001940  04 0d 0d ac 04 0d 0d b6  12 3b 72 65 61 64 20 6b  |.........;read k|
00001950  65 79 62 6f 61 72 64 0d  0d c0 12 3b 72 65 61 64  |eyboard....;read|
00001960  20 6c 65 66 74 20 6b 65  79 0d 0d ca 0f 4d 4f 56  | left key....MOV|
00001970  20 52 30 2c 23 31 32 31  0d 0d d4 10 4d 4f 56 20  | R0,#121....MOV |
00001980  52 31 2c 23 6c 65 66 74  0d 0d de 11 53 57 49 20  |R1,#left....SWI |
00001990  22 4f 53 5f 42 79 74 65  22 0d 0d e8 0d 43 4d 50  |"OS_Byte"....CMP|
000019a0  20 52 31 2c 23 30 0d 0d  f2 0e 3b 6d 6f 76 65 20  | R1,#0....;move |
000019b0  6c 65 66 74 0d 0d fc 12  43 4d 50 4e 45 20 73 68  |left....CMPNE sh|
000019c0  69 70 78 2c 23 30 0d 0e  06 18 53 55 42 4e 45 20  |ipx,#0....SUBNE |
000019d0  73 68 69 70 78 2c 73 68  69 70 78 2c 23 31 0d 0e  |shipx,shipx,#1..|
000019e0  10 04 0d 0e 1a 04 0d 0e  24 11 4d 4f 56 20 52 31  |........$.MOV R1|
000019f0  2c 23 72 69 67 68 74 0d  0e 2e 11 53 57 49 20 22  |,#right....SWI "|
00001a00  4f 53 5f 42 79 74 65 22  0d 0e 38 0d 43 4d 50 20  |OS_Byte"..8.CMP |
00001a10  52 31 2c 23 30 0d 0e 42  0f 3b 6d 6f 76 65 5f 72  |R1,#0..B.;move_r|
00001a20  69 67 68 74 0d 0e 4c 1a  43 4d 50 4e 45 20 73 68  |ight..L.CMPNE sh|
00001a30  69 70 78 2c 23 73 63 72  5f 78 68 69 67 68 0d 0e  |ipx,#scr_xhigh..|
00001a40  56 18 41 44 44 4e 45 20  73 68 69 70 78 2c 73 68  |V.ADDNE shipx,sh|
00001a50  69 70 78 2c 23 31 0d 0e  60 04 0d 0e 6a 04 0d 0e  |ipx,#1..`...j...|
00001a60  74 10 43 4d 50 20 6d 69  73 73 79 2c 23 30 0d 0e  |t.CMP missy,#0..|
00001a70  7e 35 42 4e 45 20 74 65  73 74 5f 65 73 63 61 70  |~5BNE test_escap|
00001a80  65 20 20 20 3b 20 6e 6f  6e 20 30 20 6d 65 61 6e  |e   ; non 0 mean|
00001a90  73 20 6d 69 73 73 69 6c  65 20 69 6e 20 66 6c 69  |s missile in fli|
00001aa0  67 68 74 0d 0e 88 10 4d  4f 56 20 52 31 2c 23 66  |ght....MOV R1,#f|
00001ab0  69 72 65 0d 0e 92 11 53  57 49 20 22 4f 53 5f 42  |ire....SWI "OS_B|
00001ac0  79 74 65 22 0d 0e 9c 0d  43 4d 50 20 52 31 2c 23  |yte"....CMP R1,#|
00001ad0  30 0d 0e a6 19 3b 6e 65  77 20 6d 69 73 73 69 6c  |0....;new missil|
00001ae0  65 20 72 65 71 75 69 72  65 64 0d 0e b0 19 4d 4f  |e required....MO|
00001af0  56 4e 45 20 6d 69 73 73  79 2c 23 70 6c 61 79 65  |VNE missy,#playe|
00001b00  72 5f 79 0d 0e ba 12 6d  6f 76 4e 45 20 6d 78 2c  |r_y....movNE mx,|
00001b10  73 68 69 70 78 0d 0e c4  04 0d 0e ce 04 0d 0e d8  |shipx...........|
00001b20  10 2e 74 65 73 74 5f 65  73 63 61 70 65 0d 0e e2  |..test_escape...|
00001b30  1c 53 57 49 20 22 4f 53  5f 52 65 61 64 45 73 63  |.SWI "OS_ReadEsc|
00001b40  61 70 65 53 74 61 74 65  22 0d 0e ec 0c 42 43 43  |apeState"....BCC|
00001b50  20 6d 61 69 6e 0d 0e f6  04 0d 0f 00 0f 4d 4f 56  | main........MOV|
00001b60  20 52 30 2c 23 31 32 34  0d 0f 0a 11 53 57 49 20  | R0,#124....SWI |
00001b70  22 4f 53 5f 42 79 74 65  22 0d 0f 14 1b 53 57 49  |"OS_Byte"....SWI|
00001b80  20 22 4f 53 5f 52 65 73  74 6f 72 65 43 75 72 73  | "OS_RestoreCurs|
00001b90  6f 72 73 22 0d 0f 1e 0f  4d 4f 56 20 70 63 2c 6c  |ors"....MOV pc,l|
00001ba0  69 6e 6b 0d 0f 28 04 0d  0f 32 04 0d 0f 3c 0f 3b  |ink..(...2...<.;|
00001bb0  20 63 6f 6e 73 74 61 6e  74 73 0d 0f 46 14 2e 69  | constants..F..i|
00001bc0  6e 20 20 20 20 20 45 51  55 44 20 31 34 38 0d 0f  |n     EQUD 148..|
00001bd0  50 13 20 20 20 20 20 20  20 20 45 51 55 44 20 2d  |P.        EQUD -|
00001be0  31 0d 0f 5a 13 2e 68 69  20 20 20 20 20 45 51 55  |1..Z..hi     EQU|
00001bf0  42 20 33 31 0d 0f 64 13  20 20 20 20 20 20 20 20  |B 31..d.        |
00001c00  45 51 55 42 20 31 34 0d  0f 6e 12 20 20 20 20 20  |EQUB 14..n.     |
00001c10  20 20 20 45 51 55 42 20  30 0d 0f 78 1e 20 20 20  |   EQUB 0..x.   |
00001c20  20 20 20 20 20 45 51 55  53 20 22 49 6e 76 61 64  |     EQUS "Invad|
00001c30  65 72 73 20 31 4b 22 0d  0f 82 13 20 20 20 20 20  |ers 1K"....     |
00001c40  20 20 20 45 51 55 42 20  33 31 0d 0f 8c 13 20 20  |   EQUB 31....  |
00001c50  20 20 20 20 20 20 45 51  55 42 20 33 30 0d 0f 96  |      EQUB 30...|
00001c60  12 20 20 20 20 20 20 20  20 45 51 55 42 20 30 0d  |.        EQUB 0.|
00001c70  0f a0 18 20 20 20 20 20  20 20 20 45 51 55 53 20  |...        EQUS |
00001c80  22 48 49 47 48 20 22 0d  0f aa 13 20 20 20 20 20  |"HIGH "....     |
00001c90  20 20 20 45 51 55 42 20  31 37 0d 0f b4 12 20 20  |   EQUB 17....  |
00001ca0  20 20 20 20 20 20 45 51  55 42 20 33 0d 0f be 09  |      EQUB 3....|
00001cb0  41 4c 49 47 4e 0d 0f c8  04 0d 0f d2 19 3b 20 72  |ALIGN........; r|
00001cc0  65 6d 61 69 6e 69 6e 67  20 76 61 72 69 61 62 6c  |emaining variabl|
00001cd0  65 73 0d 0f dc 0b 2e 73  74 72 69 6e 67 0d 0f e6  |es.....string...|
00001ce0  0b 45 51 55 42 20 32 32  0d 0f f0 0a 45 51 55 42  |.EQUB 22....EQUB|
00001cf0  20 31 0d 0f fa 0b 45 51  55 42 20 32 33 0d 10 04  | 1....EQUB 23...|
00001d00  11 45 51 55 42 20 31 32  38 2b 97 22 4d 22 0d 10  |.EQUB 128+."M"..|
00001d10  0e 12 45 51 55 42 20 25  30 30 31 31 31 31 30 30  |..EQUB %00111100|
00001d20  0d 10 18 12 45 51 55 42  20 25 30 31 30 31 31 30  |....EQUB %010110|
00001d30  31 30 0d 10 22 12 45 51  55 42 20 25 30 31 30 31  |10..".EQUB %0101|
00001d40  31 30 31 30 0d 10 2c 12  45 51 55 42 20 25 30 31  |1010..,.EQUB %01|
00001d50  31 31 31 31 31 30 0d 10  36 12 45 51 55 42 20 25  |111110..6.EQUB %|
00001d60  30 30 30 31 31 30 30 30  0d 10 40 12 45 51 55 42  |00011000..@.EQUB|
00001d70  20 25 30 30 31 30 30 31  30 30 0d 10 4a 12 45 51  | %00100100..J.EQ|
00001d80  55 42 20 25 30 31 30 30  30 30 31 30 0d 10 54 12  |UB %01000010..T.|
00001d90  45 51 55 42 20 25 31 30  30 30 30 30 30 31 0d 10  |EQUB %10000001..|
00001da0  5e 0b 45 51 55 42 20 32  33 0d 10 68 11 45 51 55  |^.EQUB 23..h.EQU|
00001db0  42 20 31 32 38 2b 97 22  57 22 0d 10 72 12 45 51  |B 128+."W"..r.EQ|
00001dc0  55 42 20 25 30 30 31 31  31 31 30 30 0d 10 7c 12  |UB %00111100..|.|
00001dd0  45 51 55 42 20 25 30 31  30 31 31 30 31 30 0d 10  |EQUB %01011010..|
00001de0  86 04 0d 10 90 12 45 51  55 42 20 25 30 31 30 31  |......EQUB %0101|
00001df0  31 30 31 30 0d 10 9a 12  45 51 55 42 20 25 30 31  |1010....EQUB %01|
00001e00  31 31 31 31 31 30 0d 10  a4 12 45 51 55 42 20 25  |111110....EQUB %|
00001e10  30 30 30 31 31 30 30 30  0d 10 ae 12 45 51 55 42  |00011000....EQUB|
00001e20  20 25 30 30 31 30 30 31  30 30 0d 10 b8 04 0d 10  | %00100100......|
00001e30  c2 12 45 51 55 42 20 25  30 30 31 30 30 31 30 30  |..EQUB %00100100|
00001e40  0d 10 cc 12 45 51 55 42  20 25 30 30 30 31 31 30  |....EQUB %000110|
00001e50  30 30 0d 10 d6 0b 45 51  55 42 20 32 33 0d 10 e0  |00....EQUB 23...|
00001e60  11 45 51 55 42 20 31 32  38 2b 97 22 41 22 0d 10  |.EQUB 128+."A"..|
00001e70  ea 04 0d 10 f4 12 45 51  55 42 20 25 30 30 30 31  |......EQUB %0001|
00001e80  31 30 30 30 0d 10 fe 12  45 51 55 42 20 25 30 30  |1000....EQUB %00|
00001e90  31 31 31 31 30 30 0d 11  08 12 45 51 55 42 20 25  |111100....EQUB %|
00001ea0  30 31 31 31 31 31 31 30  0d 11 12 12 45 51 55 42  |01111110....EQUB|
00001eb0  20 25 30 30 31 31 31 31  30 30 0d 11 1c 04 0d 11  | %00111100......|
00001ec0  26 12 45 51 55 42 20 25  30 30 30 31 31 30 30 30  |&.EQUB %00011000|
00001ed0  0d 11 30 12 45 51 55 42  20 25 30 30 31 31 31 31  |..0.EQUB %001111|
00001ee0  30 30 0d 11 3a 12 45 51  55 42 20 25 30 31 31 31  |00..:.EQUB %0111|
00001ef0  31 31 31 30 0d 11 44 12  45 51 55 42 20 25 31 31  |1110..D.EQUB %11|
00001f00  31 31 31 31 31 31 0d 11  4e 04 0d 11 58 0b 45 51  |111111..N...X.EQ|
00001f10  55 42 20 31 39 0d 11 62  0a 45 51 55 42 20 31 0d  |UB 19..b.EQUB 1.|
00001f20  11 6c 0a 45 51 55 42 20  32 0d 11 76 0a 45 51 55  |.l.EQUB 2..v.EQU|
00001f30  42 20 30 0d 11 80 09 2e  66 72 65 65 0d 11 8a 05  |B 0.....free....|
00001f40  5d 0d 11 94 04 0d 11 9e  04 0d 11 a8 2c f4 20 22  |]...........,. "|
00001f50  6d 61 78 5f 6d 69 73 73  69 6c 65 73 22 20 76 61  |max_missiles" va|
00001f60  64 65 72 20 6d 69 73 73  69 6c 65 20 70 6f 73 69  |der missile posi|
00001f70  74 69 6f 6e 73 0d 11 b2  04 0d 11 bc 16 78 30 20  |tions........x0 |
00001f80  20 20 20 20 20 20 20 3d  20 66 72 65 65 2b 34 0d  |       = free+4.|
00001f90  11 c6 16 79 30 20 20 20  20 20 20 20 20 3d 20 78  |...y0        = x|
00001fa0  30 20 20 2b 34 0d 11 d0  16 76 6d 78 20 20 20 20  |0  +4....vmx    |
00001fb0  20 20 20 3d 20 79 30 20  20 2b 34 0d 11 da 38 76  |   = y0  +4...8v|
00001fc0  6d 79 20 20 20 20 20 20  20 3d 20 76 6d 78 20 2b  |my       = vmx +|
00001fd0  34 20 20 20 20 20 3a f4  20 30 20 66 6f 72 20 4e  |4     :. 0 for N|
00001fe0  4f 20 6d 69 73 73 69 6c  65 20 69 6e 20 66 6c 69  |O missile in fli|
00001ff0  67 68 74 0d 11 e4 0b ed  20 70 61 73 73 25 0d 11  |ght..... pass%..|
00002000  ee 05 e1 0d 11 f8 04 0d  12 02 08 dd 20 f2 65 0d  |............ .e.|
00002010  12 0c 05 f6 0d 12 16 15  f1 22 20 61 74 20 6c 69  |........." at li|
00002020  6e 65 20 22 3b 9e 2f 31  30 0d 12 20 05 e0 0d ff  |ne ";./10.. ....|
00002030