Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!ames!elroy!smeagol!jplgodo!wlbr!etn-rad!jru From: jru@etn-rad.UUCP (John Unekis) Newsgroups: comp.sys.ibm.pc Subject: Re: forcing a graphics pixel to on or off, a question Message-ID: <232@etn-rad.UUCP> Date: Fri, 31-Jul-87 16:35:46 EDT Article-I.D.: etn-rad.232 Posted: Fri Jul 31 16:35:46 1987 Date-Received: Sun, 2-Aug-87 08:36:29 EDT References: <779@cod.UUCP> Reply-To: jru@etn-rad.UUCP (0000-John Unekis) Organization: Eaton Inc. IMSD, Westlake Village, CA Lines: 37 Keywords: hercules, pixel, graphics In article <779@cod.UUCP> murphys@cod.UUCP (Steven P. Murphy) writes: > >Here is a question for all the assembly hacks out there. > >the appended Bresenham's algorithm works great for drawing lines > ..................(more words) >may not be a zero) > > mov ch, al > and ch, cl > sub cl, ch ; 7 - (x mod 8) = bit within the byte > mov ch, color > sal ch, cl ; prepare to look at the pixel >---> or es:[bp], ch ; or the bit with color > mov cx, ax > ... try this ... mov ch, al and ch, cl sub cl, ch ; 7 - (x mod 8) = bit within the byte mov ch,0FEH ; 11111110 hex or ch, color rol ch, cl ; prepare to look at the pixel and es:[bp], ch ; and the bit with color mov ch, color sal ch, cl ; prepare to look at the pixel or es:[bp], ch ; or the bit with color mov cx, ax ... it is a few more instructions, but it does the job. P.S. - look for the code I am posting monday, it is the source to a game which contains a graphics routine for hercules which is faster than this , and is written in `C` .