IBM PC USER UPDATES UU-12 Feb, 1983 Hardware Tip Faster Screen Printing from PC Displays Faster screen printing in text made may be obtained when using either the IBM Monochrome Display or color monitors. If your BASIC programs contain text data in charachter arrays-indexed by a pointer array-moves, copies, replicates, etc. are done by arithmetic manipulation of the pointer array, rather than string manipulation. This results in faster execution and reduced use of string heap space. You may avoid BASIC extra line feeds and unwanted scrolls associated with writing into lines 24 and 25 by moving data directly into the screen buffers. The example below addresses the frist text screen page. (Subsequent screens can be accessed by changing address offsets.) Note that a BASIC string setup may be displayed on a screen by calling to the machine language routine. The call uses five parameters: *The string data itself *Starting position in the string for the move *Length of the move *Screen area (&HB000 for monochrome, &HB800 for color) *Screen location The screen location is used similarly to PRINT @ in other BASIC implementations, with 0 at the top left corner, 160 at the start of the next line, 320 for the third, etc. (The increment is two bytes per character, because of the interlaced color information.) You may use the BGN% parameter for horizontal scrolling, or for using portions of a string (similiar to MID$). If both monochrome and color monitors are available, data may be written to both without complex screen switching. Parameter checking is the responsibility of the using program! Additionally, this program may be used to create a .COM file for use with DEBUG. NO checksums are done on the machine code. Careful entry is advised, since errors may require powering down to recover. For use with the BASIC Compiler, a Call Absolute would be required; however, a compiled POKE loop runs quickly also. This example favors clarity when using a machine language over faster parameter passing and more compact code because this technique minimizes the possibility of wrong offsets being used which could affect any storage location. -------------------------------------------------------------------------------- Comment: The above is directly taken from the IBM User Updates Bulletin. The DISPLAY.BAS program was printed on the back of the bulletin. What is particulary exciting about this little routine is that it provides a means to utilize both displays without the CLS that occurs whenever one toggles from one display to the other using the normal method of poking the equip_flag. BASIC's print and graphic functions could always apply to the color display, while this routine provided a means of printing to the monochrome display. The equivalent of LINE INPUT A$ on the monochrome display can be developed using the INPUT(1) statement which does not, of itself, echo to the screen. H.Shear, 7/12/83