Dec 222017
QXLIB is a library of subroutines CALL-able from BASIC 7.0, providing the BASIC programmer with many additional functions and commands, along with un-BASIC-like speed and power.
File QXLIB10.ZIP from The Programmer’s Corner in
Category BASIC Language
QXLIB is a library of subroutines CALL-able from BASIC 7.0, providing the BASIC programmer with many additional functions and commands, along with un-BASIC-like speed and power.
File Name File Size Zip Size Zip Type
APPENDIX.DOC 10452 3478 deflated
DATA.DOC 26780 7414 deflated
DISK.DOC 17754 4774 deflated
EMS.DOC 6564 1751 deflated
EQUIP.DOC 9909 2977 deflated
GRAPHICS.DOC 36651 9351 deflated
INPUT.DOC 9211 3034 deflated
INTRO.DOC 26649 7143 deflated
ORDER.DOC 2355 741 deflated
QXLIB.LIB 63475 31584 deflated
QXLIB.QLB 47890 25465 deflated
TPCREAD.ME 199 165 deflated
VIDEO.DOC 28291 7786 deflated

Download File QXLIB10.ZIP Here

Contents of the APPENDIX.DOC file

APPENDIX A - Color attributes for video displays

Colors values for IBM (and compatible) color displays are as follows:

Color Value notes

black 0 high-intensity black = gray
blue 1
green 2
cyan 3
red 4
magenta 5
brown 6 high-intensity brown = yellow
"white" 7 normal-intensity "white" looks muddy

For IBM Monochrome, Hercules and compatible displays:

foreground value appearance

0 black if background% = 0 or 7
if background% between 1 and 6,
normal if bright% = 0
bright if bright% = 1

1 underlined bright + underline
if bright% = 1

2 - 7 normal bright if bright% = 1

background value appearance

0 - 6 black
7 normal color if foreground% = 0

bright if blink% = 1, SetBLINK(0)
called, and foreground% = 0

black if foreground% <> 0

Subroutines GetKBDToggle and SetKBDToggle

The keyboard status byte consists of 8 bits, 4 of which are used
to indicate the status of the INSERT, CapsLOCK, NumLOCK and ScrollLOCK
keys. For each of these keys, one bit is set ( =1 ) if the key is
toggled ON. The bit is zeroed if the key is OFF.

The keyboard status byte:
<--- bit positions -->
7 6 5 4 3 2 1 0
1 = Right shift pressed

1 = Left shift pressed
1 = either Control pressed
1 = either Alt pressed
1 = ScrollLOCK active
1 = NumLOCK active
1 = CapsLOCK active
1 = INSERT active

BASIC does not understand individual bits, but armed with a little
knowledge, you can out-think BASIC. BASIC interprets each bit as a
power of 2, so that
bit 0 if on = 1
bit 1 if on = 2
bit 2 if on = 4
bit 3 if on = 8
bit 4 if on = 16
bit 5 if on = 32
bit 6 if on = 64
bit 7 if on = 128

Thus, if NumLOCK and CapsLOCK are active, but ScrollLOCK and INSERT are
off, BASIC will tell you that the keyboard status byte = 32 + 64 = 96
(this is bit 5 and bit 6 ON, all other bits off). After calling
GetKBDToggle, you may determine which key or keys are ON by ANDing the
status byte with the value associated with that key's bit.

Example: Let's assume that NumLOCK and ScrollLOCK are ON, INSERT and
CapsLOCK are off.

CALL GetKBDToggle(kbd%)
PRINT kbd% ' prints 48 (results from 16+32)
IF (kbd% AND 16) THEN PRINT "ScrollLOCK ON"
IF (kbd% AND 64) THEN PRINT "CapsLOCK ON" ' will not be printed
in this example
IF (kbd% AND 128) THEN PRINT "INSERT ON" ' will not be printed
in this example

The keyboard toggles may be stored as a single integer (kbd%) in
order to restore the original status at a later time.

Setting the keyboard toggles involves setting the individual bits
in the status byte. The AND, OR and NOT operators come in handy

OR compares the bits in both operands and sets all bits in the resulting
byte corresponding to the bits in the operands.

Example: set a keyboard toggle

bits in operand a 0 0 1 0 0 0 0 0 (bit 5 set, = 32)
operand b 1 0 0 1 0 0 0 0 (bits 4 and 7 set)

a OR b 1 0 1 1 0 0 0 0 ( bits 4, 5, and 7 set)

In this way, an individual toggle may be added to kbd% and set via
SetKBDToggle. If bit 5 had already been set in operand b, the result
would be the same.

Example: turn a keyboard toggle off

bits in operand a 0 0 1 0 0 0 0 0 (bit 5 set, = 32)
NOT a 1 1 0 1 1 1 1 1 (NOT reverses all bits)
kbd% 1 0 1 1 0 0 0 0 ( a OR b, above)

(NOT a) AND kbd% 1 0 0 1 0 0 0 0

As you can see, AND sets bits in the result only if the corresponding
bits are set in BOTH operands. In this example, the bit in kbd% for
NumLOCK is turned off. If SetKBDToggle is called with this new kbd%,
NumLOCK will be turned off.

APPENDIX D - Video pages

Most video display systems have much more memory than required to display
a full screen of text. This additional memory is required when the
system is used in graphics mode, but it may also be used to advantage in
text mode. Screen pages may be used to store help screens, to save one
screen while another is displayed, or to build one screen while another
is displayed. The table below summarizes QXLIB's screen page support
for various video systems. This should not be considered a complete
table of information.

system screen size page numbers BASIC 7.0/BIOS support
------------- ----------- ------------ -----------------------
MDA 80 x 25 0 (1) yes
CGA 80 x 25 0 - 3 yes
CGA, EGA, VGA 40 x 25 0 - 7 yes
EGA, VGA 80 x 25 0 - 7 yes
EGA 80 x 43 0 - 3 yes (4)
PEGA 132 x 25 0 & 1 limited (2)
PEGA 132 x 43 0 & 1 limited (2)
HGC 80 x 25 0 - 15 limited (3)
Other varies 0 see Appendix F

(1) MDA systems have enough memory for only one complete screen, but
virtual screens (see SetVScreen) and ScreenSave may be used to
duplicate the effect of multiple screen pages.

(2) Paradise EGA 480 (PEGA) systems in 132-column modes may use
pages 0 and 1. BASIC's SCREEN , ,1 command or QXLIB's TextPage(1)
may be used to show the second video page. Note that TextPage()
also updates QXLIB's active DVM page.
PEGA systems may also be used in standard EGA modes with full BIOS,
BASIC and QXLIB support.

(3) Hercules Graphics Cards and clones have sufficient memory for 16
screen pages. These are all available if there is no other monitor
connected to the computer and the second 32k of Hercules memory is
included in the memory map. See Use64k. Hercules RAMfont cards use
some of this memory for additional fonts. Odd-numbered screen
pages, and even-numbered pages above 6 will interfere with fonts
loaded in RAM.

(4) I have encountered some problems with VGAs in modes with more than
25 rows on PS/2 Model 50z. Use at your own risk.

Virtual screens may be used with all video systems. See SetVScreen.
ScreenSave may be used with all video systems, and CopyScreen may be used
with all except MDA.

APPENDIX E - Revision history and Changes in QXLIB Subroutines

Version 1.0 March 15, 1990
Revision of QXLIB to work with BASIC 7.0 complete:
New library named QXLIB, duplicates 99% of QXLIB's
subroutines, using identical calling syntax.

APPENDIX F - Non-Standard displays

Many video cards support text modes with dimensions other than the
40x25, 40x43, 80x25 and 80x43 supported by IBM's equipment. An example
of this is the Paradise EGA 480 card, which has provision for 132x43
and 132x25 text modes. BASIC does not support these screens,
but QXLIB makes it easy to use them. QXLIB includes subroutines which
establish the PEGA 132-column text modes. Programmers using other
brands of video cards may also be able use their extended text modes,
but QXLIB may not provide much support unless you contact me.

The Paradise EGA 480 comes with software to change video modes.
13243.COM is used from the DOS command line to establish 132x43 text
mode, and 13225.COM establishes 132x25 text mode. Users of other
brands of video cards should see their instruction manuals for
comparable commands. I have included subroutines in QXLIB duplicating
the function of 13243.COM and 13225.COM, but I could also establish
these modes from within my BASIC programs using the SHELL command,
as shown:

SHELL "13243"
REM SHELL "StdColor" returns the PEGA to 80 x 25 text mode
REM the SHELL command should not be used unless you have DOS
REM 3.0 or greater.

This program line establishes the 132 x 43 mode and returns to the
calling program. This is slower than the subroutine provided
in QXLIB, because it must access the disk, and 13243.COM must be
available to DOS (either in the default directory or in the path).

The Paradise EGA 480 updates the BIOS data area when it establishes
this mode; the most likely candidates for compatibility with QXLIB
will do the same. See PEGA13243 in VIDEO.DOC for a list of subroutines
likely to be compatible.

If you want your favorite video mode included in QXLIB, give me a
call and I may be able to do something for you.

 December 22, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>