home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / fortran / elmop10.zip / ELMOPLIB.DOC < prev   
Text File  |  1993-04-07  |  87KB  |  2,909 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.              ╔═════════════════════════════════════════════════════╗
  15.              ║                                                     ║
  16.              ║                                                     ║
  17.              ║                  E L M O P   L I B                  ║
  18.              ║                                                     ║
  19.              ║          ( Pronounced  L - MO - P   LYE-B )         ║
  20.              ║                                                     ║
  21.              ║                                                     ║
  22.              ║                                                     ║
  23.              ║    A set of MicroSoft FORTRAN compatible routines   ║
  24.              ║                                                     ║
  25.              ║                                                     ║
  26.              ║                                                     ║
  27.              ║                  Michael A. Gerhard                 ║
  28.              ║                                                     ║
  29.              ║                                                     ║
  30.              ║                                                     ║
  31.              ║                    March 15, 1993                   ║
  32.              ║                                                     ║
  33.              ║                                                     ║
  34.              ╚═════════════════════════════════════════════════════╝
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                                  About Shareware
  42.                                  ---------------
  43.  
  44.              The ELMOP.LIB software is sold as shareware via user groups,
  45.         "Public Domain Software Entities", and directly from me. This
  46.         does not mean the software is free, it is not.
  47.  
  48.              The software is distributed with a nominal charge (to cover
  49.         the cost of making a disk and shipping it), so you may try the
  50.         software out first, and be assured it works with your system, and
  51.         that you wish to use it. Once you are satisfied it's adequate and
  52.         meets your needs, I the developer expect you to register with me
  53.         and pay the registration fee.
  54.  
  55.              The entire shareware concept relies on the faith of software
  56.         developers, and the honesty of users. If you abuse the privilege
  57.         of shareware software, you  risk not having any shareware, so
  58.         make your choices carefully regarding your need to register for
  59.         this or any other shareware product.
  60.  
  61.              The ELMOP.LIB shareware package may be freely distributed by
  62.         anyone, so long as not more than $5 is charged for duplicating
  63.         the disk and/or manual (the manual is on the disk). I encourage
  64.         you to make copies and give them to friends, your user group, or
  65.         anyone else. Make sure you give them an unaltered version, with
  66.         the manual on the disk.
  67.  
  68.              The assembly source code for ELMOP.LIB functions is avail-
  69.         able.  They are copyrighted and are not to be distributed.
  70.  
  71.              Registered users of ELMOP.LIB will be notified of specific
  72.         errors, corrections and updates by mail. There is also limited
  73.         telephone support for registered users.
  74.  
  75.         Shareware Disk                $  7.00    Manual on disk
  76.         Registration & Disk           $ 20.00    Manual on disk
  77.         If you bought your share disk from me, I'll register you for $13.
  78.         Assembly source (ELMOP.lib)   $ 15.00    Requires A86 assembler.
  79.         Printed Manual                $ 15.00
  80.  
  81.         NOTE: Please state disk size  (5.25" or 3.5")
  82.               If no size is stated I will ship 5.25" disk.
  83.  
  84.         For Info call (510) 372-0365 (evenings or Friday-Sunday all day)
  85.         To order, send check or mony order, and state items desired, to:
  86.              Michael Gerhard
  87.              2224 Forsythia Way
  88.              Martinez, CA  94553
  89.  
  90.  
  91.  
  92.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  93.  
  94.  
  95.                                 TABLE OF CONTENTS
  96.                                 _________________
  97.  
  98.  
  99.  
  100.              INTRODUCTION and RESTRICTIONS........................  1
  101.  
  102.  
  103.              DOS FUNCTIONS........................................  2
  104.  
  105.                 System TIME and DATE utilities....................  2
  106.                    CTIME    (Return system time)..................  2
  107.                    ITIME    (Return system time)..................  3
  108.                    SETTIM   (Set the system time).................  3
  109.                    CDATE    (Return system date)..................  3
  110.                    IDATE    (Return system date)..................  3
  111.                    SETDAT   (Set the system date).................  4
  112.  
  113.                 Directory list utilities..........................  4
  114.                    DDIR     (Return file list)....................  4
  115.                    SDDIR    (Return sorted file list).............  4
  116.                    SBDIR    (Return subdirectory list)............  4
  117.                    SSBDIR   (Return sorted subdirectory list).....  4
  118.  
  119.                 Disk file utilities...............................  5
  120.                    DSDEL    (Delete a file).......................  6
  121.                    DSREN    (Rename a file).......................  6
  122.                    FILDNT   (Return file date and time)...........  7
  123.                    SETDNT   (Set file date and time)..............  7
  124.                    FLINFO   (Return file information).............  8
  125.                    IFLSIZ   (Return size of a file)...............  8
  126.                    IRECLN   (Return file record length)...........  9
  127.                    LEXIST   (Return existence of a file)..........  9
  128.                    PTHFND   (Find file using the DOS path)........ 10
  129.                    IOLDST   (Compare two file times/dates)........ 10
  130.                    SETARC   (Set or clear archive flag)........... 11
  131.                    GATRIB   (Return file attributes).............. 11
  132.  
  133.                 Disk drive utilities.............................. 12
  134.                    IGTDRV   (Return default drive)................ 12
  135.                    SETDRV   (Change default drive)................ 13
  136.                    IDSKSP   (Return space on a disk).............. 13
  137.                    IDSKSZ   (Return size of a disk)............... 13
  138.                    IDSTAT   (Check status of floppy drive)........ 14
  139.                    NMHDRV   (Return number of harddisk drives).... 14
  140.                    VOLUME   (Return disk volume label)............ 14
  141.  
  142.                 Subdirectory utilities............................ 15
  143.                    MKDIR    (Create subdirectory)................. 15
  144.                    CHDIR    (Change current subdirectory)......... 16
  145.                    RENDIR   (Rename a subdirectory)............... 16
  146.                    RMDIR    (Remove subdirectory)................. 17
  147.                    CURDIR   (Return current subdirectory)......... 17
  148.  
  149.  
  150.  
  151.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  152.  
  153.  
  154.              DOS FUNCTIONS  (continued)
  155.  
  156.                 Write verify utilities............................ 18
  157.                    IGTVER   (Return write verify flag)............ 18
  158.                    VERON    (Set write verify flag on)............ 18
  159.                    VEROFF   (Set write verify flag off)........... 18
  160.  
  161.                 Command line...................................... 19
  162.                    CMDLIN   (Return program command line)......... 19
  163.  
  164.  
  165.                 Miscellaneous DOS functions....................... 19
  166.                    DOSVER   (Return DOS version number)........... 19
  167.                    MEMFRE   (Return amount of free memory)........ 19
  168.  
  169.  
  170.                 Environment utilities............................. 20
  171.                    CHKENV   (Return SET value from environment)... 20
  172.                    PROGNM   (Return program name)................. 21
  173.                    RDENV    (Return complete environment table)... 21
  174.  
  175.  
  176.              DISPLAY FUNCTIONS.................................... 22
  177.  
  178.                    DISPC    (Display a character)................. 22
  179.                    DISPMC   (Display 'N' characters).............. 22
  180.                    DISPST   (Display string of characters)........ 23
  181.  
  182.  
  183.              PRINTER FUNCTIONS.................................... 24
  184.  
  185.                    IPSTAT   (Return status of Printer Port)....... 24
  186.                    PRNTC    (Print a single character)............ 25
  187.                    PRNTMC   (Print 'N' characters)................ 25
  188.                    PRNTST   (Print string of characters).......... 26
  189.  
  190.  
  191.              COMPORT FUNCTIONS.................................... 27
  192.  
  193.                    INTCOM   (Initialize communication port)....... 27
  194.                    SENDMC   (Send 'N' characters)................. 28
  195.  
  196.  
  197.              KEYBOARD FUNCTIONS................................... 29
  198.  
  199.                    GTKEYE   (Wait for a key and echo)............. 30
  200.                    GTKEYS   (Wait for a key and do not echo)...... 30
  201.                    IGTKYE   (Get a key, echo and do not wait)..... 30
  202.                    IGTKEY   (Get a key, do not echo or wait)...... 30
  203.                    KBFLSH   (Flush keyboard buffer)............... 31
  204.                    KBUFIN   (Read the keyboard buffer)............ 31
  205.                    KEYRDY   (Check for key ready)................. 31
  206.  
  207.  
  208.  
  209.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  210.  
  211.  
  212.              VIDEO FUNCTIONS...................................... 32
  213.  
  214.                 Cursor utilities.................................. 32
  215.                    CUROFF   (Set cursor off)...................... 32
  216.                    CURSOR   (Set cursor size)..................... 32
  217.                    GETCUR   (Return cursor location and size)..... 33
  218.                    POSCUR   (Position cursor)..................... 33
  219.  
  220.                 Video mode and clear screen utilities............. 34
  221.                    CLS      (Clear screen)........................ 34
  222.                    IGTAPG   (Return active page).................. 35
  223.                    IGTMOD   (Return video mode)................... 35
  224.                    PGSWAP   (Swap pages 0 and 1).................. 35
  225.                    PSCRN    (Print screen)........................ 35
  226.                    SCRLDN   (Scroll window down).................. 36
  227.                    SCRLUP   (Scroll window up).................... 36
  228.                    SETAPG   (Set active page)..................... 36
  229.                    SETMOD   (Set video mode)...................... 36
  230.  
  231.                 Screen write utilities............................ 37
  232.                    HWRITE   (Write string to 'hidden' page)....... 38
  233.                    HWRITN   (Write n chars to 'hidden' page)...... 39
  234.                    SWRITE   (Write string to any page)............ 39
  235.                    SWRITN   (Write n chars to any page)........... 40
  236.                    WRTSTR   (Write string to active page)......... 40
  237.                    WRTSTN   (Write n chars to active page)........ 41
  238.                    PUTBLK   (Put block of characters)............. 41
  239.  
  240.                 Screen read utilities............................. 42
  241.                    GETBLK   (Get block of characters)............. 42
  242.                    GETCHR   (Get character from screen)........... 43
  243.  
  244.  
  245.  
  246.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  247.  
  248.  
  249.                                   INTRODUCTION
  250.                                   ____________
  251.  
  252.              These Fortran callable routines are compatible with Micro-
  253.         Soft FORTRAN versions 3.xx, 4.xx, and 5.xx.  They provide a
  254.         number of DOS functions that are not directly available in FOR-
  255.         TRAN.  Some of the features of these routines are listed below.
  256.              Set and return system time and date
  257.              Return directory lists of files and subdirectories
  258.              Create, remove, or change subdirectories
  259.              Return disk size and free space, current disk
  260.              Check floppy disk drive status
  261.              Return the program command line
  262.              Return program name, environment information
  263.              Send characters to the standard output device
  264.              Send characters to the standard printer device
  265.              Capture key stokes
  266.              Manipulate the cursor appearance and position
  267.              Clear or scroll all or portions of the screen
  268.              Display characters on any video page (color)
  269.              Get and put blocks of characters on the screen
  270.              Mouse functions (coming soon)
  271.  
  272.                                   RESTRICTIONS
  273.                                   ____________
  274.  
  275.              Most of the numeric arguments are INTEGER*2, but several are
  276.         INTEGER*4.  Make sure all arguments have the correct type.
  277.  
  278.              Use the LARGE or HUGE memory models.  ELMOP.LIB assumes that
  279.         the addresses placed on the stack for all arguments are 32bit
  280.         (i.e., they include the SEGMENT and NEAR address).  See your MS
  281.         FORTRAN manual for more information concering memory models.
  282.  
  283.                                       NOTES
  284.                                       _____
  285.  
  286.              All arguments that pass data to ELMOP.LIB routines may be
  287.         literals.  However, for numeric arguments you must ensure they
  288.         are the correct type.  An example using literals is shown below.
  289.  
  290.              CALL WRTSTR ( 10, 20, 15, 'This is a literal string\' )
  291.  
  292.              ELMOP.LIB supports the Lahey-F77L compiler. You must declare
  293.         each ELMOP.LIB function using the MSEXTERNAL keyword, and do so
  294.         in each routine using the ELMOP.LIB functions as shown below.
  295.  
  296.              Character*12  FILES(mxfils)
  297.              Character     MASK*n
  298.              Integer*2     NFILES, MXFILS
  299.              msexternal    DDIR
  300.  
  301.              call DDIR   ( MASK, MXFILS, FILES, NFILES )
  302.  
  303.  
  304.                                           1
  305.  
  306.  
  307.  
  308.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  309.  
  310.  
  311.                                   DOS FUNCTIONS
  312.                                   _____________
  313.  
  314.  
  315.         System TIME and DATE Utilities        ______________________________
  316.  
  317.              These routines allow you to set and return the system TIME
  318.         and DATE.  TIME and DATE are returned as character strings or as
  319.         their numeric components.
  320.  
  321.  
  322.         Summary
  323.  
  324.              Return system TIME as character string
  325.  
  326.                 call CTIME  ( HMS )
  327.  
  328.              Return system TIME as numeric components
  329.  
  330.                 call ITIME  ( HR, MIN, SEC, HUND )
  331.  
  332.              Set system TIME
  333.  
  334.                 call SETTIM ( HR, MIN, SEC, HUND, IER )
  335.  
  336.              Return system DATE as character string
  337.  
  338.                 call CDATE  ( MDY )
  339.  
  340.              Return system DATE as numeric components
  341.  
  342.                 call IDATE  ( MONTH, DAY, YEAR, DOW )
  343.  
  344.              Set system DATE
  345.  
  346.                 call SETDAT ( MONTH, DAY, YEAR, IER )
  347.  
  348.  
  349.  
  350.         CTIME    (Return system TIME as character string)
  351.  
  352.              Character   HMS*9
  353.  
  354.              call CTIME  ( HMS )
  355.  
  356.                 Where ---
  357.                    HMS    = TIME as character string
  358.                                                 (Form 'HH:MM:SS\')
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.                                           2
  367.  
  368.  
  369.  
  370.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  371.  
  372.  
  373.         ITIME    (Return system TIME as numeric components)
  374.  
  375.              Integer*2   HR, MIN, SEC, HUND
  376.  
  377.              call ITIME  ( HR, MIN, SEC, HUND )
  378.  
  379.                 Where ---
  380.                    HR     = Integer hour        (0 to 23)
  381.                    MIN    = Integer minutes     (0 to 59)
  382.                    SEC    = Integer seconds     (0 to 59)
  383.                    HUND   = Integer hundredths of a second
  384.                                                 (0 to 99)
  385.  
  386.  
  387.         SETTIM       (Set system TIME)
  388.  
  389.              Integer*2   HR, MIN, SEC, HUND, IER
  390.  
  391.              call SETTIM ( HR, MIN, SEC, HUND, IER )
  392.  
  393.                 Where ---
  394.                    HR    = Integer hour         (0 to 23)
  395.                    MIN   = Integer minutes      (0 to 59)
  396.                    SEC   = Integer seconds      (0 to 59)
  397.                    HUND  = Integer hundredths of a second
  398.                                                 (0 to 99)
  399.                    IER   = Integer error flag   (0=time set
  400.                                                  1=ERROR, time not set)
  401.  
  402.  
  403.         CDATE    (Return system DATE as character string)
  404.  
  405.              Character   MDY*9
  406.  
  407.              call CDATE  ( MDY )
  408.  
  409.                 Where ---
  410.                    MDY   = DATE as a character string in form 'MM/DD/YY\'
  411.  
  412.  
  413.  
  414.         IDATE    (Return system DATE as numeric components)
  415.  
  416.              Integer*2   MONTH, DAY, YEAR, DOW
  417.  
  418.              call IDATE  ( MONTH, DAY, YEAR, DOW )
  419.  
  420.                 Where ---
  421.                    MONTH = Integer month        (1 to 12
  422.                                                  1=Jan, 2=Feb, etc.)
  423.                    DAY   = Integer day          (1 to 31)
  424.                    YEAR  = Integer year         (1980 to 2099)
  425.                    DOW   = Integer day of week  (0 to 6
  426.                                                  0=Sun, 1=Mon, etc.)
  427.  
  428.                                           3
  429.  
  430.  
  431.  
  432.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  433.  
  434.  
  435.         SETDAT       (Set system DATE)
  436.  
  437.              Integer*2   MONTH, DAY, YEAR, IER
  438.  
  439.              call SETDAT ( MONTH, DAY, YEAR, IER )
  440.  
  441.                 Where ---
  442.                    MONTH = Integer month        (1 to 12
  443.                                                  1=Jan, 2=Feb, etc.)
  444.                    DAY   = Integer day          (1 to 31)
  445.                    YEAR  = Integer year         (1980 to 2099)
  446.                    IER   = Integer error flag   (0=date set
  447.                                                  1=ERROR, date not set)
  448.  
  449.  
  450.         DIRECTORY List Utilities        ________________________
  451.  
  452.              These routines will return a list of files or subdirectories
  453.         for any drive and any subdirectory.  A file mask may be specified
  454.         to limit the search.
  455.  
  456.  
  457.         DDIR       (Return file list)
  458.         SDDIR      (Return sorted file list)
  459.         SBDIR      (Return subdirectory list)
  460.         SSBDIR     (Return sorted subdirectory list)
  461.  
  462.              Character*12  FILES(mxfils)
  463.              Character     MASK*n
  464.              Integer*2     NFILES, MXFILS
  465.  
  466.              call DDIR   ( MASK, MXFILS, FILES, NFILES )
  467.              call SDDIR  ( MASK, MXFILS, FILES, NFILES )
  468.              call SBDIR  ( MASK, MXFILS, FILES, NFILES )
  469.              call SSBDIR ( MASK, MXFILS, FILES, NFILES )
  470.  
  471.                 Where ---
  472.                    MASK   = Directory search mask, may include drive,
  473.                             subdirectory and global wildcards. Must end
  474.                             with either a null (00h byte) or the
  475.                             character '|'
  476.                             Examples: '*.*|'   '*.FOR|'   'A:S??.EX?|'
  477.                                       'A:FILES.|'  'C:\DIR1\SUBDIR1\*.*|'
  478.                    MXFILS = Maximum number of names to get
  479.                        NOTE - Examines the 1st MXFILS in the directory so
  480.                               it is possible to NOT get the 1st MXFILS
  481.                               alphabetical files in the sorted list.
  482.                    FILES  = Array to receive the file name list
  483.                             Name is immediately followed by the extension
  484.                             FILES(n) = 'nnnnn.xxx   ' i.e. 'source.for  '
  485.                             Subdirectory names do not include an
  486.                             extension or leading '\'
  487.                        NOTE - FILES must be dimensioned at least MXFILS
  488.                    NFILES = Number of names actually returned in FILES
  489.  
  490.                                           4
  491.  
  492.  
  493.  
  494.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  495.  
  496.  
  497.         DISK FILE utilities        ___________________
  498.  
  499.              These routines will delete or rename disk files, check to
  500.         see if a file exists, return system information about files, com-
  501.         pare files to determine the oldest, and set file time and date.
  502.  
  503.         Summary
  504.              Delete a file
  505.  
  506.                 call DSDEL  ( FILNAM, IER )
  507.  
  508.              Rename a file
  509.  
  510.                 call DSREN  ( FILNAM, NEWFIL, IER )
  511.  
  512.              Return file time and date
  513.  
  514.                 call FILDNT ( FILNAM, MONTH,DAY,YEAR, HR,MIN,SEC )
  515.  
  516.              Set file time and date
  517.  
  518.                 call SETDNT ( FILNAM, MONTH,DAY,YEAR, HR,MIN,SEC, IER )
  519.  
  520.              Return file information
  521.  
  522.                 call FLINFO ( FILNAM, ISIZ, IATRIB, FDATE, FTIME )
  523.  
  524.              Return file size
  525.  
  526.                 isiz = IFLSIZ ( FILNAM )
  527.  
  528.              Return file record length
  529.  
  530.                 leng = IRECLN ( FILNAM )
  531.  
  532.              Check to see if file exists
  533.  
  534.                 exst = LEXIST ( FILNAM )
  535.  
  536.              Find file using the DOS path
  537.  
  538.                 call PTHFND ( FILE, PFILE, NCHR )
  539.  
  540.              Compare date/time of two files
  541.  
  542.                 iold = IOLDST ( FILNAM, FILNM2 )
  543.  
  544.              Set or clear the archive flag for a file
  545.  
  546.                 call SETARC ( FILNAM, IARCH, IER )
  547.  
  548.              Return file attributes
  549.  
  550.                 call GATRIB ( FILNAM, IRW, IHID, ISYS, IARCH, IER )
  551.  
  552.                                           5
  553.  
  554.  
  555.  
  556.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  557.  
  558.  
  559.         DSDEL    (Delete a file)
  560.  
  561.              Character  FILNAM*n
  562.              Integer*2  IER
  563.  
  564.              call DSDEL ( FILNAM, IER )
  565.  
  566.                 Where ---
  567.                    FILNAM = Name of file to delete.
  568.                             May include drive and subdirectory (no wild-
  569.                             cards).  Must end with either a null (00h
  570.                             byte) or the character '|'
  571.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  572.                    IER    = Error flag     (0=file deleted
  573.                                             1=ERROR, file not deleted)
  574.  
  575.  
  576.  
  577.         DSREN    (Rename a file)
  578.  
  579.              Character  FILNAM*n, NEWFIL*m
  580.              Integer*2  IER
  581.  
  582.              call DSREN ( FILNAM, NEWFIL, IER )
  583.  
  584.                 Where ---
  585.                    FILNAM = Name of file to rename.
  586.                             May include drive and subdirectory (no wild-
  587.                             cards).  Must end with either a null (00h
  588.                             byte) or the character '|'
  589.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  590.                    NEWFIL = FILNAM will be renamed to NEWFIL
  591.                             Must not include wildcards, drive designation
  592.                             or subdirectory specification!  Must end with
  593.                             either a null (00h byte) or the character '|'
  594.                             Example:  'NEWJNK.OLD|'
  595.                    IER    = Error flag     (0=file renamed
  596.                                             1=ERROR, file not renamed)
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.                                           6
  615.  
  616.  
  617.  
  618.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  619.  
  620.  
  621.         FILDNT       (Return file date and time)
  622.  
  623.              Character  FILNAM*n
  624.              Integer*2  MONTH, DAY, YEAR, HR, MIN, SEC )
  625.  
  626.              call FILDNT ( FILNAM, MONTH, DAY, YEAR, HR, MIN, SEC )
  627.  
  628.                 Where ---
  629.                    FILNAM = Name of file to return date/time.
  630.                             May include drive and subdirectory (no wild-
  631.                             cards).  Must end with either a null (00h
  632.                             byte) or the character '|'
  633.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  634.                    MONTH  = Integer month       (1 to 12
  635.                                                  1=Jan, 2=Feb, etc.)
  636.                    DAY    = Integer day         (1 to 31)
  637.                    YEAR   = Integer year        (1980 to 2099)
  638.                    HR     = Integer hour        (0 to 23)
  639.                    MIN    = Integer minutes     (0 to 59)
  640.                    SEC    = Integer seconds     (0 to 59)
  641.                 NOTE - If file does not exist, date/time is
  642.                        returned as 0,0,1980  0,0,0
  643.  
  644.  
  645.  
  646.         SETDNT       (Set file date and time)
  647.  
  648.              Character  FILNAM*n
  649.              Integer*2  MONTH, DAY, YEAR, HR, MIN, SEC, IER
  650.  
  651.              call SETDNT ( FILNAM, MONTH, DAY, YEAR, HR, MIN, SEC, IER )
  652.  
  653.                 Where ---
  654.                    FILNAM = Name of file to set date/time.
  655.                             May include drive and subdirectory (no wild-
  656.                             cards).  Must end with either a null (00h
  657.                             byte) or the character '|'
  658.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  659.                    MONTH  = Integer month       (1 to 12
  660.                                                  1=Jan, 2=Feb, etc.)
  661.                    DAY    = Integer day         (1 to 31)
  662.                    YEAR   = Integer year        (1980 to 2099)
  663.                    HR     = Integer hour        (0 to 23)
  664.                    MIN    = Integer minutes     (0 to 59)
  665.                    SEC    = Integer seconds     (0 to 59)
  666.                    IER    = Error flag on set date/time
  667.                                       (0=file date/time set
  668.                                        1=ERROR, file date/time not set)
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.                                           7
  677.  
  678.  
  679.  
  680.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  681.  
  682.  
  683.         FLINFO       (Return system information about file)
  684.  
  685.              Character  FILNAM*n, FDATE*8, FTIME*6
  686.              Integer*4  ISIZ
  687.              Integer*2  IATRIB
  688.  
  689.              call FLINFO ( FILNAM, ISIZ, IATRIB, FDATE, FTIME )
  690.  
  691.                 Where ---
  692.                    FILNAM = Name of file to return system information.
  693.                             May include drive and subdirectory (no wild-
  694.                             cards).  Must end with either a null (00h
  695.                             byte) or the character '|'
  696.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  697.                    ISIZ   = File size      (0 if file does not exist)
  698.                    IATRIB = File attribute (0 if file does not exist)
  699.                                  Bit 0 Set ==> File is Read-Only
  700.                                  Bit 1 Set ==> File is Hidden
  701.                                  Bit 2 Set ==> File is System
  702.                                  Bit 4 Set ==> File is Subdirectory
  703.                                  Bit 5 Set ==> Files archive bit is set
  704.                                  Other bits are reserved
  705.                    FDATE  = File date of last write  ('MM/DD/YY')
  706.                                            (blank if file does not exist)
  707.                    FTIME  = File time of last write  ('HH:MMa')
  708.                                            (blank if file does not exist)
  709.  
  710.  
  711.  
  712.         IFLSIZ       (Return size of file)
  713.  
  714.              Character  FILNAM*n
  715.              Integer*4  ISIZ, IFLSIZ
  716.  
  717.              ISIZ = IFLSIZ ( FILNAM )
  718.  
  719.                 Where ---
  720.                    FILNAM = Name of file for size.
  721.                             May include drive and subdirectory (no wild-
  722.                             cards).  Must end with either a null (00h
  723.                             byte) or the character '|'
  724.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  725.                    IFLSIZ = Integer*4 Function returns file size in bytes
  726.                                       (0 if file does not exist)
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.                                           8
  739.  
  740.  
  741.  
  742.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  743.  
  744.  
  745.         IRECLN       (Return record length of direct access ASCII file)
  746.  
  747.              Character  FILNAM*n
  748.              Integer*2  IRECLN, LENG
  749.  
  750.              LENG = IRECLN ( FILNAM )
  751.  
  752.                 Where ---
  753.                    FILNAM = Name of file for record length.
  754.                             May include drive and subdirectory (no wild-
  755.                             cards).  Must end with either a null (00h
  756.                             byte) or the character '|'
  757.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  758.                        NOTE - File must be closed
  759.                    IRECLN = Integer*2 Function returns record length of
  760.                             direct access ASCII file
  761.                                  (0 if file does not exist or there is no
  762.                                   CR within the 1st 1024 bytes)
  763.  
  764.  
  765.  
  766.         LEXIST    (Check to see if file exists)
  767.  
  768.              Character  FILNAM*n
  769.              Logical*2  LEXIST, EXST
  770.  
  771.              EXST = LEXIST ( FILNAM )
  772.  
  773.                 or
  774.  
  775.              IF ( LEXIST(FILNAM) )  THEN
  776.                 ....
  777.  
  778.                 Where ---
  779.                    FILNAM = Name of file to check for existence.
  780.                             May include drive and subdirectory (no wild-
  781.                             cards).  Must end with either a null (00h
  782.                             byte) or the character '|'
  783.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  784.                    LEXIST = Logical Function returns file existence
  785.                                       .TRUE. = FILNAM exists
  786.                                       .FALSE. = FILNAM does not exist
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.                                           9
  801.  
  802.  
  803.  
  804.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  805.  
  806.  
  807.         PTHFND       (Find a file by searching the DOS path)
  808.  
  809.            NOTE: PTHFND must be used before any files are assigned!!!
  810.  
  811.              Character  FILE*12, PFILE*80
  812.              Integer*2  NCHR
  813.  
  814.              CALL PTHFND ( FILE, PFILE, NCHR )
  815.  
  816.                 where ---
  817.                    FILE   = 12 character file name to search for in path
  818.                             FORM: nnnnnnnn.eee  (must not include drive)
  819.                    PFILE  = Full path and file name (if found) including
  820.                             the ending NULL
  821.                    NCHR   = Number of characters returned in PFILE
  822.                             NCHR = 0   FILE not found in path
  823.                             NCHR > 0   Number of characters in PFILE
  824.                                          including the ending NULL
  825.  
  826.  
  827.  
  828.         IOLDST       (Compare date/time of two files)
  829.  
  830.              Character  FILNAM*n, FILNM2*m
  831.              Integer*2  IOLDST, IOLD
  832.  
  833.              IOLD = IOLDST ( FILNAM, FILNM2 )
  834.  
  835.                 Where ---
  836.                    FILNAM = Name of 1st file for date/time comparison.
  837.                             May include drive and subdirectory (no wild-
  838.                             cards).  Must end with either a null (00h
  839.                             byte) or the character '|'
  840.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  841.                    FILNM2 = Name of 2nd file for date/time comparison.
  842.                             May include drive and subdirectory (no wild-
  843.                             cards).  Must end with either a null (00h
  844.                             byte) or the character '|'
  845.                             Example:  'C:\DIR1\SUBDIR1\JUNK.BAK|'
  846.                    IOLDST = Integer*2 Function indicates oldest file
  847.                                       (-2  FILNM2 does not exist
  848.                                        -1  FILNAM does not exist
  849.                                         0  FILNAM & FILNM2 same date/time
  850.                                         1  FILNAM is older than FILNM2
  851.                                         2  FILNM2 is older than FILNAM)
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.                                           10
  863.  
  864.  
  865.  
  866.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  867.  
  868.  
  869.         SETARC       (Set or clear the archive flag for a file)
  870.  
  871.              Integer*2  IARCH, IER
  872.              Character  FILNAM*n
  873.  
  874.              CALL SETARC ( FILNAM, IARCH, IER )
  875.  
  876.                 Where ---
  877.                   FILNAM = Name of the file to modify archive flag
  878.                             May include drive and subdirectory (no wild-
  879.                             cards).  Must end with either a null (00h
  880.                             byte) or the character '|'
  881.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  882.                   IARCH  = Archive flag function  0=clear  1=set
  883.  
  884.                   IER    = Error flag  0=okay
  885.                                       (1=function code invalid
  886.                                        2=file not found
  887.                                        3=path not found or no file
  888.                                        5=could not change attribute)
  889.  
  890.  
  891.         GATRIB       (Return file attributes)
  892.  
  893.              Integer*2  IRW, IHID, ISYS, IARCH, IER
  894.              Character  FILNAM*n
  895.  
  896.              CALL GATRIB ( FILNAM, IRW, IHID, ISYS, IARCH, IER )
  897.  
  898.                 Where ---
  899.                   FILNAM = Name of the file to modify archive flag
  900.                             May include drive and subdirectory (no wild-
  901.                             cards).  Must end with either a null (00h
  902.                             byte) or the character '|'
  903.                             Example:  'C:\DIR1\SUBDIR1\JUNK.DAT|'
  904.                   IRW    = Read Only Flag
  905.  
  906.                   IHID   = Hidden File Flag
  907.  
  908.                   ISYS   = System File Flag
  909.  
  910.                   IARCH  = Arhive Flag
  911.  
  912.                   IER    = Error flag  0=okay
  913.                                       (1=function code invalid
  914.                                        2=file not found
  915.                                        3=path not found or no file)
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.                                           11
  925.  
  926.  
  927.  
  928.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  929.  
  930.  
  931.         DISK DRIVE Utilities        ____________________
  932.  
  933.              These routines will return and set the default drive, return
  934.         the space or size of any disk, return the disk volume label,
  935.         return the number of harddisk drives, and check the status of
  936.         floppy disk drives.
  937.  
  938.  
  939.         Summary
  940.  
  941.              Return default drive
  942.  
  943.                 drv   = IGTDRV ( DUMMY )
  944.  
  945.              Set default drive
  946.  
  947.                 call SETDRV ( IDRV )
  948.  
  949.              Return space on a disk
  950.  
  951.                 dspc  = IDSKSP ( IDRV )
  952.  
  953.              Return size of a disk
  954.  
  955.                 dsiz  = IDSKSZ ( IDRV )
  956.  
  957.              Check status of floppy disk drives
  958.  
  959.                 istat = IDSTAT ( IDRV )
  960.  
  961.              Return disk volume label
  962.  
  963.                 call VOLUME ( IDRV, LABEL )
  964.  
  965.              Return number of harddisk drives
  966.  
  967.                 numhd = NMHDRV ( DUMMY )
  968.  
  969.  
  970.         IGTDRV       (Return default drive)
  971.  
  972.              Integer*2  IGTDRV, IDRV
  973.  
  974.              IDRV = IGTDRV ( DUMMY )
  975.  
  976.                 where ---
  977.                    IGTDRV = Integer*2 Function returns default drive
  978.                                       (1=A, 2=B, 3=C, etc)
  979.                    DUMMY  = Dummy argument, used as place keeper
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                                           12
  987.  
  988.  
  989.  
  990.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  991.  
  992.  
  993.         SETDRV       (Change default drive)
  994.  
  995.              Integer*2  IDRV
  996.  
  997.              call SETDRV ( IDRV )
  998.  
  999.                 where ---
  1000.                    IDRV   = Drive number to set as default
  1001.                                       (1=A, 2=B, 3=C  etc)
  1002.                        NOTE - If drive selection in invalid,
  1003.                               default drive is not changed
  1004.  
  1005.  
  1006.  
  1007.         IDSKSP       (Return space on a disk in bytes)
  1008.  
  1009.              Integer*2  IDRV
  1010.              Integer*4  IDSKSP, DSPC
  1011.  
  1012.              DSPC = IDSKSP ( IDRV )
  1013.  
  1014.                 Where ---
  1015.                    IDRV   = Drive number for space check.
  1016.                                            (0=Current, 1=A, 2=B, etc)
  1017.                        NOTE - No error checking on drive selection
  1018.                    IDSKSP = Integer*4 Function returns available space
  1019.                             on the disk in bytes
  1020.  
  1021.  
  1022.  
  1023.         IDSKSZ       (Return size of a disk in bytes)
  1024.  
  1025.              Integer*2  IDRV
  1026.              Integer*4  IDSKSZ, DSIZ
  1027.  
  1028.              DSIZ = IDSKSZ ( IDRV )
  1029.  
  1030.                 where ---
  1031.                    IDRV   = Drive number for size check.
  1032.                                            (0=Current, 1=A, 2=B, etc)
  1033.                        NOTE - No error checking on drive selection
  1034.                    IDSKSZ = Integer*4 Function returns size of the
  1035.                             disk in bytes
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.                                           13
  1049.  
  1050.  
  1051.  
  1052.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1053.  
  1054.  
  1055.         IDSTAT       (Check status of floppy drive)
  1056.  
  1057.              Integer*2  IDRV, IDSTAT, ISTAT
  1058.  
  1059.              ISTAT = IDSTAT ( IDRV )
  1060.  
  1061.                 where ---
  1062.                    IDRV   = Drive number for status check.
  1063.                                            (1=A, 2=B   ONLY)
  1064.                        NOTE - No error checking on drive selection
  1065.                    IDSTAT = Integer*2 Function returns status of
  1066.                             floppy drive
  1067.                                  (0  Floppy is ready to use
  1068.                                   1  No diskette in drive
  1069.                                   2  Diskette in drive is unformatted or
  1070.                                      a 1.2Mb diskette is in a 360Kb drive
  1071.                                   3  Miscellaneous error)
  1072.  
  1073.  
  1074.  
  1075.         NMHDRV       (Return number of harddisk drives)
  1076.  
  1077.              Integer*2  NMHDRV, NUMHD
  1078.  
  1079.              NUMHD = NMHDRV ( DUMMY )
  1080.  
  1081.                 where ---
  1082.                    NMHDRV = Integer*2 Function returns number of harddisk
  1083.                             drives (All drives know to DOS  C: and above)
  1084.                    DUMMY  = Dummy argument, used as place keeper
  1085.  
  1086.  
  1087.  
  1088.         VOLUME       (Return disk volume label)
  1089.  
  1090.              Integer*2  IDRV
  1091.              Character  LABEL*11
  1092.  
  1093.              call VOLUME ( IDRV, LABEL )
  1094.  
  1095.                 where ---
  1096.                    IDRV   = Drive number for volume.
  1097.                                            (0=Current, 1=A, 2=B, etc)
  1098.                        NOTE - No error checking on drive selection
  1099.                    VOLUME = Disk volume label (blank if none)
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.                                           14
  1111.  
  1112.  
  1113.  
  1114.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1115.  
  1116.  
  1117.         SUBDIRECTORY Utilities        ______________________
  1118.  
  1119.  
  1120.              These routines will create, change, rename, and remove sub-
  1121.         directories, and return the current subdirectory path.
  1122.  
  1123.  
  1124.         Summary
  1125.  
  1126.              Create a subdirectory
  1127.  
  1128.                 call MKDIR  ( SUBDIR, IER )
  1129.  
  1130.              Change current subdirectory
  1131.  
  1132.                 call CHDIR  ( SUBDIR, IER )
  1133.  
  1134.              Rename a subdirectory
  1135.  
  1136.                 call RENDIR ( OLDDIR, NEWDIR, IER )
  1137.  
  1138.              Remove a subdirectory
  1139.  
  1140.                 call RMDIR  ( SUBDIR, IER )
  1141.  
  1142.              Return current subdirectory path
  1143.  
  1144.                 call CURDIR ( IDRV, CPATH, IER )
  1145.  
  1146.  
  1147.         MKDIR    (Create a subdirectory)
  1148.  
  1149.              Integer*2  IER
  1150.              Character  SUBDIR*n
  1151.  
  1152.              call MKDIR ( SUBDIR, IER )
  1153.  
  1154.                 where ---
  1155.                    SUBDIR = Subdirectory name to create
  1156.                             Must end with a null (00h byte) or the char-
  1157.                             acter '|'.  If SUBDIR starts with '\' it is
  1158.                             the complete path.  If the leading '\' is
  1159.                             omitted, SUBDIR is assumed to be a subdirec-
  1160.                             tory in the current directory
  1161.                        NOTE - Same rules as DOS command MKDIR
  1162.                             Example:  '\DIR\SUBDIR1\SUBSUB2|'
  1163.                    IER    = Error flag on create subdirectory
  1164.                                  (0=subdirectory created
  1165.                                   1=ERROR, subdirectory not created)
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.                                           15
  1173.  
  1174.  
  1175.  
  1176.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1177.  
  1178.  
  1179.         CHDIR    (Change current subdirectory)
  1180.  
  1181.              Integer*2  IER
  1182.              Character  SUBDIR*n
  1183.  
  1184.              call CHDIR ( SUBDIR, IER )
  1185.  
  1186.                 where ---
  1187.                    SUBDIR = Name to make current subdirectory
  1188.                             Must end with a null (00h byte) or the char-
  1189.                             acter '|'.  If SUBDIR starts with '\' it is
  1190.                             the complete path.  If the leading '\' is
  1191.                             omitted, SUBDIR is assumed to be a subdirec-
  1192.                             tory in the current directory.  IF SUBDIR is
  1193.                             '..|' the new subdirectory is one level up
  1194.                             toward the root directory.
  1195.                        NOTE - Same rules as DOS command CHDIR
  1196.                             Example:  '\DIR\SUBDIR1\SUBSUB2|'
  1197.                    IER    = Error flag on change current subdirectory
  1198.                                  (0=current directory changed
  1199.                                   1=ERROR, current directory not changed)
  1200.  
  1201.  
  1202.  
  1203.         RENDIR       (Rename a subdirectory)
  1204.  
  1205.              Integer*2  IER
  1206.              Character  OLDDIR*11, NEWDIR*11
  1207.  
  1208.              call RENDIR ( OLDDIR, NEWDIR, IER )
  1209.  
  1210.                 where ---
  1211.                    OLDDIR = Subdirectory name to rename
  1212.                             Must be in current directory (up to 11 char-
  1213.                             acters with trailing blanks if necessary)
  1214.                        NOTE - DO NOT terminate with null or '|'
  1215.                             Example:  'SUBDIR1    '
  1216.                    NEWDIR = OLDDIR will be renamed NEWDIR
  1217.                             Will be in current directory (up to 11 char-
  1218.                             acters with trailing blanks if necessary)
  1219.                        NOTE - DO NOT terminate with null or '|'
  1220.                             Example:  'SUBDIR2    '
  1221.                    IER    = Error flag on rename subdirectory
  1222.                                  (0=subdirectory renamed
  1223.                                   1=ERROR, subdirectory not renamed)
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.                                           16
  1235.  
  1236.  
  1237.  
  1238.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1239.  
  1240.  
  1241.         RMDIR    (Remove a subdirectory)
  1242.  
  1243.              Integer*2  IER
  1244.              Character  SUBDIR*n
  1245.  
  1246.              call RMDIR ( SUBDIR, IER )
  1247.  
  1248.                 where ---
  1249.                    SUBDIR = Subdirectory name to remove
  1250.                             Must end with a null (00h byte) or the char-
  1251.                             acter '|'.  If SUBDIR starts with '\' it is
  1252.                             the complete path.  If the leading '\' is
  1253.                             omitted, SUBDIR is assumed to be a subdirec-
  1254.                             tory in the current directory
  1255.                        NOTE - Same rules as DOS command RMDIR (the subdi-
  1256.                             rectory SUBDIR must be empty)
  1257.                             Example:  '\DIR\SUBDIR1\SUBSUB2|'
  1258.                    IER    = Error flag on remove subdirectory
  1259.                                  (0=subdirectory removed
  1260.                                   1=ERROR, subdirectory not removed)
  1261.  
  1262.  
  1263.  
  1264.         CURDIR       (Return current subdirectory path)
  1265.  
  1266.              Integer*2  IDRV, IER
  1267.              Character  CPATH*65
  1268.  
  1269.              call CURDIR ( IDRV, CPATH, IER )
  1270.  
  1271.                 where ---
  1272.                    IDRV   = Drive number to get current subdirectory
  1273.                                  (0=Current, 1=A, 2=B, etc)
  1274.                    CPATH  = Returned full subdirectory name from the root
  1275.                             Does not include drive, starts with '\' and
  1276.                             ends with a null (00h byte)
  1277.                    IER    = Error flag on return current subdirectory
  1278.                                  (0=current directory returned in CPATH
  1279.                                   1=ERROR, current path not returned)
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.                                           17
  1297.  
  1298.  
  1299.  
  1300.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1301.  
  1302.  
  1303.         WRITE VERIFY utilities        ______________________
  1304.  
  1305.  
  1306.              These routines will set and return the DOS write verify
  1307.         flag.
  1308.  
  1309.  
  1310.         Summary
  1311.  
  1312.              Return the write verify flag
  1313.  
  1314.                 iver = IGTVER ( DUMMY )
  1315.  
  1316.              Set write verify flag ON
  1317.  
  1318.                 call VERON
  1319.  
  1320.              Set write verify flag OFF
  1321.  
  1322.                 call VEROFF
  1323.  
  1324.  
  1325.         IGTVER       (Return current DOS write verify flag setting)
  1326.  
  1327.              Integer*2  IGTVER, IVER
  1328.  
  1329.              IVER = IGTVER ( DUMMY )
  1330.  
  1331.                 where ---
  1332.                    IGTVER = Integer*2 function returns write verify flag
  1333.                                  (0=verify off
  1334.                                   1=verify on)
  1335.                    DUMMY  = Dummy argument, used as place keeper
  1336.  
  1337.  
  1338.  
  1339.         VERON    (Set DOS write verify flag on)
  1340.  
  1341.              CALL VERON
  1342.  
  1343.  
  1344.  
  1345.         VEROFF       (Set DOS write verify flag off)
  1346.  
  1347.              CALL VEROFF
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.                                           18
  1359.  
  1360.  
  1361.  
  1362.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1363.  
  1364.  
  1365.         COMMAND LINE utilities        ______________________
  1366.  
  1367.  
  1368.              This routine will return the command tail for the current
  1369.         command.
  1370.  
  1371.         NOTE - This routine must be used before any files are assigned!!!
  1372.  
  1373.  
  1374.         CMDLIN       (Return command line)
  1375.  
  1376.  
  1377.              Character  LINE*80
  1378.              Integer*2  NCHAR
  1379.  
  1380.              CALL CMDLIN ( LINE, NCHAR )
  1381.  
  1382.                 where ---
  1383.                    LINE   = Command string starting after the blank
  1384.                             following the command name
  1385.                    NCHAR  = Number of characters returned in LINE
  1386.                                  (0=no command line)
  1387.  
  1388.  
  1389.  
  1390.         Miscellaneous DOS Functions        ___________________________
  1391.  
  1392.  
  1393.              These routines return the DOS version number and the number
  1394.         of free bytes in conventional memory.
  1395.  
  1396.         DOSVER       (Return DOS version)
  1397.  
  1398.              Integer*2  MAJORV, MINORV
  1399.  
  1400.              CALL DOSVER ( MAJORV, MINORV )
  1401.  
  1402.                 where ---
  1403.                    MAJORV = Major version number  (MS-DOS 2.1 = 2, etc)
  1404.  
  1405.                    MINORV = Minor version number  (MS-DOS 2.1 = 10, etc)
  1406.  
  1407.  
  1408.  
  1409.         MEMFRE       (Return amount of free conventional memory)
  1410.              Integer*4  MAXMEM, MEMFRE
  1411.  
  1412.              MAXMEM = MEMFRE ( idum )
  1413.  
  1414.                 where ---
  1415.                    MEMFRE = Integer*4 function which returns the number
  1416.                             of bytes free (IDUM is a required dummy
  1417.                             parameter and is unused).
  1418.  
  1419.  
  1420.                                           19
  1421.  
  1422.  
  1423.  
  1424.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1425.  
  1426.  
  1427.         ENVIRONMENT utilities        _____________________
  1428.  
  1429.  
  1430.              These routines return values from the current DOS environ-
  1431.         ment table.
  1432.  
  1433.                NOTE - If using DOS 2.xx or below, these routines must be
  1434.                called from the main program unit.
  1435.  
  1436.  
  1437.         Summary
  1438.  
  1439.              Return SET value from environment
  1440.  
  1441.                 call CHKENV ( SETSTR, NCMAX, ENVAL, NCEVAL )
  1442.  
  1443.              Return program name
  1444.  
  1445.                 call PROGNM ( NCMAX, PROG, NCPROG )
  1446.  
  1447.              Return complete environment table
  1448.  
  1449.                 call rdenv  ( NCMAX, ENV, NCENV )
  1450.  
  1451.  
  1452.         CHKENV       (Return value placed in environment using SET)
  1453.  
  1454.              Character  SETSTR*n, ENVAL*n
  1455.              Integer*2  NCMAX, NCEVAL
  1456.  
  1457.              CALL CHKENV ( SETSTR, NCMAX, ENVAL, NCEVAL )
  1458.  
  1459.                 where ---
  1460.                    SETSTR = The SET string to match (ending with '=')
  1461.                             Example:  'LIB='
  1462.                    NCMAX  = Maximum number of characters to return in
  1463.                             ENVAL
  1464.                    ENVAL  = The environment table value set using the
  1465.                             DOS SET command with SETSTR
  1466.                    NCEVAL = Actual number of characters returned in ENVAL
  1467.                             NCEVAL = 0   SETSTR not in environment table
  1468.                             NCEVAL > 0   Number of characters in ENVAL
  1469.                                          including the ending NULL
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.                                           20
  1483.  
  1484.  
  1485.  
  1486.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1487.  
  1488.  
  1489.         PROGNM       (Return the full name of the current program)
  1490.  
  1491.              Character  PROG*n
  1492.              Integer*2  NCMAX, NCPROG
  1493.  
  1494.              CALL PROGNM ( NCMAX, PROG, NCPROG )
  1495.  
  1496.                 where ---
  1497.                    NCMAX  = Maximum number of characters to return in
  1498.                             PROG
  1499.                    PROG   = Full name of the current program (including
  1500.                             the drive and path)
  1501.                    NCPROG = Actual number of characters returned in PROG
  1502.                             including the ending NULL
  1503.  
  1504.  
  1505.  
  1506.         RDENV       (Return the complete environment table)
  1507.  
  1508.              Character  ENV*n
  1509.              Integer*2  NCMAX, NCENV
  1510.  
  1511.              CALL RDENV ( NCMAX, ENV, NCENV )
  1512.  
  1513.                 where ---
  1514.                    NCMAX  = Maximum number of characters to return in
  1515.                             ENV
  1516.                    ENV    = Environment table (including the ending
  1517.                             double NULL)
  1518.                    NCENV  = Actual number of characters returned in ENV
  1519.                             including the ending double NULL
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.                                           21
  1545.  
  1546.  
  1547.  
  1548.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1549.  
  1550.  
  1551.         DISPLAY FUNCTIONS
  1552.         _________________
  1553.  
  1554.  
  1555.              Display characters and strings of characters on the standard
  1556.         output device.
  1557.  
  1558.  
  1559.         Summary
  1560.  
  1561.              Display a single character
  1562.  
  1563.                 call DISPC ( CHR )
  1564.  
  1565.              Display a counted character string
  1566.  
  1567.                 call DISPMC ( NCHR, STRING )
  1568.  
  1569.              DISPLAY a character string
  1570.  
  1571.                 call DISPST ( STRING )
  1572.  
  1573.  
  1574.         DISPC     (Display a single character)
  1575.  
  1576.              Character   CHR
  1577.  
  1578.              call DISPC  ( CHR )
  1579.  
  1580.                 where ---
  1581.                    CHR    = Character to display at current cursor
  1582.                             position
  1583.  
  1584.  
  1585.  
  1586.         DISPMC    (Display a counted character string)
  1587.  
  1588.              Character   STRING*nchr
  1589.              Integer*2   NCHR
  1590.  
  1591.              call DISPMC ( NCHR, STRING )
  1592.  
  1593.                 where ---
  1594.                    NCHR   = Number of characters in STRING to display
  1595.                    STRING = String of characters to display starting
  1596.                             at the current cursor position
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.                                           22
  1607.  
  1608.  
  1609.  
  1610.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1611.  
  1612.  
  1613.         DISPST    (Display a character string)
  1614.  
  1615.              Character   STRING*n
  1616.  
  1617.              call DISPST ( STRING )
  1618.  
  1619.                 where ---
  1620.                    STRING = String of characters to display starting at
  1621.                             the current cursor position
  1622.                        NOTE:  Must end with '$' ('$' is not displayed)
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.                                           23
  1669.  
  1670.  
  1671.  
  1672.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1673.  
  1674.  
  1675.         PRINTER FUNCTIONS
  1676.         _________________
  1677.  
  1678.  
  1679.              Send characters and strings of characters to a printer port.
  1680.  
  1681.  
  1682.         Summary
  1683.  
  1684.              Return status of Printer Port
  1685.  
  1686.                 istat = IPSTAT ( IPORT )
  1687.  
  1688.              Print a single character
  1689.  
  1690.                 call PRNTC ( IPORT, CHAR, IER )
  1691.  
  1692.              Print a counted string
  1693.  
  1694.                 call PRNTMC ( IPORT, NCHAR, STRING, IER )
  1695.  
  1696.              Print a character string
  1697.  
  1698.                 call PRNTST ( IPORT, STRING, IER )
  1699.  
  1700.  
  1701.         IPSTAT     (Return status of Printer Port)
  1702.  
  1703.              Integer*2   IPSTAT, ISTAT, IPORT
  1704.  
  1705.              ISTAT = IPSTAT ( IPORT )
  1706.  
  1707.                 where ---
  1708.                    IPORT  = Printer port (1=LPT1, 2=LPT2)
  1709.                    IPSTAT = Integer*2 function returning printer status
  1710.                          IPSTAT = 0  Printer ready
  1711.                                   1  Port out of range (not 1 or 2)
  1712.                                   2  printer busy
  1713.                                   3  printer out of paper
  1714.                                   4  Printer off-line
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.                                           24
  1731.  
  1732.  
  1733.  
  1734.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1735.  
  1736.  
  1737.         PRNTC     (Print a single character)
  1738.  
  1739.              Character   CHR
  1740.              Integer*2   IPORT, IER
  1741.  
  1742.              call PRNTC  ( IPORT, CHR, IER )
  1743.  
  1744.                 where ---
  1745.                    IPORT  = Printer port (1=LPT1, 2=LPT2)
  1746.                    CHR    = Character to print
  1747.                    IER    = Status of the print operation
  1748.                             IER = 0  Character printed, printer ready
  1749.                                   1  Port out of range (not 1 or 2)
  1750.                                   2  printer busy
  1751.                                   3  printer out of paper
  1752.                                   4  Printer off-line, can't print
  1753.  
  1754.  
  1755.  
  1756.         PRNTMC    (Print a counted character string)
  1757.  
  1758.              Character   STRING*nchr
  1759.              Integer*2   IPORT, NCHR, IER
  1760.  
  1761.              call PRNTMC ( IPORT, NCHR, STRING, IER )
  1762.  
  1763.                 where ---
  1764.                    IPORT  = Printer port (1=LPT1, 2=LPT2)
  1765.                    NCHR   = Number of characters in STRING to print
  1766.                    STRING = String of characters to print
  1767.                    IER    = Status of the print operation
  1768.                             IER = 0  String printed, printer ready
  1769.                                   1  Port out of range (not 1 or 2)
  1770.                                   2  printer busy
  1771.                                   3  printer out of paper
  1772.                                   4  Printer off-line, can't print
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.                                           25
  1793.  
  1794.  
  1795.  
  1796.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1797.  
  1798.  
  1799.         PRNTST    (Print a character string)
  1800.  
  1801.              Character   STRING*n
  1802.              Integer*2   IPORT, IER
  1803.  
  1804.              call PRNTST ( IPORT, STRING, IER )
  1805.  
  1806.                 where ---
  1807.                    IPORT  = Printer port (1=LPT1, 2=LPT2)
  1808.                    STRING = String of characters to print
  1809.                             NOTE: Must end with '$' ('$' is not printed)
  1810.                    IER    = Status of the print operation
  1811.                             IER = 0  String printed, printer ready
  1812.                                   1  Port out of range (not 1 or 2)
  1813.                                   2  printer busy
  1814.                                   3  printer out of paper
  1815.                                   4  Printer off-line, can't print
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.                                           26
  1855.  
  1856.  
  1857.  
  1858.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1859.  
  1860.  
  1861.         COMPORT FUNCTIONS
  1862.         _________________
  1863.  
  1864.  
  1865.              Initialize and send characters to a communications port.
  1866.  
  1867.  
  1868.         Summary
  1869.  
  1870.              Initialize communication Port
  1871.  
  1872.                 call INTCOM ( ICOM, IPARAM, IER )
  1873.  
  1874.              Send a counted string
  1875.  
  1876.                 call SENDMC ( ICOM, NCHR, STRING, IER )
  1877.  
  1878.  
  1879.         INTCOM     (Initialize the communications port)
  1880.  
  1881.              Integer*2   ICOM, IPARAM, IER
  1882.  
  1883.              CALL INTCOM ( ICOM, IPARAM, IER )
  1884.  
  1885.                 where ---
  1886.                    ICOM   = Communications port (1=COM1, 2=COM2, etc.)
  1887.                    IPARAM = Packed initialization parameter
  1888.                       bits  7,6,5        4,3          2          1,0
  1889.                          Baud Rate      Parity    stop bits   word length
  1890.                       ---------------------------------------------------
  1891.                       000 =  110 baud  00 = none  0 = 1 bit   10 = 7 bits
  1892.                       001 =  150 baud  01 = odd   1 = 2 bits  11 = 8 bits
  1893.                       010 =  300 baud  11 = even
  1894.                       011 =  600 baud
  1895.                       100 = 1200 baud
  1896.                       101 = 2400 baud
  1897.                       110 = 4800 baud
  1898.                       111 = 9600 baud
  1899.                    IER    = Port status error code
  1900.                             IER = 0  Port initialized
  1901.                                   1  Port not initialized
  1902.                                  FFh Port invalid (less than 1)
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.                                           27
  1917.  
  1918.  
  1919.  
  1920.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1921.  
  1922.  
  1923.         SENDMC    (Send a counted character string)
  1924.  
  1925.              Character   STRING*nchr
  1926.              Integer*2   ICOM, NCHR, IER
  1927.  
  1928.              call SENDMC ( ICOM, NCHR, STRING, IER )
  1929.  
  1930.                 where ---
  1931.                    ICOM   = Communication port (1=COM1, 2=COM2, etc.)
  1932.                    NCHR   = Number of characters in STRING to print
  1933.                    STRING = String of characters to print
  1934.                    IER    = Status of the print operation
  1935.                             IER = 0  String sent
  1936.                                   1  Port number invalid (less than 1)
  1937.                                   2  Could not send string
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                                           28
  1979.  
  1980.  
  1981.  
  1982.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  1983.  
  1984.  
  1985.         KEYBOARD FUNCTIONS
  1986.         __________________
  1987.  
  1988.  
  1989.         Get keys from the keyboard.
  1990.  
  1991.         Summary
  1992.  
  1993.              Wait for a key and echo it
  1994.  
  1995.                 call GTKEYE ( ICHR, ACHR )
  1996.  
  1997.              Wait for a key and do not echo it
  1998.  
  1999.                 call GTKEYS ( ICHR, ACHR )
  2000.  
  2001.              Get a key if one is ready and echo it
  2002.  
  2003.                 nk = IGTKYE ( ICHR, ACHR )
  2004.  
  2005.              Get a key if one is ready and do not echo it
  2006.  
  2007.                 nk = IGTKEY ( ICHR, ACHR )
  2008.  
  2009.              Flush the keyboard type-ahead buffer
  2010.  
  2011.                 call KBFLSH
  2012.  
  2013.              Read the keyboard buffer
  2014.  
  2015.                 call KBUFIN ( MXCHR, NCHR, BUF )
  2016.  
  2017.              Check to see if a key is ready
  2018.  
  2019.                 nk = KEYRDY ( DUMMY )
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.                                           29
  2041.  
  2042.  
  2043.  
  2044.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2045.  
  2046.  
  2047.         GTKEYE    (Wait for a key and echo it on the screen)
  2048.         GTKEYS    (Wait for a key and do not echo it on the screen)
  2049.  
  2050.              Character   ACHR*2
  2051.              Integer*2   ICHR(2)
  2052.  
  2053.              call GTKEYE ( ICHR, ACHR )
  2054.              call GTKEYS ( ICHR, ACHR )
  2055.  
  2056.                 where ---
  2057.                    ICHR   = Integer value of key according to ASCII table
  2058.                             ICHR(1)=key  and ICHR(2)=0  for ASCII
  2059.                             ICHR(1)=0 and ICHR(2)=code  for Extended keys
  2060.                                       i.e. Function keys & Keypad keys
  2061.                    ACHR   = Character value of key
  2062.                             ACHR(1:1)=key and ACHR(2:2)=nul  for ASCII
  2063.                             ACHR(1:1)=nul and ACHR(2:2)=code for Extended
  2064.                                 keys   i.e. Function keys & Keypad keys
  2065.  
  2066.  
  2067.  
  2068.         IGTKYE    (Get a key if one is ready, echo it on the screen)
  2069.         IGTKEY    (Get a key if one is ready, do not echo it)
  2070.  
  2071.              Character   ACHR*2
  2072.              Integer*2   ICHR(2), iflg, igtkey, igtkye
  2073.  
  2074.              iflg = IGTKYE ( ICHR, ACHR )
  2075.              iflg = IGTKEY ( ICHR, ACHR )
  2076.  
  2077.                 where ---
  2078.                    IGTKEY = Integer*2 function returns key found flag
  2079.                             (0=key not ready, nothing returned
  2080.                              1=key ready and returned in ICHR and ACHR)
  2081.                    IGTKYE = Integer*2 function returns key found flag
  2082.                             (0=key not ready, nothing returned
  2083.                              1=key ready, returned in ICHR and ACHR and
  2084.                              echoed)
  2085.                    ICHR   = Integer value of key according to ASCII table
  2086.                             ICHR(1)=key  and ICHR(2)=0  for ASCII
  2087.                             ICHR(1)=0 and ICHR(2)=code  for Extended keys
  2088.                    ACHR   = Character value of key according to ASCII
  2089.                             ACHR(1:1)=key and ACHR(2:2)=nul  for ASCII
  2090.                             ACHR(1:1)=nul and ACHR(2:2)=code for Extended
  2091.                                 keys   i.e. Function keys & Keypad keys
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.                                           30
  2103.  
  2104.  
  2105.  
  2106.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2107.  
  2108.  
  2109.         KBFLSH    (Flush keyboard type-ahead buffer)
  2110.  
  2111.              call KBFLSH
  2112.  
  2113.               NOTE -- Call KBFLSH when you want to eliminate any keys
  2114.                    that are in the type ahead buffer. This forces a new
  2115.                    key stroke to enter the desired data. KBFLSH may be
  2116.                    used prior to any of the keyboard routines.
  2117.  
  2118.  
  2119.  
  2120.         KBUFIN    (Read the keyboard buffer)
  2121.  
  2122.              Character   BUF(mxchr)
  2123.              Integer*2   MXCHR, NCHR
  2124.  
  2125.              call KBUFIN ( MXCHR, NCHR, BUF )
  2126.  
  2127.                 where ---
  2128.                    MXCHR  = Maximum number of characters to get from the
  2129.                             keyboard. Also, minimum dimension of BUF.
  2130.                             NOTE -- MXCHR is limited to 80
  2131.                    NCHR   = Actual number of characters in buffer
  2132.                             NOTE -- NCHR does not include the carriage
  2133.                             return although the carriage return is placed
  2134.                             in BUF. Thus, NCHR will never exceed MXCHR-1.
  2135.                    BUF    = Array of characters returned. Always ends
  2136.                             with a carriage return.
  2137.                             NOTE -- You may use any DOS editing key to
  2138.                                  correct the string as it is typed. The
  2139.                                  string is accepted and returned when
  2140.                                  ENTER is pressed.
  2141.  
  2142.  
  2143.  
  2144.         KEYRDY    (Check for key ready)
  2145.  
  2146.              Integer*2   iflg, keyrdy
  2147.  
  2148.              iflg = KEYRDY ( DUMMY )
  2149.  
  2150.                 where ---
  2151.                    KEYRDY = Integer*2 function returns key ready flag
  2152.                             (0=key not ready
  2153.                              1=key ready for keyboard routines)
  2154.                    DUMMY  = Dummy argument, used as place keeper
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.                                           31
  2165.  
  2166.  
  2167.  
  2168.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2169.  
  2170.  
  2171.         VIDEO FUNCTIONS
  2172.         _______________
  2173.  
  2174.  
  2175.         Cursor Utilities        ________________
  2176.  
  2177.  
  2178.              Turn cursor off, set cursor to any size, get position and
  2179.         size of cursor and position cursor.
  2180.  
  2181.  
  2182.         Summary
  2183.  
  2184.              Turn cursor off
  2185.  
  2186.                 call CUROFF
  2187.  
  2188.              Set cursor size
  2189.  
  2190.                 call CURSOR ( ITOP, IBOT )
  2191.  
  2192.              Return cursor position and size
  2193.  
  2194.                 call GETCUR ( IROW, ICOL, ITOP, IBOT )
  2195.  
  2196.              Position cursor on the screen
  2197.  
  2198.                 call POSCUR ( IROW, ICOL )
  2199.  
  2200.  
  2201.         CUROFF    (Turn cursor off)
  2202.  
  2203.              call CUROFF
  2204.  
  2205.  
  2206.  
  2207.         CURSOR    (Set cursor size)
  2208.  
  2209.              Integer*2   ITOP, IBOT
  2210.  
  2211.              call CURSOR ( ITOP, IBOT )
  2212.  
  2213.                 where ---
  2214.                    ITOP   = Top pixel row for cursor
  2215.                    IBOT   = Bottom pixel row for cursor
  2216.                          NOTE - CGA cursor maximum size is ITOP=0 IBOT=7
  2217.                                MONO cursor maximum size is ITOP=0 IBOT=13
  2218.  
  2219.                          Example: CGA block cursor       ITOP=0, IBOT=7
  2220.                                   CGA under bar cursor   ITOP=6, IBOT=7
  2221.                                   CGA dash cursor        ITOP=3, IBOT=4
  2222.                                  MONO block cursor       ITOP=0, IBOT=13
  2223.                                  MONO under bar cursor   ITOP=12,IBOT=13
  2224.  
  2225.  
  2226.                                           32
  2227.  
  2228.  
  2229.  
  2230.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2231.  
  2232.  
  2233.         GETCUR    (Get cursor position and size)
  2234.  
  2235.              Integer*2   IROW, ICOL, ITOP, IBOT
  2236.  
  2237.              call GETCUR ( IROW, ICOL, ITOP, IBOT )
  2238.  
  2239.                 where ---
  2240.                    IROW   = Row position of cursor
  2241.                    ICOL   = Column position of cursor
  2242.                        NOTE - Row/Column range is based on the video mode
  2243.                          Modes 0 & 1
  2244.                              Screen upper left (0,0), lower right (24,39)
  2245.                          Modes 2 & 3
  2246.                              Screen upper left (0,0), lower right (24,79)
  2247.                    ITOP   = Top pixel row for cursor
  2248.                    IBOT   = Bottom pixel row for cursor
  2249.                        NOTE - CGA cursor maximum size is ITOP=0 IBOT=7
  2250.                              MONO cursor maximum size is ITOP=0 IBOT=13
  2251.  
  2252.  
  2253.  
  2254.         POSCUR    (Position cursor)
  2255.  
  2256.              Integer*2   IROW, ICOL
  2257.  
  2258.              call POSCUR ( IROW, ICOL )
  2259.  
  2260.                 where ---
  2261.                    IROW   = Row position of cursor
  2262.                    ICOL   = Column position of cursor
  2263.                        NOTE - Row/Column range is based on the video mode
  2264.                          Modes 0 & 1
  2265.                              Screen upper left (0,0), lower right (24,39)
  2266.                          Modes 2 & 3
  2267.                              Screen upper left (0,0), lower right (24,79)
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.                                           33
  2289.  
  2290.  
  2291.  
  2292.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2293.  
  2294.  
  2295.         Video Mode and Clear Screen Utilities        _____________________________________
  2296.  
  2297.  
  2298.              Clear screen, scroll portion of screen up or down,
  2299.         set/return video mode and active video page, swap video pages 0
  2300.         and 1 and print screen.
  2301.  
  2302.  
  2303.         Summary
  2304.  
  2305.              Clear the screen
  2306.  
  2307.                 call CLS
  2308.  
  2309.              Return active video page
  2310.  
  2311.                 iap = IGTAPG ( DUMMY )
  2312.  
  2313.              Return video mode
  2314.  
  2315.                 imd = IGTMOD ( DUMMY )
  2316.  
  2317.              Swap video pages 0 and 1
  2318.  
  2319.                 call PGSWAP
  2320.  
  2321.              Print the screen
  2322.  
  2323.                 call PSCRN
  2324.  
  2325.              Scroll window on screen down
  2326.  
  2327.                 call SCRLDN ( NLINS, IRUL,ICUL, IRLR,ICLR )
  2328.  
  2329.              Scroll window on page up
  2330.  
  2331.                 call SCRLUP ( NLINS, IRUL,ICUL, IRLR,ICLR )
  2332.  
  2333.              Set active video page
  2334.  
  2335.                 call SETAPG ( IAP )
  2336.  
  2337.              Set video mode
  2338.  
  2339.                 call SETMOD ( IMODE )
  2340.  
  2341.  
  2342.         CLS       (Clear screen)
  2343.  
  2344.              call CLS
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.                                           34
  2351.  
  2352.  
  2353.  
  2354.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2355.  
  2356.  
  2357.         IGTAPG    (Return active video page)
  2358.  
  2359.              Integer*2   IAP, IGTAPG
  2360.  
  2361.              IAP = IGTAPG ( dummy )
  2362.  
  2363.                 where ---
  2364.                    IGTAPG = Integer*2 function returns the active video
  2365.                             page
  2366.                       NOTE - Video modes 0 & 1 have 8 video pages, 0 to 7
  2367.                              Video modes 2 & 3 have 4 video pages, 0 to 3
  2368.                    DUMMY  = Dummy argument, used as place keeper
  2369.  
  2370.  
  2371.  
  2372.         IGTMOD    (Return video mode)
  2373.  
  2374.              Integer*2   IMODE, IGTMOD
  2375.  
  2376.              IMODE = IGTMOD ( dummy )
  2377.  
  2378.                 where ---
  2379.                    IGTMOD = Integer*2 function returns the video mode
  2380.                       NOTE - video mode 0 = 40x25 BW
  2381.                                         1 = 40x25 Color
  2382.                                         2 = 80x25 BW
  2383.                                         3 = 80x25 Color
  2384.                                        Graphics modes
  2385.                                         4 = 320x200 Color
  2386.                                         5 = 320x200 BW
  2387.                                         6 = 640x200 BW
  2388.                                         7 = Mono
  2389.                    DUMMY  = Dummy argument, used as place keeper
  2390.  
  2391.  
  2392.  
  2393.         PGSWAP    (Swap video pages 0 and 1)
  2394.  
  2395.              call PGSWAP
  2396.  
  2397.               NOTE - Normally used in conjunction with HWRITE and HWRITN
  2398.                    routines which do 'hidden' writes to the alternate
  2399.                    video page. PGSWAP clears the active video page and
  2400.                    makes the 'hidden' video page active. The page swap
  2401.                    only applies to video pages 0 and 1.
  2402.  
  2403.  
  2404.  
  2405.         PSCRN     (Print screen)
  2406.  
  2407.              call PSCRN
  2408.  
  2409.               NOTE - Similar to 'Shift-PrtSc' followed by a form feed
  2410.  
  2411.  
  2412.                                           35
  2413.  
  2414.  
  2415.  
  2416.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2417.  
  2418.  
  2419.         SCRLDN    (Scroll window down)
  2420.         SCRLUP    (Scroll window up)
  2421.  
  2422.              Integer*2   NLINS, IRUL, ICUL, IRLR, ICLR
  2423.  
  2424.              call SCRLDN ( NLINS, IRUL,ICUL, IRLR, ICLR )
  2425.              call SCRLUP ( NLINS, IRUL,ICUL, IRLR, ICLR )
  2426.  
  2427.                 where ---
  2428.                    NLINS  = Number of lines to scroll window
  2429.                       NOTE - Lines blanked at widow top for SCRLDN
  2430.                              Lines blanked at widow bottom for SCRLUP
  2431.                              If NLINS is 0, the entire window is blanked
  2432.                    IRUL   = Row of upper left corner of the window
  2433.                    ICUL   = Column of upper left corner of the window
  2434.                    IRLR   = Row of lower right corner of the window
  2435.                    ICLR   = Column of lower right corner of the window
  2436.                       NOTE - Row/Column range is based on the video mode
  2437.                         Modes 0 & 1
  2438.                             Screen upper left (0,0), lower right (24,39)
  2439.                         Modes 2 & 3
  2440.                             Screen upper left (0,0), lower right (24,79)
  2441.  
  2442.  
  2443.  
  2444.         SETAPG    (Set active video page)
  2445.  
  2446.              Integer*2   IAP
  2447.  
  2448.              call SETAPG ( IAP )
  2449.  
  2450.                 where ---
  2451.                    IAP    = Video page to make active
  2452.                       NOTE - Video modes 0 & 1 have 8 video pages, 0 to 7
  2453.                              Video modes 2 & 3 have 4 video pages, 0 to 3
  2454.  
  2455.  
  2456.         SETMOD    (Set video mode)
  2457.  
  2458.              Integer*2   IMODE
  2459.  
  2460.              call IGTMOD ( IMODE )
  2461.  
  2462.                 where ---
  2463.                    IMODE  = Selected video mode
  2464.                       NOTE - video mode 0 = 40x25 BW
  2465.                                         1 = 40x25 Color
  2466.                                         2 = 80x25 BW
  2467.                                         3 = 80x25 Color
  2468.                                        Graphics modes
  2469.                                         4 = 320x200 Color
  2470.                                         5 = 320x200 BW
  2471.                                         6 = 640x200 BW
  2472.                                         7 = Mono
  2473.  
  2474.                                           36
  2475.  
  2476.  
  2477.  
  2478.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2479.  
  2480.  
  2481.         Screen Write Utilities        ______________________
  2482.  
  2483.  
  2484.              Write character string to active video page, 'hidden' video
  2485.         page, or any video page.
  2486.  
  2487.  
  2488.         Summary
  2489.  
  2490.              Write string to 'hidden' video page
  2491.  
  2492.                 call  HWRITE ( IROW,ICOL, IATRB, STRNG )
  2493.  
  2494.              Write counted string to 'hidden' video page
  2495.  
  2496.                 call  HWRITN ( IROW,ICOL, IATRB, NC,STRNG )
  2497.  
  2498.              Write string to any video page
  2499.  
  2500.                 call  SWRITE ( IROW,ICOL, IPG, IATRB, STRNG )
  2501.  
  2502.              Write counted string to any video page
  2503.  
  2504.                 call  SWRITN ( IROW,ICOL, IPG, IATRB, NC,STRNG )
  2505.  
  2506.              Write string to active video page
  2507.  
  2508.                 call  WRTSTR ( IROW,ICOL, IATRB, STRNG )
  2509.  
  2510.              Write counted string to active video page
  2511.  
  2512.                 call  WRTSTN ( IROW,ICOL, IATRB, NC,STRNG )
  2513.  
  2514.              Write (put) a block of characters to active video page
  2515.  
  2516.                 call PUTBLK ( IRUL,ICUL, IRLR, ICLR, STRBLK )
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.                                           37
  2537.  
  2538.  
  2539.  
  2540.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2541.  
  2542.  
  2543.         HWRITE    (Write string to 'hidden' video page)
  2544.  
  2545.              Integer*2   IROW, ICOL, IATRB
  2546.              Character   STRING*n
  2547.  
  2548.              call HWRITE ( IROW,ICOL, IATRB, STRING )
  2549.  
  2550.                 where ---
  2551.                    IROW   = Row position to write string
  2552.                    ICOL   = Column position to write string
  2553.                       NOTE - Row/Column range is based on the video mode
  2554.                         Modes 0 & 1
  2555.                             Screen upper left (0,0), lower right (24,39)
  2556.                         Modes 2 & 3
  2557.                             Screen upper left (0,0), lower right (24,79)
  2558.                       If string exceeds right of screen, it is truncated
  2559.                    IATRB  = Attribute for string
  2560.                       NOTE - The attribute is a composite value that
  2561.                          specifies the text color, background color and
  2562.                          if the text is blinking or steady. Combine these
  2563.                          components in the following way:
  2564.                            1) Select the text color value
  2565.                                0 Black       8 Gray
  2566.                                1 Blue        9 High-intensity Blue
  2567.                                2 Green      10 High-intensity Green
  2568.                                3 Cyan       11 High-intensity Cyan
  2569.                                4 Red        12 High-intensity Red
  2570.                                5 Magenta    13 High-intensity Magenta
  2571.                                6 Brown      14 High-intensity Brown
  2572.                                7 White      15 High-intensity White
  2573.                            2) Add the appropriate background color value
  2574.                                0 Black      64 Red
  2575.                               16 Blue       80 Magenta
  2576.                               32 Green      96 Brown
  2577.                               48 Cyan      112 White
  2578.                            3) For blinking text, add 128
  2579.                          Example: HI White text, Red background, blinking
  2580.                                    IATRB = 15+64+128 = 207
  2581.                    STRING = String to display ending with a backslash '\'
  2582.  
  2583.                NOTE - If active video page is 0, 'hidden' page is 1
  2584.                       If active video page is 1, 'hidden' page is 0
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.                                           38
  2599.  
  2600.  
  2601.  
  2602.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2603.  
  2604.  
  2605.         HWRITN    (Write counted string to 'hidden' video page)
  2606.  
  2607.              Integer*2   IROW, ICOL, IATRB, NCHR
  2608.              Character   STRING*n
  2609.  
  2610.              call HWRITN ( IROW,ICOL, IATRB, NCHR, STRING )
  2611.  
  2612.                 where ---
  2613.                    IROW   = Row position to write string
  2614.                    ICOL   = Column position to write string
  2615.                       NOTE - Row/Column range is based on the video mode
  2616.                         Modes 0 & 1
  2617.                             Screen upper left (0,0), lower right (24,39)
  2618.                         Modes 2 & 3
  2619.                             Screen upper left (0,0), lower right (24,79)
  2620.                       If string exceeds right of screen, it is truncated
  2621.                    IATRB  = Attribute for string (see HWRITE for details)
  2622.                    NCHR   = Number of characters in STRING
  2623.                    STRING = String to display (may include '\')
  2624.  
  2625.                NOTE - If active video page is 0, 'hidden' page is 1
  2626.                       If active video page is 1, 'hidden' page is 0
  2627.  
  2628.  
  2629.  
  2630.         SWRITE    (Write string to any video page)
  2631.  
  2632.              Integer*2   IROW, ICOL, IATRB, IPAGE
  2633.              Character   STRING*n
  2634.  
  2635.              call SWRITE ( IROW,ICOL, IPAGE, IATRB, STRING )
  2636.  
  2637.                 where ---
  2638.                    IROW   = Row position to write string
  2639.                    ICOL   = Column position to write string
  2640.                       NOTE - Row/Column range is based on the video mode
  2641.                         Modes 0 & 1
  2642.                             Screen upper left (0,0), lower right (24,39)
  2643.                         Modes 2 & 3
  2644.                             Screen upper left (0,0), lower right (24,79)
  2645.                       If string exceeds right of screen, it is truncated
  2646.                    IPAGE  = Video page for write
  2647.                       NOTE - Video modes 0 & 1 have 8 video pages, 0 to 7
  2648.                              Video modes 2 & 3 have 4 video pages, 0 to 3
  2649.                    IATRB  = Attribute for string (see HWRITE for details)
  2650.                    STRING = String to display ending with a backslash '\'
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.                                           39
  2661.  
  2662.  
  2663.  
  2664.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2665.  
  2666.  
  2667.         SWRITN    (Write counted string to any video page)
  2668.  
  2669.              Integer*2   IROW, ICOL, IATRB, IPAGE, NCHR
  2670.              Character   STRING*n
  2671.  
  2672.              call SWRITN ( IROW,ICOL, IPAGE, IATRB, NCHR, STRING )
  2673.  
  2674.                 where ---
  2675.                    IROW   = Row position to write string
  2676.                    ICOL   = Column position to write string
  2677.                       NOTE - Row/Column range is based on the video mode
  2678.                         Modes 0 & 1
  2679.                             Screen upper left (0,0), lower right (24,39)
  2680.                         Modes 2 & 3
  2681.                             Screen upper left (0,0), lower right (24,79)
  2682.                       If string exceeds right of screen, it is truncated
  2683.                    IPAGE  = Video page for write
  2684.                       NOTE - Video modes 0 & 1 have 8 video pages, 0 to 7
  2685.                              Video modes 2 & 3 have 4 video pages, 0 to 3
  2686.                    IATRB  = Attribute for string (see HWRITE for details)
  2687.                    NCHR   = Number of characters in STRING
  2688.                    STRING = String to display (may include '\')
  2689.  
  2690.  
  2691.  
  2692.         WRTSTR    (Write string to active video page)
  2693.  
  2694.              Integer*2   IROW, ICOL, IATRB
  2695.              Character   STRING*n
  2696.  
  2697.              call WRTSTR ( IROW,ICOL, IATRB, STRING )
  2698.  
  2699.                 where ---
  2700.                    IROW   = Row position to write string
  2701.                    ICOL   = Column position to write string
  2702.                       NOTE - Row/Column range is based on the video mode
  2703.                         Modes 0 & 1
  2704.                             Screen upper left (0,0), lower right (24,39)
  2705.                         Modes 2 & 3
  2706.                             Screen upper left (0,0), lower right (24,79)
  2707.                       If string exceeds right of screen, it is truncated
  2708.                    IATRB  = Attribute for string (see HWRITE for details)
  2709.                    STRING = String to display ending with a backslash '\'
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.                                           40
  2723.  
  2724.  
  2725.  
  2726.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2727.  
  2728.  
  2729.         WRTSTN    (Write counted string to active video page)
  2730.  
  2731.              Integer*2   IROW, ICOL, IATRB, NCHR
  2732.              Character   STRING*n
  2733.  
  2734.              call WRTSTN ( IROW,ICOL, IATRB, NCHR, STRING )
  2735.  
  2736.                 where ---
  2737.                    IROW   = Row position to write string
  2738.                    ICOL   = Column position to write string
  2739.                       NOTE - Row/Column range is based on the video mode
  2740.                         Modes 0 & 1
  2741.                             Screen upper left (0,0), lower right (24,39)
  2742.                         Modes 2 & 3
  2743.                             Screen upper left (0,0), lower right (24,79)
  2744.                       If string exceeds right of screen, it is truncated
  2745.                    IATRB  = Attribute for string (see HWRITE for details)
  2746.                    NCHR   = Number of characters in STRING
  2747.                    STRING = String to display (may include '\')
  2748.  
  2749.  
  2750.  
  2751.         PUTBLK    (Write a block of characters to active video page)
  2752.  
  2753.              Character*n STRBLK
  2754.              Integer*2   IRUL, ICUL, IRLR, ICLR
  2755.  
  2756.              call PUTBLK ( IRUL,ICUL, IRLR, ICLR, STRBLK )
  2757.  
  2758.                 where ---
  2759.                    IRUL   = Row of upper left corner of the window
  2760.                    ICUL   = Column of upper left corner of the window
  2761.                    IRLR   = Row of lower right corner of the window
  2762.                    ICLR   = Column of lower right corner of the window
  2763.                       NOTE - Row/Column range is based on the video mode
  2764.                         Modes 0 & 1
  2765.                             Screen upper left (0,0), lower right (24,39)
  2766.                         Modes 2 & 3
  2767.                             Screen upper left (0,0), lower right (24,79)
  2768.                    STRBLK = String of characters with attributes to fill
  2769.                             the block (char,atrib,char,atrib,etc).
  2770.                        NOTE: The attributes must be single byte values
  2771.                             (See HWRITE for attribute details)
  2772.                             The block is filled row by row.
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.                                           41
  2785.  
  2786.  
  2787.  
  2788.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2789.  
  2790.  
  2791.         Screen Read Utilities        _____________________
  2792.  
  2793.  
  2794.              Read a character or block of characters from the active
  2795.         video page.
  2796.  
  2797.  
  2798.         Summary
  2799.  
  2800.              Read a block of characters from active video page
  2801.  
  2802.                 call GETBLK ( IRUL,ICUL, IRLR, ICLR, STRBLK )
  2803.  
  2804.              Read a single character from active video page
  2805.  
  2806.                 call GETCHR ( IROW,ICOL, IATRIB, CHAR )
  2807.  
  2808.  
  2809.         GETBLK    (Read a block of characters from active video page)
  2810.  
  2811.              Character*n STRBLK
  2812.              Integer*2   IRUL, ICUL, IRLR, ICLR
  2813.  
  2814.              call GETBLK ( IRUL,ICUL, IRLR, ICLR, STRBLK )
  2815.  
  2816.                 where ---
  2817.                    IRUL   = Row of upper left corner of the window
  2818.                    ICUL   = Column of upper left corner of the window
  2819.                    IRLR   = Row of lower right corner of the window
  2820.                    ICLR   = Column of lower right corner of the window
  2821.                       NOTE - Row/Column range is based on the video mode
  2822.                         Modes 0 & 1
  2823.                             Screen upper left (0,0), lower right (24,39)
  2824.                         Modes 2 & 3
  2825.                             Screen upper left (0,0), lower right (24,79)
  2826.                    STRBLK = Returned string of characters with attributes
  2827.                             from the block (char,atrib,char,atrib,etc).
  2828.                        NOTE: The attributes are single byte values
  2829.                             (See HWRITE for attribute details)
  2830.                             The block is read row by row.
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.                                           42
  2847.  
  2848.  
  2849.  
  2850.         Michael Gerhard            ELMOP.LIB               March 15, 1993
  2851.  
  2852.  
  2853.         GETCHR    (Read a single character from active video page)
  2854.  
  2855.              Character   CHAR
  2856.              Integer*2   IROW, ICOL, IATRIB
  2857.  
  2858.              call GETCHR ( IROW,ICOL, IATRIB, CHAR )
  2859.  
  2860.                 where ---
  2861.                    IROW   = Row where to read character
  2862.                    ICOL   = Column where to read character
  2863.                       NOTE - Row/Column range is based on the video mode
  2864.                         Modes 0 & 1
  2865.                             Screen upper left (0,0), lower right (24,39)
  2866.                         Modes 2 & 3
  2867.                             Screen upper left (0,0), lower right (24,79)
  2868.                    IATRIB = Returned attribute (See HWRITE for details)
  2869.                    CHAR   = Returned character
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.                                           43
  2909.