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