COMPRESSASM yte g4 ld (hl),a inc hl dec de djnz g4 jr g2 g5; Programme d'exemple de compression de donn{es ; Par CNGSoft pour Quasar CPC 18 Org &be80 cmpbyte equ &c7 putbyte equ &bc95 getbyte equ &bc80 cp 3 ret nz ld c,(ix+0) ld b,(ix+1) ld e,(ix+2) ld d,(ix+3) ld l,(ix+4) ld h,(ix+5) ld a,c or b jr z,g1 push bc call p1 pop hl ld (hl),c inc hl ld (hl),b ret g1 jmp g2 p1 xor a ld c,a ld b,a ld (ix+0),a p2 ld a,d or e jr z,p4 ld a,(hl) inc hl dec de cp (ix+1) jr nz,p3 inc (ix+0) ld a,(ix+0) xor &ff call z,p5 jr p2 p3 call p5 dec hl ld a,(hl) ld (ix+1),a inc hl ld (ix+0),1 jr p2 p4 call p5 p5 ld a,(ix+1) cp cmpbyte jr z,p6 ld a,(ix+0) and a jr z,p6 cp 3 jr c,p7 p6 ld a,(ix+0) and a jr z,p8 ld a,cmpbyte call putbyte inc bc ld a,(ix+0) call putbyte inc bc ld a,(ix+1) call putbyte inc bc xor a ld (ix+0),a jr p8 p7 ld a,(ix+1) call putbyte inc bc dec (ix+0) jr nz,p7 p8 ret g2 ld a,d or e jr z,g5 call getbyte cp cmpbyte jr z,g3 ld (hl),a inc hl dec de jr g2 g3 call getbyte and a jr z,g5 ld b,a call getbyte g4 ld (hl),a inc hl dec de djnz g4 jr g2 g5 ret end