testlz.asm 536 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. ; Example of use of z80unlze.asm
  2. ; Copyright © 2020 Pedro Gimeno Fortea
  3. org 0A000h
  4. jr Start
  5. FinalLength dw 0
  6. ; Example: Decompress a text and print it
  7. Start: ld hl,CompressedStrm
  8. ld de,0C000h
  9. call unlze
  10. ld bc,-CompressedStrm
  11. add hl,bc
  12. ld (FinalLength),hl
  13. ld hl,0C000h
  14. PrtLoop: ld a,l
  15. cp e
  16. jr nz,GoOn
  17. ld a,h
  18. cp d
  19. ret z
  20. GoOn: ld a,(hl)
  21. inc hl
  22. ; cp 0Ah
  23. ; jr nz,NonLF
  24. ; ld a,0Dh
  25. ; rst 18h
  26. ; ld a,0Ah
  27. NonLF: rst 18h
  28. jr PrtLoop
  29. CompressedStrm: incbin 'lorem_ip.txt.lz'
  30. include 'z80unlze.asm'