Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!caen!uflorida!gatech!mcnc!rti!bbt!djb From: djb@bbt.UUCP (beauvais) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: screen clearing program Message-ID: <1038@bbt.UUCP> Date: 3 Dec 90 14:01:11 GMT References: <684.273AC585@gisatl.FIDONET.ORG> Reply-To: djb@bbt.UUCP (beauvais) Organization: Broadband Technologies, Inc., Research Triangle Park, NC Lines: 47 In article <684.273AC585@gisatl.FIDONET.ORG> david.deitch@gisatl.FIDONET.ORG (David Deitch) writes: >Anyone have a program for EGA/VGA systems that will clear the number of lines >on the screen, ie 43 lines, 50 or 60 lines? CLS only clears the top 25. It's pretty easy to write your own... Pick you favorite programming language. Read the video mode, and write the mode back. Any time you write the video mode, the screen clears. You can read the current video mode by executing INT 10(hex) service 0F(hex). You can set the video mode by executing INT 10 service 0. In both cases, the the service # goes in the AH register, the mode is in the AL register. Here's an assembly language example: mov ah,0fh ;service 0F, get video mode int 10h ;video interrupt mov ah,0 ;service 0, set video mode int 10h ;video interrupt You can hack this with DEBUG. Or, if you prefer Turbo C: #include #define VIDEO 0x10 #define GET_MODE 0xf #define SET_MODE 0 void clearscreen() { union REGS regs; regs.h.ah = GET_MODE; int86 ( VIDEO, ®s, ®s ); regs.h.ah = SET_MODE; int86 ( VIDEO, ®s, ®s ); } -- Dan Beauvais UUCP: ...!mcnc!rti!bbt!djb BroadBand Technologies, Inc. Internet: djb%bbt@rti.rti.org Box 13737 BITNET: djb%bbt%rti.rti.org@CUNYVM Research Triangle Park, NC 27709 +1 (919)-544-6850 ext. 295