home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Go64!
/
Go64_2003-04_2003_CSW_Side_A.d64
/
decruncher
< prev
next >
Wrap
Text File
|
2023-02-26
|
2KB
|
156 lines
; ByteBoozer Decruncher /HCL may.2003
;variables.. #bytes
zp{CBM-@}base = $02 ; -
cpl = zp{CBM-@}base+0 ;1
cur = zp{CBM-@}base+1 ;1
zp = zp{CBM-@}base+2 ; -
put = zp{CBM-@}base+2 ;2
get = zp{CBM-@}base+4 ;2
cps = zp{CBM-@}base+6 ;2
*= $0200
.offs $1000-*
decrunch
sty get
stx get+1
ldy #2
lda (get),y
sta !cur,y
dey
bpl *-6
clc
lda #3
adc get
sta get
bcc *+4
inc get+1
d{CBM-@}loop
jsr d{CBM-@}get
dl{CBM-@}1
php
lda #1
dl{CBM-@}2
jsr d{CBM-@}get
bcc dl{CBM-@}2e
jsr d{CBM-@}get
rol a
bpl dl{CBM-@}2
dl{CBM-@}2e
plp
bcs d{CBM-@}copy
d{CBM-@}plain
sta cpl
ldy #0
lda (get),y
sta (put),y
iny
cpy cpl
bne *-7
ldx #get-zp
jsr d{CBM-@}add
iny
beq d{CBM-@}loop
sec
bcs dl{CBM-@}1
d{CBM-@}copy
adc #0
beq d{CBM-@}end
sta cpl
cmp #3
lda #0
sta cps
sta cps+1
rol a
jsr d{CBM-@}get
rol a
jsr d{CBM-@}get
rol a
tax
dc{CBM-@}1s
ldy tab,x
dc{CBM-@}1
jsr d{CBM-@}get
rol cps
rol cps+1
dey
bne dc{CBM-@}1
txa
dex
and #3
beq dc{CBM-@}1e
inc cps
bne dc{CBM-@}1s
inc cps+1
bne dc{CBM-@}1s
dc{CBM-@}1e
sec
lda put
sbc cps
sta cps
lda put+1
sbc cps+1
sta cps+1
lda (cps),y
sta (put),y
iny
cpy cpl
bne *-7
ldx #put-zp
jsr d{CBM-@}add
bmi d{CBM-@}loop
d{CBM-@}get
asl cur
bne dg{CBM-@}end
pha
tya
pha
ldy #0
lda (get),y
inc get
bne *+4
inc get+1
sec
rol a
sta cur
pla
tay
pla
dg{CBM-@}end
rts
d{CBM-@}add
clc
tya
adc zp,x
sta zp,x
bcc *+4
inc zp+1,x
dex
dex
bpl d{CBM-@}add
d{CBM-@}end
rts
tab .byte 4,2,2,2
.byte 5,2,2,3