home *** CD-ROM | disk | FTP | other *** search
- ;SG C Tools 1.1
-
- ;(C) 1993 Steve Goldsmith
- ;All Rights Reserved
-
- ;Assembled with HI-TECH C 3.09 (CP/M-80) ZAS.
-
- ;set vdc reg to read and wait for status bit 7
-
- global _invdc, _outvdc
- psect text
-
- _invdc:
- pop de ;return address
- pop hl
- push hl
- push de
- ld a,l
- ld bc,0d600h
- out (c),a
- 1:
- in a,(c)
- bit 7,a
- jr z,1b
- inc bc
- in l,(c)
- ld h,0
- ret
-
- ;in-line assembler to set vdc reg to write, wait for status bit 7 and
- ;write new value to reg
-
- _outvdc:
- pop hl ;return address
- pop bc ;port address
- pop de ;data
- push de
- push bc
- push hl
- ld a,c
- ld bc,0d600h
- out (c),a
- 1:
- in a,(c)
- bit 7,a
- jr z,1b
- inc bc
- out (c),e
- ld l,e ;return value in hl also
- ld h,0
- ret
-