home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progbas / aabas10.arj / AABAS.DOC < prev    next >
Encoding:
Text File  |  1992-04-08  |  31.8 KB  |  1,114 lines

  1.          The Affordable Alternative Library for BASIC
  2.          =------------------------------------------=
  3.                          Version 1.0
  4.  
  5.        AABAS  Copyright (c) 1992  Thomas G. Hanlin III
  6.  
  7.  
  8.  
  9. This is a library for QuickBASIC 4.0 - 4.5.  It provides
  10. convenient access to BIOS and DOS calls, covering display and
  11. keyboard, mouse, joystick, disk, printer, equipment info, XMS
  12. memory, and more.  There are capabilities here you won't find
  13. in any commercial library.
  14.  
  15. AABAS is copyrighted and may be distributed only according to
  16. the following rule:
  17.  
  18.    All AABAS files must be distributed together as a unit.  No
  19.    files may be left out, added, or altered.
  20.  
  21. You may recognize my name-- I've written more than a few
  22. libraries, ranging from $25-$35 shareware products to $200
  23. commercial libraries.  I've abandoned the commercial arena,
  24. though, since I consider its prices obscene.  Lately it's
  25. occurred to me that $25-$35 may also be a major outlay for some
  26. people.  There have been times I haven't be able to handle that
  27. much, anyway.  Enter AABAS: an affordable library which
  28. nonetheless provides many useful functions.  You can register
  29. AABAS for only $8.  Registration entitles you to the latest
  30. version of AABAS, complete with full source code in assembly
  31. language, plus a sampler containing other free and shareware
  32. products for QuickBASIC.  See REGISTER.TXT for details.
  33.  
  34. You use this library at your own risk.  It has been tested by
  35. me on my own computer, but I will not assume any responsibility
  36. for any problems which AABAS may cause you.  If you do
  37. encounter a problem, please let me know about it, and I will do
  38. my best to verify and repair the error.
  39.  
  40.                          Using AABAS
  41.  
  42.  
  43.  
  44. The .QLB that comes with AABAS was created with QuickBASIC 4.5.
  45. If you have one of the QuickBASIC 4.0 releases, you can still
  46. use AABAS, but you must create a new .QLB file.  The following
  47. will do the trick:
  48.  
  49.    LINK AABAS.LIB/Q,AABAS.QLB,NUL,BQLB40
  50.  
  51. For some later releases of QB 4.0, you will need to specify
  52. BQLB41 instead of BQLB40.  Check your QB files to see whether
  53. you have BQLB40.LIB or BQLB41.LIB.
  54.  
  55. To use AABAS routines, you must include the AABAS.BI file in
  56. your program.  You can do this directly with a text editor, if
  57. you like.  A simpler approach would be to place this line at
  58. the start of your program:
  59.  
  60.    REM $INCLUDE: 'AABAS.BI'
  61.  
  62. If you compile from the command line, using BC, you must
  63. specify AABAS as a library when you LINK the program.  You can
  64. let LINK prompt you for what it wants or type in the entire set
  65. of parameters at once, like this:
  66.  
  67.    LINK program/EX,,NUL,AABAS
  68.  
  69. If you compile using the QuickBASIC environment, you must
  70. specify AABAS as a library when you load QB:
  71.  
  72.    QB program /L AABAS
  73.  
  74. In this case, the program name is optional.
  75.  
  76.                         Assorted Notes
  77.  
  78.  
  79.  
  80. These routines are broken into two rough categories: BIOS and
  81. DOS.  I've included a few sets of routines in the BIOS category
  82. which perhaps don't entirely belong there: mouse and XMS memory
  83. routines.  Still, close enough.
  84.  
  85. The routines in the BIOS category will work on just about any
  86. machine, with the exception of a few of the odder and older
  87. machines.  How old is older?  Say, before 1984.  In other
  88. words, compatibility is not much of a problem.
  89.  
  90. The DOS routines will work on any machine that runs DOS 2.11 or
  91. later releases.  Compatibility is no problem at all there.
  92.  
  93. The source code for AABAS is entirely in MASM-compatible
  94. assembly language.  They require negligible space in your
  95. program, and may even reduce the size of your program if their
  96. use allows BASIC to remove some of its own support code from
  97. the program.
  98.  
  99. The AABAS library is based directly on BIOS and DOS routines,
  100. with no attempt to provide anything more fancy.  The library is
  101. intended to be small, convenient, and inexpensive-- just the
  102. thing for folks learning about libraries for the first time or
  103. on a budget.  You will find AABAS quite powerful within these
  104. limitations.  If you find you need something a little more
  105. comprehensive, you may wish to examine my BasWiz and PBClone
  106. libraries.  The shareware versions of these will be sent to you
  107. if you register AABAS, or you can find them at your local BBS.
  108.  
  109.                         Reference List
  110.  
  111.  
  112.  
  113. BiosAlt%        return whether an ALT key is pressed
  114. BiosBaseMem%    return amount of base memory installed
  115. BiosCaps%       return whether CapsLock is on
  116. BiosCheckKey$   get key from keyboard buffer, if any
  117. BiosChkPrt%     check a printer
  118. BiosComPorts%   return the number of com (serial) ports
  119. BiosCtrl%       return whether a CTRL key is pressed
  120. BiosELAlt%      return whether Left ALT is pressed
  121. BiosELCtrl%     return whether Left CTRL is pressed
  122. BiosERAlt%      return whether Right ALT is pressed
  123. BiosERCtrl%     return whether Right CTRL is pressed
  124. BiosESysRq%     return whether SysRq is pressed
  125. BiosFloppies%   return the number of floppy drives
  126. BiosGetKeyW$    get a key from the keyboard (wait if need be)
  127. BiosGetVideo    get the screen width, mode, and active page
  128. BiosInitPrt%    initialize a printer
  129. BiosIns%        return whether Insert is on
  130. BiosJoyPosn     get joystick positions
  131. BiosJoyPress    get joystick buttons
  132. BiosKeyIn%      stuff a key into the keyboard buffer
  133. BiosKeyRep      change the key repeat rate
  134. BiosLShift%     return whether Left SHIFT is pressed
  135. BiosMHide       hide the mouse cursor
  136. BiosMInit%      initialize the mouse, return # of buttons
  137. BiosMLButton%   return whether left mouse button is pressed
  138. BiosMLClick     return left clicks & position at last click
  139. BiosMLocate     set the mouse cursor position
  140. BiosMLRelease   return left releases & pos'n at last release
  141. BiosMMButton%   return whether middle mouse button is pressed
  142. BiosMMClick     return middle clicks & pos'n at last click
  143. BiosMMRelease   return middle releases & pos'n at last release
  144. BiosMRButton%   return whether right mouse button is pressed
  145. BiosMRClick     return right clicks & position at last click
  146. BiosMRRelease   return right releases & pos'n at last release
  147. BiosMShow       make the mouse cursor visible
  148. BiosMWhereX%    return the X coordinate of the mouse cursor
  149. BiosMWhereY%    return the Y coordinate of the mouse cursor
  150. BiosMWindow     set the allowed range for the mouse cursor
  151. BiosNum%        return whether NumLock is on
  152. BiosPrintCh%    print a character (to a printer)
  153. BiosPrtPorts%   return the number of printer (parallel) ports
  154. BiosPrtSc       print the screen on the default printer
  155. BiosRShift%     return whether Right SHIFT is pressed
  156. BiosScroll%     return whether ScrollLock is on
  157. BiosScrollDn    scroll an area of the screen down
  158. BiosScrollUp    scroll an area of the screen up
  159.  
  160.                         Reference List
  161.  
  162.  
  163.  
  164. BiosXClose      close an area of XMS
  165. BiosXExists%    see if XMS memory is available
  166. BiosXLFree&     return the largest block of XMS memory
  167. BiosXOpen       open an area of XMS for use
  168. BiosXRead       get information from XMS memory
  169. BiosXResize     resize an area of XMS memory
  170. BiosXTFree&     return the amount of available XMS memory
  171. BiosXVer%       get the XMS driver version
  172. BiosXWrite      put information into XMS memory
  173.  
  174. DosBreak%       return Break level
  175. DosBreakOff     minimize Break checking
  176. DosBreakOn      maximize Break checking
  177. DosDiskInfo     get space & capacity info about a disk drive
  178. DosGetDay$      get the current day name
  179. DosGetDir$      get a default disk directory
  180. DosGetDisk$     get the default disk drive
  181. DosGetFAttr%    get the attributes of a file
  182. DosGetKey$      get a key from standard input
  183. DosGetKeyW$     get a key from standard input (wait if needed)
  184. DosGetVersion%  get the DOS version
  185. DosSetDisk%     set the default disk drive
  186. DosSetFAttr%    set the attributes of a file
  187. DosVerify%      return disk write verification status
  188. DosVerifyOff    turn off disk write verification
  189. DosVerifyOn     turn on disk write verification
  190. DosWriteSt      write a string to standard output
  191.  
  192. BiosAlt%
  193.  
  194. This function tells you whether an Alt key is pressed.
  195.  
  196.    Alt% = BiosAlt%
  197.  
  198.  
  199.  
  200. BiosBaseMem%
  201.  
  202. This function returns the amount of base memory installed, in
  203. kilobytes.  These days, it will typically be 640.
  204.  
  205.    Kbytes% = BiosBaseMem%
  206.  
  207.  
  208.  
  209. BiosCaps%
  210.  
  211. This function tells you whether the CapsLock toggle is on.
  212.  
  213.    CapsLock% = BiosCaps%
  214.  
  215.  
  216.  
  217. BiosChkEKey$
  218.  
  219. This function reads a character from the keyboard.  It works
  220. like INKEY$, but doesn't take the key from the keyboard
  221. buffer.  This is useful for handling control characters
  222. (Ctrl-S, Ctrl-Q, Ctrl-C, etc)-- you can have your program
  223. recognize them if pressed, without disturbing the keyboard
  224. buffer if someone is using type-ahead.
  225.  
  226. Actually, it doesn't work quite like INKEY$ in another fashion
  227. which is to its advantage.  It always returns a zero or
  228. two-character string, where the first character is the ASCII
  229. code (CHR$(0) for extended keys, like function keys and arrow
  230. keys) and the second character is the scan code.  For normal
  231. keys, the scan code is always the same regardless of the shift
  232. state of the key. That is, the scan code for "A" is the scan
  233. code for "a" is the scan code for Ctrl-A is the scan code for
  234. Alt-A.  Rose is a rose is a rose, eh?  This is an occasionally
  235. useful property.
  236.  
  237. Note that this keyboard service is for "enhanced" keyboards
  238. only.  Use BiosChkKey$ for older keyboards.
  239.  
  240.    Ky$ = BiosChkEKey$
  241.  
  242. BiosChkKey$
  243.  
  244. This function reads a character from the keyboard.  It works
  245. like INKEY$, but doesn't take the key from the keyboard
  246. buffer.  This is useful for handling control characters
  247. (Ctrl-S, Ctrl-Q, Ctrl-C, etc)-- you can have your program
  248. recognize them if pressed, without disturbing the keyboard
  249. buffer if someone is using type-ahead.
  250.  
  251. Actually, it doesn't work quite like INKEY$ in another fashion
  252. which is to its advantage.  It always returns a zero or
  253. two-character string, where the first character is the ASCII
  254. code (CHR$(0) for extended keys, like function keys and arrow
  255. keys) and the second character is the scan code.  For normal
  256. keys, the scan code is always the same regardless of the shift
  257. state of the key. That is, the scan code for "A" is the scan
  258. code for "a" is the scan code for Ctrl-A is the scan code for
  259. Alt-A.  Rose is a rose is a rose, eh?  This is an occasionally
  260. useful property.
  261.  
  262. Note that this keyboard service, for reasons known only to IBM,
  263. is designed to ignore the new key codes for "enhanced"
  264. keyboards.  This means it won't detect F11 or F12, for
  265. instance.  Use BiosChkEKey$ for enhanced keyboards.
  266.  
  267.    Ky$ = BiosChkKey$
  268.  
  269.  
  270.  
  271. BiosChkPrt%
  272.  
  273. This function returns the status of the selected printer.
  274. Status information is encoded at the bit level, as follows:
  275.  
  276.    7   not busy
  277.    6   acknowledge
  278.    5   out of paper
  279.    4   selected
  280.    3   I/O error
  281.    2   unused
  282.    1   unused
  283.    0   timeout
  284.  
  285.    Status% = BiosChkPrt%(Port%)
  286.  
  287.  
  288.  
  289. BiosComPorts%
  290.  
  291. This function returns the number of serial (com) ports
  292. installed.
  293.  
  294.    Ports% = BiosComPorts%
  295.  
  296. BiosCtrl%
  297.  
  298. This function tells you whether a Ctrl key is pressed.
  299.  
  300.    Ctrl% = BiosCtrl%
  301.  
  302.  
  303.  
  304. BiosELAlt%
  305.  
  306. This function tells you whether the left Alt key is pressed.
  307. It works only with "enhanced" keyboards.
  308.  
  309.    LAlt% = BiosELAlt%
  310.  
  311.  
  312.  
  313. BiosELCtrl%
  314.  
  315. This function tells you whether the left Ctrl key is pressed.
  316. It works only with "enhanced" keyboards.
  317.  
  318.    LCtrl% = BiosELCtrl%
  319.  
  320.  
  321.  
  322. BiosERAlt%
  323.  
  324. This function tells you whether the right Alt key is pressed.
  325. It works only with "enhanced" keyboards.
  326.  
  327.    RAlt% = BiosERAlt%
  328.  
  329.  
  330.  
  331. BiosERCtrl%
  332.  
  333. This function tells you whether the right Ctrl key is pressed.
  334. It works only with "enhanced" keyboards.
  335.  
  336.    RCtrl% = BiosERCtrl%
  337.  
  338.  
  339.  
  340. BiosESysRq%
  341.  
  342. This function tells you whether the SysRq key is pressed.  It
  343. works only with "enhanced" keyboards.
  344.  
  345.    SysRq% = BiosESysRq%
  346.  
  347. BiosFloppies%
  348.  
  349. This function returns the number of floppy drives installed.
  350.  
  351.    Floppies% = BiosFloppies%
  352.  
  353.  
  354.  
  355. BiosGetEKeyW$
  356.  
  357. This function reads a character from the keyboard.  It works
  358. like INKEY$, but waits until a key is pressed before returning.
  359.  
  360. Actually, it doesn't work quite like INKEY$, which is to its
  361. advantage.  It always returns a two-character string, where the
  362. first character is the ASCII code (CHR$(0) for extended keys,
  363. like function keys and arrow keys) and the second character is
  364. the scan code.  For normal keys, the scan code is always the
  365. same regardless of the shift state of the key.  That is, the
  366. scan code for "A" is the scan code for "a" is the scan code for
  367. Ctrl-A is the scan code for Alt-A.  Rose is a rose is a rose,
  368. eh?  This is an occasionally useful property.
  369.  
  370. Note that this keyboard service is for use with "enhanced"
  371. keyboards only. Use BiosGetKeyW$ for older keyboards.
  372.  
  373.    Ky$ = BiosGetEKeyW$
  374.  
  375.  
  376.  
  377. BiosGetKeyW$
  378.  
  379. This function reads a character from the keyboard.  It works
  380. like INKEY$, but waits until a key is pressed before returning.
  381.  
  382. Actually, it doesn't work quite like INKEY$, which is to its
  383. advantage.  It always returns a two-character string, where the
  384. first character is the ASCII code (CHR$(0) for extended keys,
  385. like function keys and arrow keys) and the second character is
  386. the scan code.  For normal keys, the scan code is always the
  387. same regardless of the shift state of the key.  That is, the
  388. scan code for "A" is the scan code for "a" is the scan code for
  389. Ctrl-A is the scan code for Alt-A.  Rose is a rose is a rose,
  390. eh?  This is an occasionally useful property.
  391.  
  392. Note that this keyboard service, for reasons known only to IBM,
  393. is designed to ignore the new key codes for "enhanced"
  394. keyboards.  This means it won't detect F11 or F12, for
  395. instance.  Use BiosGetEKeyW$ for enhanced keyboards.
  396.  
  397.    Ky$ = BiosGetKeyW$
  398.  
  399. BiosGetVideo
  400.  
  401. This routine returns information about the current video mode:
  402. the width of the screen (text columns), the screen mode, and
  403. the active display page.
  404.  
  405. The screen mode uses a different numbering system than BASIC
  406. (or, more properly, vice versa).  Standard BIOS screen modes
  407. are as follows:
  408.  
  409.   Mode    Type       Resolut.  Colr  Displ.      Adapter
  410.   ----  ---------    --------  ----  ------    -----------
  411.     0   text mode     40x25     16    mono     CGA/EGA/VGA
  412.     1   text mode     40x25     16    color    CGA/EGA/VGA
  413.     2   text mode     80x25     16    mono     CGA/EGA/VGA
  414.     3   text mode     80x25     16    color    CGA/EGA/VGA
  415.     4   graphics     320x200     4    color    CGA/EGA/VGA
  416.     5   graphics     320x200     4    mono     CGA/EGA/VGA
  417.     6   graphics     640x200     2    color    CGA/EGA/VGA
  418.     7   text mode     80x25     ..    mono     MDA/Herc
  419.    13   graphics     320x200    16    color    EGA/VGA
  420.    14   graphics     640x200    16    color    EGA/VGA
  421.    15   graphics     640x350     2    mono     EGA/VGA
  422.    16   graphics     640x350    16    color    EGA/VGA
  423.    17   graphics     640x480     4    mono     VGA
  424.    18   graphics     640x480    16    color    VGA
  425.    19   graphics     320x200   256    color    VGA
  426.  
  427.    BiosGetVideo Columns%, ScreenMode%, ActivePage%
  428.  
  429.  
  430.  
  431. BiosInitPrt%
  432.  
  433. This function initializes the selected printer.  It also
  434. returns the status of the printer. Status information is
  435. encoded at the bit level, as follows:
  436.  
  437.    7   not busy
  438.    6   acknowledge
  439.    5   out of paper
  440.    4   selected
  441.    3   I/O error
  442.    2   unused
  443.    1   unused
  444.    0   timeout
  445.  
  446.    Status% = BiosInitPrt%(Port%)
  447.  
  448. BiosIns%
  449.  
  450. This function tells you whether the Insert toggle is on.
  451.  
  452.    Ins% = BiosIns%
  453.  
  454.  
  455.  
  456. BiosJoyPosn
  457.  
  458. This routine returns the current joystick coordinates.  If only
  459. one joystick is installed, the second set of coordinates is
  460. meaningless.
  461.  
  462. Coordinates typically range from 0-400 or so.  It is a good
  463. idea to include a joystick calibration routine in your program
  464. since the numbers may vary.
  465.  
  466.    BiosJoyPosn Stick1X%, Stick1Y%, Stick2X%, Stick2Y%
  467.  
  468.  
  469.  
  470. BiosJoyPress
  471.  
  472. This routine tells you which joystick buttons are being
  473. pressed.  If only one joystick is installed, the second set of
  474. coordinates is meaningless.
  475.  
  476.    BiosJoyPress Stick1A%, Stick1B%, Stick2A%, Stick2B%
  477.  
  478.  
  479.  
  480. BiosKeyIn%
  481.  
  482. This function stuffs a key into the keyboard buffer.  It is for
  483. AT-type computers only.  You may stuff up to 15 keys into the
  484. normal buffer, depending on whether there are already any keys
  485. pending.  A -1 will be returned if the keyboard buffer was full
  486. and the key couldn't be stuffed.
  487.  
  488. The key specification must be as a two-character string.  The
  489. first character is the ASCII code and the second, the scan
  490. code.  In a pinch, you can usually get away with using CHR$(0)
  491. for the scan code, but it is better to include the scan code
  492. (use the BiosGetKeyW$ routine to find out the appropriate
  493. code).
  494.  
  495.    ErrCode% = BiosKeyIn%(Ky$)
  496.  
  497. BiosKeyRep
  498.  
  499. This routine allows you to change the key repeat rate on
  500. AT-type computers.  You must specify the delay before repeat:
  501. 0-3, for 250mS to 1 second.  You must also specify the repeat
  502. rate: 0-31, for 30/second to 2/second (12 is the default).
  503.  
  504.    BiosKeyRep RepDelay%, RepRate%
  505.  
  506.  
  507.  
  508. BiosLShift%
  509.  
  510. This function tells you whether the left Shift key is pressed.
  511.  
  512.    LShift% = BiosLShift%
  513.  
  514.  
  515.  
  516. BiosMHide
  517.  
  518. This routine hides the mouse cursor, making it invisible.
  519.  
  520.    BiosMHide
  521.  
  522.  
  523.  
  524. BiosMInit%
  525.  
  526. This function tells you whether a mouse is available.  If so,
  527. it returns the number of buttons the mouse has.  If not, it
  528. returns a zero.
  529.  
  530. This function should be used at the start of any program which
  531. expects to use a mouse.  You must not use any other mouse
  532. routine unless a mouse is available.  Besides that, BiosMInit%
  533. initializes the mouse driver to a proper starting state.
  534.  
  535.    Buttons% = BiosMInit%
  536.  
  537.  
  538.  
  539. BiosMLButton%
  540.  
  541. This function tells you whether the left mouse button is being
  542. pressed.
  543.  
  544.    Pressed% = BiosMLButton%
  545.  
  546. BiosMLClick
  547.  
  548. This routine tells you how many times the left mouse button has
  549. been pressed since the last time you checked.  It also returns
  550. the position of the mouse cursor as of the last left button
  551. press.
  552.  
  553. See BiosWhereX% and BiosWhereY% for information on the unusual
  554. handling of coordinates in text and CGA SCREEN 1 modes.
  555.  
  556.    BiosMLClick Clicks%, X%, Y%
  557.  
  558.  
  559.  
  560. BiosMLocate
  561.  
  562. This routine sets the position of the mouse cursor.  Note that
  563. coordinate handling is peculiar for text mode and SCREEN 1, for
  564. which a virtual screen of 640x200 is assumed.  This means that
  565. you will have to double your X coordinate when in SCREEN 1
  566. mode.  For text mode, first subtract one from each coordinate,
  567. then multiply the coordinate by eight.  Also keep in mind that
  568. for text mode the coordinates are normally Row, Column, but are
  569. here handled as if in graphics mode, so you need to use X, Y
  570. (or Column, Row) order instead.
  571.  
  572. This is another fine mess Microsoft's gotten us into!
  573.  
  574.    BiosMLocate X%, Y%
  575.  
  576.  
  577.  
  578. BiosMLRelease
  579.  
  580. This routine tells you how many times the left mouse button has
  581. been released since the last time you checked.  It also returns
  582. the position of the mouse cursor as of the last left button
  583. release.
  584.  
  585. See BiosWhereX% and BiosWhereY% for information on the unusual
  586. handling of coordinates in text and CGA SCREEN 1 modes.
  587.  
  588.    BiosMLRelease Releases%, X%, Y%
  589.  
  590.  
  591.  
  592. BiosMMButton%
  593.  
  594. This function tells you whether the middle mouse button is
  595. being pressed.  The results will not be meaningful on a
  596. two-button mouse.
  597.  
  598.    Pressed% = BiosMMButton%
  599.  
  600. BiosMMClick
  601.  
  602. This routine tells you how many times the middle mouse button
  603. has been pressed since the last time you checked.  It also
  604. returns the position of the mouse cursor as of the last middle
  605. button press.  The results will not be meaningful on a
  606. two-button mouse.
  607.  
  608. See BiosWhereX% and BiosWhereY% for information on the unusual
  609. handling of coordinates in text and CGA SCREEN 1 modes.
  610.  
  611.    BiosMMClick Clicks%, X%, Y%
  612.  
  613.  
  614.  
  615. BiosMMRelease
  616.  
  617. This routine tells you how many times the middle mouse button
  618. has been released since the last time you checked.  It also
  619. returns the position of the mouse cursor as of the last middle
  620. button release.  The results will not be meaningful on a
  621. two-button mouse.
  622.  
  623. See BiosWhereX% and BiosWhereY% for information on the unusual
  624. handling of coordinates in text and CGA SCREEN 1 modes.
  625.  
  626.    BiosMMRelease Releases%, X%, Y%
  627.  
  628.  
  629.  
  630. BiosMRButton%
  631.  
  632. This function tells you whether the right mouse button is being
  633. pressed.
  634.  
  635.    Pressed% = BiosMRButton%
  636.  
  637.  
  638.  
  639. BiosMRClick
  640.  
  641. This routine tells you how many times the right mouse button
  642. has been pressed since the last time you checked.  It also
  643. returns the position of the mouse cursor as of the last right
  644. button press.
  645.  
  646. See BiosWhereX% and BiosWhereY% for information on the unusual
  647. handling of coordinates in text and CGA SCREEN 1 modes.
  648.  
  649.    BiosMRClick Clicks%, X%, Y%
  650.  
  651. BiosMRRelease
  652.  
  653. This routine tells you how many times the right mouse button
  654. has been released since the last time you checked.  It also
  655. returns the position of the mouse cursor as of the last right
  656. button release.
  657.  
  658. See BiosWhereX% and BiosWhereY% for information on the unusual
  659. handling of coordinates in text and CGA SCREEN 1 modes.
  660.  
  661.    BiosMRRelease Releases%, X%, Y%
  662.  
  663.  
  664.  
  665. BiosMShow
  666.  
  667. This routine tries to make the mouse cursor visible.  However,
  668. the mouse driver maintains a visibility count, so if multiple
  669. calls were made to BiosMHide, it will take just as many calls to
  670. BiosMShow to really make the cursor visible.
  671.  
  672.    BiosMShow
  673.  
  674.  
  675.  
  676. BiosMWhereX%
  677.  
  678. This function tells you the X coordinate of the mouse cursor.
  679. This is expressed in graphics coordinates even when text mode
  680. is in use.  For normal text modes and both CGA modes, a virtual
  681. screen of 640x200 is assumed.  So, for 320x200 CGA mode, divide
  682. the coordinate by two.  For 80x25 text mode, divide it by
  683. eight.
  684.  
  685.    X% = BiosMWhereX%
  686.  
  687.  
  688.  
  689. BiosMWhereY%
  690.  
  691. This function tells you the Y coordinate of the mouse cursor.
  692. This is expressed in graphics coordinates even when text mode
  693. is in use.  For normal text modes and both CGA modes, a virtual
  694. screen of 640x200 is assumed.  So, for 80x25 text mode, divide
  695. it by eight.
  696.  
  697.    Y% = BiosMWhereY%
  698.  
  699.  
  700.  
  701. BiosMWindow
  702.  
  703. This routine restricts the mouse cursor to a specified area of
  704. the screen.  See BiosMLocate for a description of the unusual
  705. cursor handling in text modes and SCREEN 1 graphics mode.
  706.  
  707.    BiosMWindow X1%, Y1%, X2%, Y2%
  708.  
  709. BiosNum%
  710.  
  711. This function tells you whether the NumLock toggle is on.
  712.  
  713.    NumLock% = BiosNum%
  714.  
  715.  
  716.  
  717. BiosPrintCh%
  718.  
  719. This function sends a character to the selected printer.  It
  720. also returns the status of the printer. Status information is
  721. encoded at the bit level, as follows:
  722.  
  723.    7   not busy
  724.    6   acknowledge
  725.    5   out of paper
  726.    4   selected
  727.    3   I/O error
  728.    2   unused
  729.    1   unused
  730.    0   timeout
  731.  
  732.    Status% = BiosPrintCh%(Port%, Ch$)
  733.  
  734.  
  735.  
  736. BiosPrtPorts%
  737.  
  738. This function returns the number of parallel (printer) ports
  739. installed.
  740.  
  741.    Ports% = BiosPrtPorts%
  742.  
  743.  
  744.  
  745. BiosPrtSc
  746.  
  747. This routine sends the screen to the printer.  It works just
  748. like pressing PrtSc (PrintScreen) on your keyboard.
  749.  
  750. If you want to print a graphics screen, you need to load the
  751. GRAPHICS.COM TSR that came with DOS.  All versions of GRAPHICS
  752. support CGA graphics modes.  Not all of them support EGA or VGA.
  753.  
  754.    BiosPrtSc
  755.  
  756.  
  757.  
  758. BiosRShift%
  759.  
  760. This function tells you whether the right Shift key is pressed.
  761.  
  762.    RShift% = BiosRShift%
  763.  
  764. BiosScroll%
  765.  
  766. This function tells you whether the ScrollLock toggle is on.
  767.  
  768.    ScrollLock% = BiosScroll%
  769.  
  770.  
  771.  
  772. BiosScrollDn
  773.  
  774. This routine scrolls any part of the screen down.  You may
  775. specify the number of times to scroll.  If you specify 0, the
  776. area will be cleared instead of scrolled.  You must specify the
  777. colors to use on the new line(s) that was created by the
  778. scrolling action.
  779.  
  780.    BiosScrollDn TopRow%, LfCol%, BotRow%, RtCol%, Times%,
  781.       Fore%, Back%
  782.  
  783.  
  784.  
  785. BiosScrollUp
  786.  
  787. This routine scrolls any part of the screen up.  You may
  788. specify the number of times to scroll.  If you specify 0, the
  789. area will be cleared instead of scrolled.  You must specify the
  790. colors to use on the new line(s) that was created by the
  791. scrolling action.
  792.  
  793.    BiosScrollUp TopRow%, LfCol%, BotRow%, RtCol%, Times%,
  794.       Fore%, Back%
  795.  
  796.  
  797.  
  798. BiosXClose
  799.  
  800. This routine closes an area of XMS associated with a specified
  801. handle.  This must be done when you are finished using that
  802. area of XMS, so other routines and programs will be able to use
  803. it again later.
  804.  
  805.    BiosXClose Handle%
  806.  
  807.  
  808.  
  809. BiosXExists%
  810.  
  811. This function tells you whether an XMS driver is installed.
  812.  
  813.    XMS% = BiosXExists%
  814.  
  815. BiosXLFree&
  816.  
  817. This function tells you the size of the largest block of XMS
  818. memory that is available, in kilobytes.  Compare with
  819. BiosXTFree&.
  820.  
  821.    LargestFreeBlock& = BiosXLFree&
  822.  
  823.  
  824.  
  825. BiosXOpen
  826.  
  827. This routine opens an area of XMS memory for use.  The size is
  828. specified in kilobytes.  If the specified amount of space can
  829. be allocated, a handle is returned which you will use to access
  830. that block in the future.  If there is an error allocating that
  831. much memory, a non-zero error code will be returned.
  832.  
  833. Note that handles are a limited resource, so you should try to
  834. use as few of them as possible.
  835.  
  836. The maximum size theoretically possible under the XMS spec is
  837. 65,535 kilobytes (64 megabytes).  I haven't tried this in
  838. practice!
  839.  
  840.    BiosXOpen KBytes&, Handle%, ErrCode%
  841.  
  842.  
  843.  
  844. BiosXRead
  845.  
  846. This routine gets information from XMS memory.  You must
  847. specify the memory handle, the starting offset within the
  848. memory associated with that handle, and the number of bytes to
  849. transfer.  The number of bytes must be an EVEN number, but is
  850. not limited to 64k.  Finally, you must specify where to place
  851. the information as a segment and offset in conventional memory.
  852. For BASIC arrays and so forth, you can get this data using the
  853. VARSEG and VARPTR functions.
  854.  
  855. Another common place to put the data might be the display.  For
  856. text modes, this is a simple transfer.  Use an offset of 0 and
  857. a segment of either &HB000 (MDA/Herc) or &B800 (CGA/EGA/VGA).
  858.  
  859.    BiosXRead Handle%, Posn&, Bytes&, DSeg%, DOfs%
  860.  
  861. BiosXResize
  862.  
  863. This routine allows you to change the size of a previously
  864. allocated block of XMS memory.  You must specify the handle of
  865. the area to resize and the desired size, in kilobytes.  If
  866. unable to reallocate the block as specified, BiosXResize will
  867. return a non-zero error code.
  868.  
  869.    BiosXResize Handle%, Bytes&, ErrCode%
  870.  
  871.  
  872.  
  873. BiosXTFree&
  874.  
  875. This function returns the total amount of available XMS memory
  876. in kilobytes.  Compare with BiosXLFree&.
  877.  
  878.    TotalFree& = BiosXTFree&
  879.  
  880.  
  881.  
  882. BiosXVer%
  883.  
  884. This function returns the XMS driver version, multiplied by
  885. 100.  For instance, version 1.01 would be returned as 101.
  886.  
  887.    XMSver! = BiosXVer% / 100!
  888.  
  889.  
  890.  
  891. BiosXWrite
  892.  
  893. This routine puts information into XMS memory.  You must
  894. specify the memory handle, the starting offset within the
  895. memory associated with that handle, and the number of bytes to
  896. transfer.  The number of bytes must be an EVEN number, but is
  897. not limited to 64k.  Finally, you must specify where to get the
  898. information as a segment and offset in conventional memory. For
  899. BASIC arrays and so forth, you can get this data using the
  900. VARSEG and VARPTR functions.
  901.  
  902. Another common place from which to get the data might be the
  903. display.  For text modes, this is a simple transfer.  Use an
  904. offset of 0 and a segment of either &HB000 (MDA/Herc) or &B800
  905. (CGA/EGA/VGA).
  906.  
  907.    BiosXWrite Handle%, Posn&, Bytes&, DSeg%, DOfs%
  908.  
  909. DosBreak%
  910.  
  911. This function returns the current level of Break checking.  At
  912. level 0, DOS checks for Ctrl-C/Break only during keyboard input
  913. or screen output.  At level -1, DOS also checks during disk
  914. access.
  915.  
  916.    ExtendedBreak% = DosBreak%
  917.  
  918.  
  919.  
  920. DosBreakOff
  921.  
  922. This routine disables extended Break checking, so DOS only
  923. checks for Break during keyboard input or screen output.
  924.  
  925.    DosBreakOff
  926.  
  927.  
  928.  
  929. DosBreakOn
  930.  
  931. This routine enables extended Break checking, so DOS checks for
  932. Break during disk access as well as during keyboard input or
  933. screen output.
  934.  
  935.    DosBreakOn
  936.  
  937.  
  938.  
  939. DosDiskInfo
  940.  
  941. This routine returns an assortment of information about a given
  942. disk drive: sectors per cluster, free clusters, bytes per
  943. sector, and total clusters.  From this, you can derive further
  944. information such as how much disk space is available and the
  945. total disk space.
  946.  
  947. You may specify a null drive to get the information from the
  948. default drive.
  949.  
  950. If there was an error, SecsPerClus& will be -1.
  951.  
  952.    DosDiskInfo Drive$, SecsPerClus&, FreeClus&, BytesPerSec&,
  953.       TotalClus&
  954.  
  955.  
  956.  
  957. DosGetDay$
  958.  
  959. This function returns the current day of the week as a
  960. three-character string.  For instance, on Wednesday the result
  961. would be "Wed".
  962.  
  963.    Today$ = DosGetDay$
  964.  
  965. DosGetDir$
  966.  
  967. This function returns the default directory on the specified
  968. drive.  If there was an error, a null string ("") will be
  969. returned.
  970.  
  971. You may specify a null drive to get the directory of the
  972. default drive.
  973.  
  974.    Subdir$ = DosGetDir$(Drive$)
  975.  
  976.  
  977.  
  978. DosGetDisk$
  979.  
  980. This function returns the letter of the currently selected
  981. disk drive.
  982.  
  983.    Drive$ = DosGetDisk$
  984.  
  985.  
  986.  
  987. DosGetFAttr%
  988.  
  989. This function returns the file attributes of a specified file.
  990. The file must be terminated by CHR$(0).  If there was an error,
  991. -1 will be returned.  Otherwise, the result will be any
  992. combination of the following, added together:
  993.  
  994.     1   read-only
  995.     2   hidden
  996.     4   system
  997.     8   volume label
  998.    16   subdirectory
  999.    32   archive
  1000.  
  1001. The results can be most conveniently decoded using the AND
  1002. function.  For instance:
  1003.  
  1004.    IF DosGetFAttr%(File$ + CHR$(0)) AND 16 THEN
  1005.       PRINT "Subdirectory"
  1006.    END IF
  1007.  
  1008.  
  1009.  
  1010. DosGetKey$
  1011.  
  1012. This function attempts to read a character from DOS standard
  1013. input (normally the keyboard).  It works like INKEY$.
  1014.  
  1015. Standard input can be redirected from the command line, so it
  1016. may get information from a file or device instead of the
  1017. keyboard.  That is one of the advantages of this function.
  1018.  
  1019.    Ky$ = DosGetKey$
  1020.  
  1021. DosGetKeyW$
  1022.  
  1023. This function reads a character from DOS standard input
  1024. (normally the keyboard).  It works like INKEY$, but waits until
  1025. a key is pressed before returning.
  1026.  
  1027. Standard input can be redirected from the command line, so it
  1028. may get information from a file or device instead of the
  1029. keyboard.  That is one of the advantages of this function.
  1030.  
  1031.    Ky$ = DosGetKeyW$
  1032.  
  1033.  
  1034.  
  1035. DosGetVersion%
  1036.  
  1037. This function returns the DOS version multiplied by 100.  For
  1038. instance, DOS 2.11 would be returned as 211.
  1039.  
  1040.    DOSver! = DosGetVersion% / 100!
  1041.  
  1042.  
  1043.  
  1044. DosSetDisk%
  1045.  
  1046. This function sets the default disk drive.  It also returns the
  1047. number of logical drives in the system.
  1048.  
  1049. Note that a logical drive may be considered being like a drive
  1050. letter-- it may refer to part of a larger physical drive, to a
  1051. RAMdisk, to some other device, or to nothing at all.
  1052.  
  1053.    LogicalDrives% = DosSetDisk% (Drive$)
  1054.  
  1055.  
  1056.  
  1057. DosSetFAttr%
  1058.  
  1059. This function sets the file attributes of a specified file.
  1060. The file must be terminated by CHR$(0).  If there was an error,
  1061. -1 will be returned.  Otherwise, 0 will be returned.
  1062.  
  1063. You may set any combination of the following attributes, added
  1064. together:
  1065.  
  1066.     1   read-only
  1067.     2   hidden
  1068.     4   system
  1069.    32   archive
  1070.  
  1071.    ErrCode% = DosSetFAttr%(File$ + CHR$(0), FAttr%)
  1072.  
  1073. DosVerify%
  1074.  
  1075. This function tells you whether disk write verification is
  1076. turned on.
  1077.  
  1078.    Verify% = DosVerify%
  1079.  
  1080.  
  1081.  
  1082. DosVerifyOff
  1083.  
  1084. This routine disables disk write verification.  Verification
  1085. provides better file security but slows things down.  It is
  1086. normally off by default.
  1087.  
  1088.    DosVerifyOff
  1089.  
  1090.  
  1091.  
  1092. DosVerifyOn
  1093.  
  1094. This routine enables disk write verification.  Verification
  1095. provides better file security but slows things down.  It is
  1096. normally off by default.
  1097.  
  1098.    DosVerifyOn
  1099.  
  1100.  
  1101.  
  1102. DosWriteSt
  1103.  
  1104. This routine writes a string to the DOS standard output
  1105. (normally the display).
  1106.  
  1107. Standard output can be redirected from the command line, so it
  1108. may write information to a file or device instead of the
  1109. display.  It also supports device drivers such as ANSI.SYS.
  1110. That is one of the advantages of this routine.
  1111.  
  1112.    DosWriteSt St$
  1113.  
  1114.