home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / zsys / simtel20 / z3lib / zlib2.lbr / Z3PCRT.Z80 < prev    next >
Encoding:
Text File  |  1986-02-07  |  768 b   |  38 lines

  1. ;
  2. ; Z3LIB Module Name:  Z3PCRT
  3. ; Author:  Richard Conn
  4. ; Z3LIB  Version Number:  1.3
  5. ; Module Version Number:  1.1
  6. ;
  7.     public    putcrt
  8.  
  9.     ext    envptr
  10.  
  11. ;
  12. ;    PUTCRT stores the selection of 0 or 1 in the CRT Selection buffer
  13. ; in the Environment Descriptor.
  14. ;    On exit, A=0 and Zero Flag Set if invalid selection value (not 0 or 1)
  15. ;
  16. putcrt:
  17.     push    hl        ;save regs
  18.     push    de
  19.     cp    2        ;range check
  20.     jp    nc,pcerror
  21.     push    af        ;save selection
  22.     ld    hl,(envptr)    ;pt to environment
  23.     ld    de,2fh        ;pt to entry
  24.     add    hl,de
  25.     pop    af        ;get selection
  26.     ld    (hl),a        ;store selection
  27.     pop    de        ;get regs
  28.     pop    hl
  29.     or    0ffh        ;set NZ for OK
  30.     ret
  31. pcerror:
  32.     pop    de        ;restore registers
  33.     pop    hl
  34.     xor    a        ;error return
  35.     ret
  36.  
  37.     end
  38.