home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / c128 / util / sfxsrc.lzh / SFX.I < prev    next >
Encoding:
Text File  |  1990-02-12  |  2.2 KB  |  69 lines

  1. ; lhsfx.i
  2. ;──────────────────────────────────────────────────────────────────────────────
  3. ; LHARChive self extraction module for C64/C128 - Copyright 1990 - Chris Smeets
  4. ;──────────────────────────────────────────────────────────────────────────────
  5.  
  6. status      EQU $0090
  7.  
  8. ;─────────────────────────────────────────────────────────────────
  9. ; Miscellaneous constants
  10. ;─────────────────────────────────────────────────────────────────
  11.  
  12. N           EQU 4096            ; String table Size
  13. NIL         EQU N               ; Value of a null code
  14. F           EQU 60              ; Lookahead length
  15. THRESHOLD   EQU 2               ; ??
  16. N_CHAR      EQU 256-THRESHOLD+F ; Character code <= this value      (314)
  17. T           EQU N_CHAR*2-1      ; Size of tree tables               (627)
  18. R           EQU T-1             ; Root node position                (626)
  19. MAX_FREQ    EQU $8000           ; Cumulative frequency limit before reconst
  20. Tstar2      EQU 2*T
  21. Rstar2      EQU 2*R
  22.  
  23. ; Error return codes for decode
  24.  
  25. DecodeOK    EQU 0
  26. NullFile    EQU 1
  27. DiskError   EQU 2
  28. CRCError    EQU 3
  29. BadHeader   EQU 4
  30.  
  31.  
  32. Z_low       EQU 2               ; Lowest  byte   of zero page used by SFX
  33.  
  34. ;─────────────────────────────────────────────────────────────────
  35. ; 'Registers' R0 through R3 are general purpose scratch registers.
  36. ;─────────────────────────────────────────────────────────────────
  37. ; Total 16 bytes
  38.  
  39. R0          EQU Z_low
  40. R1          EQU R0+4
  41. R2          EQU R1+4
  42. R3          EQU R2+4
  43.  
  44. ;────────────────────────────────────────────────────────────────
  45. ; Registers T0 through T4 are also scratch registers.
  46. ;────────────────────────────────────────────────────────────────
  47. ; Total 22 bytes
  48.  
  49. T0          EQU R3+4
  50. T1          EQU T0+2
  51. T2          EQU T1+2
  52. T3          EQU T2+2
  53. T4          EQU T3+2
  54. T5          EQU T4+2
  55. T6          EQU T5+2
  56. T7          EQU T6+2
  57. T8          EQU T7+2
  58. T9          EQU T8+2
  59. T10         EQU T9+2
  60.  
  61. Z_high      EQU T10+2
  62.  
  63. ;────────────────────────────────────────────────────────────────
  64. ; Other zero page used. These are not saved and restored.
  65. ;────────────────────────────────────────────────────────────────
  66.  
  67. IBUF        EQU $fa     ; Pointer into memory for getc
  68. BITBUF      EQU $fc     ; Bit buffer. One byte
  69.