Home » Personal collection » Commodore disks » disk12b2_driving_games_3.d64 » mandelcode9
mandelcode9
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 » Personal collection » Commodore disks » disk12b2_driving_games_3.d64 |
Filename: | mandelcode9 |
Read OK: | ✔ |
File size: | 2549 bytes |
Load address: | 0801 |
Exec address: | 0000 |
File contents
10 ;MANDLEPLOT 20 ;SOURCE CODE 30 ;22/10/95 40 ; 100 *=$C000 110 XPIXEL=$4103 120 YPIXEL=$4104 130 COLOUR=$4105 140 YPIB=$4106 150 MAXCOL=$4107 11890 XP=$CF40 11900 YP=$CF41 11910 XPB=$CF42 11920 CLICK=$CF43 11930 BUTNO=$CF44 11940 HOUR=$CF45 11950 SCHAR=$CF46 11960 XSP=$CF47 11970 YSP=$CF48 11980 XSQ=$CF49 11990 YSQ=$CF4A 12000 ; WIMP ROUTINES 12010 ; 12020 ; WIMP - MOUSE 12030 IRQ LDA #$00 12040 STA CLICK 12050 LDA $C5 12060 CMP #$01 12070 BNE CONCHECK 12080 STA CLICK 12090 CONCHECK CMP #$0C 12100 BEQ LEFTK 12110 LKC CMP #$17 12120 BEQ RIGHTK 12130 RKC CMP #$32 12140 BEQ UPK 12150 UPKC CMP #$37 12160 BEQ DOWNK 12170 DKC LDA $DC00 12180 TAX 12190 AND #$01 12200 BEQ UPJ 12210 UJC TXA 12220 AND #$02 12230 BEQ DOWNJ 12240 DJC TXA 12250 AND #$04 12260 BEQ LEFTJ 12270 LJC TXA 12280 AND #$08 12290 BEQ RIGHTJ 12300 RJC TXA 12310 AND #$10 12320 EOR #$10 12330 BEQ CJCH 12340 STA CLICK 12350 CJCH JMP $EA31 12360 LEFTK JSR LEFT 12370 JMP LKC 12380 RIGHTK JSR RIGHT 12390 JMP RKC 12400 UPK JSR UP 12410 JMP UPKC 12420 DOWNK JSR DOWN 12430 JMP DKC 12440 UPJ JSR UP 12450 JMP UJC 12460 DOWNJ JSR DOWN 12470 JMP DJC 12480 LEFTJ JSR LEFT 12490 JMP LJC 12500 RIGHTJ JSR RIGHT 12510 JMP RJC 12520 LEFT DEC XP 12530 LDA XP 12540 CMP #$FF 12550 BNE NOTFF 12560 LDY #$00 12570 STY XPB 12580 NOTFF LDY XPB 12590 BNE FIN 12600 CMP #$18 12610 BNE FIN 12620 INC XP 12630 FIN JMP CONTROL 12640 RIGHT INC XP 12650 LDA XP 12660 BNE NOT00 12670 LDY #$01 12680 STY XPB 12690 NOT00 LDY XPB 12700 BEQ FIN 12710 CMP #$58 12720 BNE FIN 12730 DEC XP 12740 JMP CONTROL 12750 UP DEC YP 12760 LDA YP 12770 CMP #$32 12780 BNE FIN 12790 INC YP 12800 JMP CONTROL 12810 DOWN INC YP 12820 LDA YP 12830 CMP #$F8 12840 BNE FIN 12850 DEC YP 12860 JMP CONTROL 12870 ; WIMP - POINTER 12880 CONTROL LDA HOUR 12890 BNE HGLASS 12900 LDA XP 12910 CMP #$28 12920 BCC NSQUP 12930 CMP #$F8 12940 BCS NSQUP 12950 LDA XPB 12960 BNE NSQUP 12970 LDA YP 12980 CMP #$42 12990 BCC NSQUP 13000 CMP #$C1 13010 BCS NSQUP 13020 LDA XP 13030 AND #$F8 13040 STA $D000 13050 LDA YP 13060 AND #$F8 13070 ORA #$02 13080 STA $D001 13090 LDA $D010 13100 AND #$FC 13110 STA $D010 13120 LDA #$92 13130 STA $63F8 13140 LDA $D015 13150 AND #$FC 13160 ORA #$01 13170 STA $D015 13180 LDA #$01 13190 STA $D027 13200 RTS 13210 HGLASS LDX #$93 13220 STX $63F8 13230 INX 13240 STX $63F9 13250 NSQUP LDA XP 13260 STA $D000 13270 STA $D002 13280 LDA YP 13290 STA $D001 13300 STA $D003 13310 LDA $D010 13320 AND #$FC 13330 LSR A 13340 CLC 13350 ADC XPB 13360 ASL A 13370 CLC 13380 ADC XPB 13390 STA $D010 13400 LDA #$00 13410 STA $D027 13420 LDA #$01 13430 STA $D028 13440 LDA $D015 13450 ORA #$03 13460 STA $D015 13470 LDA HOUR 13480 BNE QTRO 13490 LDA #$90 13500 STA $63F8 13510 LDA #$91 13520 STA $63F9 13530 QTRO RTS 13540 ; STARTUP ROUTINES 13550 SR LDA #$8B 13560 STA $D011 13570 LDA $DD02 13580 ORA #$02 13590 STA $DD02 13600 LDA $DD00 13610 AND #$FE 13620 ORA #$02 13630 STA $DD00 13640 LDA #$00 13650 STA $D020 13660 STA $D021 13670 STA $D000 13680 STA YSP 13690 STA XSP 13700 LDA #$86 13710 STA $D018 13720 LDA #$0B 13730 STA $D001 13740 LDA #$10 13750 STA $D008 13760 LDA #$3A 13770 STA $D009 13780 LDA #$10 13790 STA $D010 13800 LDA #$01 13810 STA $D029 13820 STA $D02B 13830 LDA #$00 13840 STA $D02A 13850 STA SCHAR 13860 LDA #$01 13870 LDX #$08 13880 TAY 13890 JSR $FFBA 13900 LDA #$0C 13910 LDX #<EGRTXT 13920 LDY #>EGRTXT 13930 JSR $FFBD 13940 LDA #$00 13950 JSR $FFD5 13960 LDA #$01 13970 LDX #$08 13980 TAY 13990 JSR $FFBA 14000 LDA #$08 14010 LDX #<ECTXT 14020 LDY #>ECTXT 14030 JSR $FFBD 14040 LDA #$00 14050 JSR $FFD5 14060 LDA #$9B 14070 STA $D011 14080 LDA #$00 14090 STA BUTNO 14100 LDA #$92 14110 STA $63FC 14120 SEI 14130 LDA #$00 14140 STA $0314 14150 LDA #$C0 14160 STA $0315 14170 CLI 14180 LDA #$00 14190 STA XP 14200 STA HOUR 14210 LDA #$80 14220 STA YP 14230 LDA #$01 14240 STA XPB 14250 LDA #$1C 14260 STA $D015 14270 JSR LEFT 14280 LDA #$00 14290 STA $D004 14300 STA $D006 14310 LDA #$D9 14320 STA $D005 14330 STA $D007 14340 LDA #$95 14350 STA $63FB 14360 LDA #$08 14370 STA $D01C 14380 LDA #$18 14390 STA $D016 30000 ; MANDLEBROT SET PLOTTER 30010 MANDLE LDA #$00 30020 STA YPIXEL 30030 LDA #$03 30040 STA $4100 30050 LDA #$06 30060 STA $4102 30070 JSR EQUAL 30080 MMAINL LDA #$00 30090 STA XPIXEL 30100 LDA #$01 30110 STA $4100 30120 LDA #$05 30130 STA $4102 30140 JSR EQUAL 30150 MMAINLB LDA #$05 30160 STA $4100 30170 LDA #$07 30180 STA $4102 30190 JSR EQUAL 30200 INC $4100 30210 INC $4102 30220 JSR EQUAL 30230 LDA #$00 30240 STA COLOUR 30250 LOOP LDA #$07 30260 STA $4100 30270 STA $4101 30280 LDA #$10 30290 STA $4102 30300 JSR MULTIPLY 30310 LDA #$08 30320 STA $4100 30330 STA $4101 30340 LDA #$11 30350 STA $4102 30360 JSR MULTIPLY 30370 LDX #$10 30380 STX $4100 30390 INX 30400 STX $4101 30410 INX 30420 STX $4102 30430 JSR ADDITION 30440 LDA $4091 30450 CMP #$04 30460 BCC FAIL 30470 CMP #$50 30480 BCS FAIL 30490 SUCPASS JMP SUCCESS 30500 FAIL INC COLOUR 30505 LDA COLOUR 30510 CMP MAXCOL 30520 BEQ SUCPASS 30530 JSR SUBTRACT 30540 LDA #$12 30550 STA $4100 30560 LDA #$05 30570 STA $4101 30580 LDA #$13 30590 STA $4102 30600 JSR ADDITION 30610 LDA #$07 30620 STA $4100 30630 LDA #$08 30640 STA $4101 30650 INC $4102 30660 JSR MULTIPLY 30670 LDA #$14 30680 STA $4100 30690 LDA #$1C 30700 STA $4101 30710 LDA #$15 30720 STA $4102 30730 JSR MULTIPLY 30740 LDA #$15 30750 STA $4100 30760 LDA #$06 30770 STA $4101 30780 LDA #$16 30790 STA $4102 30800 JSR ADDITION 30810 LDA #$13 30820 STA $4100 30830 LDA #$07 30840 STA $4102 30850 JSR EQUAL 30860 LDA #$16 30870 STA $4100 30880 LDA #$08 30890 STA $4102 30900 JSR EQUAL 30910 JMP LOOP 30920 SUCCESS JSR PLOT 30930 LDA #$05 30940 STA $4100 30950 STA $4102 30960 LDA #$02 30970 STA $4101 30980 JSR ADDITION 30990 LDA XPIXEL 31000 BNE XRELOP 31010 LDA #$06 31020 STA $4100 31030 STA $4102 31040 LDA #$04 31050 STA $4101 31060 JSR ADDITION 31070 INC YPIXEL 31080 LDA YPIXEL 31090 CMP #$C8 31100 BNE YRELOP 31110 RTS 31120 XRELOP JMP MMAINLB 31130 YRELOP JMP MMAINL 40000 ; ARITHMETIC ROUTINES 40010 GETDIGIT CLD 40020 ASL A 40030 ASL A 40040 ASL A 40050 STA $02 40060 TXA 40070 LSR A 40080 STA $24 40090 LDA #$07 40100 SEC 40110 SBC $24 40120 CLC 40130 ADC $02 40140 TAY 40150 LDA $4000,Y 40160 TAY 40170 TXA 40180 AND #$01 40190 BEQ LSNGD 40200 TYA 40210 AND #$F0 40220 LSR A 40230 LSR A 40240 LSR A 40250 LSR A 40260 RTS 40270 LSNGD TYA 40280 AND #$0F 40290 RTS 40300 MULTIPLYB JSR NEGATIVE 40305 LDA $4102 40310 ASL A 40320 ASL A 40330 ASL A 40340 TAX 40350 LDA #$00 40360 TAY 40370 MLOPA STA $4000,X 40380 INY 40390 INX 40400 CPY #$08 40410 BNE MLOPA 40420 LDA #$06 40430 STA $FC 40440 NEWDIGIT LDA $4101 40450 LDX $FC 40460 JSR GETDIGIT 40470 CMP #$00 40480 BEQ DMOVER 40490 STA $FD 40500 LDA #$06 40510 STA $FB 40520 DMLOP LDA $4100 40530 LDX $FB 40540 JSR GETDIGIT 40550 DMLB CMP #$00 40560 BEQ DMOVER 40570 STA $FE 40580 LDA $FB 40590 CLC 40600 ADC $FC 40610 SEC 40620 SBC #$0C 40630 LDX $FD 40640 TAY 40650 AND #$01 40660 BEQ MSKIP 40670 TXA 40680 ASL A 40690 ASL A 40700 ASL A 40710 ASL A 40720 TAX 40730 MSKIP TYA 40740 LSR A 40750 STA $02 40760 LDA #$07 40770 SEC 40780 SBC $02 40790 STA $02 40800 LDA $4102 40810 ASL A 40820 ASL A 40830 ASL A 40840 ADC $02 40850 TAY 40860 STX $24 40870 LDX $02 40880 SED 40890 LDA $4000,Y 40900 CLC 40910 ADC $24 40920 STA $4000,Y 40930 MALP CLD 40940 BCC MAQUIT 40950 DEY 40960 DEX 40970 CPX #$FF 40980 BEQ MAQUIT 40990 SED 41000 LDA $4000,Y 41010 CLC 41020 ADC #$01 41030 STA $4000,Y 41040 JMP MALP 41050 DMOVER INC $FB 41060 LDA $FB 41070 CMP #$0E 41080 BCC DMLOP 41090 INC $FC 41100 LDA $FC 41110 CMP #$0E 41120 BCC NEWDIGIT 41130 LDA YPIB 41140 BEQ QUIT 41150 LDA $4102 41160 STA $4101 41170 LDA #$1D 41180 STA $4100 41190 JSR SUBTRACT 41200 QUIT RTS 41210 MAQUIT LDX $FE 41220 DEX 41230 TXA 41240 JMP DMLB 41250 MSUP LDA $4100 41260 ASL A 41270 ASL A 41280 ASL A 41290 TAX 41300 DEX 41310 STX $FB 41320 LDA $4101 41330 ASL A 41340 ASL A 41350 ASL A 41360 TAX 41370 DEX 41380 STX $FD 41390 LDA $4102 41400 ASL A 41410 ASL A 41420 ASL A 41430 TAX 41440 DEX 41450 STX $22 41460 LDA #$40 41470 STA $FC 41480 STA $FE 41490 STA $23 41500 RTS 41510 EQUAL JSR MSUP 41520 LDY #$08 41530 ELOP LDA ($FB),Y 41540 STA ($22),Y 41550 DEY 41560 BNE ELOP 41570 RTS 41580 ADDITION JSR MSUP 41590 LDY #$08 41600 SED 41610 CLC 41620 ADLOP LDA ($FB),Y 41630 ADC ($FD),Y 41640 STA ($22),Y 41650 DEY 41660 BNE ADLOP 41670 CLD 41680 RTS 41690 SUBTRACT JSR MSUP 41700 LDY #$08 41710 SED 41720 SEC 41730 SULOP LDA ($FB),Y 41740 SBC ($FD),Y 41750 STA ($22),Y 41760 DEY 41770 BNE SULOP 41780 CLD 41790 RTS 41800 NEGATIVE LDA #$00 41810 PHA 41820 LDA $4100 41830 TAY 41840 ASL A 41850 ASL A 41860 ASL A 41870 TAX 41880 LDA $4001,X 41890 CMP #$50 41895 BCC NEGRMOVEAB 41900 PLA 41910 ADC #$00 41920 PHA 41930 JMP NEGRMOVEA 41940 NEGRMOVEAB LDA $4101 41950 TAY 41960 ASL A 41970 ASL A 41980 ASL A 41990 TAX 42000 LDA $4001,X 42010 CMP #$50 42020 PLA 42030 BCC NOEOR 42040 EOR #$01 42050 PHA 42060 BCS NEGRMOVEB 42070 NEGRMOVEBB PLA 42080 NOEOR STA YPIB 42090 RTS 42100 NEGRMOVE LDA $4100 42110 PHA 42120 LDA $4101 42130 PHA 42140 LDA $4102 42150 PHA 42160 TYA 42170 STA $4101 42180 STA $4102 42190 LDA #$1D 42200 STA $4100 42210 JSR SUBTRACT 42220 PLA 42230 STA $4102 42240 PLA 42250 STA $4101 42260 PLA 42270 STA $4100 42280 RTS 42290 NEGRMOVEA JSR NEGRMOVE 42300 JMP NEGRMOVEAB 42310 NEGRMOVEB JSR NEGRMOVE 42320 JMP NEGRMOVEBB 42330 MULTIPLY LDA $4102 42340 PHA 42350 LDA $4101 42360 PHA 42370 LDA #$18 42380 STA $4102 42390 JSR EQUAL 42400 INC $4102 42410 PLA 42420 STA $4100 42430 JSR EQUAL 42440 LDA #$18 42450 STA $4100 42460 LDA #$19 42470 STA $4101 42480 PLA 42490 STA $4102 42500 JMP MULTIPLYB 50000 ; GRAPHIC POINT PLOTTER 50010 PLOTPC LDA #$47 50020 STA $FB 50030 LDA #$3F 50040 STA $FC 50050 LDA YPIXEL 50060 LSR A 50070 LSR A 50080 LSR A 50090 STA YPIB 50100 AND #$03 50110 ASL A 50120 ASL A 50130 ASL A 50140 ASL A 50150 ASL A 50160 ASL A 50170 STA $02 50180 LDA $FB 50190 SEC 50200 SBC $02 50210 STA $FB 50220 LDA $FC 50230 SBC #$00 50235 SBC YPIB 50240 PHA 50250 LDA YPIB 50260 LSR A 50270 LSR A 50280 STA $02 50290 PLA 50300 SEC 50310 SBC $02 50320 STA $FC 50330 LDA YPIXEL 50340 AND #$07 50350 STA YPIB 50360 LDA $FB 50370 SEC 50380 SBC YPIB 50390 PHA 50400 LDA XPIXEL 50410 AND #$F8 50420 STA YPIB 50430 PLA 50440 CLC 50450 ADC YPIB 50460 STA $FB 50470 LDA $FC 50480 SBC #$00 50490 STA $FC 50500 LDA XPIXEL 50510 AND #$07 50520 TAX 50530 LDA #$80 50540 GBITLP CPX #$00 50550 BEQ PPCONT 50560 LSR A 50570 DEX 50580 JMP GBITLP 50590 PPCONT STA $FD 50600 RTS 50610 PLOTON JSR PLOTPC 50620 LDY #$00 50630 LDA ($FB),Y 50640 ORA $FD 50650 STA ($FB),Y 50660 RTS 50670 PLOTOFF JSR PLOTPC 50680 LDA $FD 50690 EOR #$FF 50700 STA $FD 50710 LDY #$00 50720 LDA ($FB),Y 50730 AND $FD 50740 STA ($FB),Y 50750 RTS 50760 PLOT LDA COLOUR 50770 AND #$02 50780 BNE PPAON 50790 JSR PLOTOFF 50800 JMP PPACNT 50810 PPAON JSR PLOTON 50820 PPACNT INC XPIXEL 50830 LDA COLOUR 50840 AND #$01 50850 BNE PPBON 50860 JSR PLOTOFF 50870 JMP PPBCNT 50880 PPBON JSR PLOTON 50890 PPBCNT INC XPIXEL 50900 RTS
;MANDLEPLOT " ;SOURCE CODE 0 ;22/10/95 6( ; Bd ��$C000 Sn XPIXEL�$4103 dx YPIXEL�$4104 u� COLOUR�$4105 �� YPIB�$4106 �� MAXCOL�$4107 �r.XP�$CF40 �|.YP�$CF41 ��.XPB�$CF42 ��.CLICK�$CF43 ��.BUTNO�$CF44 ��.HOUR�$CF45 ��.SCHAR�$CF46 �.XSP�$CF47 �.YSP�$CF48 & �.XSQ�$CF49 4 �.YSQ�$CF4A v �.; WIMP ROUTINES | �.; � �.; WIMP - MOUSE � �.IRQ LDA #$00 � /STA CLICK � /LDA $C5 � /CMP #$01 � &/BNE C�CHECK � 0/STA CLICK � :/C�CHECK CMP #$0C D/BEQ LEFTK N/LKC CMP #$17 ( X/BEQ RIGHTK 9 b/RKC CMP #$32 E l/BEQ UPK W v/UPKC CMP #$37 e �/BEQ DOWNK w �/DKC LDA $DC00 �/TAX � �/� #$01 � �/BEQ UPJ � �/UJC TXA � �/� #$02 � �/BEQ DOWNJ � �/DJC TXA � �/� #$04 � �/BEQ LEFTJ � �/LJC TXA � �/� #$08 0BEQ RIGHTJ 0RJC TXA 0� #$10 ) 0E� #$10 6*0BEQ CJCH D40STA CLICK W>0CJCH JMP $EA31 jH0LEFTK JSR LEFT vR0JMP LKC �\0RIGHTK JSR RIGHT �f0JMP RKC �p0UPK JSR UP �z0JMP UPKC ��0DOWNK JSR DOWN ��0JMP DKC ��0UPJ JSR UP ��0JMP UJC �0DOWNJ JSR DOWN �0JMP DJC �0LEFTJ JSR LEFT +�0JMP LJC @�0RIGHTJ JSR RIGHT L�0JMP RJC \�0LEFT DEC XP g�0LDA XP t�0CMP #$FF �1BNE �FF �1LDY #$00 �1STY XPB �$1�FF LDY XPB �.1BNE FIN �81CMP #$18 �B1BNE FIN �L1INC XP �V1FIN JMP �ROL �`1RIGHT INC XP j1LDA XP t1BNE �00 ~1LDY #$01 + �1STY XPB ; �1�00 LDY XPB G �1BEQ FIN T �1CMP #$58 ` �1BNE FIN k �1DEC XP x �1JMP �ROL � �1UP DEC YP � �1LDA YP � �1CMP #$32 � �1BNE FIN � �1INC YP � 2JMP �ROL � 2DOWN INC YP � 2LDA YP � 2CMP #$F8 � (2BNE FIN 22DEC YP <2JMP �ROL !F2; WIMP � PO�ER 3P2�ROL LDA HOUR BZ2BNE HGLASS Md2LDA XP Zn2CMP #$28 hx2BCC NSQUP u�2CMP #$F8 ��2BCS NSQUP ��2LDA XPB ��2BNE NSQUP ��2LDA YP ��2CMP #$42 ��2BCC NSQUP ��2CMP #$C1 ��2BCS NSQUP ��2LDA XP ��2� #$F8 �2STA $D000 �2LDA YP 3� #$F8 $3�A #$02 23STA $D001 @"3LDA $D010 K,3� #$FC Y63STA $D010 f@3LDA #$92 tJ3STA $63F8 �T3LDA $D015 �^3� #$FC �h3�A #$01 �r3STA $D015 �|3LDA #$01 ��3STA $D027 ��3RTS ��3HGLASS LDX #$93 ��3STX $63F8 ��3INX �3STX $63F9 �3NSQUP LDA XP !�3STA $D000 /�3STA $D002 :�3LDA YP H�3STA $D001 V�3STA $D003 d�3LDA $D010 o4� #$FC y4LSR A �4CLC �&4ADC XPB �04ASL A �:4CLC �D4ADC XPB �N4STA $D010 �X4LDA #$00 �b4STA $D027 �l4LDA #$01 �v4STA $D028 ��4LDA $D015 �4�A #$03 �4STA $D015 $�4LDA HOUR 1�4BNE QTRO >�4LDA #$90 L�4STA $63F8 Y�4LDA #$91 g�4STA $63F9 t�4QTRO RTS ��4; STARTUP ROUTINES ��4SR LDA #$8B ��4STA $D011 �5LDA $DD02 �5�A #$02 �5STA $DD02 � 5LDA $DD00 �*5� #$FE �45�A #$02 >5STA $DD00 H5LDA #$00 R5STA $D020 -\5STA $D021 ;f5STA $D000 Gp5STA YSP Sz5STA XSP `�5LDA #$86 n�5STA $D018 {�5LDA #$0B ��5STA $D001 ��5LDA #$10 ��5STA $D008 ��5LDA #$3A ��5STA $D009 ��5LDA #$10 ��5STA $D010 ��5LDA #$01 ��5STA $D029 �5STA $D02B 6LDA #$00 6STA $D02A ,6STA SCHAR 9$6LDA #$01 F.6LDX #$08 N86TAY \B6JSR $FFBA iL6LDA #$0C zV6LDX #�EGRTXT �`6LDY #�EGRTXT �j6JSR $FFBD �t6LDA #$00 �~6JSR $FFD5 ��6LDA #$01 ��6LDX #$08 ��6TAY ��6JSR $FFBA ��6LDA #$08 �6LDX #�ECTXT �6LDY #�ECTXT �6JSR $FFBD ,�6LDA #$00 :�6JSR $FFD5 G�6LDA #$9B U�6STA $D011 b 7LDA #$00 p 7STA BUTNO }7LDA #$92 �7STA $63FC �(7SEI �27LDA #$00 �<7STA $0314 �F7LDA #$C0 �P7STA $0315 �Z7CLI �d7LDA #$00 �n7STA XP �x7STA HOUR �7LDA #$80 �7STA YP �7LDA #$01 '�7STA XPB 4�7LDA #$1C B�7STA $D015 O�7JSR LEFT \�7LDA #$00 j�7STA $D004 x�7STA $D006 ��7LDA #$D9 ��7STA $D005 ��7STA $D007 �8LDA #$95 �8STA $63FB �8LDA #$08 �"8STA $D01C �,8LDA #$18 �68STA $D016 0u; MANDLEBROT SET PLOTTER !:uM�LE LDA #$00 0DuSTA YPIXEL =NuLDA #$03 KXuSTA $4100 XbuLDA #$06 fluSTA $4102 tvuJSR EQUAL ��uMMAINL LDA #$00 ��uSTA XPIXEL ��uLDA #$01 ��uSTA $4100 ��uLDA #$05 ��uSTA $4102 ��uJSR EQUAL ��uMMAINLB LDA #$05 ��uSTA $4100 �uLDA #$07 �uSTA $4102 '�uJSR EQUAL 5�uINC $4100 CvINC $4102 QvJSR EQUAL ^vLDA #$00 m vSTA COLOUR *vLOOP LDA #$07 �4vSTA $4100 �>vSTA $4101 �HvLDA #$10 �RvSTA $4102 �\vJSR MULTIPLY �fvLDA #$08 �pvSTA $4100 �zvSTA $4101 ��vLDA #$11 �vSTA $4102 �vJSR MULTIPLY )�vLDX #$10 7�vSTX $4100 ?�vINX M�vSTX $4101 U�vINX c�vSTX $4102 s�vJSR ADDITI� ��vLDA $4091 ��vCMP #$04 ��vBCC FAIL �wCMP #$50 �wBCS FAIL �wSUCPASS JMP SUCCESS �$wFAIL INC COLOUR �)wLDA COLOUR �.wCMP MAXCOL 8wBEQ SUCPASS BwJSR SUBTRACT -LwLDA #$12 ;VwSTA $4100 H`wLDA #$05 VjwSTA $4101 ctwLDA #$13 q~wSTA $4102 ��wJSR ADDITI� ��wLDA #$07 ��wSTA $4100 ��wLDA #$08 ��wSTA $4101 ��wINC $4102 ��wJSR MULTIPLY ��wLDA #$14 ��wSTA $4100 ��wLDA #$1C �wSTA $4101 �wLDA #$15 ' xSTA $4102 8 xJSR MULTIPLY ExLDA #$15 SxSTA $4100 `(xLDA #$06 n2xSTA $4101 {<xLDA #$16 �FxSTA $4102 �PxJSR ADDITI� �ZxLDA #$13 �dxSTA $4100 �nxLDA #$07 �xxSTA $4102 ��xJSR EQUAL ��xLDA #$16 ��xSTA $4100 �xLDA #$08 �xSTA $4102 !�xJSR EQUAL .�xJMP LOOP C�xSUCCESS JSR PLOT P�xLDA #$05 ^�xSTA $4100 l�xSTA $4102 y�xLDA #$02 ��xSTA $4101 �yJSR ADDITI� �yLDA XPIXEL �yBNE XRELOP �"yLDA #$06 �,ySTA $4100 �6ySTA $4102 �@yLDA #$04 �JySTA $4101 TyJSR ADDITI� ^yINC YPIXEL 'hyLDA YPIXEL 4ryCMP #$C8 C|yBNE YRELOP K�yRTS b�yXRELOP JMP MMAINLB x�yYRELOP JMP MMAINL �@�; ARITHMETIC ROUTINES �J��DIGIT CLD �T�ASL A �^�ASL A �h�ASL A �r�STA $02 �|�TXA ���LSR A ���STA $24 ���LDA #$07 ���SEC ��SBC $24 ��CLC ADC $02 &̜TAY 6֜LDA $4000,Y >�TAY F�TXA Q� #$01 _��BEQ LSNGD g�TYA r�� #$F0 |�LSR A �&�LSR A �0�LSR A �:�LSR A �D�RTS �N�LSNGD TYA �X�� #$0F �b�RTS �l�MULTIPLYB JSR NEGATIVE �q�LDA $4102 �v�ASL A ��ASL A ��ASL A ��TAX ��LDA #$00 '��TAY =��MLOPA STA $4000,X E��INY MƝINX ZНCPY #$08 hڝBNE MLOPA u�LDA #$06 ��STA $FC ����DIGIT LDA $4101 ��LDX $FC ��JSR �DIGIT ��CMP #$00 � �BEQ DMOVER �*�STA $FD �4�LDA #$06 �>�STA $FB H�DMLOP LDA $4100 R�LDX $FB !\�JSR �DIGIT 3f�DMLB CMP #$00 Bp�BEQ DMOVER Nz�STA $FE Z��LDA $FB b��CLC n��ADC $FC v��SEC ���SBC #$0C ���LDX $FD ���TAY �ʞ� #$01 �ԞBEQ MSKIP �ޞTXA ��ASL A ��ASL A ���ASL A ��ASL A ��TAX ��MSKIP TYA $�LSR A .�STA $02 8�LDA #$07 ! B�SEC - L�SBC $02 9 V�STA $02 G `�LDA $4102 Q j�ASL A [ t�ASL A e ~�ASL A q ��ADC $02 y ��TAY � ��STX $24 � ��LDX $02 � ��SED � ��LDA $4000,Y � ğCLC � ΟADC $24 � ؟STA $4000,Y � �MALP CLD � �BCC MAQUIT � ��DEY � �DEX ! �CPX #$FF !�BEQ MAQUIT !�SED -!(�LDA $4000,Y 5!2�CLC B!<�ADC #$01 R!F�STA $4000,Y _!P�JMP MALP r!Z�DMOVER INC $FB ~!d�LDA $FB �!n�CMP #$0E �!x�BCC DMLOP �!��INC $FC �!��LDA $FC �!��CMP #$0E �!��BCC �DIGIT �!��LDA YPIB �!��BEQ QUIT �!��LDA $4102 "ȠSTA $4101 "ҠLDA #$1D "ܠSTA $4100 /"�JSR SUBTRACT <"�QUIT RTS O"��MAQUIT LDX $FE W"�DEX _"�TXA l"�JMP DMLB ""�MSUP LDA $4100 �",�ASL A �"6�ASL A �"@�ASL A �"J�TAX �"T�DEX �"^�STX $FB �"h�LDA $4101 �"r�ASL A �"|�ASL A �"��ASL A �"��TAX �"��DEX #��STX $FD #��LDA $4102 #��ASL A ##¡ASL A -#̡ASL A 5#֡TAX =#�DEX I#�STX $22 V#�LDA #$40 b#��STA $FC n#�STA $FE z#�STA $23 �#�RTS �#&�EQUAL JSR MSUP �#0�LDY #$08 �#:�ELOP LDA ($FB),Y �#D�STA ($22),Y �#N�DEY �#X�BNE ELOP �#b�RTS �#l�ADDITI� JSR MSUP $v�LDY #$08 $��SED $��CLC ,$��ADLOP LDA ($FB),Y <$��ADC ($FD),Y L$��STA ($22),Y T$��DEY b$��BNE ADLOP j$ƢCLD r$ТRTS �$ڢSUBTRACT JSR MSUP �$�LDY #$08 �$�SED �$��SEC �$�SULOP LDA ($FB),Y �$�SBC ($FD),Y �$�STA ($22),Y �$ �DEY �$*�BNE SULOP �$4�CLD %>�RTS %H�NEGATIVE LDA #$00 %R�PHA -%\�LDA $4100 5%f�TAY ?%p�ASL A I%z�ASL A S%��ASL A [%��TAX k%��LDA $4001,X x%��CMP #$50 �%��BCC NEGRMOVEAB �%��PLA �%��ADC #$00 �%��PHA �%ʣJMP NEGRMOVEA �%ԣNEGRMOVEAB LDA $4101 �%ޣTAY �%�ASL A �%�ASL A �%��ASL A &�TAX &�LDA $4001,X &�CMP #$50 &&$�PLA 3&.�BCC NOE� ?&8�E� #$01 G&B�PHA Y&L�BCS NEGRMOVEB l&V�NEGRMOVEBB PLA ~&`�NOE� STA YPIB �&j�RTS �&t�NEGRMOVE LDA $4100 �&~�PHA �&��LDA $4101 �&��PHA �&��LDA $4102 �&��PHA �&��TYA �&��STA $4101 �&ĤSTA $4102 'ΤLDA #$1D 'ؤSTA $4100 !'�JSR SUBTRACT )'�PLA 7'��STA $4102 ?'