home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / asmwiz16.zip / ASMWIZ.MAN < prev    next >
Text File  |  1993-05-23  |  124KB  |  4,833 lines

  1. Service : BC_ASC2INT
  2.  
  3. Module  : Base Conversion Services
  4.  
  5. Compat  : Any
  6.  
  7. Purpose : Converts an ASCIIZ string to an unsigned integer
  8.  
  9. Parms:
  10.       BL <-- base from which to convert (2-36)
  11.    DS:SI <-- pointer to string
  12.    -------
  13.       AX = unsigned integer (0-65,535)
  14.  
  15. Description:
  16.  
  17. The BC_ASC2INT service converts an ASCIIZ string to an unsigned
  18. integer value. The conversion stops at the first character which
  19. cannot be construed as being part of the number.
  20.  
  21. Any reasonable base may be specified, giving this service
  22. considerable flexibility. More commonly-used bases include:
  23.  
  24.      2     binary
  25.      8     octal
  26.     10     decimal
  27.     16     hex
  28.  
  29.  
  30.  
  31.  
  32. Service : BC_ASC2LONG
  33.  
  34. Module  : Base Conversion Services
  35.  
  36. Compat  : Any
  37.  
  38. Purpose : Converts an ASCIIZ string to an unsigned long int
  39.  
  40. Parms:
  41.       BL <-- base from which to convert (2-36)
  42.    DS:SI <-- pointer to string
  43.    -------
  44.    DX,AX = unsigned long integer (0-4,294,967,295)
  45.  
  46. Description:
  47.  
  48. The BC_ASC2LONG service converts an ASCIIZ string to an unsigned
  49. long integer value. The conversion stops at the first character
  50. which cannot be construed as being part of the number.
  51.  
  52. Any reasonable base may be specified, giving this service
  53. considerable flexibility. More commonly-used bases include:
  54.  
  55.      2     binary
  56.      8     octal
  57.     10     decimal
  58.     16     hex
  59.  
  60. Service : BC_ASC2SINT
  61.  
  62. Module  : Base Conversion Services
  63.  
  64. Compat  : Any
  65.  
  66. Purpose : Converts an ASCIIZ string to a signed integer
  67.  
  68. Parms:
  69.       BL <-- base from which to convert (2-36)
  70.    DS:SI <-- pointer to string
  71.    -------
  72.       AX = unsigned integer (-32768 to 32767)
  73.  
  74. Description:
  75.  
  76. The BC_ASC2SINT service converts an ASCIIZ string to a signed
  77. integer value. The conversion stops at the first character which
  78. cannot be construed as being part of the number.
  79.  
  80. Any reasonable base may be specified, giving this service
  81. considerable flexibility. More commonly-used bases include:
  82.  
  83.      2     binary
  84.      8     octal
  85.     10     decimal
  86.     16     hex
  87.  
  88. Note that negative numbers are frequently represented as
  89. unsigned numbers when a base other than 10 (decimal) is used. If
  90. you wish to follow that convention, simply use BC_ASC2INT
  91. instead of this routine.
  92.  
  93. Service : BC_ASC2SLONG
  94.  
  95. Module  : Base Conversion Services
  96.  
  97. Compat  : Any
  98.  
  99. Purpose : Converts an ASCIIZ string to a signed long integer
  100.  
  101. Parms:
  102.       BL <-- base from which to convert (2-36)
  103.    DS:SI <-- pointer to string
  104.    -------
  105.    DX,AX = signed long int (-2,147,483,648 to 2,147,483,647)
  106.  
  107. Description:
  108.  
  109. The BC_ASC2SLONG service converts an ASCIIZ string to a signed
  110. long integer value. The conversion stops at the first character
  111. which cannot be construed as being part of the number.
  112.  
  113. Any reasonable base may be specified, giving this service
  114. considerable flexibility. More commonly-used bases include:
  115.  
  116.      2     binary
  117.      8     octal
  118.     10     decimal
  119.     16     hex
  120.  
  121. Note that negative numbers are frequently represented as
  122. unsigned numbers when a base other than 10 (decimal) is used. If
  123. you wish to follow that convention, simply use BC_ASC2LONG
  124. instead of this routine.
  125.  
  126. Service : BC_INT2ASC
  127.  
  128. Module  : Base Conversion Services
  129.  
  130. Compat  : Any
  131.  
  132. Purpose : Converts an unsigned integer to an ASCIIZ string
  133.  
  134. Parms:
  135.       AX <-- unsigned integer (0-65,535)
  136.       BL <-- desired base (2-36)
  137.    ES:DI <-- pointer to string buffer (recommend 17 bytes)
  138.  
  139. Description:
  140.  
  141. The BC_INT2ASC service converts an integer value to an ASCIIZ
  142. number of a specified base. The integer is presumed to be
  143. unsigned, giving a range of 0-65,535.
  144.  
  145. More commonly-used bases include:
  146.  
  147.      2     binary
  148.      8     octal
  149.     10     decimal
  150.     16     hex
  151.  
  152.  
  153.  
  154.  
  155. Service : BC_LONG2ASC
  156.  
  157. Module  : Base Conversion Services
  158.  
  159. Compat  : Any
  160.  
  161. Purpose : Converts an unsigned long int to an ASCIIZ string
  162.  
  163. Parms:
  164.    DX,AX <-- unsigned long integer (0-4,294,967,295)
  165.       BL <-- desired base (2-36)
  166.    ES:DI <-- pointer to string buffer (recommend 33 bytes)
  167.  
  168. Description:
  169.  
  170. The BC_LONG2ASC service converts an unsigned long integer value
  171. to an ASCIIZ number of a specified base.
  172.  
  173. More commonly-used bases include:
  174.  
  175.      2     binary
  176.      8     octal
  177.     10     decimal
  178.     16     hex
  179.  
  180. Service : BC_SINT2ASC
  181.  
  182. Module  : Base Conversion Services
  183.  
  184. Compat  : Any
  185.  
  186. Purpose : Converts a signed integer to an ASCIIZ string
  187.  
  188. Parms:
  189.       AX <-- signed integer (-32768 to 32767)
  190.       BL <-- desired base (2-36)
  191.    ES:DI <-- pointer to string buffer (recommend 18 bytes)
  192.  
  193. Description:
  194.  
  195. The BC_SINT2ASC service converts an integer value to an ASCIIZ
  196. number of a specified base. The integer is presumed to be
  197. signed, giving a range of -32,768 to 32,767.
  198.  
  199. More commonly-used bases include:
  200.  
  201.      2     binary
  202.      8     octal
  203.     10     decimal
  204.     16     hex
  205.  
  206. Note that negative numbers are frequently represented as
  207. unsigned numbers when a base other than 10 (decimal) is used. If
  208. you wish to follow that convention, simply use BC_INT2ASC
  209. instead of this routine.
  210.  
  211. Service : BC_SLONG2ASC
  212.  
  213. Module  : Base Conversion Services
  214.  
  215. Compat  : Any
  216.  
  217. Purpose : Converts a signed long integer to an ASCIIZ string
  218.  
  219. Parms:
  220.    DX,AX <-- signed long int (-2,147,483,648 to 2,147,483,647)
  221.       BL <-- desired base (2-36)
  222.    ES:DI <-- pointer to string buffer (recommend 34 bytes)
  223.  
  224. Description:
  225.  
  226. The BC_SLONG2ASC service converts a signed long integer value to
  227. an ASCIIZ number of a specified base.
  228.  
  229. More commonly-used bases include:
  230.  
  231.      2     binary
  232.      8     octal
  233.     10     decimal
  234.     16     hex
  235.  
  236. Note that negative numbers are frequently represented as
  237. unsigned numbers when a base other than 10 (decimal) is used. If
  238. you wish to follow that convention, simply use BC_LONG2ASC
  239. instead of this routine.
  240.  
  241. Service : BK_GETCAPS
  242.  
  243. Module  : Keyboard
  244.  
  245. Compat  : BIOS with enhanced keyboard support
  246.  
  247. Purpose : gets the CapsLock state
  248.  
  249. Parms:
  250.    -------
  251.       AX = 0 if off, 0FFFFh if on
  252.  
  253. Description:
  254.  
  255. The BK_GETCAPS service tells you the current CapsLock state.
  256.  
  257. Note that the BK services require a modern BIOS with enhanced
  258. keyboard support. If your program needs to run on older machines
  259. (those made before the 101-key keyboard came out), use the BKO
  260. services instead.
  261.  
  262.  
  263.  
  264. Service : BK_GETKEY
  265.  
  266. Module  : Keyboard
  267.  
  268. Compat  : BIOS with enhanced keyboard support
  269.  
  270. Purpose : gets a key
  271.  
  272. Parms:
  273.       AL <-- bit field (see description)
  274.    -------
  275.       AX = key code (- scan code, 0 no key, + ASCII code)
  276.       Flags = ZF if no key, NZ if got a key
  277.  
  278. Description:
  279.  
  280. The BK_GETKEY service gets a key from the keyboard. It provides
  281. an assortment of options which may be selected by setting the
  282. appropriate bit in AL before calling the routine:
  283.  
  284.    Bit    Meaning
  285.    ===    =======
  286.     0     wait for a key to be pressed
  287.     1     ignore extended ASCII keys (function keys, etc)
  288.     2     capitalize letters (only ASCII 97-122 affected)
  289.     3     clear keyboard buffer before accepting a key
  290.    4-7    RESERVED for future expansion. Set to zero.
  291.  
  292. The result will be returned in AX. If there was no key, AX will
  293. be zero. If there was a normal key, its ASCII code will be
  294. returned. If there was an extended ASCII key, the scan code of
  295. the key will be returned as a negative number.
  296.  
  297. Note that the BK services require a modern BIOS with enhanced
  298. keyboard support. If your program needs to run on older machines
  299. (those made before the 101-key keyboard came out), use the BKO
  300. services instead.
  301.  
  302. Service : BK_GETNUM
  303.  
  304. Module  : Keyboard
  305.  
  306. Compat  : BIOS with enhanced keyboard support
  307.  
  308. Purpose : gets the NumLock state
  309.  
  310. Parms:
  311.    -------
  312.       AX = 0 if off, 0FFFFh if on
  313.  
  314. Description:
  315.  
  316. The BK_GETNUM service tells you the current NumLock state.
  317.  
  318. Note that the BK services require a modern BIOS with enhanced
  319. keyboard support. If your program needs to run on older machines
  320. (those made before the 101-key keyboard came out), use the BKO
  321. services instead.
  322.  
  323. Service : BKO_GETCAPS
  324.  
  325. Module  : Keyboard
  326.  
  327. Compat  : BIOS
  328.  
  329. Purpose : gets the CapsLock state
  330.  
  331. Parms:
  332.    -------
  333.       AX = 0 if off, 0FFFFh if on
  334.  
  335. Description:
  336.  
  337. The BKO_GETCAPS service tells you the current CapsLock state.
  338.  
  339. Note that the BKO services provide compatibility across the
  340. entire range of keyboards. As such, they do not provide access
  341. to enhanced key codes (e.g., F11 and F12). If your program needs
  342. access to enhanced key codes, use the BK services instead.
  343.  
  344.  
  345.  
  346. Service : BKO_GETKEY
  347.  
  348. Module  : Keyboard
  349.  
  350. Compat  : BIOS with enhanced keyboard support
  351.  
  352. Purpose : gets a key
  353.  
  354. Parms:
  355.       AL <-- bit field (see description)
  356.    -------
  357.       AX = key code (- scan code, 0 no key, + ASCII code)
  358.       Flags = ZF if no key, NZ if got a key
  359.  
  360. Description:
  361.  
  362. The BKO_GETKEY service gets a key from the keyboard. It provides
  363. an assortment of options which may be selected by setting the
  364. appropriate bit in AL before calling the routine:
  365.  
  366.    Bit    Meaning
  367.    ===    =======
  368.     0     wait for a key to be pressed
  369.     1     ignore extended ASCII keys (function keys, etc)
  370.     2     capitalize letters (only ASCII 97-122 affected)
  371.     3     clear keyboard buffer before accepting a key
  372.    4-7    RESERVED for future expansion. Set to zero.
  373.  
  374. The result will be returned in AX. If there was no key, AX will
  375. be zero. If there was a normal key, its ASCII code will be
  376. returned. If there was an extended ASCII key, the scan code of
  377. the key will be returned as a negative number.
  378.  
  379. Note that the BKO services provide compatibility across the
  380. entire range of keyboards. As such, they do not provide access
  381. to enhanced key codes (e.g., F11 and F12). If your program needs
  382. access to enhanced key codes, use the BK services instead.
  383.  
  384. Service : BKO_GETNUM
  385.  
  386. Module  : Keyboard
  387.  
  388. Compat  : BIOS
  389.  
  390. Purpose : gets the NumLock state
  391.  
  392. Parms:
  393.    -------
  394.       AX = 0 if off, 0FFFFh if on
  395.  
  396. Description:
  397.  
  398. The BKO_GETNUM service tells you the current NumLock state.
  399.  
  400. Note that the BKO services provide compatibility across the
  401. entire range of keyboards. As such, they do not provide access
  402. to enhanced key codes (e.g., F11 and F12). If your program needs
  403. access to enhanced key codes, use the BK services instead.
  404.  
  405. Service : BV_CHROUT
  406.  
  407. Module  : BIOS Video Services
  408.  
  409. Compat  : BIOS
  410.  
  411. Purpose : Displays a character on the screen
  412.  
  413. Parms:
  414.       AL <-- character to display
  415.  
  416. Description:
  417.  
  418. The BV_CHROUT routine displays a character on the screen.
  419.  
  420. The following control codes are interpreted:
  421.    7      Bell             beep
  422.    8      Backspace        non-destructive backspace
  423.    9      Tab              space over to the next tab stop
  424.   10      Linefeed         move cursor down one line
  425.   12      Formfeed         clear screen and home cursor
  426.   13      Carriage Return  home cursor on current line
  427.  
  428. Redirection, if any, is ignored.
  429.  
  430.  
  431.  
  432.  
  433. Service : BV_CLEOLN
  434.  
  435. Module  : BIOS Video Services
  436.  
  437. Compat  : BIOS
  438.  
  439. Purpose : Clears to the end of the line
  440.  
  441. Parms:
  442.    none
  443.  
  444. Description:
  445.  
  446. The BV_CLEOLN service clears from the current cursor position to
  447. the end of the current screen line, inclusive.
  448.  
  449. Redirection, if any, is ignored.
  450.  
  451. Service : BV_CLS
  452.  
  453. Module  : BIOS Video Services
  454.  
  455. Compat  : BIOS
  456.  
  457. Purpose : Clears the screen
  458.  
  459. Parms:
  460.    none
  461.  
  462. Description:
  463.  
  464. The BV_CLS service clears the screen and homes the cursor to the
  465. upper left corner.
  466.  
  467. Redirection, if any, is ignored.
  468.  
  469.  
  470.  
  471.  
  472. Service : BV_COLOR
  473.  
  474. Module  : BIOS Video Services
  475.  
  476. Compat  : BIOS
  477.  
  478. Purpose : Sets the default text color
  479.  
  480. Parms:
  481.       AL <-- default color
  482.  
  483. Description:
  484.  
  485. The BV_COLOR service sets the default text color. A color
  486. attribute table is given in the ASMWIZ.DOC file. In general,
  487. however, the background is in the high nybble and ranges 0-7 in
  488. text modes, 0 in graphics modes; the foreground is in the low
  489. nybble and ranges 0-7 in text modes, 0-x in graphics modes.
  490.  
  491. Redirection, if any, is ignored.
  492.  
  493. Service : BV_CRLF
  494.  
  495. Module  : BIOS Video Services
  496.  
  497. Compat  : BIOS
  498.  
  499. Purpose : Displays a <CR><LF> (carriage return and linefeed)
  500.  
  501. Parms:
  502.    none
  503.  
  504. Description:
  505.  
  506. The BV_CRLF routine displays a carriage return and linefeed on
  507. the screen.
  508.  
  509. Redirection, if any, is ignored.
  510.  
  511.  
  512.  
  513.  
  514. Service : BV_DELLINE
  515.  
  516. Module  : BIOS Video Services
  517.  
  518. Compat  : BIOS
  519.  
  520. Purpose : Deletes the current screen row
  521.  
  522. Parms:
  523.    none
  524.  
  525. Description:
  526.  
  527. The BV_DELLINE service deletes the row on which the cursor is
  528. placed. Any rows beneath it are moved up and the bottom line of
  529. the screen is cleared to a row of spaces in the current screen
  530. colors.
  531.  
  532. Redirection, if any, is ignored.
  533.  
  534. Service : BV_FIXCOLOR
  535.  
  536. Module  : BIOS Video Services
  537.  
  538. Compat  : Any
  539.  
  540. Purpose : Tells the BV services to convert color to monochrome
  541.  
  542. Parms:
  543.       AL <-- whether to convert to mono (0 no, 1 yes)
  544.  
  545. Description:
  546.  
  547. The BV_FIXCOLOR service tells the BIOS Video services whether to
  548. convert colors to their monochrome equivalents. If not, the
  549. colors will remain as you originally specified. If so, the
  550. colors will be converted to appropriate values for use on a
  551. monochrome display.
  552.  
  553. The color-to-mono translation attempts to mimic the original
  554. display as closely as possible. It analyzes the foreground and
  555. background colors by their intensity. The results are translated
  556. to white on black, bright white on black, or black on white. The
  557. "blink" attribute is preserved. If the original foreground was
  558. identical to the background (invisible characters), the result
  559. will be black on black.
  560.  
  561. See also the MI_GETSCREEN service, which allows you to
  562. automatically detect what kind of display is in use.
  563.  
  564. Service : BV_GETCOLOR
  565.  
  566. Module  : BIOS Video Services
  567.  
  568. Compat  : BIOS
  569.  
  570. Purpose : Gets the default text color
  571.  
  572. Parms:
  573.    -------
  574.       AL = default color
  575.  
  576. Description:
  577.  
  578. The BV_GETCOLOR service gets the default text color. A
  579. color/attribute table is given in the ASMWIZ.DOC file. In
  580. general, however, the background is in the high nybble and
  581. ranges 0-7 in text modes, 0 in graphics modes; the foreground is
  582. in the low nybble and ranges 0-7 in text modes, 0-x in graphics
  583. modes.
  584.  
  585. Redirection, if any, is ignored.
  586.  
  587. Service : BV_MODE
  588.  
  589. Module  : BIOS Video Services
  590.  
  591. Compat  : BIOS
  592.  
  593. Purpose : Gets the default screen mode
  594.  
  595. Parms:
  596.    -------
  597.       AL = mode
  598.  
  599. Description:
  600.  
  601. The BV_GETMODE service gets the current screen mode. A table of
  602. screen modes is given in the ASMWIZ.DOC file.
  603.  
  604.  
  605.  
  606.  
  607. Service : BV_HIDECURSOR
  608.  
  609. Module  : BIOS Video Services
  610.  
  611. Compat  : BIOS
  612.  
  613. Purpose : Hides the cursor
  614.  
  615. Parms:
  616.    none
  617.  
  618. Description:
  619.  
  620. The BV_HIDECURSOR service hides the cursor, making it invisible.
  621. This does not affect normal cursor operation.
  622.  
  623. Redirection, if any, is ignored.
  624.  
  625. Service : BV_INSLINE
  626.  
  627. Module  : BIOS Video Services
  628.  
  629. Compat  : BIOS
  630.  
  631. Purpose : Inserts a line at the current screen row
  632.  
  633. Parms:
  634.    none
  635.  
  636. Description:
  637.  
  638. The BV_INSLINE service inserts a row at the current cursor
  639. location. Any rows beneath it are moved down and the new line
  640. screen is cleared to a row of spaces in the current screen
  641. colors.
  642.  
  643. Redirection, if any, is ignored.
  644.  
  645.  
  646.  
  647.  
  648. Service : BV_LOCATE
  649.  
  650. Module  : BIOS Video Services
  651.  
  652. Compat  : BIOS
  653.  
  654. Purpose : Sets the cursor position
  655.  
  656. Parms:
  657.       DH <-- row (1-25)
  658.       DL <-- column (1-40/80)
  659.  
  660. Description:
  661.  
  662. The BV_LOCATE service sets the cursor position.
  663.  
  664. Redirection, if any, is ignored.
  665.  
  666. Service : BV_MODE
  667.  
  668. Module  : BIOS Video Services
  669.  
  670. Compat  : BIOS
  671.  
  672. Purpose : Sets the screen mode
  673.  
  674. Parms:
  675.       AL <-- screen mode (0-7, 13-19, depending on adapter)
  676.  
  677. Description:
  678.  
  679. The BV_MODE routine sets the screen mode.  This may be:
  680.  
  681.      Mode  Resolu.  Type  Colr  Use        Adapter(s)
  682.  
  683.        0   40x25    b&w     16  text       CGA, EGA, VGA
  684.        1   40x25    color   16  text       CGA, EGA, VGA
  685.        2   80x25    b&w     16  text       CGA, EGA, VGA
  686.  def-  3   80x25    color   16  text       CGA, EGA, VGA
  687.        4   320x200  color    4  graphics   CGA, EGA, VGA
  688.        5   320x200  b&w      4  graphics   CGA, EGA, VGA
  689.        6   640x200  color    2  graphics   CGA, EGA, VGA
  690.  mda-  7   80x25    b&w      -  text       MDA, EGA, VGA
  691.       13   320x200  color   16  graphics   EGA, VGA
  692.       14   640x200  color   16  graphics   EGA, VGA
  693.       15   640x350  mono     -  graphics   EGA, VGA
  694.       16   640x350  color   16  graphics   EGA, VGA
  695.       17   640x480  color    2  graphics   VGA
  696.       18   640x480  color   16  graphics   VGA
  697.       19   320x200  color  256  graphics   VGA
  698.  
  699. Redirection, if any, is ignored.
  700.  
  701. Service : BV_POPUP
  702.  
  703. Module  : BIOS Video Services
  704.  
  705. Compat  : BIOS
  706.  
  707. Purpose : Displays a pop-up window on the screen
  708.  
  709. Parms:
  710.    DS:DX <-- pointer to parameter list
  711.  
  712. Description:
  713.  
  714. The BV_POPUP service displays a pop-up window on the screen. A
  715. variety of frames is available for the window. Titles are
  716. optional and will be left- justified in the top bar of the
  717. window if supplied.
  718.  
  719. Frame types are as follows:
  720.  
  721.    0    none (blank)
  722.    1    single lines
  723.    2    double lines
  724.    3    single horizontal lines, double vertical lines
  725.    4    double horizontal lines, single vertical lines
  726.  
  727. The parameter list should look like this:
  728.  
  729. Y1           db ?            ; top row of window
  730. X1           db ?            ; left column of window
  731. Y2           db ?            ; bottom row of window
  732. X2           db ?            ; right column of window
  733. FRAMETYPE    db ?            ; frame type
  734. FRAMECOLOR   db ?            ; frame color
  735. TITLE        dw ?            ; offset (DS:) of ASCIIZ title
  736.                              ; use 0FFFFh for no title
  737.  
  738. Redirection, if any, is ignored.
  739.  
  740. Service : BV_SHOWCURSOR
  741.  
  742. Module  : BIOS Video Services
  743.  
  744. Compat  : BIOS
  745.  
  746. Purpose : Shows the cursor
  747.  
  748. Parms:
  749.    none
  750.  
  751. Description:
  752.  
  753. The BV_SHOWCURSOR service shows the cursor, making it visible.
  754. NOTE: This service may change the cursor shape if used before
  755. BV_HIDECURSOR.
  756.  
  757. Redirection, if any, is ignored.
  758.  
  759.  
  760.  
  761.  
  762. Service : BV_STROUT
  763.  
  764. Module  : BIOS Video Services
  765.  
  766. Compat  : BIOS
  767.  
  768. Purpose : Displays a string on the screen
  769.  
  770. Parms:
  771.    DS:DX <-- ptr to string to display
  772.  
  773. Description:
  774.  
  775. The BV_STROUT routine displays a string on the screen. The
  776. string must be in ASCIIZ format (NUL terminated).
  777.  
  778. The following control codes are interpreted:
  779.    7      Bell             beep
  780.    8      Backspace        non-destructive backspace
  781.    9      Tab              space over to the next tab stop
  782.   10      Linefeed         move cursor down one line
  783.   12      Formfeed         clear screen and home cursor
  784.   13      Carriage Return  home cursor on current line
  785.  
  786. Redirection, if any, is ignored.
  787.  
  788. Service : BV_WHERE
  789.  
  790. Module  : BIOS Video Services
  791.  
  792. Compat  : BIOS
  793.  
  794. Purpose : Gets the cursor position
  795.  
  796. Parms:
  797.    -------
  798.       DH = row (1-25)
  799.       DL = column (1-40/80)
  800.  
  801. Description:
  802.  
  803. The BV_WHERE service gets the cursor position.
  804.  
  805. Redirection, if any, is ignored.
  806.  
  807. Service : CG_CHROUT
  808.  
  809. Module  : CGA Graphics Services
  810.  
  811. Compat  : Clone
  812.  
  813. Purpose : Displays a character on the screen
  814.  
  815. Parms:
  816.       AL <-- character to display
  817.  
  818. Description:
  819.  
  820. The CG_CHROUT routine displays a character on the screen. The
  821. screen must be in one of the CGA graphics modes (video modes
  822. 4-6).
  823.  
  824. The following control codes are interpreted:
  825.    7      Bell             beep
  826.    8      Backspace        non-destructive backspace
  827.    9      Tab              space over to the next tab stop
  828.   10      Linefeed         move cursor down one line
  829.   12      Formfeed         clear screen and home cursor
  830.   13      Carriage Return  home cursor on current line
  831.  
  832. Redirection, if any, is ignored.
  833.  
  834.  
  835.  
  836.  
  837. Service : CG_CLEOLN
  838.  
  839. Module  : CGA Graphics Services
  840.  
  841. Compat  : Clone
  842.  
  843. Purpose : Clears to the end of the line
  844.  
  845. Parms:
  846.    none
  847.  
  848. Description:
  849.  
  850. The CG_CLEOLN service clears from the current cursor position to
  851. the end of the current screen line, inclusive. The screen must
  852. be in one of the CGA graphics modes (video modes 4-6).
  853.  
  854. Redirection, if any, is ignored.
  855.  
  856. Service : CG_CLS
  857.  
  858. Module  : CGA Graphics Services
  859.  
  860. Compat  : Clone
  861.  
  862. Purpose : Clears the screen
  863.  
  864. Parms:
  865.    none
  866.  
  867. Description:
  868.  
  869. The CG_CLS service clears the screen and homes the cursor to the
  870. upper left corner. The screen must be in one of the CGA graphics
  871. modes (video modes 4-6).
  872.  
  873. Redirection, if any, is ignored.
  874.  
  875.  
  876.  
  877.  
  878. Service : CG_COLOR
  879.  
  880. Module  : CGA Graphics Services
  881.  
  882. Compat  : Clone
  883.  
  884. Purpose : Sets the default text color
  885.  
  886. Parms:
  887.       AL <-- default color
  888.  
  889. Description:
  890.  
  891. The CG_COLOR service sets the default text color. A
  892. color/attribute table is given in the ASMWIZ.DOC file. In
  893. general, however, the background is in the high nybble and
  894. ranges 0-3; the foreground is in the low nybble and also ranges
  895. 0-3. The actual colors displayed depend on the palette setting.
  896.  
  897. Redirection, if any, is ignored.
  898.  
  899. Service : CG_CRLF
  900.  
  901. Module  : CGA Graphics Services
  902.  
  903. Compat  : Clone
  904.  
  905. Purpose : Displays a <CR><LF> (carriage return and linefeed)
  906.  
  907. Parms:
  908.    none
  909.  
  910. Description:
  911.  
  912. The CG_CRLF routine displays a carriage return and linefeed on
  913. the screen. The screen must be in one of the CGA graphics modes
  914. (video modes 4-6).
  915.  
  916. Redirection, if any, is ignored.
  917.  
  918.  
  919.  
  920.  
  921. Service : CG_GETCOLOR
  922.  
  923. Module  : CGA Graphics Services
  924.  
  925. Compat  : Clone
  926.  
  927. Purpose : Gets the default text color
  928.  
  929. Parms:
  930.    -------
  931.       AL = default color
  932.  
  933. Description:
  934.  
  935. The CG_GETCOLOR service gets the default text color. A
  936. color/attribute table is given in the ASMWIZ.DOC file. In
  937. general, however, the background is in the high nybble and
  938. ranges 0-3; the foreground is in the low nybble and also ranges
  939. 0-3. The actual colors displayed depend on the palette setting.
  940.  
  941. Redirection, if any, is ignored.
  942.  
  943. Service : CG_INIT
  944.  
  945. Module  : CGA Graphics Services
  946.  
  947. Compat  : Clone
  948.  
  949. Purpose : Initializes the CGA Graphics Services
  950.  
  951. Parms:
  952.    none
  953.  
  954. Description:
  955.  
  956. The CG_INIT routine initializes the CGA Graphics Services. It
  957. should be used once in your program, before any other CGA
  958. Graphics Services are called.
  959.  
  960. Redirection, if any, is ignored.
  961.  
  962.  
  963.  
  964.  
  965. Service : CG_LOCATE
  966.  
  967. Module  : CGA Graphics Services
  968.  
  969. Compat  : Clone
  970.  
  971. Purpose : Sets the cursor position
  972.  
  973. Parms:
  974.       DH <-- row (1-25)
  975.       DL <-- column (1-40/80)
  976.  
  977. Description:
  978.  
  979. The CG_LOCATE service sets the cursor position. The screen must
  980. be in one of the CGA graphics modes (video modes 4-6).
  981.  
  982. Redirection, if any, is ignored.
  983.  
  984. Service : CG_MODE
  985.  
  986. Module  : CGA Graphics Services
  987.  
  988. Compat  : Clone
  989.  
  990. Purpose : Sets the screen mode
  991.  
  992. Parms:
  993.       AL <-- screen mode (4-6)
  994.  
  995. Description:
  996.  
  997. The CG_MODE routine sets the screen mode. This may be any of the
  998. following:
  999.  
  1000.      Mode  Resolu.  Type  Colr  Use        Adapter(s)
  1001.  
  1002.        4   320x200  color    4  graphics   CGA, EGA, VGA
  1003.        5   320x200  b&w      4  graphics   CGA, EGA, VGA
  1004.        6   640x200  color    2  graphics   CGA, EGA, VGA
  1005.  
  1006. Redirection, if any, is ignored.
  1007.  
  1008.  
  1009.  
  1010.  
  1011. Service : CG_STROUT
  1012.  
  1013. Module  : CGA Graphics Services
  1014.  
  1015. Compat  : Clone
  1016.  
  1017. Purpose : Displays a string on the screen
  1018.  
  1019. Parms:
  1020.    DS:DX <-- ptr to the string to display
  1021.  
  1022. Description:
  1023.  
  1024. The CG_STROUT routine displays a string on the screen. The
  1025. string must be in ASCIIZ (NUL terminated) format. The screen
  1026. must be in one of the CGA graphics modes (video modes 4-6).
  1027.  
  1028. The following control codes are interpreted:
  1029.    7      Bell             beep
  1030.    8      Backspace        non-destructive backspace
  1031.    9      Tab              space over to the next tab stop
  1032.   10      Linefeed         move cursor down one line
  1033.   12      Formfeed         clear screen and home cursor
  1034.   13      Carriage Return  home cursor on current line
  1035.  
  1036. Redirection, if any, is ignored.
  1037.  
  1038. Service : CG_WHERE
  1039.  
  1040. Module  : CGA Graphics Services
  1041.  
  1042. Compat  : Clone
  1043.  
  1044. Purpose : Gets the cursor position
  1045.  
  1046. Parms:
  1047.    -------
  1048.       DH = row (1-25)
  1049.       DL = column (1-40/80)
  1050.  
  1051. Description:
  1052.  
  1053. The CG_WHERE service gets the cursor position. The screen must
  1054. be in one of the CGA graphics modes (video modes 4-6).
  1055.  
  1056. Redirection, if any, is ignored.
  1057.  
  1058. Service : DF_CLOSE
  1059.  
  1060. Module  : File Services
  1061.  
  1062. Compat  : DOS
  1063.  
  1064. Purpose : Closes a file
  1065.  
  1066. Parms:
  1067.       BX <-- (virtual) file handle
  1068.  
  1069. Description:
  1070.  
  1071. The DF_CLOSE service closes a file. This causes the disk
  1072. information associated with the file to be updated and the file
  1073. handle to be freed. You should use DF_CLOSE or DF_DONE to close
  1074. all files before your program terminates.
  1075.  
  1076. If an error occurs, the carry flag is set and AX contains the
  1077. error code. The AX register may be modified regardless of
  1078. whether an error occurs. Possible errors include specification
  1079. of an invalid handle and (if critical error handling is turned
  1080. on) inability to update the disk.
  1081.  
  1082.  
  1083.  
  1084.  
  1085. Service : DF_DONE
  1086.  
  1087. Module  : File Services
  1088.  
  1089. Compat  : DOS
  1090.  
  1091. Purpose : Closes all open files
  1092.  
  1093. Parms:
  1094.    none
  1095.  
  1096. Description:
  1097.  
  1098. The DF_DONE service closes all open file. This causes the disk
  1099. information associated with the files to be updated and the file
  1100. handles to be freed. You should use DF_CLOSE or DF_DONE to close
  1101. all files before your program terminates.
  1102.  
  1103. If an error occurs at any point, the carry flag is set and AX
  1104. contains the error code. The AX register may be modified
  1105. regardless of whether an error occurs. The only error possible
  1106. is inability to update the disk (only returned if critical error
  1107. handling is turned on).
  1108.  
  1109. Service : DF_FLUSH
  1110.  
  1111. Module  : File Services
  1112.  
  1113. Compat  : DOS
  1114.  
  1115. Purpose : Flushes a file to disk
  1116.  
  1117. Parms:
  1118.       BX <-- (virtual) file handle
  1119.  
  1120. Description:
  1121.  
  1122. The DF_FLUSH service flushes a file. This causes the disk
  1123. information associated with the file to be updated as if the
  1124. file had been closed, only faster. This is typically used to
  1125. make sure a file is properly updated to its current status, so
  1126. it won't disappear entirely if the power goes off or a similar
  1127. disaster strikes.
  1128.  
  1129. For DOS versions prior to 3.3, there must be at least one free
  1130. file handle for this service to work, because a temporary handle
  1131. is needed. For later DOS versions, there is no such requirement.
  1132.  
  1133. If an error occurs, the carry flag is set and AX contains the
  1134. error code. The AX register may be modified regardless of
  1135. whether an error occurs. Possible errors include specification
  1136. of an invalid handle and (if critical error handling is turned
  1137. on) inability to update the disk.
  1138.  
  1139.  
  1140.  
  1141.  
  1142. Service : DF_GETTIME
  1143.  
  1144. Module  : File Services
  1145.  
  1146. Compat  : DOS
  1147.  
  1148. Purpose : Gets a file's time/date stamp
  1149.  
  1150. Parms:
  1151.       BX <-- (virtual) file handle
  1152.    -------
  1153.       AX = time (DOS internal format)
  1154.       DX = date (DOS internal format)
  1155.  
  1156. Description:
  1157.  
  1158. The DF_GETTIME service gets a file's time/date stamp.
  1159.  
  1160. If an error occurs, the carry flag is set and AX contains the
  1161. error code.
  1162.  
  1163. Service : DF_HANDLE
  1164.  
  1165. Module  : File Services
  1166.  
  1167. Compat  : DOS
  1168.  
  1169. Purpose : Gets the DOS handle of a file
  1170.  
  1171. Parms:
  1172.       BX <-- (virtual) file handle
  1173.    -------
  1174.       BX = (DOS) file handle
  1175.  
  1176. Description:
  1177.  
  1178. The DF_HANDLE service gets the DOS file handle, given the
  1179. virtual file handle used by the AsmWiz services. If the file has
  1180. an input buffer, the buffer is flushed so that any operations
  1181. you do using the DOS file handle will not cause the AsmWiz
  1182. services to report incorrect information.
  1183.  
  1184. Note that the correlation between the virtual file handle and
  1185. DOS file handle is not guaranteed to remain constant. Any time
  1186. you use an AsmWiz file handling service, the DOS file handle for
  1187. any given virtual file handle may change. This is required to
  1188. allow for the future implementation of the ability to keep an
  1189. indefinite number of files open at the same time under any DOS
  1190. version.
  1191.  
  1192. If an error occurs, the carry flag is set and AX contains the
  1193. error code. The only possible error is the specification of an
  1194. invalid virtual file handle.
  1195.  
  1196.  
  1197.  
  1198.  
  1199. Service : DF_INIT
  1200.  
  1201. Module  : File Services
  1202.  
  1203. Compat  : DOS
  1204.  
  1205. Purpose : Initializes the File Services
  1206.  
  1207. Parms:
  1208.       DX <-- 0 (zero)
  1209.  
  1210. Description:
  1211.  
  1212. The DF_INIT service initializes the File Services. The DX
  1213. register currently must be zero. It will later be used to pass
  1214. the PSP segment if you want extended file handles, which will
  1215. allow an indefinite number of files to be open at one time.
  1216.  
  1217. Service : DF_LOCATE
  1218.  
  1219. Module  : File Services
  1220.  
  1221. Compat  : DOS
  1222.  
  1223. Purpose : Sets the location of a file's read/write pointer
  1224.  
  1225. Parms:
  1226.       BX <-- (virtual) file handle
  1227.       CL <-- location method (0-2)
  1228.    DX,AX <-- location offset
  1229.  
  1230. Description:
  1231.  
  1232. The DF_LOCATE service sets the location of a file's read/write
  1233. pointer. This tells the File Services where the next read or
  1234. write should begin. You may specify any of three location
  1235. methods:
  1236.  
  1237.    0    offset from the start of the file    absolute offset
  1238.    1    offset from the current location     relative offset
  1239.    2    offset from the end of the file      relative offset
  1240.  
  1241. The "offset from the end of the file" method specifies an offset
  1242. at, or past, the current end of the file. It is commonly used
  1243. with an offset of zero to set up a file for an append operation.
  1244. It can also be used in conjunction with DF_WHERE in order to get
  1245. the size of the file.
  1246.  
  1247. If an error occurs, the carry flag is set and AX contains the
  1248. error code. Possible errors include specification of an invalid
  1249. handle and (if critical error handling is turned on) inability
  1250. to access the file.
  1251.  
  1252. Service : DF_OPEN
  1253.  
  1254. Module  : File Services
  1255.  
  1256. Compat  : DOS
  1257.  
  1258. Purpose : Opens a file for access
  1259.  
  1260. Parms:
  1261.       AX <-- access method: how to open the file
  1262.    DS:DX <-- pointer to ASCIIZ filename
  1263.       CX <-- input buffer length (use 0 for no buffer)
  1264.    ES:SI <-- pointer to input buffer, if any
  1265.    -------
  1266.       BX = (virtual) file handle
  1267.  
  1268. Description:
  1269.  
  1270. The DF_OPEN service opens a file for access. File sharing (for
  1271. networks and multitasking) is supported automatically if the DOS
  1272. version is capable of handling it ("deny write" is used). You
  1273. must specify the access method in AX, as follows:
  1274.  
  1275.    bit 0    allow Reading from the file
  1276.    bit 1    allow Writing to the file
  1277.    bit 2    Create a new file or truncate an existing one to zero bytes
  1278.    bit 3    use Text mode (as opposed to the normal Binary mode)
  1279.  
  1280. Unused bits should be set to zero, to allow compatibility with
  1281. future versions of AsmWiz. For instance, to open and read from
  1282. an existing text file, you might use AX = 1001b (1001 binary is
  1283. 9 in decimal or hex).
  1284.  
  1285. Text mode is handy for use with ASCII text files. It affects
  1286. reading from and writing to the file. If text mode is set, reads
  1287. from the file will stop when a carriage return/linefeed sequence
  1288. is encountered (or if a specified maximum number of characters
  1289. have been read) and a NUL character will be added to convert the
  1290. buffer to a string. Disk writing in this mode expects strings
  1291. (rather than using a byte count) and will automatically add a
  1292. carriage return/linefeed sequence. Control-Z is not used as an
  1293. end of file indicator, since such usage is archaic and
  1294. inappropriate in MS-DOS.
  1295.  
  1296. Note that if you are reading from a file using text mode, you
  1297. must specify an input buffer. An error code will be returned if
  1298. you do otherwise.
  1299.  
  1300. Note that the file handle returned is an index into an internal
  1301. file table and is not a normal DOS file handle. If you need to
  1302. find out the actual file handle used, you can get it from the
  1303. DF_HANDLE service.
  1304.  
  1305. If an error occurs, the carry flag is set and AX contains the
  1306. error code. The AX register may be modified regardless of
  1307. whether an error occurs. The error code will be -2 if you
  1308. attempt to read from a file that was opened in text mode without
  1309. a buffer. For a list of other possible errors, see the end of
  1310. the ASMWIZ.DOC file.
  1311.  
  1312. Service : DF_READ
  1313.  
  1314. Module  : File Services
  1315.  
  1316. Compat  : DOS
  1317.  
  1318. Purpose : Reads from a file
  1319.  
  1320. Parms:
  1321.       BX <-- (virtual) file handle
  1322.       CX <-- bytes to read (if text mode, max bytes to read)
  1323.    DS:DX <-- pointer to read buffer
  1324.    -------
  1325.       AX = bytes actually read (if NC and not text mode)
  1326.  
  1327. Description:
  1328.  
  1329. The DF_READ service reads from a file.
  1330.  
  1331. For files that were opened in text mode, the read operation will
  1332. stop on encountering a carriage return / linefeed sequence or
  1333. after having read the specified maximum number of bytes. The
  1334. CR/LF is not stored in the result. The result will be always be
  1335. converted to ASCIIZ (null-terminated string format), so your
  1336. actual buffer must be at least one byte larger than the
  1337. specified maximum number of bytes. If nulls are encountered in
  1338. the input stream, they will be converted to spaces. The
  1339. Control-Z code is not used as an end of file indicator and will
  1340. be read in like any other character.
  1341.  
  1342. If an error occurs, the carry flag is set and AX contains the
  1343. error code. The AX register may be modified regardless of
  1344. whether an error occurs. For a list of possible errors, see the
  1345. end of the ASMWIZ.DOC file.
  1346.  
  1347. Service : DF_TIME
  1348.  
  1349. Module  : File Services
  1350.  
  1351. Compat  : DOS
  1352.  
  1353. Purpose : Sets a file's time/date stamp
  1354.  
  1355. Parms:
  1356.       BX <-- (virtual) file handle
  1357.       AX <-- time (DOS internal format)
  1358.       DX <-- date (DOS internal format)
  1359.  
  1360. Description:
  1361.  
  1362. The DF_TIME service sets a file's time/date stamp.
  1363.  
  1364. If an error occurs, the carry flag is set and AX contains the
  1365. error code.
  1366.  
  1367.  
  1368.  
  1369.  
  1370. Service : DF_WHERE
  1371.  
  1372. Module  : File Services
  1373.  
  1374. Compat  : DOS
  1375.  
  1376. Purpose : Gets the location of a file's read/write pointer
  1377.  
  1378. Parms:
  1379.       BX <-- (virtual) file handle
  1380.    -------
  1381.    DX,AX = location offset
  1382.  
  1383. Description:
  1384.  
  1385. The DF_WHERE service gets the location of a file's read/write
  1386. pointer, which tells you where the next read or write will
  1387. begin.
  1388.  
  1389. If an error occurs, the carry flag is set and AX contains the
  1390. error code. Possible errors include specification of an invalid
  1391. handle and (if critical error handling is turned on) inability
  1392. to access the file.
  1393.  
  1394. Service : DF_WRITE
  1395.  
  1396. Module  : File Services
  1397.  
  1398. Compat  : DOS
  1399.  
  1400. Purpose : Writes to a file
  1401.  
  1402. Parms:
  1403.       BX <-- (virtual) file handle
  1404.       CX <-- bytes to write (if not text mode)
  1405.    DS:DX <-- pointer to write buffer
  1406.  
  1407. Description:
  1408.  
  1409. The DF_WRITE service writes to a file.
  1410.  
  1411. For files that were opened in text mode, the write operation
  1412. expects an ASCIIZ string. It writes the string to the file
  1413. without the null terminator, then writes a carriage return /
  1414. linefeed sequence.
  1415.  
  1416. If an error occurs, the carry flag is set and AX contains the
  1417. error code. For a list of possible errors, see the end of the
  1418. ASMWIZ.DOC file. If there was no error code returned by DOS but
  1419. the entire buffer wasn't written, an error code of -1 (negative
  1420. one) is returned.
  1421.  
  1422. Service : DK_GETKEY
  1423.  
  1424. Module  : Keyboard
  1425.  
  1426. Compat  : DOS
  1427.  
  1428. Purpose : gets a key
  1429.  
  1430. Parms:
  1431.       AL <-- bit field (see description)
  1432.    -------
  1433.       AX = key code (- scan code, 0 no key, + ASCII code)
  1434.       Flags = ZF if no key, NZ if got a key
  1435.  
  1436. Description:
  1437.  
  1438. The DK_GETKEY service gets a key from the keyboard. It provides
  1439. an assortment of options which may be selected by setting the
  1440. appropriate bit in AL before calling the routine:
  1441.  
  1442.    Bit    Meaning
  1443.    ===    =======
  1444.     0     wait for a key to be pressed
  1445.     1     ignore extended ASCII keys (function keys, etc)
  1446.     2     capitalize letters (only ASCII 97-122 affected)
  1447.     3     clear keyboard buffer before accepting a key
  1448.    4-7    RESERVED for future expansion. Set to zero.
  1449.  
  1450. The result will be returned in AX. If there was no key, AX will
  1451. be zero. If there was a normal key, its ASCII code will be
  1452. returned. If there was an extended ASCII key, the scan code of
  1453. the key will be returned as a negative number.
  1454.  
  1455. Service : DV_CHROUT
  1456.  
  1457. Module  : DOS Video Services
  1458.  
  1459. Compat  : DOS
  1460.  
  1461. Purpose : Displays a character on the screen
  1462.  
  1463. Parms:
  1464.       AL <-- character to display
  1465.  
  1466. Description:
  1467.  
  1468. The DV_CHROUT routine displays a character on the screen.
  1469.  
  1470. The following control codes are interpreted:
  1471.    7      Bell             beep
  1472.    8      Backspace        non-destructive backspace
  1473.    9      Tab              space over to the next tab stop
  1474.   10      Linefeed         move cursor down one line
  1475.   13      Carriage Return  home cursor on current line
  1476.  
  1477. Redirection, if any, is in effect. Text from this service may be
  1478. redirected to any file or device. Pipes can also be used.
  1479.  
  1480.  
  1481.  
  1482.  
  1483. Service : DV_CLEOLN
  1484.  
  1485. Module  : DOS Video Services
  1486.  
  1487. Compat  : DOS (with ANSI)
  1488.  
  1489. Purpose : Clears to the end of the line
  1490.  
  1491. Parms:
  1492.    none
  1493.  
  1494. Description:
  1495.  
  1496. The DV_CLEOLN service clears from the current cursor position to
  1497. the end of the current screen line, inclusive. It requires ANSI.
  1498.  
  1499. Redirection, if any, is in effect. Text from this service may be
  1500. redirected to any file or device. Pipes can also be used.
  1501.  
  1502. Service : DV_CLS
  1503.  
  1504. Module  : DOS Video Services
  1505.  
  1506. Compat  : DOS (with ANSI)
  1507.  
  1508. Purpose : Clears the screen
  1509.  
  1510. Parms:
  1511.    none
  1512.  
  1513. Description:
  1514.  
  1515. The DV_CLS service clears the screen and homes the cursor to the
  1516. upper left corner. It requires ANSI.
  1517.  
  1518. Redirection, if any, is in effect. Text from this service may be
  1519. redirected to any file or device. Pipes can also be used.
  1520.  
  1521.  
  1522.  
  1523.  
  1524. Service : DV_COLOR
  1525.  
  1526. Module  : DOS Video Services
  1527.  
  1528. Compat  : DOS (with ANSI)
  1529.  
  1530. Purpose : Sets the default text color
  1531.  
  1532. Parms:
  1533.       AL <-- default color
  1534.  
  1535. Description:
  1536.  
  1537. The DV_COLOR service sets the default text color. A
  1538. color/attribute table is given in the ASMWIZ.DOC file. In
  1539. general, however, the background is in the high nybble and
  1540. ranges 0-7 in text modes, 0 in graphics modes; the foreground is
  1541. in the low nybble and ranges 0-7 in text modes, 0-x in graphics
  1542. modes.
  1543.  
  1544. Redirection, if any, is in effect. Text from this service may be
  1545. redirected to any file or device. Pipes can also be used.
  1546.  
  1547. Service : DV_CRLF
  1548.  
  1549. Module  : DOS Video Services
  1550.  
  1551. Compat  : DOS
  1552.  
  1553. Purpose : Displays a <CR><LF> (carriage return and linefeed)
  1554.  
  1555. Parms:
  1556.    none
  1557.  
  1558. Description:
  1559.  
  1560. The DV_CRLF routine displays a carriage return and linefeed on
  1561. the screen.
  1562.  
  1563. Redirection, if any, is in effect. Text from this service may be
  1564. redirected to any file or device. Pipes can also be used.
  1565.  
  1566.  
  1567.  
  1568.  
  1569. Service : DV_DELLINE
  1570.  
  1571. Module  : DOS Video Services
  1572.  
  1573. Compat  : DOS (with extended ANSI)
  1574.  
  1575. Purpose : Deletes the current screen row
  1576.  
  1577. Parms:
  1578.    none
  1579.  
  1580. Description:
  1581.  
  1582. The DV_DELLINE service deletes the row on which the cursor is
  1583. placed. Any rows beneath it are moved up and the bottom line of
  1584. the screen is cleared to a row of spaces in the current screen
  1585. colors.
  1586.  
  1587. This service is only available under extended versions of the
  1588. ANSI driver, such as NANSI.SYS and ZANSI.SYS. It requires the
  1589. use of an ANSI code which is not implemented in the standard IBM
  1590. subset of the ANSI protocol.
  1591.  
  1592. Redirection, if any, is in effect. Text from this service may be
  1593. redirected to any file or device. Pipes can also be used.
  1594.  
  1595. Service : DV_FIXCOLOR
  1596.  
  1597. Module  : DOS Video Services
  1598.  
  1599. Compat  : Any
  1600.  
  1601. Purpose : Tells the DV services to convert color to monochrome
  1602.  
  1603. Parms:
  1604.       AL <-- whether to convert to mono (0 no, 1 yes)
  1605.  
  1606. Description:
  1607.  
  1608. The DV_FIXCOLOR service tells the DOS Video services whether to
  1609. convert colors to their monochrome equivalents. If not, the
  1610. colors will remain as you originally specified. If so, the
  1611. colors will be converted to appropriate values for use on a
  1612. monochrome display.
  1613.  
  1614. The color-to-mono translation attempts to mimic the original
  1615. display as closely as possible. It analyzes the foreground and
  1616. background colors by their intensity. The results are translated
  1617. to white on black, bright white on black, or black on white. The
  1618. "blink" attribute is preserved. If the original foreground was
  1619. identical to the background (invisible characters), the result
  1620. will be black on black.
  1621.  
  1622. See also the MI_GETSCREEN service, which allows you to
  1623. automatically detect what kind of display is in use.
  1624.  
  1625. Service : DV_INSLINE
  1626.  
  1627. Module  : DOS Video Services
  1628.  
  1629. Compat  : DOS (with extended ANSI)
  1630.  
  1631. Purpose : Inserts a line at the current screen row
  1632.  
  1633. Parms:
  1634.    none
  1635.  
  1636. Description:
  1637.  
  1638. The DV_INSLINE service inserts a row at the current cursor
  1639. location. Any rows beneath it are moved down and the new line
  1640. screen is cleared to a row of spaces in the current screen
  1641. colors.
  1642.  
  1643. This service is only available under extended versions of the
  1644. ANSI driver, such as NANSI.SYS and ZANSI.SYS. It requires the
  1645. use of an ANSI code which is not implemented in the standard IBM
  1646. subset of the ANSI protocol.
  1647.  
  1648. Redirection, if any, is in effect. Text from this service may be
  1649. redirected to any file or device. Pipes can also be used.
  1650.  
  1651.  
  1652.  
  1653.  
  1654. Service : DV_LOCATE
  1655.  
  1656. Module  : DOS Video Services
  1657.  
  1658. Compat  : DOS (with ANSI)
  1659.  
  1660. Purpose : Sets the cursor position
  1661.  
  1662. Parms:
  1663.       DH <-- row (1-25)
  1664.       DL <-- column (1-40/80)
  1665.  
  1666. Description:
  1667.  
  1668. The DV_LOCATE service sets the cursor position. It requires
  1669. ANSI.
  1670.  
  1671. Redirection, if any, is in effect. Text from this service may be
  1672. redirected to any file or device. Pipes can also be used.
  1673.  
  1674. Service : DV_MODE
  1675.  
  1676. Module  : DOS Video Services
  1677.  
  1678. Compat  : DOS (with ANSI)
  1679.  
  1680. Purpose : Sets the screen mode
  1681.  
  1682. Parms:
  1683.       AL <-- screen mode (0-6)
  1684.  
  1685. Description:
  1686.  
  1687. The DV_MODE routine sets the screen mode. This may be any of the
  1688. following:
  1689.  
  1690.      Mode  Resolu.  Type  Colr  Use        Adapter(s)
  1691.  
  1692.        0   40x25    b&w     16  text       CGA, EGA, VGA
  1693.        1   40x25    color   16  text       CGA, EGA, VGA
  1694.        2   80x25    b&w     16  text       CGA, EGA, VGA
  1695.  def-  3   80x25    color   16  text       CGA, EGA, VGA
  1696.        4   320x200  color    4  graphics   CGA, EGA, VGA
  1697.        5   320x200  b&w      4  graphics   CGA, EGA, VGA
  1698.        6   640x200  color    2  graphics   CGA, EGA, VGA
  1699.  
  1700. Additional modes may be available, depending on the ANSI driver
  1701. used. See description of the BV_MODE service for information on
  1702. these additional modes.
  1703.  
  1704. Redirection, if any, is in effect. Text from this service may be
  1705. redirected to any file or device. Pipes can also be used.
  1706.  
  1707. Service : DV_STROUT
  1708.  
  1709. Module  : DOS Video Services
  1710.  
  1711. Compat  : DOS
  1712.  
  1713. Purpose : Displays a string on the screen
  1714.  
  1715. Parms:
  1716.    DS:DX <-- ptr to the string to display
  1717.  
  1718. Description:
  1719.  
  1720. The DV_STROUT routine displays a string on the screen. The
  1721. string must be in ASCIIZ (NUL terminated) format.
  1722.  
  1723. The following control codes are interpreted:
  1724.    7      Bell             beep
  1725.    8      Backspace        non-destructive backspace
  1726.    9      Tab              space over to the next tab stop
  1727.   10      Linefeed         move cursor down one line
  1728.   13      Carriage Return  home cursor on current line
  1729.  
  1730. Redirection, if any, is in effect. Text from this service may be
  1731. redirected to any file or device. Pipes can also be used.
  1732.  
  1733. Service : EH_ADDBREAK
  1734.  
  1735. Module  : Exception Handling Services
  1736.  
  1737. Compat  : DOS
  1738.  
  1739. Purpose : Adds a procedure to be called on ^C or ^Break
  1740.  
  1741. Parms:
  1742.       DX <-- offset of procedure (from CS:)
  1743.    -------
  1744.    Flags = CY if there's no room for another procedure
  1745.            NC if the procedure was added
  1746.  
  1747. Description:
  1748.  
  1749. The EH_ADDBREAK service adds a procedure to the list of
  1750. procedures to be called if Control-C or Control-Break is
  1751. pressed. Up to eight procedures can be chained this way. They
  1752. will be called only if ^C / ^Break has been allowed by your
  1753. program.
  1754.  
  1755. This service allows for orderly shutdown if the user chooses to
  1756. abort the program. Files are closed automatically, but interrupt
  1757. vectors are not ordinarily restored on program exit, which can
  1758. lead to catastrophe if you have replaced one of the interrupt
  1759. handlers. A number of the AsmWiz services do such things and
  1760. need to execute a shutdown procedure before the program
  1761. terminates: MD_DONE for the 100th-second delay services, for
  1762. instance. If you allow the user to break out of the program with
  1763. ^C or ^Break, you should make sure that any procedures which
  1764. must be called before program termination are added to the break
  1765. chain by EH_ADDBREAK.
  1766.  
  1767. Your shutdown routine must be a NEAR procedure. It may alter any
  1768. register, except SS and SP (the stack must remain intact). Any
  1769. BIOS or DOS interrupt may be called. Your routine is expected to
  1770. exit with a NEAR return.
  1771.  
  1772. If you use EH_ADDBREAK, don't forget to initialize the break
  1773. handler by calling EH_INITBREAK at the start of your program!
  1774.  
  1775. Service : EH_CRITDONE
  1776.  
  1777. Module  : Exception Handling Services
  1778.  
  1779. Compat  : DOS
  1780.  
  1781. Purpose : Terminates the critical error handler
  1782.  
  1783. Parms:
  1784.    none
  1785.  
  1786. Description:
  1787.  
  1788. The EH_CRITDONE service terminates the critical error handler
  1789. installed by EH_INITCRIT. You can do this if you wish to use
  1790. your own critical error handler or the default handler, for
  1791. example. It is not necessary to call EH_CRITDONE before
  1792. terminating your program.
  1793.  
  1794. See also the EH_INITCRIT and EH_CRITERR services.
  1795.  
  1796. Service : EH_CRITERR
  1797.  
  1798. Module  : Exception Handling Services
  1799.  
  1800. Compat  : DOS
  1801.  
  1802. Purpose : Checks for critical errors
  1803.  
  1804. Parms:
  1805.    -------
  1806.       Flags = CY if there was a critical error
  1807.                  AH contains the error code
  1808.               NC if there was no error
  1809.  
  1810. Description:
  1811.  
  1812. The EH_CRITERR service tells you whether a critical error
  1813. occurred. It should be used just after any DOS functions which
  1814. may cause a critical error. This includes virtually all disk
  1815. operations, DOS-based communications and printing. If a critical
  1816. error occurred, the carry flag will be set, AH will contain the
  1817. critical error code, and AL will contain any normal error code
  1818. that was returned. If no critical error occurred, the flags and
  1819. registers will be untouched, so normal errors (if any) will pass
  1820. through.
  1821.  
  1822. This service clears the critical error code when it is called,
  1823. so if you call it a second time, no error will be returned
  1824. unless another critical error occurred in the meantime.
  1825.  
  1826. A list of critical error codes and DOS error codes is included
  1827. at the end of the ASMWIZ.DOC file.
  1828.  
  1829. See also the EH_INITCRIT and EH_CRITDONE services.
  1830.  
  1831. Example:
  1832.    MOV   AH,3Ch     ; create file
  1833.    INT   21h        ;
  1834.    CALL  EH_CRITERR ; see if there was a critical error
  1835.    JNC   All_Ok     ;   no errors at all
  1836.    CMP   AH,0       ; was it a normal error?
  1837.    JZ    NormalErr  ;   yep, go take care of it
  1838.    ; it was a critical error... AH contains the critical error code.
  1839.  
  1840. Service : EH_INITBREAK
  1841.  
  1842. Module  : Exception Handling Services
  1843.  
  1844. Compat  : DOS
  1845.  
  1846. Purpose : Initializes the ^C / ^Break handler
  1847.  
  1848. Parms:
  1849.    none
  1850.  
  1851. Description:
  1852.  
  1853. The EH_INITBREAK service initializes the break handling
  1854. services. This allows you to either ignore Control-C and
  1855. Control-Break, or to specify one or more procedures to call
  1856. before your program is terminated.
  1857.  
  1858. See also the EH_ADDBREAK, EH_SETBREAK, and EH_SUBBREAK services.
  1859.  
  1860. Service : EH_INITCRIT
  1861.  
  1862. Module  : Exception Handling Services
  1863.  
  1864. Compat  : DOS
  1865.  
  1866. Purpose : Initializes the critical error handler
  1867.  
  1868. Parms:
  1869.    none
  1870.  
  1871. Description:
  1872.  
  1873. The EH_INITCRIT service initializes and installs a critical
  1874. error handler. This allows your programs to recover from
  1875. problems that would normally cause DOS to display the infamous
  1876. "A>bort, R>etry, I>gnore" prompt.
  1877.  
  1878. When a critical error occurs, the error handler installed by
  1879. EH_INITCRIT makes a note of what kind of error it was, then
  1880. tells DOS to ignore the error. Your program is expected to check
  1881. for critical errors using the EH_CRITERR service.
  1882.  
  1883. Note that DOS will not allow certain errors to be ignored. In
  1884. that case, DOS will act as if a Control-Break had been entered.
  1885. The break handling services can catch such conditions. See
  1886. EH_INITBREAK for more information.
  1887.  
  1888. See also the EH_CRITERR and EH_CRITDONE services.
  1889.  
  1890. Service : EH_SETBREAK
  1891.  
  1892. Module  : Exception Handling Services
  1893.  
  1894. Compat  : DOS
  1895.  
  1896. Purpose : Allows you to turn ^Break / ^C on or off
  1897.  
  1898. Parms:
  1899.       AL   <-- 0 to turn breaks off, 1 to turn them on
  1900.  
  1901. Description:
  1902.  
  1903. The EH_SETBREAK service allows you to turn ^Break / ^C on or
  1904. off. If you turn breaks off, there will be no effect on your
  1905. program if these keys are pressed. If you turn them on, pressing
  1906. these keys will cause your program to be terminated after it
  1907. calls any procedures specified by EH_ADDBREAK.
  1908.  
  1909. Whether breaks are on or off, there is one minor effect that a
  1910. break key will have which can't be prevented: "^C" with a
  1911. carriage return and linefeed will be displayed. That seems to be
  1912. controlled by the BIOS, rather than DOS, and I haven't yet found
  1913. a way around it. I'll be working on it, though.
  1914.  
  1915. If you use EH_SETBREAK, don't forget to initialize the break
  1916. handler by calling EH_INITBREAK at the start of your program!
  1917.  
  1918. Service : EH_SUBBREAK
  1919.  
  1920. Module  : Exception Handling Services
  1921.  
  1922. Compat  : DOS
  1923.  
  1924. Purpose : Removes a procedure from the list to be called
  1925.           on ^C or ^Break
  1926.  
  1927. Parms:
  1928.       DX   <-- offset of procedure (from CS:)
  1929.    -------
  1930.       Flags = CY if the procedure was not in the list
  1931.               NC if the procedure was removed
  1932.  
  1933. Description:
  1934.  
  1935. The EH_SUBBREAK service removes a procedure to the list of
  1936. procedures to be called if Control-C or Control-Break is
  1937. pressed. This reverses the effect of the EH_ADDBREAK service.
  1938.  
  1939. Service : FI_COMPLETE
  1940.  
  1941. Module  : Filename Manipulation Services
  1942.  
  1943. Compat  : DOS
  1944.  
  1945. Purpose : Completes a filespec
  1946.  
  1947. Parms:
  1948.    DS:SI <-- ptr to filespec
  1949.    DS:BX <-- ptr to default extension (1-3 bytes)
  1950.    ES:DI <-- ptr to result buffer (80 bytes minimum)
  1951.    -------
  1952.       flags: CY = the filespec is not valid
  1953.  
  1954. Description:
  1955.  
  1956. The FI_COMPLETE service completes a file specification. If no
  1957. drive was specified, the current drive will be inserted. The
  1958. directory specification will be converted to an absolute path,
  1959. with "." and ".." references also resolved. If there is no
  1960. filename, "*.*" will be used. If there is a filename without an
  1961. extension, the specified default extension will be added.
  1962.  
  1963. Note that this service translates filespecs almost, but not
  1964. quite, the same as DOS would. The final part of a filespec is
  1965. assumed to be a filename unless it ends in "\". This means that
  1966. something like "C:\BIN" will be translated to "C:\BIN." (if the
  1967. default extension is null). If you want to specify a directory
  1968. named BIN, you would use the form "C:\BIN\", which would be
  1969. translated to "C:\BIN\*.*". This may seem like a bit of an
  1970. inconvenience, but it removes a dangerous ambiguity from file
  1971. specification.
  1972.  
  1973. This service does not check to see if the drive or directory
  1974. specified is valid. It does check to make sure that the
  1975. specification is valid and will trim over-long file or directory
  1976. names appropriately. Unlike DOS, directory specifications are
  1977. not allowed to contain extensions, but few people use that
  1978. capability in any event. I'll see about adding it to a future
  1979. version, however.
  1980.  
  1981. Service : FI_MATCH      (formerly MI_MATCHFILE)
  1982.  
  1983. Module  : Filename Manipulation Services
  1984.  
  1985. Compat  : Any
  1986.  
  1987. Purpose : Determines whether file name matches a given pattern
  1988.  
  1989. Parms:
  1990.    DS:SI <-- ptr to pattern (which may contain wildcards)
  1991.    ES:DI <-- ptr to filename (may not contain drive or path)
  1992.    -------
  1993.       flags: ZF = the filename matches the pattern
  1994.              NZ = the filename does not match the pattern
  1995.  
  1996. Description:
  1997.  
  1998. The FI_MATCH service compares a filename with a specified
  1999. pattern. The pattern may contain the "*" or "?" wildcards. This
  2000. pattern-matching service works just the way DOS does. It can be
  2001. used for finding a desired set of matches within a list of known
  2002. files, for excluding an unwanted set of files from a directory
  2003. list, and so forth.
  2004.  
  2005. The DOS "DEL" command is used as a basis for this matcher. Thus,
  2006. using "*" as a pattern is equivalent to using "*.", not "*.*" as
  2007. "DIR" would interpret the pattern. The matcher uses the more
  2008. conservative algorithm in an attempt to avoid excessive
  2009. broadness in its matches. If you prefer otherwise, simply have
  2010. your program replace the "*" pattern with "*.*" before calling
  2011. this service.
  2012.  
  2013. Service : FI_PATTERN
  2014.  
  2015. Module  : Filename Manipulation Services
  2016.  
  2017. Compat  : Any
  2018.  
  2019. Purpose : Pushes a filename through a pattern specification
  2020.  
  2021. Parms:
  2022.    DS:SI <-- pointer to filename
  2023.    DS:BX <-- pointer to pattern
  2024.    ES:DI <-- pointer to new filename (13 bytes minimum)
  2025.    -------
  2026.    Flags = CY for some errors
  2027.  
  2028. Description:
  2029.  
  2030. The FI_PATTERN service pushes a filename through a specified
  2031. pattern. This would be used for creating a replacement for the
  2032. COPY command, for example. If you entered a filename of
  2033. "EXAMPLE.ASM" and a pattern of "*.BAK", for instance, the result
  2034. would be "EXAMPLE.BAK".
  2035.  
  2036. This service expects filenames without drive or directory
  2037. specifications. Wildcards are allowed in the pattern, but not in
  2038. the filename. The carry flag will be set on return if the
  2039. filename or pattern were malformed (basically, just if they were
  2040. over 8 chars + "." + 3 chars).
  2041.  
  2042. Service : FI_SPLIT
  2043.  
  2044. Module  : Filename Manipulation Services
  2045.  
  2046. Compat  : Any
  2047.  
  2048. Purpose : Split a path spec into drive, directory, filename
  2049.  
  2050. Parms:
  2051.    DS:SI <-- pointer to path specification
  2052.    ES:DI <-- pointer to result buffer (minimum 80 bytes)
  2053.  
  2054. Description:
  2055.  
  2056. The FI_SPLIT service takes a path specification apart into its
  2057. components. Although a full path spec is not required, it is
  2058. probably a good idea to make sure that the spec is reasonable
  2059. beforehand, as wildly erroneous path specs may cause the results
  2060. to overflow your result buffer.
  2061.  
  2062. The results are stored as a series of ASCIIZ strings. The drive
  2063. will be at offset 0, the directory at offset 2, and the filename
  2064. at offset 67. As you might guess, then, the drive is up to one
  2065. character (plus nul), the directory is up to 64 chars (plus
  2066. nul), and the filename is up to 12 chars (plus nul).
  2067.  
  2068. Service : G13_BOX
  2069.  
  2070. Module  : Graphics Services
  2071.  
  2072. Compat  : Clone
  2073.  
  2074. Purpose : Draws a box
  2075.  
  2076. Parms:
  2077.       CX <-- left X coordinate    (0-319)
  2078.       DX <-- top Y coordinate     (0-199)
  2079.       SI <-- right X coordinate   (0-319)
  2080.       DI <-- bottom Y coordinate  (0-199)
  2081.       AH <-- whether to fill box  (0 no, 1 yes)
  2082.       AL <-- color                (0-255)
  2083.  
  2084. Description:
  2085.  
  2086. The G13_BOX service displays a box on the screen. The screen
  2087. must be in mode 13h (VGA 320x200).
  2088.  
  2089. Service : G13_LINE
  2090.  
  2091. Module  : Graphics Services
  2092.  
  2093. Compat  : Clone
  2094.  
  2095. Purpose : Draws a line
  2096.  
  2097. Parms:
  2098.       CX <-- starting X coordinate  (0-319)
  2099.       DX <-- starting Y coordinate  (0-199)
  2100.       SI <-- ending X coordinate    (0-319)
  2101.       DI <-- ending Y coordinate    (0-199)
  2102.       AL <-- color                  (0-255)
  2103.  
  2104. Description:
  2105.  
  2106. The G13_LINE service displays a line on the screen. The screen
  2107. must be in mode 13h (VGA 320x200).
  2108.  
  2109. Drawing diagonal lines is a bit slow and will be optimized in a
  2110. future release. Vertical and horizontal line drawing is
  2111. extremely fast, however. For this mode, horizontal lines are
  2112. drawn the fastest.
  2113.  
  2114.  
  2115.  
  2116.  
  2117. Service : G13_PLOT
  2118.  
  2119. Module  : Graphics Services
  2120.  
  2121. Compat  : Clone
  2122.  
  2123. Purpose : Sets the color of a point
  2124.  
  2125. Parms:
  2126.       CX <-- X coordinate (0-319)
  2127.       DX <-- Y coordinate (0-199)
  2128.       AL <-- color (0-255)
  2129.  
  2130. Description:
  2131.  
  2132. The G13_PLOT service sets the current color of a specified
  2133. point. The screen must be in mode 13h (VGA 320x200).
  2134.  
  2135. Service : G4_BOX
  2136.  
  2137. Module  : Graphics Services
  2138.  
  2139. Compat  : Clone
  2140.  
  2141. Purpose : Draws a box
  2142.  
  2143. Parms:
  2144.       CX <-- left X coordinate    (0-319)
  2145.       DX <-- top Y coordinate     (0-199)
  2146.       SI <-- right X coordinate   (0-319)
  2147.       DI <-- bottom Y coordinate  (0-199)
  2148.       AH <-- whether to fill box  (0 no, 1 yes)
  2149.       AL <-- color                (0-3)
  2150.  
  2151. Description:
  2152.  
  2153. The G4_BOX service displays a box on the screen. The screen must
  2154. be in Mode 4 or 5 (CGA 320x200).
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160. Service : G4_GETPEL
  2161.  
  2162. Module  : Graphics Services
  2163.  
  2164. Compat  : Clone
  2165.  
  2166. Purpose : Gets the current color of a point
  2167.  
  2168. Parms:
  2169.       CX <-- X coordinate (0-319)
  2170.       DX <-- Y coordinate (0-199)
  2171.    -------
  2172.       AL = color (0-3)
  2173.  
  2174. Description:
  2175.  
  2176. The G4_GETPEL service gets the current color of a specified
  2177. point. The screen must be in Mode 4 or 5 (CGA 320x200). Why
  2178. "pel"? Graphics points are also known as pixels or pels.
  2179.  
  2180. Service : G4_LINE
  2181.  
  2182. Module  : Graphics Services
  2183.  
  2184. Compat  : Clone
  2185.  
  2186. Purpose : Draws a line
  2187.  
  2188. Parms:
  2189.       CX <-- starting X coordinate  (0-319)
  2190.       DX <-- starting Y coordinate  (0-199)
  2191.       SI <-- ending X coordinate    (0-319)
  2192.       DI <-- ending Y coordinate    (0-199)
  2193.       AL <-- color                  (0-3)
  2194.  
  2195. Description:
  2196.  
  2197. The G4_LINE service displays a line on the screen. The screen
  2198. must be in Mode 4 or 5 (CGA 320x200).
  2199.  
  2200. Drawing diagonal lines is a bit slow and will be optimized in a
  2201. future release. Vertical and horizontal line drawing is
  2202. extremely fast, however. For the CGA, horizontal line drawing is
  2203. the fastest.
  2204.  
  2205.  
  2206.  
  2207.  
  2208. Service : G4_PLOT
  2209.  
  2210. Module  : Graphics Services
  2211.  
  2212. Compat  : Clone
  2213.  
  2214. Purpose : Sets the color of a point
  2215.  
  2216. Parms:
  2217.       CX <-- X coordinate (0-319)
  2218.       DX <-- Y coordinate (0-199)
  2219.       AL <-- color (0-3)
  2220.  
  2221. Description:
  2222.  
  2223. The G4_PLOT service sets the current color of a specified point.
  2224. The screen must be in Mode 4 or 5 (CGA 320x200).
  2225.  
  2226. Service : G6_BOX
  2227.  
  2228. Module  : Graphics Services
  2229.  
  2230. Compat  : Clone
  2231.  
  2232. Purpose : Draws a box
  2233.  
  2234. Parms:
  2235.       CX <-- left X coordinate    (0-639)
  2236.       DX <-- top Y coordinate     (0-199)
  2237.       SI <-- right X coordinate   (0-639)
  2238.       DI <-- bottom Y coordinate  (0-199)
  2239.       AH <-- whether to fill box  (0 no, 1 yes)
  2240.       AL <-- color                (0-1)
  2241.  
  2242. Description:
  2243.  
  2244. The G6_BOX service displays a box on the screen. The screen must
  2245. be in Mode 6 (CGA 640x200).
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251. Service : G6_GETPEL
  2252.  
  2253. Module  : Graphics Services
  2254.  
  2255. Compat  : Clone
  2256.  
  2257. Purpose : Gets the current color of a point
  2258.  
  2259. Parms:
  2260.       CX <-- X coordinate (0-639)
  2261.       DX <-- Y coordinate (0-199)
  2262.    -------
  2263.       AL = color (0-1)
  2264.  
  2265. Description:
  2266.  
  2267. The G6_GETPEL service gets the current color of a specified
  2268. point. The screen must be in Mode 6 (CGA 640x200). Why "pel"?
  2269. Graphics points are also known as pixels or pels.
  2270.  
  2271. Service : G6_LINE
  2272.  
  2273. Module  : Graphics Services
  2274.  
  2275. Compat  : Clone
  2276.  
  2277. Purpose : Draws a line
  2278.  
  2279. Parms:
  2280.       CX <-- starting X coordinate  (0-639)
  2281.       DX <-- starting Y coordinate  (0-199)
  2282.       SI <-- ending X coordinate    (0-639)
  2283.       DI <-- ending Y coordinate    (0-199)
  2284.       AL <-- color                  (0-1)
  2285.  
  2286. Description:
  2287.  
  2288. The G6_LINE service displays a line on the screen. The screen
  2289. must be in Mode 6 (CGA 640x200).
  2290.  
  2291. Drawing diagonal lines is a bit slow and will be optimized in a
  2292. future release. Vertical and horizontal line drawing is
  2293. extremely fast, however. For the CGA, horizontal line drawing is
  2294. the fastest.
  2295.  
  2296.  
  2297.  
  2298.  
  2299. Service : G6_PLOT
  2300.  
  2301. Module  : Graphics Services
  2302.  
  2303. Compat  : Clone
  2304.  
  2305. Purpose : Sets the color of a point
  2306.  
  2307. Parms:
  2308.       CX <-- X coordinate (0-639)
  2309.       DX <-- Y coordinate (0-199)
  2310.       AL <-- color (0-1)
  2311.  
  2312. Description:
  2313.  
  2314. The G6_PLOT service sets the current color of a specified point.
  2315. The screen must be in Mode 6 (CGA 640x200).
  2316.  
  2317. Service : GD_BOX
  2318.  
  2319. Module  : Graphics Services
  2320.  
  2321. Compat  : Clone
  2322.  
  2323. Purpose : Draws a box
  2324.  
  2325. Parms:
  2326.       CX <-- left X coordinate    (0-319)
  2327.       DX <-- top Y coordinate     (0-199)
  2328.       SI <-- right X coordinate   (0-319)
  2329.       DI <-- bottom Y coordinate  (0-199)
  2330.       AH <-- whether to fill box  (0 no, 1 yes)
  2331.       AL <-- color                (0-15)
  2332.  
  2333. Description:
  2334.  
  2335. The GD_BOX service displays a box on the screen. The screen must
  2336. be in Mode 0Dh (EGA 320x200).
  2337.  
  2338. Service : GD_LINE
  2339.  
  2340. Module  : Graphics Services
  2341.  
  2342. Compat  : Clone
  2343.  
  2344. Purpose : Draws a line
  2345.  
  2346. Parms:
  2347.       CX <-- starting X coordinate  (0-319)
  2348.       DX <-- starting Y coordinate  (0-199)
  2349.       SI <-- ending X coordinate    (0-319)
  2350.       DI <-- ending Y coordinate    (0-199)
  2351.       AL <-- color                  (0-15)
  2352.  
  2353. Description:
  2354.  
  2355. The GD_LINE service displays a line on the screen. The screen
  2356. must be in Mode 0Dh (EGA 320x200).
  2357.  
  2358. Drawing diagonal lines is a bit slow and will be optimized in a
  2359. future release. Vertical and horizontal line drawing is
  2360. extremely fast, however. For the EGA, vertical line drawing is
  2361. the fastest.
  2362.  
  2363.  
  2364.  
  2365.  
  2366. Service : GD_PLOT
  2367.  
  2368. Module  : Graphics Services
  2369.  
  2370. Compat  : Clone
  2371.  
  2372. Purpose : Sets the color of a point
  2373.  
  2374. Parms:
  2375.       CX <-- X coordinate (0-319)
  2376.       DX <-- Y coordinate (0-199)
  2377.       AL <-- color (0-15)
  2378.  
  2379. Description:
  2380.  
  2381. The GD_PLOT service sets the current color of a specified point.
  2382. The screen must be in Mode 0Dh (EGA 320x200).
  2383.  
  2384. Service : GE_BOX
  2385.  
  2386. Module  : Graphics Services
  2387.  
  2388. Compat  : Clone
  2389.  
  2390. Purpose : Draws a box
  2391.  
  2392. Parms:
  2393.       CX <-- left X coordinate    (0-639)
  2394.       DX <-- top Y coordinate     (0-199/349/479)
  2395.       SI <-- right X coordinate   (0-639)
  2396.       DI <-- bottom Y coordinate  (0-199/349/479)
  2397.       AH <-- whether to fill box  (0 no, 1 yes)
  2398.       AL <-- color                (0-1/15)
  2399.  
  2400. Description:
  2401.  
  2402. The GE_BOX service displays a box on the screen. The screen must
  2403. be in one of the following modes:
  2404.  
  2405.    0Eh   EGA 640x200   16 colors
  2406.    10h   EGA 640x350   16 colors
  2407.    11h   VGA 640x480    2 colors
  2408.    12h   VGA 640x480   16 colors
  2409.  
  2410. Service : GE_LINE
  2411.  
  2412. Module  : Graphics Services
  2413.  
  2414. Compat  : Clone
  2415.  
  2416. Purpose : Draws a line
  2417.  
  2418. Parms:
  2419.       CX <-- starting X coordinate  (0-639)
  2420.       DX <-- starting Y coordinate  (0-199/349/479)
  2421.       SI <-- ending X coordinate    (0-639)
  2422.       DI <-- ending Y coordinate    (0-199/349/479)
  2423.       AL <-- color                  (0-1/15)
  2424.  
  2425. Description:
  2426.  
  2427. The GE_LINE service displays a line on the screen. The screen
  2428. must be in one of the following modes:
  2429.  
  2430.    0Eh   EGA 640x200   16 colors
  2431.    10h   EGA 640x350   16 colors
  2432.    11h   VGA 640x480    2 colors
  2433.    12h   VGA 640x480   16 colors
  2434.  
  2435. Drawing diagonal lines is a bit slow and will be optimized in a
  2436. future release. Vertical and horizontal line drawing is
  2437. extremely fast, however. For the EGA and VGA, vertical line
  2438. drawing is the fastest.
  2439.  
  2440.  
  2441.  
  2442.  
  2443. Service : GE_PLOT
  2444.  
  2445. Module  : Graphics Services
  2446.  
  2447. Compat  : Clone
  2448.  
  2449. Purpose : Sets the color of a point
  2450.  
  2451. Parms:
  2452.       CX <-- X coordinate (0-639)
  2453.       DX <-- Y coordinate (0-199/349/479)
  2454.       AL <-- color (0-1/15)
  2455.  
  2456. Description:
  2457.  
  2458. The GE_PLOT service sets the current color of a specified point.
  2459. The screen must be in one of the following modes:
  2460.  
  2461.    0Eh   EGA 640x200   16 colors
  2462.    10h   EGA 640x350   16 colors
  2463.    11h   VGA 640x480    2 colors
  2464.    12h   VGA 640x480   16 colors
  2465.  
  2466. Service : GH_BOX
  2467.  
  2468. Module  : Graphics Services
  2469.  
  2470. Compat  : Clone
  2471.  
  2472. Purpose : Draws a box
  2473.  
  2474. Parms:
  2475.       CX <-- left X coordinate    (0-719)
  2476.       DX <-- top Y coordinate     (0-347)
  2477.       SI <-- right X coordinate   (0-719)
  2478.       DI <-- bottom Y coordinate  (0-347)
  2479.       AH <-- whether to fill box  (0 no, 1 yes)
  2480.       AL <-- color                (0-1)
  2481.  
  2482. Description:
  2483.  
  2484. The GH_BOX service displays a box on the screen. The screen must
  2485. be in Hercules graphics mode. It is not actually important that
  2486. the upper left corner and lower right corner of the box be
  2487. specified in that order.
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493. Service : GH_GETPEL
  2494.  
  2495. Module  : Graphics Services
  2496.  
  2497. Compat  : Clone
  2498.  
  2499. Purpose : Gets the current color of a point
  2500.  
  2501. Parms:
  2502.       CX <-- X coordinate (0-719)
  2503.       DX <-- Y coordinate (0-347)
  2504.    -------
  2505.       AL = color (0-1)
  2506.  
  2507. Description:
  2508.  
  2509. The GH_GETPEL service gets the current color of a specified
  2510. point. The screen must be in Hercules graphics mode. Why "pel"?
  2511. Graphics points are also known as pixels or pels.
  2512.  
  2513. Service : GH_LINE
  2514.  
  2515. Module  : Graphics Services
  2516.  
  2517. Compat  : Clone
  2518.  
  2519. Purpose : Draws a line
  2520.  
  2521. Parms:
  2522.       CX <-- starting X coordinate  (0-719)
  2523.       DX <-- starting Y coordinate  (0-347)
  2524.       SI <-- ending X coordinate    (0-719)
  2525.       DI <-- ending Y coordinate    (0-347)
  2526.       AL <-- color                  (0-1)
  2527.  
  2528. Description:
  2529.  
  2530. The GH_LINE service displays a line on the screen. The screen
  2531. must be in Hercules graphics mode.
  2532.  
  2533. Drawing diagonal lines is a bit slow and will be optimized in a
  2534. future release. Vertical and horizontal line drawing is
  2535. extremely fast, however.
  2536.  
  2537.  
  2538.  
  2539.  
  2540. Service : GH_PLOT
  2541.  
  2542. Module  : Graphics Services
  2543.  
  2544. Compat  : Clone
  2545.  
  2546. Purpose : Sets the color of a point
  2547.  
  2548. Parms:
  2549.       CX <-- X coordinate (0-719)
  2550.       DX <-- Y coordinate (0-347)
  2551.       AL <-- color (0-1)
  2552.  
  2553. Description:
  2554.  
  2555. The GH_PLOT service sets the current color of a specified point.
  2556. The screen must be in Hercules graphics mode.
  2557.  
  2558. Service : HG_CHROUT
  2559.  
  2560. Module  : Hercules Graphics Services
  2561.  
  2562. Compat  : Clone
  2563.  
  2564. Purpose : Displays a character on the screen
  2565.  
  2566. Parms:
  2567.       AL <-- character to display
  2568.  
  2569. Description:
  2570.  
  2571. The HG_CHROUT routine displays a character on the screen. The
  2572. screen must be in Hercules graphics mode.
  2573.  
  2574. The following control codes are interpreted:
  2575.    7      Bell             beep
  2576.    8      Backspace        non-destructive backspace
  2577.    9      Tab              space over to the next tab stop
  2578.   10      Linefeed         move cursor down one line
  2579.   12      Formfeed         clear screen and home cursor
  2580.   13      Carriage Return  home cursor on current line
  2581.  
  2582. Redirection, if any, is ignored.
  2583.  
  2584.  
  2585.  
  2586.  
  2587. Service : HG_CLEOLN
  2588.  
  2589. Module  : Hercules Graphics Services
  2590.  
  2591. Compat  : Clone
  2592.  
  2593. Purpose : Clears to the end of the line
  2594.  
  2595. Parms:
  2596.    none
  2597.  
  2598. Description:
  2599.  
  2600. The HG_CLEOLN service clears from the current cursor position to
  2601. the end of the current screen line, inclusive. The screen must
  2602. be in Hercules graphics mode.
  2603.  
  2604. Redirection, if any, is ignored.
  2605.  
  2606. Service : HG_CLS
  2607.  
  2608. Module  : Hercules Graphics Services
  2609.  
  2610. Compat  : Clone
  2611.  
  2612. Purpose : Clears the screen
  2613.  
  2614. Parms:
  2615.    none
  2616.  
  2617. Description:
  2618.  
  2619. The HG_CLS service clears the screen and homes the cursor to the
  2620. upper left corner. The screen must be in Hercules graphics mode.
  2621.  
  2622. Redirection, if any, is ignored.
  2623.  
  2624.  
  2625.  
  2626.  
  2627. Service : HG_COLOR
  2628.  
  2629. Module  : Hercules Graphics Services
  2630.  
  2631. Compat  : Clone
  2632.  
  2633. Purpose : Sets the default text color
  2634.  
  2635. Parms:
  2636.       AL <-- default color
  2637.  
  2638. Description:
  2639.  
  2640. The HG_COLOR service sets the default text color. The background
  2641. is in the high nybble and the foreground in the low nybble.
  2642. Colors may be 0 (black) or 1 (white), giving the following
  2643. possibilities:
  2644.  
  2645.   Fore   Back    Color in AL
  2646.   -----  -----   -----------
  2647.   black  black       00h
  2648.   black  white       10h     (reverse video)
  2649.   white  black       01h     (normal video)
  2650.   white  white       11h
  2651.  
  2652.  
  2653. Redirection, if any, is ignored.
  2654.  
  2655. Service : HG_CRLF
  2656.  
  2657. Module  : Hercules Graphics Services
  2658.  
  2659. Compat  : Clone
  2660.  
  2661. Purpose : Displays a <CR><LF> (carriage return and linefeed)
  2662.  
  2663. Parms:
  2664.    none
  2665.  
  2666. Description:
  2667.  
  2668. The HG_CRLF routine displays a carriage return and linefeed on
  2669. the screen. The screen must be in Hercules graphics mode.
  2670.  
  2671. Redirection, if any, is ignored.
  2672.  
  2673.  
  2674.  
  2675.  
  2676. Service : HG_GETCOLOR
  2677.  
  2678. Module  : Hercules Graphics Services
  2679.  
  2680. Compat  : Clone
  2681.  
  2682. Purpose : Gets the default text color
  2683.  
  2684. Parms:
  2685.    -------
  2686.       AL = default color
  2687.  
  2688. Description:
  2689.  
  2690. The HG_GETCOLOR service gets the default text color. The
  2691. background is in the high nybble and the foreground in the low
  2692. nybble. Colors may be 0 (black) or 1 (white), giving the
  2693. following possibilities:
  2694.  
  2695.   Fore   Back    Color in AL
  2696.   -----  -----   -----------
  2697.   black  black       00h
  2698.   black  white       10h     (reverse video)
  2699.   white  black       01h     (normal video)
  2700.   white  white       11h
  2701.  
  2702.  
  2703. Redirection, if any, is ignored.
  2704.  
  2705. Service : HG_LOCATE
  2706.  
  2707. Module  : Hercules Graphics Services
  2708.  
  2709. Compat  : Clone
  2710.  
  2711. Purpose : Sets the cursor position
  2712.  
  2713. Parms:
  2714.       DH <-- row (1-43)
  2715.       DL <-- column (1-90)
  2716.  
  2717. Description:
  2718.  
  2719. The HG_LOCATE service sets the cursor position. The screen must
  2720. be in Hercules graphics mode.
  2721.  
  2722. Redirection, if any, is ignored.
  2723.  
  2724. Service : HG_MODE
  2725.  
  2726. Module  : Hercules Graphics Services
  2727.  
  2728. Compat  : Clone
  2729.  
  2730. Purpose : Sets the screen mode
  2731.  
  2732. Parms:
  2733.       AL <-- screen mode (0-1)
  2734.  
  2735. Description:
  2736.  
  2737. The HG_MODE service sets the screen mode. Since the Hercules
  2738. graphics mode is not assigned a BIOS mode number, I've set up an
  2739. arbitrary system. The mode may be either:
  2740.  
  2741.      Mode   Resolu.       Use       Notes
  2742.  
  2743.        0     80x25       text     same as BIOS mode 7: normal MDA
  2744.        1     90x43     graphics   this is a 720x348 graphics mode
  2745.  
  2746. The HG services are designed for use in Hercules graphics mode.
  2747. When in text mode, the Hercules operates like an ordinary MDA,
  2748. so you should use the MV, BV, or DV services instead.
  2749.  
  2750. Redirection, if any, is ignored.
  2751.  
  2752.  
  2753.  
  2754.  
  2755. Service : HG_STROUT
  2756.  
  2757. Module  : Hercules Graphics Services
  2758.  
  2759. Compat  : Clone
  2760.  
  2761. Purpose : Displays a string on the screen
  2762.  
  2763. Parms:
  2764.    DS:DX <-- ptr to the string to display
  2765.  
  2766. Description:
  2767.  
  2768. The HG_STROUT routine displays a string on the screen. The
  2769. string must be in ASCIIZ (NUL terminated) format. The screen
  2770. must be in Hercules graphics mode.
  2771.  
  2772. The following control codes are interpreted:
  2773.    7      Bell             beep
  2774.    8      Backspace        non-destructive backspace
  2775.    9      Tab              space over to the next tab stop
  2776.   10      Linefeed         move cursor down one line
  2777.   12      Formfeed         clear screen and home cursor
  2778.   13      Carriage Return  home cursor on current line
  2779.  
  2780. Redirection, if any, is ignored.
  2781.  
  2782. Service : HG_WHERE
  2783.  
  2784. Module  : Hercules Graphics Services
  2785.  
  2786. Compat  : Clone
  2787.  
  2788. Purpose : Gets the cursor position
  2789.  
  2790. Parms:
  2791.    -------
  2792.       DH = row (1-43)
  2793.       DL = column (1-90)
  2794.  
  2795. Description:
  2796.  
  2797. The HG_WHERE service gets the cursor position. The screen must
  2798. be in Hercules graphics mode.
  2799.  
  2800. Redirection, if any, is ignored.
  2801.  
  2802. Service : MA_ADD32
  2803.  
  2804. Module  : Math (32-bit) Services
  2805.  
  2806. Compat  : Any
  2807.  
  2808. Purpose : Adds two unsigned long integers
  2809.  
  2810. Parms:
  2811.    DS:SI   <-- first operand
  2812.    DS:SI+4 <-- second operand
  2813.    -------
  2814.    DS:SI+8 = result
  2815.  
  2816. Description:
  2817.  
  2818. The MA_ADD32 routine adds two unsigned long integers, giving a
  2819. result of the same type. Since such numbers are rather bulky,
  2820. they are passed through a buffer rather than through registers.
  2821. The numbers in the buffer are stored in normal Intel format,
  2822. least significant word to most significant word. The buffer
  2823. should look something like this:
  2824.  
  2825.    FIRST32   dd ?
  2826.    SECOND32  dd ?
  2827.    RESULT32  dd ?
  2828.  
  2829. Service : MA_DIV32
  2830.  
  2831. Module  : Math (32-bit) Services
  2832.  
  2833. Compat  : Any
  2834.  
  2835. Purpose : Divides an unsigned very long integer by a long int
  2836.  
  2837. Parms:
  2838.    DS:SI   <-- dividend (64 bits: high bit must be zero)
  2839.    DS:SI+8 <-- divisor (unsigned long integer)
  2840.    -------
  2841.    DS:SI+12 = quotient (unsigned long integer)
  2842.    DS:SI+16 = remainder (unsigned long integer)
  2843.  
  2844. Description:
  2845.  
  2846. The MA_DIV32 routine divides an unsigned 63-bit integer by an
  2847. unsigned long integer, giving a quotient and remainder.
  2848.  
  2849. Since the numbers are rather bulky, they are passed through a
  2850. buffer rather than through registers. The numbers in the buffer
  2851. are stored in normal Intel format, least significant word to
  2852. most significant word. The buffer should look something like
  2853. this:
  2854.  
  2855.    FIRST64   dq ?
  2856.    SECOND32  dd ?
  2857.    RESULT32  dd ?
  2858.    REMAIN32  dd ?
  2859.  
  2860. Note that since this service uses unsigned numbers, it is
  2861. possible to use it to divide a 32-bit quantity by another 32-bit
  2862. quantity, giving a 32-bit result. In that case, just convert the
  2863. 32-bit dividend to 64 bits by making the upper 32 bits zero. The
  2864. BC_LONG2ASC service uses this approach in the course of its
  2865. work.
  2866.  
  2867. Service : MA_MUL32
  2868.  
  2869. Module  : Math (32-bit) Services
  2870.  
  2871. Compat  : Any
  2872.  
  2873. Purpose : Multiplies two unsigned long integers
  2874.  
  2875. Parms:
  2876.    DS:SI   <-- first operand
  2877.    DS:SI+4 <-- second operand
  2878.    -------
  2879.    DS:SI+8 = result (64 bits)
  2880.  
  2881. Description:
  2882.  
  2883. The MA_MUL32 routine multiplies two unsigned long integers,
  2884. giving a result of a type that might be called an unsigned very
  2885. long integer (64 bits). Since such numbers are rather bulky,
  2886. they are passed through a buffer rather than through registers.
  2887. The numbers in the buffer are stored in normal Intel format,
  2888. least significant word to most significant word. The buffer
  2889. should look something like this:
  2890.  
  2891.    FIRST32   dd ?
  2892.    SECOND32  dd ?
  2893.    RESULT64  dq ?
  2894.  
  2895. Note that since this service uses unsigned numbers, it is
  2896. possible to use it to multiply a 32-bit quantity by a 16-bit
  2897. quantity, giving (maybe) a 32-bit result. In that case, just
  2898. convert the 16-bit quantity to 32 bits by making the upper 16
  2899. bits zero; if the next-to-highest word of the result is nonzero,
  2900. there was an overflow, and the result did not fit into 32 bits.
  2901.  
  2902. Service : MA_SUB32
  2903.  
  2904. Module  : Math (32-bit) Services
  2905.  
  2906. Compat  : Any
  2907.  
  2908. Purpose : Subtracts one unsigned long integer from another
  2909.  
  2910. Parms:
  2911.    DS:SI   <-- first operand
  2912.    DS:SI+4 <-- second operand
  2913.    -------
  2914.    DS:SI+8 = result
  2915.  
  2916. Description:
  2917.  
  2918. The MA_SUB32 routine subtracts one unsigned long integer from
  2919. another, giving a result of the same type. Since such numbers
  2920. are rather bulky, they are passed through a buffer rather than
  2921. through registers. The numbers in the buffer are stored in
  2922. normal Intel format, least significant word to most significant
  2923. word. The buffer should look something like this:
  2924.  
  2925.    FIRST32   dd ?
  2926.    SECOND32  dd ?
  2927.    RESULT32  dd ?
  2928.  
  2929. Service : MD_DELAY
  2930.  
  2931. Module  : Delay Services
  2932.  
  2933. Compat  : Clone
  2934.  
  2935. Purpose : Delays for a number of 100ths of seconds
  2936.  
  2937. Parms:
  2938.       CX <-- delay (0-32767)
  2939.  
  2940. Description:
  2941.  
  2942. The MD_DELAY service waits for a specified number of clock
  2943. ticks. This is based on the timer system initialized by the
  2944. MD_INIT service. Timer #0 is used by MD_DELAY, so you should
  2945. avoid Timer #0 if you use MD_DELAY. Timer #1 will probably be
  2946. reserved for music in the future, so avoid it if you expect to
  2947. add sound effects to your program.
  2948.  
  2949. If you use the 100th-second time services, it is vital that you
  2950. initialize them with MD_INIT (at the start of your program) and
  2951. terminate them with MD_DONE (at the end of your program).
  2952.  
  2953. Since the system clock is maintained via the interrupt system,
  2954. interrupts will be enabled for the duration of this service, to
  2955. avoid an infinite delay.
  2956.  
  2957. This service has been designed to accommodate multitaskers. If
  2958. another task is in operation, the delay may be a trifle longer
  2959. than expected, however.
  2960.  
  2961.  
  2962.  
  2963.  
  2964. Service : MD_DONE
  2965.  
  2966. Module  : Delay Services
  2967.  
  2968. Compat  : Clone
  2969.  
  2970. Purpose : Terminates the 100th-second timer handler
  2971.  
  2972. Parms:
  2973.    none
  2974.  
  2975. Description:
  2976.  
  2977. The MD_DONE service terminates the 100th-second timer handler.
  2978. The original timer interrupt is restored and the system clock is
  2979. reset to 18.2 cycles per second, which is presumed to have been
  2980. the original speed.
  2981.  
  2982. If you use the 100th-second time services, it is vital that you
  2983. initialize them with MD_INIT (at the start of your program) and
  2984. terminate them with MD_DONE (at the end of your program).
  2985.  
  2986. Service : MD_GETTIMER
  2987.  
  2988. Module  : Delay Services
  2989.  
  2990. Compat  : Clone
  2991.  
  2992. Purpose : Gets one of the 100th-second countdown timers
  2993.  
  2994. Parms:
  2995.       AL <-- timer number (0-7)
  2996.    -------
  2997.       CX = time count (0-65,534)
  2998.  
  2999. Description:
  3000.  
  3001. The MD_GETTIMER service gets the time remaining from one of the
  3002. 100th-second countdown timers. The time returned will be in
  3003. 200ths of seconds. It is expected that you will normally just
  3004. compare the result with zero to see if the countdown time has
  3005. elapsed. See the MD_SETTIMER service for details.
  3006.  
  3007. If you use the 100th-second time services, it is vital that you
  3008. initialize them with MD_INIT (at the start of your program) and
  3009. terminate them with MD_DONE (at the end of your program).
  3010.  
  3011.  
  3012.  
  3013.  
  3014. Service : MD_INIT
  3015.  
  3016. Module  : Delay Services
  3017.  
  3018. Compat  : Clone
  3019.  
  3020. Purpose : Initializes the 100th-second timer handler
  3021.  
  3022. Parms:
  3023.    none
  3024.  
  3025. Description:
  3026.  
  3027. The MD_INIT service initializes the 100th-second timer handler.
  3028. The system clock is reset to 200.27 cycles per second. The old
  3029. timer interrupt is executed every 11th time through, so as to
  3030. maintain the usual 18.2 cycles per second for the rest of the
  3031. system.
  3032.  
  3033. If you use the 100th-second time services, it is vital that you
  3034. initialize them with MD_INIT (at the start of your program) and
  3035. terminate them with MD_DONE (at the end of your program).
  3036.  
  3037. The MD_INIT service provides up to eight countdown timers which
  3038. may be accessed by the MD_SETTIMER and MD_GETTIMER services.
  3039. These countdown timers decrement their respective counts at a
  3040. rate of 100 per second. The count is not allowed to go below
  3041. zero.
  3042.  
  3043. Service : MD_SETTIMER
  3044.  
  3045. Module  : Delay Services
  3046.  
  3047. Compat  : Clone
  3048.  
  3049. Purpose : Sets one of the 100th-second countdown timers
  3050.  
  3051. Parms:
  3052.       AL <-- timer number (0-7)
  3053.       CX <-- time count (0-32,767)
  3054.  
  3055. Description:
  3056.  
  3057. The MD_SETTIMER service sets one of the 100th-second countdown
  3058. timers going. The time will be decremented once every 100th of a
  3059. second until it reaches zero. This is useful for occasions where
  3060. you need to do something within a specified amount of time. For
  3061. instance, in a communications program you might want a "receive
  3062. character" routine to keep looking for a character for up to a
  3063. second before returning a "time out" error.
  3064.  
  3065. Up to eight countdown timers are available. Timer 0 is used by
  3066. MD_DELAY, so don't access it if you wish to use the MD_DELAY
  3067. service. Timer 1 is reserved for the upcoming MU_MUSIC music
  3068. service, so don't use it if you would like to add music to a
  3069. future program. Timers 2-7 are always available for your use.
  3070.  
  3071. The time count is restricted to a maximum of 32,767 because it
  3072. is doubled internally. The timer runs at 200 cycles/second to
  3073. improve accuracy and make it easy to maintain the old rate of
  3074. 18.2 cycles/second for the system.
  3075.  
  3076. If you use the 100th-second time services, it is vital that you
  3077. initialize them with MD_INIT (at the start of your program) and
  3078. terminate them with MD_DONE (at the end of your program).
  3079.  
  3080.  
  3081.  
  3082.  
  3083. Service : MD_TICK
  3084.  
  3085. Module  : Delay Services
  3086.  
  3087. Compat  : Clone
  3088.  
  3089. Purpose : Delays for a number of clock ticks (1/18th seconds)
  3090.  
  3091. Parms:
  3092.       CX <-- delay (0-65535)
  3093.  
  3094. Description:
  3095.  
  3096. The MD_TICK service waits for a specified number of clock ticks.
  3097. This is based on the system clock. There are about 18.2 ticks
  3098. per second, so the delay for one tick is approximately 1/18th
  3099. second.
  3100.  
  3101. Since the system clock is maintained via the interrupt system,
  3102. interrupts will be enabled for the duration of this service, to
  3103. avoid an infinite delay.
  3104.  
  3105. This service has been designed to accommodate multitaskers. If
  3106. another task is in operation, the delay may be a trifle longer
  3107. than expected, however.
  3108.  
  3109. Service : ME_BINFO
  3110.  
  3111. Module  : Memory Services
  3112.  
  3113. Compat  : Clone
  3114.  
  3115. Purpose : Gets information about a BSAVE-format memory image
  3116.  
  3117. Parms:
  3118.    DS:DX <-- pointer to ASCIIZ filename
  3119.    -------
  3120.    ES:SI = memory image segment:offset
  3121.       CX = memory image size (bytes)
  3122.    Flags = CY if unable to get information; AX = error code
  3123.  
  3124. Description:
  3125.  
  3126. The ME_BINFO service gets information about a memory image
  3127. stored in a BSAVE-format file. The information is retrieved from
  3128. the file header.
  3129.  
  3130. The BSAVE format is used by BASIC in storing memory images to
  3131. disk. It is typically used for saving screen images.
  3132.  
  3133. If there is an error in reading from the specified file, the
  3134. carry flag will be set and an error code will be returned. The
  3135. error code corresponds with normal DOS error codes, except for
  3136. the code of -1, which means that the file was not in BSAVE
  3137. format.
  3138.  
  3139. The following information may prove helpful in decoding picture
  3140. files:
  3141.  
  3142.    Segment      Picture type
  3143.  
  3144.     B000h       Monochrome (Hercules graphics)
  3145.     B800h       CGA
  3146.     A000h       EGA or VGA
  3147.                 (monochrome unless there are multiple files)
  3148.  
  3149. Service : ME_BLOAD
  3150.  
  3151. Module  : Memory Services
  3152.  
  3153. Compat  : Clone
  3154.  
  3155. Purpose : Restores a memory image from a BSAVE-format file
  3156.  
  3157. Parms:
  3158.    DS:DX <-- pointer to ASCIIZ filename
  3159.    -------
  3160.    Flags = CY if unable to load memory image; AX = error code
  3161.  
  3162. Description:
  3163.  
  3164. The ME_BLOAD service restores a memory image from a file in
  3165. BSAVE format. The image is restored to the location from which
  3166. it was originally saved.
  3167.  
  3168. The BSAVE format is used by BASIC in storing memory images to
  3169. disk. It is typically used for saving screen images.
  3170.  
  3171. If there is an error in reading from the specified file, the
  3172. carry flag will be set and an error code will be returned. The
  3173. error code corresponds with normal DOS error codes, except for
  3174. the code of -1, which means that the file was not in BSAVE
  3175. format.
  3176.  
  3177. The following information may prove helpful in decoding picture
  3178. files:
  3179.  
  3180.    Segment      Picture type
  3181.  
  3182.     B000h       Monochrome (Hercules graphics)
  3183.     B800h       CGA
  3184.     A000h       EGA or VGA
  3185.                 (monochrome unless there are multiple files)
  3186.  
  3187. Service : ME_BSAVE
  3188.  
  3189. Module  : Memory Services
  3190.  
  3191. Compat  : Clone
  3192.  
  3193. Purpose : Saves a memory image to a BSAVE-format file
  3194.  
  3195. Parms:
  3196.    DS:DX <-- pointer to ASCIIZ filename
  3197.    ES:SI <-- pointer to start of area to be saved
  3198.       CX <-- size of memory area (bytes)
  3199.    -------
  3200.    Flags = CY if unable to save memory image; AX = error code
  3201.  
  3202. Description:
  3203.  
  3204. The ME_BSAVE service saves a memory image to a file in BSAVE
  3205. format.
  3206.  
  3207. The BSAVE format is used by BASIC in storing memory images to
  3208. disk. It is typically used for saving screen images.
  3209.  
  3210. If there is an error in writing to the specified file, the carry
  3211. flag will be set and an error code will be returned. The error
  3212. code corresponds with normal DOS error codes.
  3213.  
  3214. The following information may prove helpful in saving picture
  3215. files (note that the offset is normally zero):
  3216.  
  3217.    Segment      Picture type               Length
  3218.  
  3219.     B000h       Hercules graphics          16,384
  3220.     B800h       CGA graphics               16,384
  3221.     A000h       EGA or VGA (monochrome)    28,000+
  3222.  
  3223. It is possible to save EGA and VGA pictures in color, using four
  3224. files rather than one, plus a palette file. This is a bit
  3225. awkward, though, so we'll save it for a future version of AsmWiz
  3226. (using the PCX file format, instead).
  3227.  
  3228. Service : ME_HIGHOFS
  3229.  
  3230. Module  : Memory Services
  3231.  
  3232. Compat  : Any
  3233.  
  3234. Purpose : Converts an address to have the lowest segment
  3235.           and highest offset
  3236.  
  3237. Parms:
  3238.    DX:AX <-- segment:offset
  3239.    -------
  3240.    DX:AX = converted segment:offset
  3241.  
  3242. Description:
  3243.  
  3244. The ME_HIGHOFS service converts an address so that it has the
  3245. highest possible offset and lowest possible segment. This allows
  3246. you to work backwards from this address by up to 65,519 bytes
  3247. without wrapping around within the segment, which is a
  3248. convenience for reverse REP operations, for example. The
  3249. resulting offset will be in the range FFF0h - FFFFh, unless the
  3250. address is extremely low in memory, in which case the range may
  3251. be lower.
  3252.  
  3253.  
  3254.  
  3255.  
  3256. Service : ME_LOWOFS
  3257.  
  3258. Module  : Memory Services
  3259.  
  3260. Compat  : Any
  3261.  
  3262. Purpose : Converts an address to have the highest segment and
  3263.           lowest offset
  3264.  
  3265. Parms:
  3266.    DX:AX <-- segment:offset
  3267.    -------
  3268.    DX:AX = converted segment:offset
  3269.  
  3270. Description:
  3271.  
  3272. The ME_LOWOFS service converts an address so that it has the
  3273. lowest possible offset and highest possible segment. This allows
  3274. you to work forwards from this address by up to 65,519 bytes
  3275. without wrapping around within the segment, which is a
  3276. convenience for forward REP operations, for example. The
  3277. resulting offset will be in the range 0000h - 000Fh.
  3278.  
  3279. Service : ME_MOVE
  3280.  
  3281. Module  : Memory Services
  3282.  
  3283. Compat  : Any
  3284.  
  3285. Purpose : Moves a block of data from one place to another
  3286.  
  3287. Parms:
  3288.    DS:SI <-- source segment:offset
  3289.    ES:DI <-- destination segment:offset
  3290.       CX <-- bytes to move (0 - 65,519)
  3291.  
  3292. Description:
  3293.  
  3294. The ME_MOVE service moves data from one place to another. It
  3295. automatically handles overlaps, so the data will always be
  3296. copied correctly.
  3297.  
  3298. The reason ME_MOVE can only handle up to 65,519 characters
  3299. rather than a full 65,535 is because it uses the ME_LOWOFS and
  3300. ME_HIGHOFS services rather than recalculating and re-normalizing
  3301. the addresses every time. The loss of a few bytes' range is, in
  3302. most cases, an acceptable price for the vastly increased speed.
  3303. If you need greater range, calling ME_MOVE more than once may be
  3304. a bit of a nuisance, but it will still be considerably faster
  3305. than the recalculation approach.
  3306.  
  3307. Service : MI_BOOT
  3308.  
  3309. Module  : Miscellaneous Services
  3310.  
  3311. Compat  : Clone
  3312.  
  3313. Purpose : Reboots the computer (warm boot)
  3314.  
  3315. Parms:
  3316.    none
  3317.  
  3318. Description:
  3319.  
  3320. The MI_BOOT service restarts the computer by performing a warm
  3321. boot.
  3322.  
  3323. I'd provide a "cold boot" service as well, but I've found that
  3324. doing a cold boot is liable to lock up many clones, including
  3325. some Compaq models. The warm boot, however, always seems to work
  3326. as advertised.
  3327.  
  3328. This service may be accessed by JMP instead of CALL if you
  3329. prefer. It really doesn't matter, since the stack is reset and
  3330. control is returned to the system during the boot process. The
  3331. JMP is trivially more efficient, though.
  3332.  
  3333. Service : MI_GETSCREEN
  3334.  
  3335. Module  : Miscellaneous Services
  3336.  
  3337. Compat  : Clone
  3338.  
  3339. Purpose : Gets information about the active video display
  3340.  
  3341. Parms:
  3342.    -------
  3343.       AH = adapter type (1-6: MDA, Herc, CGA, EGA, MCGA, VGA)
  3344.       AL = color flag (0 color, 1 mono)
  3345.  
  3346. Description:
  3347.  
  3348. The MI_GETSCREEN service gets vital information about the
  3349. active display. It tells you whether the display is capable of
  3350. handling color and what kind of display adapter is in use.
  3351.  
  3352. Note that the color flag will not necessarily be accurate for
  3353. CGAs. It is possible to connect a monochrome monitor to the CGA,
  3354. but there is no way for the computer to detect whether this has
  3355. been done, so it is assumed that CGAs are always color. You
  3356. should add a "/B" command-line option to your program so that
  3357. the user can specify that a monochrome CGA display is in use
  3358. ("/B" is what Microsoft uses to specify "black and white").
  3359.  
  3360. If the adapter is determined to be MDA or Hercules, the
  3361. interrupt system will be turned on and the service will delay
  3362. for up to 1/9th second as it attempts to decide which kind of
  3363. adapter is in use. The original interrupt status will be
  3364. restored when the service exits.
  3365.  
  3366. The AsmWiz text services allow for automatic conversion of
  3367. colors to their monochrome equivalents, making it easy to handle
  3368. any display. See the BV_FIXCOLOR, DV_FIXCOLOR, or MV_FIXCOLOR
  3369. service for more information.
  3370.  
  3371. Service : MI_PARSE
  3372.  
  3373. Module  : Miscellaneous Services
  3374.  
  3375. Compat  : DOS
  3376.  
  3377. Purpose : Parses a command line into file specs and options
  3378.  
  3379. Parms:
  3380.    DS:SI <-- ptr to command line (for COM files, is CS:0080h)
  3381.    ES:DI <-- ptr to filename buffer (recommend 128 bytes)
  3382.    ES:BX <-- ptr to option buffer (recommend 128 bytes)
  3383.       AL <-- switch character (normally "/" for DOS)
  3384.    -------
  3385.       AH = number of options
  3386.       AL = number of filenames
  3387.  
  3388. Description:
  3389.  
  3390. The MI_PARSE routine takes the information passed to your
  3391. program on the command line and parses it into filenames and
  3392. options.
  3393.  
  3394. The command line is everything that comes after your program
  3395. name when the user types in the name of your program. It is
  3396. generally used for passing filenames and options to your
  3397. program. DOS itself is rather crude about such matters and
  3398. simply passes the original input to your program, after removing
  3399. the name of the program itself and any piping or redirection
  3400. which may have been done.
  3401.  
  3402. This routine assumes that anything which isn't an option is a
  3403. filename. Of course, this need not be true, but it's a
  3404. convenient fiction for separating the options from the rest of
  3405. the information.
  3406.  
  3407. Options may be delimited by the character of your choice. DOS
  3408. normally uses "/" and assumes "\" is used for specifying paths.
  3409. Many people prefer the *nix convention of "-" for switches and
  3410. "/" for specifying paths, however, so this routine allows for
  3411. that possibility. DOS will recognize "/" as being the same as
  3412. "\" in any DOS interrupt that accepts paths, so this works out
  3413. fairly well, since *nix folks are accustomed to using "/" as a
  3414. path delimiter. It's somewhat appalling that Microsoft/IBM
  3415. deliberately chose to avoid the *nix conventions, but it is
  3416. certainly handy that DOS will (more or less) accept such usage
  3417. internally, if not at the command level. Note that use of "-" as
  3418. a switch character means that you will not be able to access any
  3419. files which contain "-" characters in the filename. This is
  3420. rarely a problem, but it can happen.
  3421.  
  3422. The two parameter tables, filenames and options, will consist of
  3423. strings in their original order in the command line. Each string
  3424. will be terminated by a null character, in keeping with C usage.
  3425. The number of strings in each parameter table is returned by
  3426. MI_PARSE in one or another half of the AX register, as specified
  3427. in the "Parms" list, above.
  3428.  
  3429. You will normally specify the offset of the command line for
  3430. this service. For COM-format files, this is CS:0080h.
  3431.  
  3432. Service : MI_RANDOM
  3433.  
  3434. Module  : Miscellaneous Services
  3435.  
  3436. Compat  : Any
  3437.  
  3438. Purpose : Generates a pseudo-random number
  3439.  
  3440. Parms:
  3441.       DX <-- desired range of pseudo-random number (1-4000)
  3442.    -------
  3443.       AX = pseudo-random number (0 to DX - 1)
  3444.  
  3445. Description:
  3446.  
  3447. The MI_RANDOM service generates pseudo-random numbers within a
  3448. desired range.
  3449.  
  3450. A linear congruential method is used to generate the numbers.
  3451. The algorithm was derived from the book "How to Solve it by
  3452. Computer", by R. G. Dromey (Prentiss-Hall).
  3453.  
  3454. See also the MI_RANDOMIZE service, which is used to initialize
  3455. the random number generator.
  3456.  
  3457.  
  3458.  
  3459.  
  3460. Service : MI_RANDOMIZE
  3461.  
  3462. Module  : Miscellaneous Services
  3463.  
  3464. Compat  : Any / Clone
  3465.  
  3466. Purpose : Initializes the pseudo-random number generator
  3467.  
  3468. Parms:
  3469.       AX <-- random number seed or 0FFFFh
  3470.  
  3471. Description:
  3472.  
  3473. The MI_RANDOMIZE routine initializes the MI_RANDOM random number
  3474. generator service. You may specify your own random number seed
  3475. (in which case this routine is compatible with any PC) or use
  3476. 0FFFFh for the routine to pick its own seed (in which case this
  3477. routine is only compatible with clones).
  3478.  
  3479. If you specify 0FFFFh, the random number seed is read directly
  3480. from the timer chip's countdown tick, giving a quite adequately
  3481. random initial seed value.
  3482.  
  3483. Specifying your own seed may be done to maximize compatibility
  3484. with the most machines. In that case, you will probably want to
  3485. get a seed value from the DOS time service, using the seconds
  3486. value. Use of the "hundredths of seconds" value is not advised,
  3487. as it is always zero on some machines.
  3488.  
  3489. You might also want to specify your own seed during debugging,
  3490. to assure you of a reproducible set of pseudo-random numbers.
  3491. The same stream of numbers will always be generated from the
  3492. same seed value.
  3493.  
  3494. Service : MI_SCANENV
  3495.  
  3496. Module  : Miscellaneous Services
  3497.  
  3498. Compat  : DOS
  3499.  
  3500. Purpose : Scans the DOS environment (or similar table) for a
  3501.           specified string
  3502.  
  3503. Parms:
  3504.    DS:SI <-- ptr to DOS environment
  3505.    ES:DI <-- ptr to string for which to seek
  3506.    -------
  3507.    DS:SI = ptr to parm value (if NC; CY is set if not found)
  3508.  
  3509. Description:
  3510.  
  3511. The MI_SCANENV routine scans the DOS environment for a specified
  3512. string and returns the value of the parameter which matches that
  3513. string. If there is no matching parameter, the carry flag is
  3514. set.
  3515.  
  3516. You may also use this routine for scanning your own tables if
  3517. you format them like the DOS environment: each entry of the
  3518. table is an ASCIIZ string which contains a parameter name and
  3519. parameter value, seperated by an "equals" sign. The end of the
  3520. table is marked by an additional NUL character. Matching is
  3521. case-sensitive ("comspec" will not match "COMSPEC").
  3522.  
  3523. The segment of the environment is stored at offset 002Ch within
  3524. the PSP. For COM files, the segment is at CS:[002Ch] (see notes
  3525. under MI_PARSE). Since parameters in the environment are stored
  3526. in uppercase, you should make sure that the string for which you
  3527. seek is also capitalized.
  3528.  
  3529. The resulting match, if any, will be pointed to by DS:SI on
  3530. exit. It is the value of the parameter, not the parameter name,
  3531. which is returned.
  3532.  
  3533.  
  3534. Example:
  3535.       MOV   DS,DS:[002Ch]       ; assumes CS = DS = ES  (COM file)
  3536.       XOR   SI,SI
  3537.       MOV   DI,OFFSET TOFIND
  3538.       CALL  MI_SCANENV
  3539.       JC    NOTFOUND
  3540.       MOV   DX,SI
  3541.       CALL  DV_STROUT
  3542.       CALL  DV_CRLF
  3543.       (etc)
  3544.    NOTFOUND:
  3545.       (etc)
  3546.    TOFIND  DB "PATH",0
  3547.  
  3548. This example will search the environment for the "PATH"
  3549. parameter. If a PATH exists, it will be displayed, looking
  3550. perhaps something like "C:\DOS;C:\WP" (without the quotes).
  3551.  
  3552. Service : MK_SETCAPS
  3553.  
  3554. Module  : Keyboard
  3555.  
  3556. Compat  : BIOS
  3557.  
  3558. Purpose : sets the Caps Lock state
  3559.  
  3560. Parms:
  3561.       AX <-- 0 to turn off, nonzero to turn on
  3562.  
  3563. Description:
  3564.  
  3565. The MK_SETCAPS service sets the Caps Lock state.
  3566.  
  3567. To avoid disrupting the global environment, it is a good idea to
  3568. get the state of Caps Lock at the start of your program, and
  3569. restore this original state before your program exits-- unless,
  3570. of course, your program is specifically intended to alter the
  3571. Caps Lock setting.
  3572.  
  3573. Use of this routine may cause the corresponding keyboard status
  3574. light on some old keyboards (mostly IBM PC and XT types) to be
  3575. at variance with the actual setting.
  3576.  
  3577.  
  3578.  
  3579. Service : MK_SETNUM
  3580.  
  3581. Module  : Keyboard
  3582.  
  3583. Compat  : BIOS
  3584.  
  3585. Purpose : sets the Num Lock state
  3586.  
  3587. Parms:
  3588.       AX <-- 0 to turn off, nonzero to turn on
  3589.  
  3590. Description:
  3591.  
  3592. The MK_SETNUM service sets the Num Lock state.
  3593.  
  3594. To avoid disrupting the global environment, it is a good idea to
  3595. get the state of Num Lock at the start of your program, and
  3596. restore this original state before your program exits-- unless,
  3597. of course, your program is specifically intended to alter the
  3598. Num Lock setting.
  3599.  
  3600. Use of this routine may cause the corresponding keyboard status
  3601. light on some old keyboards (mostly IBM PC and XT types) to be
  3602. at variance with the actual setting.
  3603.  
  3604. Service : MO_GLOCATE
  3605.  
  3606. Module  : Mouse Services
  3607.  
  3608. Compat  : BIOS (Microsoft-type mouse driver)
  3609.  
  3610. Purpose : Sets the mouse cursor location (graphics modes)
  3611.  
  3612. Parms:
  3613.       CX <-- X (horiz) coordinate (0-MaxX, depending on mode)
  3614.       DX <-- Y (vert) coordinate (0-MaxY, depending on mode)
  3615.  
  3616. Description:
  3617.  
  3618. The MO_GLOCATE service sets the mouse cursor position. It works
  3619. whether or not the mouse cursor is visible.
  3620.  
  3621. In 80x25 text mode and CGA graphics modes, the mouse driver uses
  3622. virtual coordinates based on a 640x200 graphics screen. Keep
  3623. this in mind if using these modes.
  3624.  
  3625.  
  3626.  
  3627.  
  3628. Service : MO_GWHERE
  3629.  
  3630. Module  : Mouse Services
  3631.  
  3632. Compat  : BIOS (Microsoft-type mouse driver)
  3633.  
  3634. Purpose : Gets the mouse cursor location
  3635.  
  3636. Parms:
  3637.    -------
  3638.       AH = right mouse button (0 if not pressed, 1 if pressed)
  3639.       AL = left mouse button  (0 if not pressed, 1 if pressed)
  3640.       CX <-- X (horiz) coordinate (0-MaxX, depending on mode)
  3641.       DX <-- Y (vert) coordinate (0-MaxY, depending on mode)
  3642.  
  3643. Description:
  3644.  
  3645. The MO_GWHERE service gets the mouse cursor position and current
  3646. button status. It works whether or not the mouse cursor is
  3647. visible.
  3648.  
  3649. In 80x25 text mode and CGA graphics modes, the mouse driver uses
  3650. virtual coordinates based on a 640x200 graphics screen. Keep
  3651. this in mind if using these modes.
  3652.  
  3653. Service : MO_HIDECURSOR
  3654.  
  3655. Module  : Mouse Services
  3656.  
  3657. Compat  : BIOS (Microsoft-type mouse driver)
  3658.  
  3659. Purpose : Hides the mouse cursor
  3660.  
  3661. Parms:
  3662.    none
  3663.  
  3664. Description:
  3665.  
  3666. The MO_HIDECURSOR service hides the mouse cursor. After using
  3667. this service, the mouse cursor will not be visible, although it
  3668. will still be there.
  3669.  
  3670. This is a somewhat peculiar service. If you use it more than
  3671. once, it will take more than one application of MO_SHOWCURSOR
  3672. before the cursor actually reappears. The mouse driver keeps a
  3673. "level of invisibility" counter rather than simply turning the
  3674. cursor on and off.
  3675.  
  3676.  
  3677.  
  3678.  
  3679. Service : MO_INIT
  3680.  
  3681. Module  : Mouse Services
  3682.  
  3683. Compat  : BIOS (Microsoft-type mouse driver)
  3684.  
  3685. Purpose : Initialize mouse, if any, and get info about it
  3686.  
  3687. Parms:
  3688.    -------
  3689.       AL = number of buttons (0-3)
  3690.  
  3691. Description:
  3692.  
  3693. The MO_INIT service initializes the mouse driver and returns the
  3694. number of buttons on the mouse. If no mouse is available, the
  3695. number of buttons will be zero. Otherwise, you can expect 2-3
  3696. buttons.
  3697.  
  3698. The Microsoft mouse is somewhat limited in that it has only two
  3699. buttons. Most compatible mice have three. The AsmWiz mouse
  3700. services will work with either, but will ignore the middle
  3701. button of three-button mice.
  3702.  
  3703. Service : MO_LOCATE
  3704.  
  3705. Module  : Mouse Services
  3706.  
  3707. Compat  : BIOS (Microsoft-type mouse driver)
  3708.  
  3709. Purpose : Sets the mouse cursor location
  3710.  
  3711. Parms:
  3712.       DH <-- row (1-25)
  3713.       DL <-- column (1-80)
  3714.  
  3715. Description:
  3716.  
  3717. The MO_LOCATE service sets the mouse cursor position. It works
  3718. whether or not the mouse cursor is visible.
  3719.  
  3720. Normally, the mouse driver uses coordinates based on a 640x200
  3721. virtual screen. In order to make it easier to handle the mouse
  3722. for text, this service automatically converts from an 80x25
  3723. format.
  3724.  
  3725.  
  3726.  
  3727.  
  3728. Service : MO_RANGE
  3729.  
  3730. Module  : Mouse Services
  3731.  
  3732. Compat  : BIOS (Microsoft-type mouse driver)
  3733.  
  3734. Purpose : Sets the mouse cursor range
  3735.  
  3736. Parms:
  3737.       CH <-- top row (1-25)
  3738.       CL <-- left column (1-80)
  3739.       DH <-- bottom row (1-25)
  3740.       DL <-- right column (1-80)
  3741.  
  3742. Description:
  3743.  
  3744. The MO_RANGE service sets the mouse cursor range. The mouse
  3745. cursor will be constrained to the specified area of the screen.
  3746.  
  3747. Normally, the mouse driver uses coordinates based on a 640x200
  3748. virtual screen. In order to make it easier to handle the mouse
  3749. for text, this service automatically converts from an 80x25
  3750. format.
  3751.  
  3752. Service : MO_SHOWCURSOR
  3753.  
  3754. Module  : Mouse Services
  3755.  
  3756. Compat  : BIOS (Microsoft-type mouse driver)
  3757.  
  3758. Purpose : Shows the mouse cursor
  3759.  
  3760. Parms:
  3761.    none
  3762.  
  3763. Description:
  3764.  
  3765. The MO_SHOWCURSOR service shows the mouse cursor. After using
  3766. this service, the mouse cursor will (probably) be visible.
  3767.  
  3768. See the description of the MO_HIDECURSOR service for details on
  3769. that "probably" caution!
  3770.  
  3771.  
  3772.  
  3773.  
  3774. Service : MO_WHERE
  3775.  
  3776. Module  : Mouse Services
  3777.  
  3778. Compat  : BIOS (Microsoft-type mouse driver)
  3779.  
  3780. Purpose : Gets the mouse cursor location
  3781.  
  3782. Parms:
  3783.    -------
  3784.       AH = right mouse button (0 if not pressed, 1 if pressed)
  3785.       AL = left mouse button  (0 if not pressed, 1 if pressed)
  3786.       DH = row (1-25)
  3787.       DL = column (1-80)
  3788.  
  3789. Description:
  3790.  
  3791. The MO_WHERE service gets the mouse cursor position and current
  3792. button status. It works whether or not the mouse cursor is
  3793. visible.
  3794.  
  3795. Normally, the mouse driver uses coordinates based on a 640x200
  3796. virtual screen. In order to make it easier to handle the mouse
  3797. for text, this service automatically converts to an 80x25
  3798. format.
  3799.  
  3800. Service : MU_SOUND
  3801.  
  3802. Module  : Sound and Music Services
  3803.  
  3804. Compat  : Clone
  3805.  
  3806. Purpose : Produces a sound of the desired frequency & duration
  3807.  
  3808. Parms:
  3809.    AX <-- frequency of the sound, in cycles per second (Hertz)
  3810.    DX <-- duration of the sound (in 1/18th seconds)
  3811.  
  3812. Description:
  3813.  
  3814. The MU_SOUND routine produces a sound of the specified frequency
  3815. (about 50-4000 is useful) and duration (in 18ths of seconds).
  3816.  
  3817. If you are interested in producing music using this service, the
  3818. following table may prove of some use. You can move down an
  3819. octave by halving the frequency for a given note (which can be
  3820. efficiently accomplished using the SHR or SHift Right
  3821. assembly-language operation). About seven octaves are available
  3822. on the usual PC compatible.
  3823.  
  3824. Note     Frequency (highest octave)
  3825. =====    =========
  3826.   A         3520
  3827. A#,B-       3714
  3828.   B         3952
  3829.   C         4186
  3830. C#,D-       4434
  3831.   D         4698
  3832. D#,E-       4978
  3833.   E         5274
  3834.   F         5588
  3835. F#,G-       5920
  3836.   G         6272
  3837. G#,A-       6644
  3838.  
  3839. Service : MV_CHROUT
  3840.  
  3841. Module  : Machine-level Video Services
  3842.  
  3843. Compat  : Clone
  3844.  
  3845. Purpose : Displays a character on the screen
  3846.  
  3847. Parms:
  3848.       AL <-- character to display
  3849.  
  3850. Description:
  3851.  
  3852. The MV_CHROUT routine displays a character on the screen. The
  3853. screen must be in one of the text modes (video modes 0-3, 7).
  3854.  
  3855. The following control codes are interpreted:
  3856.    7      Bell             beep
  3857.    8      Backspace        non-destructive backspace
  3858.    9      Tab              space over to the next tab stop
  3859.   10      Linefeed         move cursor down one line
  3860.   12      Formfeed         clear screen and home cursor
  3861.   13      Carriage Return  home cursor on current line
  3862.  
  3863. Redirection, if any, is ignored.
  3864.  
  3865.  
  3866.  
  3867.  
  3868. Service : MV_CLEOLN
  3869.  
  3870. Module  : Machine-level Video Services
  3871.  
  3872. Compat  : Clone
  3873.  
  3874. Purpose : Clears to the end of the line
  3875.  
  3876. Parms:
  3877.    none
  3878.  
  3879. Description:
  3880.  
  3881. The MV_CLEOLN service clears from the current cursor position to
  3882. the end of the current screen line, inclusive. The screen must
  3883. be in one of the text modes (video modes 0-3, 7).
  3884.  
  3885. Redirection, if any, is ignored.
  3886.  
  3887. Service : MV_CLS
  3888.  
  3889. Module  : Machine-level Video Services
  3890.  
  3891. Compat  : Clone
  3892.  
  3893. Purpose : Clears the screen
  3894.  
  3895. Parms:
  3896.    none
  3897.  
  3898. Description:
  3899.  
  3900. The MV_CLS service clears the screen and homes the cursor to the
  3901. upper left corner. The screen must be in one of the text modes
  3902. (video modes 0-3, 7).
  3903.  
  3904. Redirection, if any, is ignored.
  3905.  
  3906.  
  3907.  
  3908.  
  3909. Service : MV_COLOR
  3910.  
  3911. Module  : Machine-level Video Services
  3912.  
  3913. Compat  : Clone
  3914.  
  3915. Purpose : Sets the default text color
  3916.  
  3917. Parms:
  3918.       AL <-- default color
  3919.  
  3920. Description:
  3921.  
  3922. The MV_COLOR service sets the default text color. A
  3923. color/attribute table is given in the ASMWIZ.DOC file. In
  3924. general, however, the background is in the high nybble and
  3925. ranges 0-7; the foreground is in the low nybble and also ranges
  3926. 0-7. For bright, add 8 to the foreground; for blinking, add 8 to
  3927. the background.
  3928.  
  3929. Redirection, if any, is ignored.
  3930.  
  3931. Service : MV_CRLF
  3932.  
  3933. Module  : Machine-level Video Services
  3934.  
  3935. Compat  : Clone
  3936.  
  3937. Purpose : Displays a <CR><LF> (carriage return and linefeed)
  3938.  
  3939. Parms:
  3940.    none
  3941.  
  3942. Description:
  3943.  
  3944. The MV_CRLF routine displays a carriage return and linefeed on
  3945. the screen. The screen must be in one of the text modes (video
  3946. modes 0-3, 7).
  3947.  
  3948. Redirection, if any, is ignored.
  3949.  
  3950.  
  3951.  
  3952.  
  3953. Service : MV_DELCHR
  3954.  
  3955. Module  : Machine-level Video Services
  3956.  
  3957. Compat  : Clone
  3958.  
  3959. Purpose : Deletes the character at the cursor
  3960.  
  3961. Parms:
  3962.    none
  3963.  
  3964. Description:
  3965.  
  3966. The MV_DELCHR service deletes the character on which the cursor
  3967. is placed. Any characters to the right of it are moved left and
  3968. the rightmost column of the screen is cleared to a space in the
  3969. current screen colors.
  3970.  
  3971. Redirection, if any, is ignored.
  3972.  
  3973. Service : MV_DELLINE
  3974.  
  3975. Module  : Machine-level Video Services
  3976.  
  3977. Compat  : Clone
  3978.  
  3979. Purpose : Deletes the current screen row
  3980.  
  3981. Parms:
  3982.    none
  3983.  
  3984. Description:
  3985.  
  3986. The MV_DELLINE service deletes the row on which the cursor is
  3987. placed. Any rows beneath it are moved up and the bottom line of
  3988. the screen is cleared to a row of spaces in the current screen
  3989. colors.
  3990.  
  3991. Redirection, if any, is ignored.
  3992.  
  3993. Service : MV_FIXCOLOR
  3994.  
  3995. Module  : Machine-level Video Services
  3996.  
  3997. Compat  : Any
  3998.  
  3999. Purpose : Tells the MV services to convert color to monochrome
  4000.  
  4001. Parms:
  4002.       AL <-- whether to convert to mono (0 no, 1 yes)
  4003.  
  4004. Description:
  4005.  
  4006. The MV_FIXCOLOR service tells the Machine-level Video services
  4007. whether to convert colors to their monochrome equivalents. If
  4008. not, the colors will remain as you originally specified. If so,
  4009. the colors will be converted to appropriate values for use on a
  4010. monochrome display.
  4011.  
  4012. The color-to-mono translation attempts to mimic the original
  4013. display as closely as possible. It analyzes the foreground and
  4014. background colors by their intensity. The results are translated
  4015. to white on black, bright white on black, or black on white. The
  4016. "blink" attribute is preserved. If the original foreground was
  4017. identical to the background (invisible characters), the result
  4018. will be black on black.
  4019.  
  4020. See also the MI_GETSCREEN service, which allows you to
  4021. automatically detect what kind of display is in use.
  4022.  
  4023. Service : MV_FRAME
  4024.  
  4025. Module  : Machine-level Video Services
  4026.  
  4027. Compat  : Clone
  4028.  
  4029. Purpose : Displays a window frame
  4030.  
  4031. Parms:
  4032.    CH,CL <-- upper left corner (row 1-25/43, column 1-40/80)
  4033.    DH,DL <-- lower right corner (row 1-25/43, column 1-40/80)
  4034.    DS:SI <-- frame pointer (SI = -1 to -9 for built-in frames)
  4035.  
  4036. Description:
  4037.  
  4038. The MV_FRAME service displays a window frame. You may design
  4039. your own frame or use one of a variety of built-in frames.
  4040.  
  4041. If you choose to build your own frame, you must point DS:SI to
  4042. an eight-byte list of characters with which to build the frame.
  4043. The list should be in this order: top left corner, top middle,
  4044. top right corner, left middle, right middle, lower left corner,
  4045. lower middle, and lower right corner.
  4046.  
  4047. You may also choose to use a built-in frame by setting SI in the
  4048. range -1 to -9, as follows:
  4049.  
  4050.    -1      single line frame
  4051.    -2      double line frame
  4052.    -3      single horizontal lines, double vertical lines
  4053.    -4      double horizontal lines, single vertical lines
  4054.    -5      blank block frame              (CHR$(32))
  4055.    -6      low intensity block frame      (CHR$(176))
  4056.    -7      medium intensity block frame   (CHR$(177))
  4057.    -8      high intensity block frame     (CHR$(178))
  4058.    -9      solid block frame              (CHR$(219))
  4059.  
  4060. Redirection, if any, is ignored.
  4061.  
  4062. Service : MV_GETCOLOR
  4063.  
  4064. Module  : Machine-level Video Services
  4065.  
  4066. Compat  : Clone
  4067.  
  4068. Purpose : Gets the default text color
  4069.  
  4070. Parms:
  4071.    -------
  4072.       AL = default color
  4073.  
  4074. Description:
  4075.  
  4076. The MV_GETCOLOR service gets the default text color. A
  4077. color/attribute table is given in the ASMWIZ.DOC file. In
  4078. general, however, the background is in the high nybble and
  4079. ranges 0-7; the foreground is in the low nybble and also ranges
  4080. 0-7.
  4081.  
  4082. Redirection, if any, is ignored.
  4083.  
  4084.  
  4085.  
  4086.  
  4087. Service : MV_MODE
  4088.  
  4089. Module  : Machine-level Video Services
  4090.  
  4091. Compat  : Clone
  4092.  
  4093. Purpose : Gets the default screen mode
  4094.  
  4095. Parms:
  4096.    -------
  4097.       AL = mode
  4098.  
  4099. Description:
  4100.  
  4101. The MV_GETMODE service gets the current screen mode. A table of
  4102. screen modes is given in the ASMWIZ.DOC file.
  4103.  
  4104. Service : MV_HIDECURSOR
  4105.  
  4106. Module  : Machine-level Video Services
  4107.  
  4108. Compat  : Clone
  4109.  
  4110. Purpose : Hides the cursor
  4111.  
  4112. Parms:
  4113.    none
  4114.  
  4115. Description:
  4116.  
  4117. The MV_HIDECURSOR service hides the cursor, making it invisible.
  4118. This does not affect normal cursor operation.
  4119.  
  4120. Redirection, if any, is ignored.
  4121.  
  4122.  
  4123.  
  4124.  
  4125. Service : MV_INIT
  4126.  
  4127. Module  : Machine-level Video Services
  4128.  
  4129. Compat  : Clone
  4130.  
  4131. Purpose : Initializes the Machine-level Video Services
  4132.  
  4133. Parms:
  4134.    none
  4135.  
  4136. Description:
  4137.  
  4138. The MV_INIT routine initializes the Machine-level Graphics
  4139. Services. It should be used once in your program, before any
  4140. other Machine-level Graphics Services are called.
  4141.  
  4142. Redirection, if any, is ignored.
  4143.  
  4144. Service : MV_INSCHR
  4145.  
  4146. Module  : Machine-level Video Services
  4147.  
  4148. Compat  : Clone
  4149.  
  4150. Purpose : Inserts a space at the cursor position
  4151.  
  4152. Parms:
  4153.    none
  4154.  
  4155. Description:
  4156.  
  4157. The MV_INSCHR service inserts a space at the current cursor
  4158. location. Any characters to the right of it are moved right and
  4159. a space is inserted in the current screen colors.
  4160.  
  4161. Redirection, if any, is ignored.
  4162.  
  4163.  
  4164.  
  4165.  
  4166. Service : MV_INSLINE
  4167.  
  4168. Module  : Machine-level Video Services
  4169.  
  4170. Compat  : Clone
  4171.  
  4172. Purpose : Inserts a line at the current screen row
  4173.  
  4174. Parms:
  4175.    none
  4176.  
  4177. Description:
  4178.  
  4179. The MV_INSLINE service inserts a row at the current cursor
  4180. location. Any rows beneath it are moved down and the new line
  4181. screen is cleared to a row of spaces in the current screen
  4182. colors.
  4183.  
  4184. Redirection, if any, is ignored.
  4185.  
  4186. Service : MV_LOCATE
  4187.  
  4188. Module  : Machine-level Video Services
  4189.  
  4190. Compat  : Clone
  4191.  
  4192. Purpose : Sets the cursor position
  4193.  
  4194. Parms:
  4195.       DH <-- row (1-25)
  4196.       DL <-- column (1-40/80)
  4197.  
  4198. Description:
  4199.  
  4200. The MV_LOCATE service sets the cursor position. The screen must
  4201. be in one of the text modes (video modes 0-3, 7).
  4202.  
  4203. Redirection, if any, is ignored.
  4204.  
  4205.  
  4206.  
  4207.  
  4208. Service : MV_MODE
  4209.  
  4210. Module  : Machine-level Video Services
  4211.  
  4212. Compat  : Clone
  4213.  
  4214. Purpose : Sets the screen mode
  4215.  
  4216. Parms:
  4217.       AL <-- screen mode (0-3, 7)
  4218.  
  4219. Description:
  4220.  
  4221. The MV_MODE routine sets the screen mode. This may be any of the
  4222. following:
  4223.  
  4224.      Mode  Resolu.  Type  Colr  Use        Adapter(s)
  4225.  
  4226.        0   40x25    b&w     16  text       CGA, EGA, VGA
  4227.        1   40x25    color   16  text       CGA, EGA, VGA
  4228.        2   80x25    b&w     16  text       CGA, EGA, VGA
  4229.        3   80x25    color   16  text       CGA, EGA, VGA
  4230.        7   80x25    b&w      -  text       MDA, EGA, VGA
  4231.  
  4232. Redirection, if any, is ignored.
  4233.  
  4234. Service : MV_POPUP
  4235.  
  4236. Module  : Machine-level Video Services
  4237.  
  4238. Compat  : Clone
  4239.  
  4240. Purpose : Displays a pop-up window on the screen
  4241.  
  4242. Parms:
  4243.    DS:DX <-- pointer to parameter list
  4244.  
  4245. Description:
  4246.  
  4247. The MV_POPUP service displays a pop-up window on the screen. A
  4248. variety of frames is available for the window. Titles are
  4249. optional and will be left- justified in the top bar of the
  4250. window if supplied.
  4251.  
  4252. Frame types are as follows:
  4253.  
  4254.    0    none (blank)
  4255.    1    single lines
  4256.    2    double lines
  4257.    3    single horizontal lines, double vertical lines
  4258.    4    double horizontal lines, single vertical lines
  4259.  
  4260. The parameter list should look like this:
  4261.  
  4262. Y1           db ?            ; top row of window
  4263. X1           db ?            ; left column of window
  4264. Y2           db ?            ; bottom row of window
  4265. X2           db ?            ; right column of window
  4266. FRAMETYPE    db ?            ; frame type
  4267. FRAMECOLOR   db ?            ; frame color
  4268. TITLE        dw ?            ; offset (DS:) of ASCIIZ title
  4269.                              ; use 0FFFFh for no title
  4270.  
  4271. Redirection, if any, is ignored.
  4272.  
  4273. Service : MV_SAVESIZE
  4274.  
  4275. Module  : Machine-level Video Services
  4276.  
  4277. Compat  : Any
  4278.  
  4279. Purpose : Gets the number of bytes needed to save screen area
  4280.  
  4281. Parms:
  4282.    -------
  4283.       AX = bytes
  4284.  
  4285. Description:
  4286.  
  4287. The MV_SAVESIZE service tells you how many bytes will be needed
  4288. to save an area of the screen with MV_SCRSAVE. This is intended
  4289. as a convenience for programs that allocate the required space
  4290. on the fly. The actual calculation looks like this:
  4291.  
  4292.    Bytes = (RowsToSave * ScreenColumns + ColumnsToSave + 1)*2
  4293.  
  4294. You will need 4,002 bytes to save an entire 80x25 screen.
  4295.  
  4296. Service : MV_SCRREST
  4297.  
  4298. Module  : Machine-level Video Services
  4299.  
  4300. Compat  : Clone
  4301.  
  4302. Purpose : Restores a saved area of the screen
  4303.  
  4304. Parms:
  4305.    DS:SI <-- pointer to buffer containing a saved screen area
  4306.       DH <-- top row      (where to restore to)
  4307.       DL <-- left column  (where to restore to)
  4308.  
  4309. Description:
  4310.  
  4311. The MV_SCRREST service restores a saved area of the screen to
  4312. the display. The image may be stored to any location, regardless
  4313. of where it was saved from, as long as the results don't go off
  4314. the edge of the screen.
  4315.  
  4316. Only the upper left corner of the location to which to restore
  4317. is specified. This service calculates the lower left corner from
  4318. size parameters which are stored in the saved screen image.
  4319.  
  4320. Text mode (modes 0-3, 7) is required. Only display page zero is
  4321. supported.
  4322.  
  4323. Service : MV_SCRSAVE
  4324.  
  4325. Module  : Machine-level Video Services
  4326.  
  4327. Compat  : Clone
  4328.  
  4329. Purpose : Saves an area of the screen to a buffer
  4330.  
  4331. Parms:
  4332.    ES:DI <-- pointer to a buffer to which to save screen area
  4333.       CH <-- top row
  4334.       CL <-- left column
  4335.       DH <-- bottom row
  4336.       DL <-- right column
  4337.    -------
  4338.       AX = bytes used to store the image
  4339.  
  4340. Description:
  4341.  
  4342. The MV_SCRSAVE service saves an area of the screen to a buffer.
  4343. The number of bytes used to store the image is returned. You can
  4344. find out the number of bytes that will be needed in advance, if
  4345. desired, via the MV_SAVESIZE service.
  4346.  
  4347. The saved image will be a direct copy of the specified area of
  4348. the screen. The first two bytes of the image will contain the
  4349. number of rows and columns in the image, respectively.
  4350.  
  4351. Text mode (modes 0-3, 7) is required. Only display page zero is
  4352. supported.
  4353.  
  4354. Service : MV_SHOWCURSOR
  4355.  
  4356. Module  : Machine-level Video Services
  4357.  
  4358. Compat  : Clone
  4359.  
  4360. Purpose : Shows the cursor
  4361.  
  4362. Parms:
  4363.    none
  4364.  
  4365. Description:
  4366.  
  4367. The MV_SHOWCURSOR service shows the cursor, making it visible.
  4368. NOTE: This service may change the cursor shape if used before
  4369. MV_HIDECURSOR.
  4370.  
  4371. Redirection, if any, is ignored.
  4372.  
  4373.  
  4374.  
  4375.  
  4376. Service : MV_STROUT
  4377.  
  4378. Module  : Machine-level Video Services
  4379.  
  4380. Compat  : Clone
  4381.  
  4382. Purpose : Displays a string on the screen
  4383.  
  4384. Parms:
  4385.    DS:DX <-- ptr to the string to display
  4386.  
  4387. Description:
  4388.  
  4389. The MV_STROUT routine displays a string on the screen. The
  4390. string must be in ASCIIZ (NUL terminated) format. The screen
  4391. must be in one of the text modes (video modes 0-3, 7).
  4392.  
  4393. The following control codes are interpreted:
  4394.    7      Bell             beep
  4395.    8      Backspace        non-destructive backspace
  4396.    9      Tab              space over to the next tab stop
  4397.   10      Linefeed         move cursor down one line
  4398.   12      Formfeed         clear screen and home cursor
  4399.   13      Carriage Return  home cursor on current line
  4400.  
  4401. Redirection, if any, is ignored.
  4402.  
  4403. Service : MV_WHERE
  4404.  
  4405. Module  : Machine-level Video Services
  4406.  
  4407. Compat  : Clone
  4408.  
  4409. Purpose : Gets the cursor position
  4410.  
  4411. Parms:
  4412.    -------
  4413.       DH = row (1-25)
  4414.       DL = column (1-40/80)
  4415.  
  4416. Description:
  4417.  
  4418. The MV_WHERE service gets the cursor position. The screen must
  4419. be in one of the text modes (video modes 0-3, 7).
  4420.  
  4421. Redirection, if any, is ignored.
  4422.  
  4423. Service : S0_COMPARE
  4424.  
  4425. Module  : String Services
  4426.  
  4427. Compat  : Any
  4428.  
  4429. Purpose : Compares two strings
  4430.  
  4431. Parms:
  4432.    DS:SI <-- ptr to first string
  4433.    ES:DI <-- ptr to second string
  4434.    -------
  4435.    Flags = ZF if equal, NZ if not equal
  4436.    Flags = CY if first < second, NC if first >= second
  4437.  
  4438. Description:
  4439.  
  4440. The S0_COMPARE service compares two strings. The carry flag and
  4441. zero flag are set as you might expect for a comparison
  4442. operation.
  4443.  
  4444. Strings must be in ASCIIZ form (NUL terminated).
  4445.  
  4446.  
  4447.  
  4448.  
  4449. Service : S0_DUPE
  4450.  
  4451. Module  : String Services
  4452.  
  4453. Compat  : Any
  4454.  
  4455. Purpose : Creates a string by duplicating a given character
  4456.  
  4457. Parms:
  4458.       AL <-- character to duplicate
  4459.       CX <-- number of times to repeat the character
  4460.    ES:DI <-- ptr to result string
  4461.  
  4462. Description:
  4463.  
  4464. The S0_DUPE service creates a string by repeating a single
  4465. character. The resulting string will be in ASCIIZ form (NUL
  4466. terminated), so be sure to use a buffer large enough to hold
  4467. both the string and its terminator.
  4468.  
  4469. Service : S0_FIND
  4470.  
  4471. Module  : String Services
  4472.  
  4473. Compat  : Any
  4474.  
  4475. Purpose : Searches for a substring within a string
  4476.  
  4477. Parms:
  4478.    DS:SI <-- ptr to substring
  4479.    ES:DI <-- ptr to string
  4480.    -------
  4481.       AX = position of substring within string
  4482.  
  4483. Description:
  4484.  
  4485. The S0_FIND service searches for a substring within a string. It
  4486. returns zero if the substring does not exist within the string.
  4487. The Zero Flag is set accordingly (NZ if found).
  4488.  
  4489. Service : S0_LEFT
  4490.  
  4491. Module  : String Services
  4492.  
  4493. Compat  : Any
  4494.  
  4495. Purpose : Copies a section from the left of a string
  4496.  
  4497. Parms:
  4498.       CX <-- number of characters to copy
  4499.    DS:SI <-- ptr to source string
  4500.    ES:DI <-- ptr to result string
  4501.  
  4502. Description:
  4503.  
  4504. The S0_LEFT service copies a specified number of characters from
  4505. the left of one string into another. If you prefer, you can use
  4506. the same address for both strings, allowing you to place the
  4507. result back into the source buffer.
  4508.  
  4509. Strings must be in ASCIIZ form (NUL terminated).
  4510.  
  4511.  
  4512.  
  4513.  
  4514. Service : S0_LENGTH
  4515.  
  4516. Module  : String Services
  4517.  
  4518. Compat  : Any
  4519.  
  4520. Purpose : Returns the length of a string
  4521.  
  4522. Parms:
  4523.    DS:SI <-- ptr to source string
  4524.    -------
  4525.       CX = string length
  4526.  
  4527. Description:
  4528.  
  4529. The S0_LENGTH service returns the length of a string, not
  4530. counting the NUL terminator.
  4531.  
  4532. Strings must be in ASCIIZ form (NUL terminated).
  4533.  
  4534. Service : S0_LOCASE
  4535.  
  4536. Module  : String Services
  4537.  
  4538. Compat  : Any
  4539.  
  4540. Purpose : Converts a string to lowercase (International)
  4541.  
  4542. Parms:
  4543.    DS:SI <-- ptr to source string
  4544.    ES:DI <-- ptr to result string
  4545.  
  4546. Description:
  4547.  
  4548. The S0_LOCASE service converts all of the alphabetic characters
  4549. in a string to lowercase. As well as American alphabet
  4550. characters, the international alphabet characters supplied in
  4551. the upper 128 IBM ASCII set are also translated.
  4552.  
  4553. If you prefer, you can use the same address for both strings,
  4554. allowing you to place the result back into the source buffer.
  4555.  
  4556. Strings must be in ASCIIZ form (NUL terminated).
  4557.  
  4558. See also S0_LOCASES, which provides a slightly slower service
  4559. which affects only American letters, at a fraction of the cost
  4560. in memory.
  4561.  
  4562.  
  4563.  
  4564.  
  4565. Service : S0_LOCASES
  4566.  
  4567. Module  : String Services
  4568.  
  4569. Compat  : Any
  4570.  
  4571. Purpose : Converts a string to lowercase (American)
  4572.  
  4573. Parms:
  4574.    DS:SI <-- ptr to source string
  4575.    ES:DI <-- ptr to result string
  4576.  
  4577. Description:
  4578.  
  4579. The S0_LOCASES service converts all of the alphabetic characters
  4580. in a string to lowercase. Only American letters (in the ASCII
  4581. range 1-127) are affected.
  4582.  
  4583. If you prefer, you can use the same address for both strings,
  4584. allowing you to place the result back into the source buffer.
  4585.  
  4586. Strings must be in ASCIIZ form (NUL terminated).
  4587.  
  4588. See also S0_LOCASE, which provides a faster international
  4589. version of the same routine, at the cost of more memory.
  4590.  
  4591.  
  4592.  
  4593.  
  4594. Service : S0_MID
  4595.  
  4596. Module  : String Services
  4597.  
  4598. Compat  : Any
  4599.  
  4600. Purpose : Copies a section of one string to another
  4601.  
  4602. Parms:
  4603.       CX <-- number of characters to copy
  4604.       DX <-- where to start copying from (1-x)
  4605.    DS:SI <-- ptr to source string
  4606.    ES:DI <-- ptr to result string
  4607.  
  4608. Description:
  4609.  
  4610. The S0_MID service copies a specified number of characters one
  4611. string to another, starting from a given location. If you
  4612. prefer, you can use the same address for both strings, allowing
  4613. you to place the result back into the source buffer.
  4614.  
  4615. Strings must be in ASCIIZ form (NUL terminated).
  4616.  
  4617. Service : S0_RIGHT
  4618.  
  4619. Module  : String Services
  4620.  
  4621. Compat  : Any
  4622.  
  4623. Purpose : Copies a section from the right of a string
  4624.  
  4625. Parms:
  4626.       CX <-- number of characters to copy
  4627.    DS:SI <-- ptr to source string
  4628.    ES:DI <-- ptr to result string
  4629.  
  4630. Description:
  4631.  
  4632. The S0_RIGHT service copies a specified number of characters
  4633. from the right of one string into another. If you prefer, you
  4634. can use the same address for both strings, allowing you to place
  4635. the result back into the source buffer.
  4636.  
  4637. Strings must be in ASCIIZ form (NUL terminated).
  4638.  
  4639.  
  4640.  
  4641.  
  4642. Service : S0_TRIM
  4643.  
  4644. Module  : String Services
  4645.  
  4646. Compat  : Any
  4647.  
  4648. Purpose : Trims the white space from either side of a string
  4649.  
  4650. Parms:
  4651.       AL <-- trim code: set bit 0 for left, bit 1 for right
  4652.    DS:SI <-- ptr to source string
  4653.    ES:DI <-- ptr to result string
  4654.  
  4655. Description:
  4656.  
  4657. The S0_TRIM service removes the "white space" from either side
  4658. (or both sides) of a string. Blanks and control characters are
  4659. considered white space. This is a handy routine for normalizing
  4660. user input and trimming the padding from fixed-length records,
  4661. for instance.
  4662.  
  4663. If you prefer, you can use the same address for both strings,
  4664. allowing you to place the result back into the source buffer.
  4665.  
  4666. Strings must be in ASCIIZ form (NUL terminated).
  4667.  
  4668. Service : S0_UPCASE
  4669.  
  4670. Module  : String Services
  4671.  
  4672. Compat  : Any
  4673.  
  4674. Purpose : Converts a string to uppercase (International)
  4675.  
  4676. Parms:
  4677.    DS:SI <-- ptr to source string
  4678.    ES:DI <-- ptr to result string
  4679.  
  4680. Description:
  4681.  
  4682. The S0_UPCASE service converts all of the alphabetic characters
  4683. in a string to uppercase. As well as American alphabet
  4684. characters, the international alphabet characters supplied in
  4685. the upper 128 IBM ASCII set are also translated.
  4686.  
  4687. If you prefer, you can use the same address for both strings,
  4688. allowing you to place the result back into the source buffer.
  4689.  
  4690. Strings must be in ASCIIZ form (NUL terminated).
  4691.  
  4692. See also S0_UPCASES, which provides a slightly slower service
  4693. which will capitalize only American letters, but which takes up
  4694. a fraction of the memory.
  4695.  
  4696. Service : S0_UPCASES
  4697.  
  4698. Module  : String Services
  4699.  
  4700. Compat  : Any
  4701.  
  4702. Purpose : Converts a string to uppercase (American)
  4703.  
  4704. Parms:
  4705.    DS:SI <-- ptr to source string
  4706.    ES:DI <-- ptr to result string
  4707.  
  4708. Description:
  4709.  
  4710. The S0_UPCASES service converts all of the alphabetic characters
  4711. in a string to uppercase. Only American letters (ASCII 1-127
  4712. range) are affected.
  4713.  
  4714. If you prefer, you can use the same address for both strings,
  4715. allowing you to place the result back into the source buffer.
  4716.  
  4717. Strings must be in ASCIIZ form (NUL terminated).
  4718.  
  4719. See also S0_UPCASE, which provides a faster service which will
  4720. capitalize letters in the entire IBM ASCII set (ASCII 1-255),
  4721. but which takes up considerably more memory.
  4722.  
  4723. Service : TC_CHKSUM
  4724.  
  4725. Module  : Telecommunications Services
  4726.  
  4727. Compat  : Any
  4728.  
  4729. Purpose : Calculates a checksum for Xmodem or Ymodem
  4730.  
  4731. Parms:
  4732.    DS:SI <-- ptr to data block
  4733.       CX <-- length of data block (bytes)
  4734.    -------
  4735.       AX = checksum
  4736.  
  4737. Description:
  4738.  
  4739. The TC_CHKSUM routine calculates the checksum of a block of
  4740. data. The algorithm used is compatible with the Xmodem and
  4741. Ymodem file transfer protocols (use the lower byte of the
  4742. checksum, AL, in that case).
  4743.  
  4744.  
  4745.  
  4746.  
  4747. Service : TC_CRC
  4748.  
  4749. Module  : Telecommunications Services
  4750.  
  4751. Compat  : Any
  4752.  
  4753. Purpose : Calculates a CRC for Xmodem or Ymodem
  4754.  
  4755. Parms:
  4756.    DS:SI <-- ptr to data block
  4757.       CX <-- length of data block (bytes)
  4758.    -------
  4759.       AX = CRC
  4760.  
  4761. Description:
  4762.  
  4763. The TC_CRC routine calculates the CRC (Cyclical Redundancy
  4764. Check) value of a block of data. The algorithm used is
  4765. compatible with the Xmodem and Ymodem file transfer protocols.
  4766.  
  4767. If you use TC_CRC for an outgoing Xmodem/Ymodem block, you need
  4768. to add two nulls to the end of the block and increment CX
  4769. accordingly. When you get the CRC, exchange AL and AH, then put
  4770. AX where the nulls were, which will complete the outgoing
  4771. packet. The reason for the swap is that Xmodem/Ymodem expect the
  4772. CRC with the high byte followed by the low byte (non-Intel
  4773. format).
  4774.  
  4775. If you use TC_CRC for an incoming Xmodem/Ymodem block, leave the
  4776. received CRC at the end of the data block and increment CX
  4777. accordingly. If the calculated CRC comes out to zero, the
  4778. received packet is fine.
  4779.  
  4780. Service : TD_GETDATE
  4781.  
  4782. Module  : Time and Date Services
  4783.  
  4784. Compat  : DOS
  4785.  
  4786. Purpose : Returns the date as a formatted string
  4787.  
  4788. Parms:
  4789.       AL <-- 0 for 2-digit year, 1 for 4-digit year
  4790.    DS:DX <-- ptr to result buffer (minimum 11 bytes)
  4791.  
  4792. Description:
  4793.  
  4794. The TD_GETDATE service returns the current date as a formatted
  4795. string. The formatting includes international date handling, in
  4796. that the string is formatted in the appropriate manner for the
  4797. country in which the computer is being operated. If a DOS
  4798. version before 3.0 is used, the date delimiters are not
  4799. guaranteed to be correct, but the month, day and year will be in
  4800. the proper order regardless.
  4801.  
  4802. The result is returned as an ASCIIZ (NUL terminated) string.
  4803.  
  4804.  
  4805.  
  4806.  
  4807. Service : TD_GETTIME
  4808.  
  4809. Module  : Time and Date Services
  4810.  
  4811. Compat  : DOS
  4812.  
  4813. Purpose : Returns the time as a formatted string
  4814.  
  4815. Parms:
  4816.    DS:DX <-- ptr to result buffer (minimum 8 bytes)
  4817.  
  4818. Description:
  4819.  
  4820. The TD_GETTIME service returns the current time as a formatted
  4821. string. The formatting includes international time handling, in
  4822. that the string is formatted in the appropriate manner for the
  4823. country in which the computer is being operated. If a DOS
  4824. version before 3.0 is used, the time delimiters and 12/24-hour
  4825. formatting are not guaranteed to be correct.
  4826.  
  4827. If the hour is a single-digit number, it will be preceeded by a
  4828. space. This is handy for keeping times in columns, but if you
  4829. don't want the space there, chop it off by calling the S0_TRIM
  4830. service.
  4831.  
  4832. The result is returned as an ASCIIZ (NUL terminated) string.
  4833.