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

  1. ;
  2. ; Z3LIB Module Name:  Z3MSGC
  3. ; Author:  Richard Conn
  4. ; Z3LIB  Version Number:  1.3
  5. ; Module Version Number:  1.1
  6. ;
  7.     public    getreg
  8.  
  9.     ext    getmsg
  10.  
  11. ;
  12. ;    GETREG returns the value of the register specified in B.  This
  13. ; value is returned in the A register.  Zero Flag is set accordingly.
  14. ; Only PSW is affected.
  15. ;
  16. getreg:
  17.     push    hl        ;save HL
  18.     push    de        ;save DE
  19.     call    getmsg        ;get ptr to messages
  20.     ld    de,30h        ;offset to registers
  21.     add    hl,de
  22.     ld    a,b        ;get register number
  23.     add    a,l        ;make HL pt to register
  24.     ld    l,a
  25.     ld    a,h
  26.     adc    a,0
  27.     ld    h,a
  28.     ld    a,(hl)        ;get register value
  29.     pop    de        ;get DE
  30.     pop    hl        ;get HL
  31.     or    a        ;set flags
  32.     ret
  33.  
  34.     end
  35.