-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathelite-source.asm
11876 lines (10426 loc) · 98.3 KB
/
elite-source.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\************************************************
\* ELITE<A>
\************************************************
LOMEM=&3D70
C_A%=&F40
W%=&7200
L%=&1128
HIMEM=W%
\Z=0
D%=&563A
WP=&D40
K%=&900
LS%=WP-1
QQ18=&400
T%=&300
NOST=18
NOSH=12
COPS=2
SH3=COPS
CYL=7
THG=6
SST=8
MSL=9
AST=10
OIL=11
TGL=12
ESC=13
NI%=36
POW=15
B=&30
FF=&FF
OSWRCH=&FFEE
OSBYTE=&FFF4
OSWORD=&FFF1
OSFILE=&FFDD
SCLI=&FFF7
VIA=&FE40
USVIA=VIA
IRQ1V=&204
VSCAN=57
XX21=D%
ZP=0
X=128
Y=96
\\ ZERO PAGE
org ZP
.RAND skip 4 ;=FNZT(4)
.TRTB% skip 2 ; skip 2 ;=FNZ2
.T1 skip 1 ;=FNZ
.SC skip 2 ;=FNZ2
SCH=SC+1
.XX16 skip 18 ;=FNZT(18)
.P skip 3 ;=FNZT(3)
.XX0 skip 2 ;=FNZ2
.INF skip 2 ;=FNZ2
.V skip 2 ;=FNZ2
.XX skip 2 ;=FNZ2
.YY skip 2 ;=FNZ2
.SUNX skip 2 ;=FNZ2
.BETA skip 1 ;=FNZ
.BET1 skip 1 ;=FNZ
.XC skip 1 ;=FNZ
.YC skip 1 ;=FNZ
.QQ22 skip 2 ;=FNZ2
.ECMA skip 1 ;=FNZ
.XX15 skip 6 ;=FNZT(6)
.XX12 skip 6 ;=FNZT(6)
X1=XX15
Y1=X1+1
X2=Y1+1
Y2=X2+1
.K skip 4 ;=FNZT(4)
.KL skip 16 ;=FNZT(16)
.LAS skip 1 ;=FNZ
.MSTG skip 1 ;=FNZ
f0=&20
f1=&71
f2=&72
f3=&73
f4=&14
f5=&74
f6=&75
f7=&16
f8=&76
f9=&77
KY1=KL+1
KY2=KL+2
KY3=KL+3
KY4=KL+4
KY5=KL+5
KY6=KL+6
KY7=KL+7
KY12=KL+8
KY13=KL+9
KY14=KL+10
KY15=KL+11
KY16=KL+12
KY17=KL+13
KY18=KL+14
KY19=KL+15
.INWK skip NI% ;=FNZT(NI%)
XX19=INWK+33
XX1=INWK
.LSP skip 1 ;=FNZ
.QQ15 skip 6 ;=FNZT(6)
.XX18 skip 9 ;=FNZT(9)
QQ17=XX18
QQ19=QQ17+1
K5=XX18
K6=K5+4
.ALP1 skip 1 ;=FNZ
.ALP2 skip 2 ;=FNZ2
.BET2 skip 2 ;=FNZ2
.DELTA skip 1 ;=FNZ
.DELT4 skip 2 ;=FNZ2
.U skip 1 ;=FNZ
.Q skip 1 ;=FNZ
.R skip 1 ;=FNZ
.S skip 1 ;=FNZ
.XSAV skip 1 ;=FNZ
.YSAV skip 1 ;=FNZ
.XX17 skip 1 ;=FNZ
.QQ11 skip 1 ;=FNZ
.ZZ skip 1 ;=FNZ
.XX13 skip 1 ;=FNZ
.MCNT skip 1 ;=FNZ
.DL skip 1 ;=FNZ
.TYPE skip 1 ;=FNZ
.JSTX skip 1 ;=FNZ
.JSTY skip 1 ;=FNZ
.ALPHA skip 1 ;=FNZ
.QQ12 skip 1 ;=FNZ
.TGT skip 1 ;=FNZ
.SWAP skip 1 ;=FNZ
.COL skip 1 ;=FNZ
.FLAG skip 1 ;=FNZ
.CNT skip 1 ;=FNZ
.CNT2 skip 1 ;=FNZ
.STP skip 1 ;=FNZ
.XX4 skip 1 ;=FNZ
.XX20 skip 1 ;=FNZ
.XX14 skip 1 ;=FNZ
.RAT skip 1 ;=FNZ
.RAT2 skip 1 ;=FNZ
.K2 skip 4 ;=FNZT(4)
PRINT "ZERO PAGE VARIABLES FROM ",~ZP," to ",~P%
;IFZ=4THENZ=6ELSEZ=4
\\ WORKSPACE at WP=&D40
org WP
.FRIN skip NOSH+1 ;=FNWT(NOSH+1)
.MANY skip 14 ;=FNWT(14)
SSPR=MANY+SST
.ECMP skip 1 ;=FNW
.MJ skip 1 ;=FNW
CABTMP=MANY
.LAS2 skip 1 ;=FNW
.MSAR skip 1 ;=FNW
.VIEW skip 1 ;=FNW
.LASCT skip 1 ;=FNW
.GNTMP skip 1 ;=FNW
.HFX skip 1 ;=FNW
.EV skip 1 ;=FNW
.DLY skip 1 ;=FNW
.de skip 1 ;=FNW
T=&D1
XX2=&D2
K3=XX2
K4=K3+14
.LSO skip 192 ;=FNWT(192)
LSX=LSO
.LSX2 skip 78 ;=FNWT(78)
.LSY2 skip 78 ;=FNWT(78)
.SY skip NOST+1 ;=FNWT(NOST+1)
.SYL skip NOST+1 ;=FNWT(NOST+1)
.SZ skip NOST+1 ;=FNWT(NOST+1)
.SZL skip NOST+1 ;=FNWT(NOST+1)
.XSAV2 skip 1;=FNW
.YSAV2 skip 1;=FNW
.MCH skip 1 ;=FNWFNW
.FSH skip 1 ;=FNW
.ASH skip 1 ;=FNW
.ENERGY skip 1 ;=FNW
\\REMFF
.LASX skip 1 ;=FNW
.LASY skip 1 ;=FNW
.COMX skip 1 ;=FNW
.COMY skip 1 ;=FNW
.QQ24 skip 1 ;=FNW
.QQ25 skip 1 ;=FNW
.QQ28 skip 1 ;=FNW
.QQ29 skip 1 ;=FNW
.gov skip 1 ;=FNW
.tek skip 1 ;=FNW
.SLSP skip 2 ;=FNW2
.XX24 skip 1 ;=FNW
.ALTIT skip 1 ;=FNW
VEC=&7FFE
svn=&7FFD
.QQ2 skip 6 ;=FNWT(6)
.QQ3 skip 1 ;=FNW
.QQ4 skip 1 ;=FNW
.QQ5 skip 1 ;=FNW
.QQ6 skip 2 ;=FNW2
.QQ7 skip 2 ;=FNW2
.QQ8 skip 2 ;=FNW2
.QQ9 skip 1 ;=FNW
.QQ10 skip 1 ;=FNW
.NOSTM skip 1 ;=FNW
PRINT "WP WORKSPACE FROM ",~WP," to ",~P%
\\ WORKSPACE at T%=&300
ORG T%
.TP skip 1 ;=FNTP
.QQ0 skip 1 ;=FNTP
.QQ1 skip 1 ;=FNTP
.QQ21 skip 6 ;=FNTPT(6)
.CASH skip 4 ;=FNTPT(4)
.QQ14 skip 1 ;=FNTP
.COK skip 1 ;=FNTP
.GCNT skip 1 ;=FNTP
.LASER skip 6 ;=FNTPT(6)
.CRGO skip 1 ;=FNTP
.QQ20 skip 17 ;=FNTPT(17)
.ECM skip 1 ;=FNTP
.BST skip 1 ;=FNTP
.BOMB skip 1 ;=FNTP
.ENGY skip 1 ;=FNTP
.DKCMP skip 1 ;=FNTP
.GHYP skip 1 ;=FNTP
.ESCP skip 5 ;=FNTPT(5)
.NOMSL skip 1 ;=FNTP
.FIST skip 1 ;=FNTP
.AVL skip 17 ;=FNTPT(17)
.QQ26 skip 1 ;=FNTP
.TALLY skip 2 ;=FNTPT(2)
.SVC skip 3 ;=FNTPT(3)
NT%=SVC+2-TP ;NT%=SVC+2-TP
SX=P% ; T%
SXL=SX+NOST+1
XX3=256
\\REM&70
PRINT "T% WORKSPACE FROM ",~T%," to ",~P%," possibly ",~SXL
\ ZP allocations
\DEFFNZ=FNZT(1)
\DEFFNZ2=FNZT(2)
\DEFFNZT(N%)
\ZP=ZP+N%
\=ZP-N%
\ WP allocations
\DEFFNW=FNWT(1)
\DEFFNW2=FNWT(2)
\DEFFNWT(N%)
\WP=WP+N%
\=WP-N%
\ T% allocations
\DEFFNTP=FNTPT(1)
\DEFFNTPT(N%)
\T%=T%+N%
\=T%-N%
;P%=C%
;O%=W%
ORG C_A%
H_A%=L% ;+P%-C% as P%=C% above
GUARD &6000 ; Screen buffer starts here
\[OPTZ
.S%
EQUW TT170 ; entry point for Elite game
EQUW TT26 ; WRCHV
EQUW IRQ1 ; IRQ1V
EQUW BR1 ; BRKV
.COMC brk
.DNOIZ brk
.DAMP brk
.DJD brk
.PATG brk
.FLH brk
.JSTGY brk
.JSTE brk
.JSTK brk
.M%
LDA K%
STA RAND
LDX JSTX
JSR cntr
JSR cntr
TXA
EOR #128
TAY
AND #128
STA ALP2
STX JSTX
EOR #128
STA ALP2+1
TYA
BPL P%+7
EOR #FF
CLC
ADC #1
LSR A
LSR A
CMP #8
BCS P%+4
LSR A
CLC
STA ALP1
ORA ALP2
STA ALPHA
LDX JSTY
JSR cntr
TXA
EOR #128
TAY
AND #128
STX JSTY
STA BET2+1
EOR #128
STA BET2
TYA
BPL P%+4
EOR #FF
ADC #4
LSR A
LSR A
LSR A
LSR A
CMP #3
BCS P%+3
LSR A
STA BET1
ORA BET2
STA BETA
LDA KY2
BEQ MA17
LDA DELTA
CMP #40
BCS MA17
INC DELTA
.MA17
LDA KY1
BEQ MA4
DEC DELTA
BNE MA4
INC DELTA
.MA4
LDA KY15
AND NOMSL
BEQ MA20
LDY #&EE
JSR ABORT
LDA #40
JSR NOISE
.MA31
LDA #0
STA MSAR
.MA20
LDA MSTG
BPL MA25
LDA KY14
BEQ MA25
LDX NOMSL
BEQ MA25
STA MSAR
LDY #&E0
JSR MSBAR
.MA25
LDA KY16
BEQ MA24
LDA MSTG
BMI MA64
JSR FRMIS
.MA24
LDA KY12
BEQ MA76
ASL BOMB
.MA76
LDA KY13
AND ESCP
BEQ P%+5
JMP ESCAPE
LDA KY18
BEQ P%+5
JSR WARP
LDA KY17
AND ECM
BEQ MA64
LDA ECMA
BNE MA64
DEC ECMP
JSR ECBLB2
.MA64
LDA KY19
AND DKCMP
AND SSPR
BEQ MA68
LDA K%+NI%+32
BMI MA68
JMP GOIN
.MA68
LDA #0
STA LAS
STA DELT4
LDA DELTA
LSR A
ROR DELT4
LSR A
ROR DELT4
STA DELT4+1
LDA LASCT
BNE MA3
LDA KY7
BEQ MA3
LDA GNTMP
CMP #242
BCS MA3
LDX VIEW
LDA LASER,X
BEQ MA3
PHA
AND #127
STA LAS
STA LAS2
LDA #0
JSR NOISE
JSR LASLI
PLA
BPL ma1
LDA #0
.ma1
AND #&FA
STA LASCT
.MA3
LDX #0
.MAL1
STX XSAV
LDA FRIN,X
BNE P%+5
JMP MA18
STA TYPE
JSR GINF
LDY #(NI%-1)
.MAL2
LDA (INF),Y
STA INWK,Y
DEY
BPL MAL2
LDA TYPE
BMI MA21
ASL A
TAY
LDA XX21-2,Y
STA XX0
LDA XX21-1,Y
STA XX0+1
LDA BOMB
BPL MA21
CPY #2*SST
BEQ MA21
LDA INWK+31
AND #32
BNE MA21
LDA INWK+31
ORA #128
STA INWK+31
JSR EXNO2
.MA21
JSR MVEIT
LDY #(NI%-1)
.MAL3
LDA INWK,Y
STA (INF),Y
DEY
BPL MAL3
LDA INWK+31
AND #&A0
JSR MAS4
BNE MA65
LDA INWK
ORA INWK+3
ORA INWK+6
BMI MA65
LDX TYPE
BMI MA65
CPX #SST
BEQ ISDK
AND #&C0
BNE MA65
CPX #MSL
BEQ MA65
CPX #OIL
BCS P%+5
JMP MA58
LDA BST
AND INWK+5
BPL MA58
LDA #3
CPX #TGL
BCC oily
BNE slvy2
LDA #16
BNE slvy2
.oily
JSR DORND
AND #7
.slvy2
STA QQ29
LDA #1
JSR tnpr
LDY #78
BCS MA59
LDY QQ29
ADC QQ20,Y
STA QQ20,Y
TYA
ADC #208
JSR MESS
JMP MA60
.MA65
JMP MA26
.ISDK
LDA K%+NI%+32
BMI MA62
LDA INWK+14
CMP #&D6
BCC MA62
JSR SPS4
LDA XX15+2
BMI MA62
CMP #89
BCC MA62
LDA INWK+16
AND #&7F
CMP #80
BCC MA62
.GOIN
LDA #0
STA QQ22+1
LDA #8
JSR LAUN
JSR RES4
JMP BAY
.MA62
LDA DELTA
CMP #5
BCC MA67
JMP DEATH
.MA59
JSR EXNO3
.MA60
ASL INWK+31
SEC
ROR INWK+31
.MA61
BNE MA26
.MA67
LDA #1
STA DELTA
LDA #5
BNE MA63
.MA58
ASL INWK+31
SEC
ROR INWK+31
LDA INWK+35
SEC
ROR A
.MA63
JSR OOPS
JSR EXNO3
.MA26
LDA QQ11
BNE MA15
JSR PLUT
JSR HITCH
BCC MA8
LDA MSAR
BEQ MA47
JSR BEEP
LDX XSAV
LDY #&E
JSR ABORT2
.MA47
LDA LAS
BEQ MA8
LDX #15
JSR EXNO
LDA INWK+35
SEC
SBC LAS
BCS MA14
LDA TYPE
CMP #SST
BEQ MA14+2
LDA INWK+31
ORA #128
STA INWK+31
BCS MA8
JSR DORND
BPL oh
LDY #0
AND (XX0),Y
STA CNT
.um
BEQ oh
LDX #OIL
LDA #0
JSR SFS1
DEC CNT
BPL um
.oh
JSR EXNO2
.MA14
STA INWK+35
LDA TYPE
JSR ANGRY
.MA8
JSR LL9
.MA15
LDY #35
LDA INWK+35
STA (INF),Y
LDA INWK+31
BPL MAC1
AND #&20
BEQ NBOUN
LDA TYPE
CMP #COPS
BNE q2
LDA FIST
ORA #64
STA FIST
.q2
LDA DLY
ORA MJ
BNE KS1S
LDY #10
LDA (XX0),Y
BEQ KS1S
TAX
INY
LDA (XX0),Y
TAY
JSR MCASH
LDA #0
JSR MESS
.KS1S
JMP KS1
.NBOUN
.MAC1
LDA TYPE
BMI MA27
JSR FAROF
BCC KS1S
.MA27
LDY #31
LDA INWK+31
STA (INF),Y
LDX XSAV
INX
JMP MAL1
.MA18
LDA BOMB
BPL MA77
ASL BOMB
JSR WSCAN
LDA #&30
STA &FE21
.MA77
LDA MCNT
AND #7
BNE MA22
LDX ENERGY
BPL b
LDX ASH
JSR SHD
STX ASH
LDX FSH
JSR SHD
STX FSH
.b
SEC
LDA ENGY
ADC ENERGY
BCS P%+5
STA ENERGY
LDA MJ
BNE MA23S
LDA MCNT
AND #31
BNE MA93
LDA SSPR
BNE MA23S
TAY
JSR MAS2
BNE MA23S
LDX #28
.MAL4
LDA K%,X
STA INWK,X
DEX
BPL MAL4
INX
LDY #9
JSR MAS1
BNE MA23S
LDX #3
LDY #11
JSR MAS1
BNE MA23S
LDX #6
LDY #13
JSR MAS1
BNE MA23S
LDA #&C0
JSR FAROF2
BCC MA23S
LDA QQ11
BNE P%+5\!
JSR WPLS
JSR NWSPS
.MA23S
JMP MA23
.MA22
LDA MJ
BNE MA23
LDA MCNT
AND #31
.MA93
CMP #10
BNE MA29
LDA #50
CMP ENERGY
BCC P%+6
ASL A
JSR MESS
LDY #FF
STY ALTIT
INY
JSR m
BNE MA23
JSR MAS3
BCS MA23
SBC #&24
BCC MA28
STA R
JSR LL5
LDA Q
STA ALTIT
BNE MA23
.MA28
JMP DEATH
.MA29
CMP #20
BNE MA23
LDA #30
STA CABTMP
LDA SSPR
BNE MA23
LDY #NI%
JSR MAS2
BNE MA23
JSR MAS3
EOR #FF
ADC #30
STA CABTMP
BCS MA28
CMP #&E0
BCC MA23
LDA BST
BEQ MA23
LDA DELT4+1
LSR A
ADC QQ14
CMP #70
BCC P%+4
LDA #70
STA QQ14
LDA #160
JSR MESS
.MA23
LDA LAS2
BEQ MA16
LDA LASCT
CMP #8
BCS MA16
JSR LASLI2
LDA #0
STA LAS2
.MA16
LDA ECMP
BEQ MA69
JSR DENGY
BEQ MA70
.MA69
LDA ECMA
BEQ MA66
DEC ECMA
BNE MA66
.MA70
JSR ECMOF
.MA66
LDA QQ11
BNE MA9
JMP STARS
.MAS1
LDA INWK,Y
ASL A
STA K+1
LDA INWK+1,Y
ROL A
STA K+2
LDA #0
ROR A
STA K+3
JSR MVT3
STA INWK+2,X
LDY K+1
STY INWK,X
LDY K+2
STY INWK+1,X
AND #127
.MA9
RTS
.m
LDA #0
.MAS2
ORA K%+2,Y
ORA K%+5,Y
ORA K%+8,Y
AND #127
RTS
.MAS3
LDA K%+1,Y
JSR SQUA2
STA R
LDA K%+4,Y
JSR SQUA2
ADC R
BCS MA30
STA R
LDA K%+7,Y
JSR SQUA2
ADC R
BCC P%+4
.MA30
LDA #FF
RTS
.MVEIT
LDA INWK+31
AND #&A0
BNE MV30
LDA MCNT
EOR XSAV
AND #15
BNE MV3
JSR TIDY
.MV3
LDX TYPE
BPL P%+5
JMP MV40
LDA INWK+32
BPL MV30
CPX #MSL
BEQ MV26
LDA MCNT
EOR XSAV
AND #7
BNE MV30
.MV26
JSR TACTICS
.MV30
JSR SCAN
LDA INWK+27
ASL A
ASL A
STA Q
LDA INWK+10
AND #127
JSR FMLTU
STA R
LDA INWK+10
LDX #0
JSR MVT1-2
LDA INWK+12
AND #127
JSR FMLTU
STA R
LDA INWK+12
LDX #3