8-Bit Software Online Conversion
:2.S.PALO4'1 - Listing
20REM SNAPSHOT
40REM A.K. 11/6/86
50REM PALO004 Generates own imposter
60REM Has Eclipse parser less get`str
ing
80
100osfile=&FFDD
120oswrch=&FFEE
140osbyte=&FFF4
160osnewl=&FFE7
180osasci=&FFE3
185gsread=&FFC5
190gsinit=&FFC2
200
220
240FOR pass=4 TO 7 STEP 3
260P%=&8000
280O%=&4000
300[
320OPT pass
340.lang EQUB 0
360EQUW 0
380
400.serv JMP enter
420.rom EQUB &82
440.offset EQUB copy-&8000
460.title EQUS "Snapshot"
480.copy EQUB 0
500EQUS "(C)"
520.mess EQUS "Allan"
540EQUB 0
560EQUD 0
580EQUD 0
600
620.enter CMP#5
640BEQ interbr
660CMP#9
680BEQ help
700CMP#4
720BEQ parse
730CMP#&FE
735BEQ stop
740RTS
750.stop LDA#0
751STA repeat`flag
752LDA#&FE
753RTS
760.interbr JMP inter
780.help ½ *help message
800PHA
820TXA
840PHA
860TYA
880PHA
900LDX#dark MOD 256
920LDY#dark DIV 256
940JSR display
960PLA
980TAY
1000PLA
1020TAX
1040PLA
1060RTS
1080
1120.display ½ X & Y piont to message
1140½ X lb, Y HB, mess end with 0
1160STX&70
1180STY&71
1200LDY#0
1220.dback LDA(&70),Y
1240JSR osasci
1260INY
1280CMP#0
1300BNE dback
1320RTS
1500
1510.parse STY sy ½ mask for P ½ desgne
d for ROMs Service call 4 to here
1520LDA(&F2),Y
1530ORA#&20
1540CMP#ASC"p"
1550BNE pfo1
1560INY
1570.pfo1 STY sy+1
1580LDX#0 ½ count through coms
1590STX count
1600.pba5 LDY sy+1
1610.pba1 LDA(&F2),Y
1620ORA#&20
1630CMP comms,X
1640BNE next`com
1650CMP#&20
1660BEQ end`com
1670CMP#&2D
1680BEQ end`com
1690INX
1700INY
1710JMP pba1
1720.next`com LDA comms,X
1730CMP#&FF
1740BEQ bad`com
1750CMP#&2D
1760BEQ upto`next`com
1770CMP#&20
1780BEQ upto`next`com
1790INX
1800JMP next`com
1810.upto`next`com INX
1820INC count
1830JMP pba5
1840.end`com LDA count
1850ASL A
1860TAX
1870LDA com`addr,X
1880STA jump
1890LDA com`addr+1,X
1900STA jump+1
1910JMP(jump)
1920.bad`com LDY sy ½ it's not for me
1930LDA#4
1940RTS
1950
1960.syntax ½ an error has occured issu
e error &DC
1970LDY#0
1980STY&100
1990.pba2 LDA errorDC,Y
2000STA&101,Y
2010INY
2020CMP#0
2030BNE pba2
2040JMP&100
2050
2060.asc`hex SEC
2070SBC#&30
2080CMP#9
2090BMI pfo2
2100SEC
2110SBC#7
2120.pfo2 CMP#0
2130BMI syntax
2140RTS
2150.cli`two`asc`hex ½ convert 2 ascii
chars in a cli to hex in A
2160.pba3 INY ½ Y is offset
2170BEQ syntax
2180LDA(&F2),Y
2190CMP#&D
2200JSR valid`asc
2210BCS pba3
2220.pfo3 JSR asc`hex
2230STA sa
2240INY
2250LDA(&F2),Y
2260INY
2270CMP#&D
2280BEQ was
2290CMP#&20
2300BEQ was
2310JSR valid`asc
2320BCS syntax
2330BEQ was
2340ASL sa
2350ASL sa
2360ASL sa
2370ASL sa
2380JSR asc`hex
2390ORA sa
2400RTS
2410.was LDA sa
2420RTS
2430
2440.valid`asc ½ check is A(asc) is val
id in hex C=0 ok,C=1 no
2450CMP#&30
2460BMI pset
2470CMP#&47
2480BCS pset
2490CMP#&3A
2500BMI pclear
2510CMP#&40
2520BMI pset
2530.pclear CLC
2540RTS
2550.pset SEC
2560RTS
2690
2900.prepear ½ get an imposter
2901LDA#&FF
2902STA got`imposter
2910½ put at &AC00 up
2920SEI
2930LDY#0
2940.back LDA 0,Y
2950STA&AC00,Y
2960INY
2970CPY#0
2980BNE back
2990LDA#0
3000STA&70
3010STA&72
3020LDA#1
3030STA&71
3040LDA#&AD
3050STA&73
3060LDY#0
3070.back2 LDA(&70),Y
3080STA(&72),Y
3090INY
3100CPY#0
3110BNE back2
3120INC&71
3130INC&73
3140LDA&73
3150CMP#&C0
3160BNE back2
3170CLI
3180LDA#7
3190JSR oswrch
3200LDA#0
3210RTS
3220
3300.get ½ bring oldboy up
3310LDY#0
3320.back1 LDA0,Y
3330STA&8A00,Y
3340INY
3350BNE back1
3360LDA#0
3370STA&70
3380STA&72
3390LDA#1
3400STA&71
3410LDA#&8B
3420STA&73
3430.back2 LDY#0
3440.back3 LDA(&70),Y
3450STA(&72),Y
3460INY
3470BNE back3
3480INC&71
3490INC&73
3500LDA&71
3510CMP#&15
3520BNE back2
3530
3540½ Send in the imposter stored at &A
C00 to &C000
3550LDA#0
3560STA&70
3570STA&72
3580LDA#1
3590STA&71
3600LDA#&AD
3610STA&73
3620
3630.back5 LDY#0
3640.back6 LDA(&72),Y
3650STA(&70),Y
3660INY
3670BNE back6
3680INC&71
3690INC&73
3700LDA&71
3710CMP#&14
3720BNE back5
3730LDY#0
3740.back7 LDA&AC00,Y
3750STA0,Y
3760INY
3770BNE back7
3780
3790LDY#0 ½ copy OSFILE control block
3800.back4 LDA data,Y
3810STA&7E0,Y
3820INY
3830CPY#&1A
3840BNE back4
3850CLI ½ interupts on
3860JSR save
3870SEI ½ interupts off
3880
3890LDA#0
3900STA&70
3910STA&72
3920LDA#&30
3930STA&71
3940LDA#&8A
3950STA&73
3960.back8 LDY#0
3970.back9 LDA(&72),Y
3980STA(&70),Y
3990INY
4000BNE back9
4010INC&71
4020INC&73
4030LDA&73
4040CMP#&9F
4050BNE back8
4060
4070LDA ss
4080STA&4508
4090
4100LDY#0
4110.backA LDA data2,Y
4120STA&7E0,Y
4130INY
4140CPY#&1A
4150BNE backA
4160CLI
4170JSR save
4180LDA#0
4190JMP put`plus
4300
4310.put ½ Disc data into memory
4320LDY#0 ½ load Oldboy
4330.gback1 LDA data3,Y
4340STA&7E0,Y
4350INY
4360CPY#&1A
4370BNE gback1
4380JSR load
4390
4400.put`plus LDA#0 ½ Oldboy coming up
4410STA&70
4420STA&72
4430LDA#&30
4440STA&71
4450LDA#&8A
4460STA&73
4470LDY#0
4480.gback2 LDA(&70),Y
4490STA(&72),Y
4500INY
4510CPY#0
4520BNE gback2
4530INC&71
4540INC&73
4550LDA&71
4560CMP#&45
4570BNE gback2
4580
4590LDA&4508 ½ Oldboy carries stack poi
nter
4600STA ss
4610LDA#22 ½ correct mode
4620JSR oswrch
4630LDA&3355
4640STA mode
4650JSR oswrch
4660
4670LDY#0 ½ bring in POT
4680.gback3 LDA data4,Y
4690STA&7E0,Y
4700INY
4710CPY#&1A
4720BNE gback3
4730JSR load
4740
4750½ interupts off
4760SEI
4770LDA#0 ½ send Oldboy home excepy Z
4780STA&70
4790STA&72
4800LDA#&8B
4810STA&71
4820LDA#&1
4830STA&73
4840LDY#0
4850.gback5 LDA(&70),Y
4860STA(&72),Y
4870INY
4880BNE gback5
4890INC&71
4900INC&73
4910LDA&71
4920CMP#&9F
4930BNE gback5
4940
4950LDY#0 ½ send z page home
4960.gback6 LDA&8A00,Y
4970STA 0,Y
4980INY
4990BNE gback6
5000
5010LDX mode
5020CPX#7
5030BNE other
5040LDA#13 ½ only mode 7
5050STA&FE00
5060LDA&350
5070STA&FE01
5080LDA#12
5090STA&FE00
5100LDA&351
5110SEC
5120SBC#&74
5130EOR#&20
5140STA&FE01
5150.gback7 ½ impersonate an IRQ2 retur
n
5160LDX ss
5170TXS
5171LDA repeat`flag
5172CMP#&FF
5173BNE no`repeat
5174JMP set`inter
5180.no`repeat LDA#0
5190CLI ½ interupts
5200RTS
5210.other LDA#&D
5220STA&FE00
5230LDA&350
5240LSR A
5245LSR A
5250LSR A
5260STA&FE01
5270LDA#&C
5280STA&FE00
5290LDA&351
5300LSR A
5305LSR A
5310LSR A
5320STA&FE01
5330JMP gback7
5490
5500.wait JSR cli`two`asc`hex
5505STA waiting
5506.set`inter LDA#0
5510STA tim+1
5520JMP timer
5530.inter ½ service interupt
5540LDA#&40
5550STA&FE6D
5560LDA tim
5570CLC
5580ADC#1
5590STA tim
5600LDA tim+1
5610ADC#0
5620STA tim+1
5630CMP waiting
5640BEQ show
5650.timer LDA#&FF
5660STA&FE64
5670STA&FE65
5680LDA#&C0
5690STA&FE6E
5700LDA#0
5710CLI
5720RTS
5730.show TSX
5740STX ss
5750JMP get
5760
5800.now LDA got`imposter ½ check that
we have an imposter
5801CMP#&FF
5802BNE do`not
5805JMP show
5822.do`not LDA#7
5824JSR oswrch
5826LDA#0
5828RTS
5830
5840.restore JMP put
5850
5860.repeat LDA#&FF
5870STA repeat`flag
5880LDA#0
5890RTS
8000.save LDA#0
8010LDX#&E0
8020LDY#&7
8030JMP osfile
8040.load LDA#&FF
8050LDX#&E0
8060LDY#&7
8070JMP osfile
8800
8850.repeat`flag BRK
8860.waiting BRK
8870.got`imposter BRK
8880.tim EQUW0
8890.mode BRK
8900.ss BRK
8910.sa BRK:BRK
8930.sy BRK:BRK
8950.sx BRK:BRK
8970.count EQUB0
8980.jump EQUW0
8990.comms EQUS"now"
9020EQUB&2D
9030EQUS"ready"
9040EQUB&2D
9050EQUS"restore"
9060EQUB&2D
9070EQUS"wait"
9080EQUB&20
9090EQUS"repeat"
9100EQUB&2D
9121EQUB&FF
9130.com`addr EQUW now
9140EQUW prepear
9150EQUW restore
9170EQUW wait
9180EQUW repeat
9800.errorDC EQUB&DC
9810EQUS"Syntax error from Dark"
9820BRK
9830.dark EQUB&D
9835EQUS"Dark Side of the RAM bays"
9836EQUW&D0A:EQUS"Snapshot version Palo
4.1"
9837EQUW&D0A:EQUS"Ready, Wait, Repeat,
Restore, Now"
9838EQUW&D0A
9840BRK
9850.data EQUW&7F3
9852EQUD&1400
9854EQUD&1400
9856EQUD&1400
9858EQUD&8000
9860EQUB0
9862EQUS"POT"
9864EQUB&D
9870.data2 EQUW&7F3
9872EQUD0
9874EQUD0
9876EQUD&3000
9878EQUD&4510
9880EQUB0
9882EQUS"OLDBOY"
9884EQUB&D
9890.data3 EQUW&7F3
9892EQUD&3000
9894EQUD0
9896EQUD0
9898EQUD0
9900EQUB0
9902EQUS"OLDBOY"
9904EQUB&D
9910.data4 EQUW&7F3
9912EQUD&1400
9914EQUD0
9916EQUD0
9918EQUD0
9920EQUB0
9922EQUS"POT"
9924EQUB&D
9990]
9992NEXT
9994END