home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
A
/
ARC20.ARC
/
ARCMACS.ARC
/
UNSQUEEZ.MAC
< prev
Wrap
Text File
|
1989-11-07
|
1KB
|
82 lines
; UNSQUEEZE for Turbo-ARC, TR 071189
.z80
extrn siz,crypt,getc_decsiz,source,node
extrn putc_ncr,dest,notspeof
ld ix,siz ; point to global size
xor a ; A=bitpos
loop: bit 7,(ix+3)
jr nz,exit ; SIZ negative: exit
ld de,0
inloop: or a
jr nz,noread
push af
push de
push ix
ld de,(source)
push de
call getc_decsiz
push hl
call crypt
ld c,l ; C = crypt(getc_decsiz(source))
pop ix
pop de
pop af
noread: ld hl,(node)
srl c
jr nc,noinc
inc hl
inc hl
noinc: add hl,de
add hl,de
add hl,de
add hl,de
ld e,(hl)
inc hl
ld d,(hl) ; i:=node(i,curin and 1)
inc a
and 7
bit 7,d
jr z,inloop ; until i<0
ld hl,notspeof
sbc hl,de
jr z,eof
push af
push bc
push ix
ld hl,(dest)
push hl
ld a,e
cpl
ld e,a
ld d,0
push de
call putc_ncr ; putc_ncr(dest,not i);
pop ix
pop bc
pop af
jr loop
eof: bit 7,(ix+3) ; siz < 0 ?
jr nz,exit
ld hl,(source)
push hl
call getc_decsiz
jr eof ; read until siz negative
exit:
end
bitpos:=0;
while siz.hi>-1 do begin
i:=0;
repeat
if bitpos=0 then curin:=crypt(getc_decsiz(source));
i:=node^[i,curin and 1];
curin:=curin shr 1;
bitpos:=succ(bitpos) and 7;
until i<0;
if i<>notspeof then putc_ncr(dest,not i);
end;