Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.PCS 1/10/84; site mtgzz.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!whuxl!houxm!ihnp4!inuxc!pegasus!mtuxo!mtgzz!dmt From: dmt@mtgzz.UUCP (d.m.tutelman) Newsgroups: net.micro.pc Subject: Re: Help with Video Retrace Code Message-ID: <1019@mtgzz.UUCP> Date: Sat, 3-Aug-85 22:08:42 EDT Article-I.D.: mtgzz.1019 Posted: Sat Aug 3 22:08:42 1985 Date-Received: Mon, 5-Aug-85 07:38:38 EDT References: <85@drux1.UUCP> Organization: AT&T Information Systems Labs, Middletown NJ Lines: 28 Cc: dmt > Does anyone know the assembler code to do a check on the horizontal > retrace flag for the mono and color display on the PC to prevent > fuzz? > Actually, you could even do it in C, though the code examples I have are assembler. The important thing to know is that the status register of the 6845 display chip includes a bit (bit 1) for horizontal retrace status. (The 6845 is used in both the mono and color boards.) The code that follows is adapted from the Micromint MPX-16 BIOS, but is very similar to the BIOS code published in the IBM PC Tech Ref: mov dx,video_base ; 3B4H or 3D4H add dx,6 ; status register waitlow:in al,dx ; get the status reg test al,1 ; horizontal retrace bit on? jnz waitlow cli ; don't want to be interrupted here waithi: in al,dx ; now wait till it goes on again test al,1 jz waithi ;NOW you can write for a period equal to the retrace interval. Dave Tutelman Physical - AT&T Information Systems Holmdel, NJ 07733 Logical - ...ihnp4!mtuxo!mtgzz!dmt Audible - (201)-834-2895