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 / BEEHIVE / OS / ZPM3N07.ARK / SETZ3.Z80 < prev    next >
Text File  |  1992-04-26  |  2KB  |  80 lines

  1.  
  2. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  3. ;             S E T Z 3
  4. ;             for  ZPM3
  5. ;            by Simeon Cran
  6. ;               30/3/92
  7. ;
  8. ; This program automatically sets the system environment address in the ZPM3
  9. ; SCB for Z3PLUS users. Certain advanced ZCPR facilities such as wheel
  10. ; protection of files will then be activated.
  11. ;
  12. ; Z3PLUS users should run SETZ3.COM once when they start up Z3PLUS and again
  13. ; when returning to regular (non-Z-System) operation. When run after Z3PLUS
  14. ; is started, the SCB environment address word is set with the ZCPR environment
  15. ; address. When run after returning to regular operation, the SCB environment
  16. ; address word is cleared to 0000h.
  17. ;
  18. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  19.  
  20. ;===============================================================================
  21.  
  22. BDOS    equ    5
  23. deffcb    equ    5ch
  24. SCBfunc    equ    31h    ; Get/Set SCB function number
  25. SCBoff    equ    3bh    ; Offset in SCB to get SCB base page
  26. Z3ENVoff equ    83h    ; Offset in SCB base page of the ZCPR system
  27.             ;  environment pointer.
  28.  
  29.     jp    start    ; Jump over general data
  30.     db    'Z3ENV'
  31.     db    1
  32. Z3ENV:    dw    0
  33.     dw    0
  34. HELPmsg:
  35.     db    ' SYNTAX:'
  36.     db    10,13
  37.     db    '  SETZ3'
  38.     db    10,13
  39.     db    '              Sets the ZCPR environment address in the SCB,'
  40.     db    10,13
  41.     db    '              or else clears it if not running ZCPR.'
  42.     db    10,13
  43.     db    '  SETZ3 //    Displays this brief help message'
  44.     db    '$'
  45.  
  46. HELP:    ld    de,HELPmsg
  47. MSGexit:
  48.     ld    c,9
  49.     call    bdos
  50.     rst    0
  51.  
  52. start:    ; Get the address of the SCB environment address pointer.
  53.     ld    de,(Z3ENV)
  54.     ld    a,d
  55.     or    e        ; Has it been set by Z3PLUS?
  56.     jr    nz,Zinstall    ; Jump if it has
  57.     ex    de,hl
  58.     ld    a,d
  59.     or    e        ; Was it in HL instead?
  60.     jr    nz,Zinstall
  61. Zinstall:    ; DE holds 0 if uninstalling, otherwise the address of the
  62.         ;  ZCPR evironment descriptor.
  63.     push    de
  64.     ld    c,SCBfunc
  65.     ld    de,SCBPB
  66.     call    bdos        ; Get base page of SCB
  67.     ld    h,a
  68.     ld    l,Z3ENVoff    ; HL is now the address of the word
  69.     pop    de
  70.     ld    (hl),e
  71.     inc    hl
  72.     ld    (hl),d        ; Set it appropriately
  73.     rst    0        ; And exit.
  74.     
  75.     
  76. SCBPB:    ; System control block function parameter block.
  77.     db    03bh
  78.     db    0        ; Get operation
  79.  
  80.