MBX_??? Command Reference for MicroBASIC v3.20
Documented by Jason Downey [FG/98] ž Updated by BlackLight
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

+-------------------+
| TABLE OF CONTENTS |
+-------------------+

  A) Legal Limitations
  B) General Format
  C) Contact Information
  D) Command Reference
  E) Credits

+----------------------+
| A) LEGAL LIMITATIONS |
+----------------------+

Although reasonable attempts have been made to make this document as
accurate as possible the author assumes  no liability for the use of
this document under any circumstance. Use at your own risk.

+-------------------+
| B) GENERAL FORMAT |
+-------------------+

MBX_?????[Stuff]

where ?????  --> is the name of the MBX file without the .MBX extension
      Stuff  --> are the things needed to pass to the routine. Be sure
                 to include the square brackets

+------------------------+
| C) CONTACT INFORMATION |
+------------------------+

Found an error? Comments or questions? My routines don't work? Drop me
a note at qasic@hotmail.com. I'll respond as soon as I can.

Questions/comments regarding MicroBASIC should be directed at BlackLight
at microbasic@blacklight.wxs.org

+----------------------+
| D) COMMAND REFERENCE |
+----------------------+

Name   : MBX_ATXOFF
Author : BlackLight (2001)
Syntax : MBX_ATXOFF
Purpose: Turns off ATX systems. If no ATX is found, the program continues.
Caution: Never run this command under a Windows 3.x/9x environment, because
         it will turn off the power immediately, and doesn't allow Windows to
         write any unsaved files to disk. (Under Windows NT, this MBX does
         nothing)
Example: MBX_IFWIN[winfound]
         PRINT "Shutting down computer...";: MBX_ATXOFF
         PRINT "failed"
         PRINT "Running Windows NT, or no ATX-system.": END
         winfound:
         PRINT "This program cannot be run under Windows.": END

Name   : MBX_BLINK
Author : BlackLight (2001)
Syntax : MBX_BLINK
Purpose: Enables blinking colors, and disables bright background colors.

Name   : MBX_BRIGHT
Author : BlackLight (2001)
Syntax : MBX_BRIGHT
Purpose: Enables bright background colors, and disables blinking colors.

Name   : MBX_CAPLKOFF
Author : Jason Downey [FG/98]
Syntax : MBX_CAPLKOFF
Purpose: Turns CapsLock Off
Bugs   : It won't work correctly in the RUN_MBF or MBFRUN environment for
         some strange reason. Any help on this issue would be sincerely
         appreciated.
Example: print "CapsLock is ON. Press any key."
         MBX_CAPLKON
         inkey
         print "CapsLock is OFF. Press any key to exit."
         MBX_CAPLKOFF
         inkey
         end

Name   : MBX_CAPLKON
Author : Jason Downey [FG/98]
Syntax : MBX_CAPLKON
Purpose: Turns CapsLock On
Bugs   : It won't work correctly in the RUN_MBF or MBFRUN environment for
         some strange reason. Any help on this issue would be sincerely
         appreciated.
Example: print "CapsLock is ON. Press any key."
         MBX_CAPLKON
         inkey
         print "CapsLock is OFF. Press any key to exit."
         MBX_CAPLKOFF
         inkey
         end

Name   : MBX_COLDBOOT
Author : Jason Downey [FG/98]
Syntax : MBX_COLDBOOT
Purpose: Does a cold reboot (with the memory test) of the computer
Notes  : For some odd reason, this command sometimes does a warm boot instead
         of a cold boot and vice-versa. Any one out there with more expertise?
Example: print "You are about to reboot computer!!!"
         inkey
         mbx_coldboot
         end

Name   : MBX_CPRINT
Author : BlackLight (2001)
Syntax : MBX_CPRINT[attr "Text" length]
Purpose: Same as PRINT, but with this MBX, you can specify the color. It does
         not use ANSI.SYS, but only standard EGA interrupt functions.
Notes  : - You need to specify the correct length of the text, otherwise the
           results will be unpredictable.
         - attr=foregroundcolor+(16*backgroundcolor)
           if you want it to blink, add 128
         - 100% Compatible with LOCATE, other PRINT commands, etc.
         - Also works in most graphical modes, but without background color.
         - Does NOT print a CrLf at the end, so it works like PRINT "txt";
Example: MBX_CPRINT[30 "Yellow on blue" 14]

Name   : MBX_IF4DOS
Author : Jason Downey [FG/98]
Syntax : MBX_IF4DOS[Label]
Purpose: Jumps to a specific label if 4DOS is found in memory
Example: MBX_IF4DOS[Found]
         Print "4DOS NOT being used."
         End
         Found:
         Print "4DOS BEING used."
         End

Name   : MBX_IFAPPEND
Author : Jason Downey [FG/98]
Syntax : MBX_IFAPPEND[Label]
Purpose: Jumps to a specific label if APPEND is being found in use
Example: MBX_IFAPPEND[Found]
         Print "APPEND is NOT being used"
         End
         Found:
         Print "APPEND is being used"
         End

Name   : MBX_IFASSIGN
Author : Jason Downey [FG/98]
Syntax : MBX_IFASSIGN[Label]
Purpose: Jumps to a specific label if ASSIGN is being found in use
Example: MBX_IFASSIGN[Found]
         Print "ASSIGN is NOT being used"
         End
         Found:
         Print "ASSIGN is being used"
         End

Name   : MBX_IFDBSPCE
Author : BlackLight
Syntax : MBX_IFDBSPCE[Label]
Purpose: Jumps to a specific label if DoubleSpace is being used
Example: MBX_IFDBSPCE[Found]
         Print "DoubleSpace NOT being used"
         End
         Found:
         Print "DoubleSpace being used"
         End

Name   : MBX_IFDDOS
Author : Jason Downey [FG/98]
Syntax : MBX_IFDDOS[Label]
Purpose: Jumps to a specific label if running under Double Dos
Example: MBX_IFDDOS[Found]
         Print "You're NOT running under Double DOS"
         End
         Found:
         Print "You ARE running under Double DOS"
         End

Name   : MBX_IFDOS4GW
Author : Jason Downey [FG/98]
Syntax : MBX_IFDOS4GW[Label]
Purpose: Jumps to a specific label if running under DOS4GW Protected Mode
Example: MBX_IFDOS4GW[Found]
         Print "You're NOT running under a program that uses DOS4GW"
         End
         Found:
         Print "You ARE running under a program that uses DOS4GW"
         End

Name   : MBX_IFDOSKEY
Author : BlackLight
Syntax : MBX_IFDOSKEY[Label]
Purpose: Jumps to a specific label if DOSKEY is found in memory
Example: MBX_IFDOSKEY[Found]
         Print "DosKey NOT Found"
         End
         Found:
         Print "DosKey Found"
         End

Name   : MBX_IFDQV
Auhtor : Jason Downey [FG/98]
Syntax : MBX_IFDQV[Label]
Purpose: Jumps to a specific label if DesqView is found to be running
Example: MBX_IFDQV[Found]
         Print "DesqView NOT Found"
         End
         Found:
         Print "DesqView Found"
         End

Name   : MBX_IFDRIVER
Auhtor : Jason Downey [FG/98]
Syntax : MBX_IFDRIVER[Label]
Purpose: Jumps to a specific label if DRIVER.SYS (in DOS) is being used
Example: MBX_IFDRIVER[Found]
         Print "DRIVER.SYS NOT being used."
         End
         Found:
         Print "DRIVER.SYS being used."
         End

Name   : MBX_IFEGA
Author : BlackLight (2001)
Syntax : MBX_IFEGA[Label]
Purpose: Jumps to a specific label if an EGA-video adapter (or better) is
         detected.
Example: MBX_IFEGA[Found]
         Print "No EGA found."
         End
         Found:
         Print "EGA card found."
         End

Name   : MBX_IFGUIDES
Author : BlackLight
Syntax : MBX_IFGUIDES[Label]
Purpose: Jumps to a specific label if NGUIDES is found in memory
Example: MBX_IFGUIDES[Found]
         Print "NGUIDES NOT Found"
         End
         Found:
         Print "NGUIDES Found"
         End

Name   : MBX_IFKSTACK
Author : BlackLight
Syntax : MBX_IFKSTACK[Label]
Purpose: Jumps to a specific label if KSTACK (found in 4DOS) is found in             memory
Example: MBX_IFKSTACK[Found]
         Print "KSTACK NOT Found"
         End
         Found:
         Print "KSTACK Found"
         End

Name   : MBX_IFNDOS
Author : BlackLight
Syntax : MBX_IFNDOS[Label]
Purpose: Jumps to a specific label if NDOS (found in Norton Utilies for
         DOS) is found in memory
Example: MBX_IFNDOS[Found]
         Print "NDOS NOT Found"
         End
         Found:
         Print "NDOS Found"
         End

Name   : MBX_IFSDRV
Author : BlackLight
Syntax : MBX_IFSDRV[Label]
Purpose: Jumps to a specific label if SmartDrive is being used
Example: MBX_IFSDRV[Found]
         Print "SmartDrive not being used"
         End
         Found:
         Print "SmartDrive being used"
         End

Name   : MBX_IFSHARE
Author : BlackLight
Syntax : MBX_IFSHARE[Label]
Purpose: Jumps to a specific label if SHARE is found in memory
Example: MBX_IFSHARE[Found]
         Print "SHARE NOT Found"
         End
         Found:
         Print "SHARE Found"
         End

Name   : MBX_IFWIN
Author : BlackLight
Syntax : MBX_IFWIN[Label]
Purpose: Jumps to a specific label if WINDOWS (v3.0+) is found in memory
Example: MBX_IFWIN[Found]
         Print "Windows NOT in memory"
         End
         Found:
         Print "Windows is IN memory"
         End

Name   : MBX_IFXMS
Author : BlackLight
Syntax : MBX_IFXMS[Label]
Purpose: Jumps to a specific label if extended memory is found
Example: MBX_IFXMS[Found]
         Print "XMS not detected."
         End
         Found:
         Print "XMS detected."
         End

Name   : MBX_IFVESA
Author : Jason Downey [FG/98]
Syntax : MBX_IFVESA[Label]
Purpose: Jumps to a specific label if VESA ability is found
Example: mbx_ifvesa[vesafound]
         print "VESA compatibility not found"
         end
         vesafound:
         print "VESA compatibility found"
         end

Name   : MBX_JUMPS
Author : BlackLight
Syntax : MBX_JUMPS["text to display" Label]
Purpose: Displays text WITHOUT a carriage return and jumps to a label
Note   : Does the same as PRINT "text";: GOTO Label
Example: MBX_JUMPS["Skipping..." SkipperLabel]
         Print "This was skipped"
         SkipperLabel:
         Print "done"
         Print "This was not skipped"
         end

Name   : MBX_MOUSEOFF
Author : BlackLight
Syntax : MBX_MOUSEOFF
Purpose: Turns off the square mouse cursor. Only to be called AFTER
         MOUSEON!
Example: MBX_RESETMOU
         MBX_MOUSEON
         print "You know see a mouse cursor. Press a key."
         sleep
         MBX_MOUSEOFF
         print "You don't see it now!"
         end

Name   : MBX_MOUSEON
Author : BlackLight
Syntax : MBX_MOUSEON
Purpose: Turns on the square mouse cursor. You should reset your mouse first
         with the command MBX_RESETMOU
Example: MBX_RESETMOU
         MBX_MOUSEON
         print "You know see a mouse cursor. Press a key."
         sleep
         MBX_MOUSEOFF
         print "You don't see it now!"
         end

Name   : MBX_MULTIPAR
Author : BlackLight
Syntax : MBX_MULTIPAR["text" "text"]
Purpose: Prints the stuff enclosed inside the square brackets by printing
         the first phrase and then the second phrase. Demonstrates the use
         of multiple parameters.
Example: MBX_MULTIPAR["I'm first" "I'm second"]
         end

Name   : MBX_NUMLKOFF
Author : Jason Downey [FG/98]
Syntax : MBX_NUMLKOFF
Purpose: Turns NumLock Off
Bugs   : It won't work correctly in the RUN_MBF or MBFRUN environment for
         some strange reason. Any help on this issue would be sincerely
         appreciated.
Example: print "NumLock is ON. Press any key."
         MBX_NUMLKON
         inkey
         print "NumLock is OFF. Press any key to exit."
         MBX_NUMLKOFF
         inkey
         end

Name   : MBX_NUMLKON
Author : Jason Downey [FG/98]
Syntax : MBX_NUMLKON
Purpose: Turns NumLock On
Bugs   : It won't work correctly in the RUN_MBF or MBFRUN environment for
         some strange reason. Any help on this issue would be sincerely
         appreciated.
Example: print "NumLock is ON. Press any key."
         MBX_NUMLKON
         inkey
         print "NumLock is OFF. Press any key to exit."
         MBX_NUMLKOFF
         inkey
         end

Name   : MBX_PRINTCLO
Author : BlackLight
Syntax : MBX_PRINTCLO["text"]
Purpose: Prints the stuff enclosed inside the square brackets. A clone of
         MicroBASIC's print command
Example: MBX_PRINTCLO["MicroBASIC rules!"]
         end

Name   : MBX_RESETMOU
Author : BlackLight
Syntax : MBX_RESETMOU
Purpose: Resets the mouse. Use this before any MBX_MOUSEON statements!
Example: MBX_RESETMOU
         MBX_MOUSEON
         print "You know see a mouse cursor. Press a key."
         sleep
         MBX_MOUSEOFF
         print "You don't see it now!"
         end

Name   : MBX_SCREEN
Author : BlackLight
Syntax : MBX_SCREEN[mode]
Purpose: Resets the screen to any mode
Example: MBX_SCREEN[0]
         print "This is mode 0 - text mode. Press any key"
         sleep
         MBX_SCREEN[13]
         print "This is screen mode 13"
         end

Name   : MBX_SCREEN00
Author : BlackLight
Syntax : MBX_SCREEN00
Purpose: Resets the screen to mode 00h
Example: MBX_SCREEN13
         print "This is screen 13. Press any key."
         sleep
         MBX_SCREEN00
         print "this is screen 0"
         end

Name   : MBX_SCREEN01
Author : BlackLight
Syntax : MBX_SCREEN01
Purpose: Resets the screen to mode 01h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN01
         print "This is screen mode 1"
         end

Name   : MBX_SCREEN02
Author : BlackLight
Syntax : MBX_SCREEN02
Purpose: Resets the screen to mode 02h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN02
         print "This is screen mode 2"
         end

Name   : MBX_SCREEN03
Author : BlackLight
Syntax : MBX_SCREEN03
Purpose: Resets the screen to mode 03h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN03
         print "This is screen mode 3"
         end

Name   : MBX_SCREEN04
Author : BlackLight
Syntax : MBX_SCREEN04
Purpose: Resets the screen to mode 04h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN04
         print "This is screen mode 4"
         end

Name   : MBX_SCREEN05
Author : BlackLight
Syntax : MBX_SCREEN05
Purpose: Resets the screen to mode 05h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN05
         print "This is screen mode 5"
         end

Name   : MBX_SCREEN06
Author : BlackLight
Syntax : MBX_SCREEN06
Purpose: Resets the screen to mode 06h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN06
         print "This is screen mode 6"
         end

Name   : MBX_SCREEN07
Author : BlackLight
Syntax : MBX_SCREEN07
Purpose: Resets the screen to mode 07h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN07
         print "This is screen mode 7"
         end

Name   : MBX_SCREEN08
Author : BlackLight
Syntax : MBX_SCREEN08
Purpose: Resets the screen to mode 08h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN08
         print "This is screen mode 8"
         end

Name   : MBX_SCREEN09
Author : BlackLight
Syntax : MBX_SCREEN09
Purpose: Resets the screen to mode 03h
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN03
         print "This is screen mode 9"
         end

Name   : MBX_SCREEN0A
Author : BlackLight
Syntax : MBX_SCREEN0A
Purpose: Resets the screen to mode 0Ah (10)
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN0A
         print "This is screen mode 10"
         end

Name   : MBX_SCREEN0B
Author : BlackLight
Syntax : MBX_SCREEN0B
Purpose: Resets the screen to mode 0Bh (11)
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN0B
         print "This is screen mode 11"
         end

Name   : MBX_SCREEN12
Author : Jason Downey [FG/98]
Syntax : MBX_SCREEN12
Purpose: Resets the screen to mode 12 - 640x480x16
Example: MBX_SCREEN13
         print "This is screen mode 13. Press any key."
         sleep
         MBX_SCREEN12
         print "This is screen mode 12"
         end

Name   : MBX_SCREEN13
Author : BlackLight
Syntax : MBX_SCREEN13
Purpose: Resets the screen to mode 13h
Example: MBX_SCREEN00
         print "This is screen mode 00. Press any key."
         sleep
         MBX_SCREEN13
         print "This is screen mode 13"
         end

Name   : MBX_SCRLKOFF
Author : Jason Downey [FG/98]
Syntax : MBX_SCRLKOFF
Purpose: Turns Scroll Lock Off
Bugs   : It won't work correctly in the RUN_MBF or MBFRUN environment for
         some strange reason. Any help on this issue would be sincerely
         appreciated.
Example: print "Scroll Lock is ON. Press any key."
         MBX_SCRLKON
         inkey
         print "Scroll Lock is OFF. Press any key to exit."
         MBX_SCRLKOFF
         inkey
         end

Name   : MBX_SCRLKON
Author : Jason Downey [FG/98]
Syntax : MBX_SCRLKON
Purpose: Turns Scroll Lock On
Bugs   : It won't work correctly in the RUN_MBF or MBFRUN environment for
         some strange reason. Any help on this issue would be sincerely
         appreciated.
Example: print "Scroll Lock is ON. Press any key."
         MBX_SCRLKON
         inkey
         print "Scroll Lock is OFF. Press any key to exit."
         MBX_SCRLKOFF
         inkey
         end

Name   : MBX_WARMBOOT
Author : Jason Downey [FG/98]
Syntax : MBX_WARMBOOT
Purpose: Does a warm reboot (just like CTRL-ALT-DEL) of the computer
Notes  : For some odd reason, this command sometimes does a cold boot instead
         of a warm boot and vice-versa. Any one out there with more expertise?
Example: print "You are about to reboot computer!!!"
         inkey
         mbx_warmboot
         end

+------------+
| E) CREDITS |
+------------+

A majority of these routines were developed by BlackLight and myself
(Jason).

I don't know about  BlackLight but  my routines came  from extensive
research in  assembly language  and looking at existing source code.
Some of my routines  may indicate  the original author (look for the
source comment).

Some of my sources include:
      ž ABC (All Basic Code)
      ž SWAG (SourceWare Archive Group)
      ž BASM (BASIC to Assember)
      ž DOS World (yeah, DOS lives on!!!)
      ž Friends in programming class, etc.

Special recognition goes go the following people
      ž Jeff Wright - getting the Data Segment (pop DS)
      ž Edward Lam/Brent Ashley - helping me with another alternative
                                  to the POP DS routine
      ž William Yu - founder and maintainer for ABC
      ž BlackLight - hey. Endless hours of work...this guy deserves
                     at least SOME credit
