' Mainprog.bas is the "main program" giving you an example of how to
' call subprograms.
' The program calls two subprograms to find out if a color or monochrome
' monitor is active (Subprog1) and to find out if a Hercules adapter
' is in the system (Subprog2)
CALL Find.monitor(Monitor.segment%, Egamode%, Egacolumns%, Egarows%, Egastatus%, Egamem%)
PRINT "The currently active monitor is on a ";
IF Monitor.segment% = &HB000 THEN
PRINT "monochrome adapter."
PRINT "color graphics adapter."
IF Egastatus% = -1 THEN
PRINT "There is no EGA or VGA card present."
IF Egastatus% > 9 THEN
A$ = "VGA "
Egastatus% = Egastatus% - 10' don't need the added 10 anymore
A$ = "EGA "
PRINT A$; "is present in ";
IF Egastatus% = 1 THEN PRINT "monochrome mode." ELSE PRINT "color mode."
PRINT "The current video mode is"; Egamode%
PRINT "The monitor is displaying"; Egacolumns%; "columns ";
PRINT "and"; Egarows%; "Rows."
PRINT A$; "card has"; Egamem%; "kbytes of memory."
IF Hercules.status% = 0 THEN
PRINT "There is no Hercules adapter in this system."
PRINT "There is a Hercules or compatible adapter in this system."