home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Z3LIB Module Name: Z3MSGC
- ; Author: Richard Conn
- ; Z3LIB Version Number: 1.3
- ; Module Version Number: 1.1
- ;
- public getreg
-
- ext getmsg
-
- ;
- ; GETREG returns the value of the register specified in B. This
- ; value is returned in the A register. Zero Flag is set accordingly.
- ; Only PSW is affected.
- ;
- getreg:
- push hl ;save HL
- push de ;save DE
- call getmsg ;get ptr to messages
- ld de,30h ;offset to registers
- add hl,de
- ld a,b ;get register number
- add a,l ;make HL pt to register
- ld l,a
- ld a,h
- adc a,0
- ld h,a
- ld a,(hl) ;get register value
- pop de ;get DE
- pop hl ;get HL
- or a ;set flags
- ret
-
- end