home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / fortran / fv121s.zip / FAT0.DOC < prev    next >
Text File  |  1988-06-11  |  39KB  |  848 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                                  FAT-Video 1.21
  25.  
  26.                         Fortran Accessory Tools for Video
  27.  
  28.                         Copyright (c) 1987 Marc A. Norton
  29.                               All Rights Reserved.
  30.                                   MAY 1988
  31.  
  32.  
  33.                                 FAT-Video 1.21
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.                                 Table of Contents
  41.                                 -----------------
  42.  
  43.         Description                                             Page
  44.         -----------                                             ----
  45.  
  46.         Table of Functions                                      i
  47.  
  48.         About Shareware                                         iv
  49.  
  50.         Introduction                                            v
  51.  
  52.         Technical Info                                          vii
  53.  
  54.         Updates                                                 xi
  55.  
  56.         Video Library Functions                                 V-1
  57.  
  58.         Window Library Functions                                W-1
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  71.  
  72.  
  73.         APR 1988                FAT-Video 1.21                   Page i
  74.  
  75.  
  76.  
  77.  
  78.                 Table of Functions - Video Library
  79.                 ----------------------------------
  80.  
  81.         No.     Function                                        Page
  82.         ---     --------                                        ----
  83.  
  84.         1       SETVM(MODE)                                     V-1
  85.         2       SETCP(ROW,COL,PAGE)                             V-2
  86.         3       GETCP(ROW,COL,PAGE)                             V-3
  87.         4       SETDP(PAGE)                                     V-4
  88.         5       SCWUP(NLINES,ATTR,ULR,ULC,LRR,LRC)              V-5
  89.         6       SCWDN(NLINES,ATTR,ULR,ULC,LRR,LRC)              V-6
  90.         7       GETAC(ATTR,CHAR,PAGE)                           V-7
  91.         8       WRTAC(ATTR,CHAR,PAGE)                           V-8
  92.         9       WRTACP(ATTR,CHAR,ROW,COL,PAGE)                  V-10
  93.         10      WRTCH(CHAR,COLOR,PAGE)                          V-12
  94.         11      SETPAL(ID,COLOR)                                V-13
  95.         12      WRTGP(COLOR,ROW,COL)                            V-14
  96.         13      GETGP(COLOR,ROW,COL)                            V-15
  97.         14      CHTEL(CHAR,PAGE,COLOR)                          V-16
  98.         15      GETMOD(MODE,NCOLS,PAGE)                         V-17
  99.         16      SETAB(ATTR,FORE,BACK,INT,BLINK)                 V-18
  100.         17      GETAB(ATTR,FORE,BACK,INT,BLINK)                 V-19
  101.         18      WRTAS(ATTR,STRING)                              V-20
  102.         19      WRTASP(ATTR,STRING,ROW,COL,PAGE)                V-21
  103.         20      PEEKB(OFF,SEG,VAL)                              V-22
  104.         21      PEEKW(OFF,SEG,VAL)                              V-23
  105.         22      POKEB(OFF,SEG,VAL)                              V-24
  106.         23      POKEW(OFF,SEG,VAL)                              V-25
  107.         24      MEMSTR(OFF,SEG,STRING,NBYTES)                   V-26
  108.         25      STRMEM(OFF,SEG,STRING,NBYTES)                   V-27
  109.         26      GETVID(ULR,ULC,LRR,LRC,SEG)                     V-28
  110.         27      PUTVID(ULR,ULC,LRR,LRC,SEG)                     V-29
  111.         28      GETCGA(ULR,ULC,LRR,LRC,SEG)                     V-30
  112.         29      PUTCGA(ULR,ULC,LRR,LRC,SEG)                     V-31
  113.         30      GETMON(ULR,ULC,LRR,LRC,SEG)                     V-32
  114.         31      PUTMON(ULR,ULC,LRR,LRC,SEG)                     V-33
  115.         32      CLS()                                           V-34
  116.         33      RDKBD(CODE,CHAR)                                V-35
  117.         34      KBDST(CODE,CHAR)                                V-36
  118.         35      KBDFL(FLAGS)                                    V-37
  119.         36      CHINP(KEY)                                      V-38
  120.         37      ALLMEM(NPAR,SEG,MAXPAR)                         V-39
  121.         38      FREMEM(SEG,IER)                                 V-40
  122.         39      SETNUL(STRING)                                  V-41
  123.         40      REVAB(ATTR,RATTR)                               V-42
  124.  
  125.  
  126.  
  127.         Copyright (c) 1987 Marc A. Norton   All Rights Reserved.
  128.  
  129.         APR 1988                FAT-VIDEO 1.21                   Page ii
  130.  
  131.  
  132.  
  133.  
  134.                 Table of Functions - Video Library
  135.                 ----------------------------------
  136.  
  137.         No.     Function                                        Page
  138.         ---     --------                                        ----
  139.         41      SETBC(COLOR)                                    V-43
  140.         42      BVEF(Flag)                                      V-44
  141.         43      EGAF(Flag)                                      V-44
  142.         44      CGACOF()                                        V-45
  143.         45      CGACON()                                        V-45
  144.         46      MONCOF()                                        V-46
  145.         47      MONCON()                                        V-46
  146.         48      COMLIN(TAIL)                                    V-47
  147.         49      GETDOS(MAJOR,MINOR)                             V-47
  148.         50      GETTIM(HR,MIN,SEC,HSEC)                         V-48
  149.         51      CLRKBD()                                        V-48
  150.         52      BEEP()                                          V-48
  151.         53      CUROFF()                                        V-48
  152.         54      CURON()                                         V-48
  153.         55      GETML(NBYTES,LSEG,LOFF)                         V-49
  154.         56      RLSML(NBYTES,LSEG,LOFF)                         V-49
  155.         57      PEEKL(OFF,SEG,VALUE)                            V-50
  156.         58      POKEL(OFF,SEG,VALUE)                            V-50
  157.         59      WRTS(STRING)                                    V-51
  158.         60      WRTSP(STRING,ROW,COL,PAGE)                      V-51
  159.         61      CPUT(STRING)                                    V-52
  160.         62      CPUTA(ATTR,STRING)                              V-52
  161.         63      CPUTP(STRING,ROW,COL)                           V-53
  162.         64      CPUTAP(ATTR,STRING,ROW,COL)                     V-53
  163.         65      CPUTAC(ATTR,VALUE)                              V-54
  164.         66      CPUTC(VALUE)                                    V-54
  165.         67      CLRSTR(STRING,LEN)                              V-55
  166.         68      REMNUL(STRING)                                  V-55
  167.         69      CGETS(STRINT)                                   V-56
  168.         70      CGETAS(ATTR,STRING,MAXLEN,IERR)                 V-57
  169.         71      CGETIS(ATTR,STRING,MAXLEN,IERR)                 V-58
  170.         72      CGETRS(ATTR,STRING,MAXLEN,IERR)                 V-59
  171.         73      CEDAS(ATTR,STRING),MAXLEN,IERR)                 V-60
  172.         74      CEDIS(ATTR,STRING,MAXLEN,IERR)                  V-61
  173.         75      CEDRS(ATTR,STRING,MAXLEN,IERR)                  V-62
  174.         76      RQST(WATTR,RATTR,ULR,ULC,NB,MESS,RESP,LEN,IERR) V-63
  175.  
  176.         Copyright (c) 1987 Marc A. Norton   All Rights Reserved.
  177.  
  178.         APR 1988                FAT-VIDEO 1.21                   Page iii
  179.  
  180.  
  181.  
  182.  
  183.                 Table of Functions - Window Library
  184.                 ------------------------------------
  185.  
  186.         No.     Function                                        Page
  187.         ---     --------                                        ----
  188.  
  189.         1       WOPEN(WID,BA,TA,ULR,ULC,NR,NC,TITLE,WB,WT,WC)   W-1
  190.         2       WCLOSE(WID)                                     W-2
  191.         3       WPRNAS(WID,ATTR,STRING)                         W-3
  192.         4       WPRINT(WID,STRING)                              W-4
  193.         5       WCLS(WID)                                       W-5
  194.         6       WCRX(WID)                                       W-6
  195.         7       WLFX(WID)                                       W-7
  196.         8       WCRLF(WID)                                      W-8
  197.         9       WCLEOL(WID)                                     W-9
  198.         10      WGETCP(WID,ROW,COL)                             W-10
  199.         11      WSETCP(WID,ROW,COL)                             W-11
  200.         12      WGETSN(WID,STRING,LEN)                          W-12
  201.         13      WGETSE(WID,ATTR,STRING,LEN)                     W-13
  202.         14      WGETCE(WID,ATTR,IKAR)                           W-14
  203.         15      MENBAR(WID,PRNAM,NATTR,SATTR,ISEL)              W-15
  204.         16      WMENU(ITNAM,NATTR,SATTR,ULR,ULC,TITLE,ISEL)     W-16
  205.         17      WBOX(BATTR,TATTR,ULR,ULC,LRR,LRC,TITLE,WT,WC)   W-17
  206.         18      WMOVR(WID,INR,INC)                              W-18
  207.         19      WMOVA(WID,ROW,COL)                              W-19
  208.         20      WXOPEN(WID,BA,TA,ULR,ULC,NR,NC,TITLE,WB,WT,WC)  W-20
  209.         21      GETADP(ADAP)                                    W-21
  210.         22      WAIT(SECONDS)                                   W-22
  211.         23      MENU1(WID,PRNAM,ITNAM,NATTR,SATTR,ISEL)         W-23
  212.         24      I2=WGETI2(WID,IER)                              W-24
  213.         25      I4=WGETI4(WID,IER)                              W-24
  214.         26      WPUTI2(WID,NUM)                                 W-25
  215.         27      WPUTI4(WID,NUM)                                 W-25
  216.         28      X4=WGETR4(WID,IER)                              W-26
  217.         29      X8=WGETR8(WID,IER)                              W-26
  218.  
  219.         Copyright (c) 1987 Marc A. Norton   All Rights Reserved.
  220.  
  221.  
  222.         APR 1988                FAT-VIDEO 1.21                   Page iv
  223.  
  224.  
  225.  
  226.                                 About Shareware
  227.                                 ---------------
  228.            The FAT-Video software is sold as shareware via user groups,
  229.         "Public Domain Software Entities", and directly from me. This
  230.         does not mean the software is free, it is not.
  231.  
  232.            The software is distributed with a nominal charge, so you
  233.         may try the software out first, and be assured it works
  234.         with your system, and that you wish to use it. Once you are
  235.         satisfied it's adequate and meets your needs, I the developer
  236.         expect you to register with me and pay the registration fee.
  237.  
  238.            The entire shareware concept relies on the faith of software
  239.         developers, and the honesty of users. If you abuse the privilege
  240.         of shareware software, you  risk not having any shareware, so make
  241.         your choices carefully regarding your need to register for this
  242.         or any other shareware product.
  243.  
  244.            The FAT-Video shareware package may be freely distributed by
  245.         anyone, so long as not more than $12 is charged for duplicating
  246.         the disk and/or manual(the manual is on the disk). In fact this
  247.         is the best advertising I could have, so I encourage you to
  248.         make a copy and give it to a friend, or your user group, or
  249.         anyone else. Make sure you give them an unaltered version, with
  250.         the manual on the disk.
  251.  
  252.            The registered users of the FAT-Video package will be notified
  253.         of specific errors, corrections and updates by mail. There is also
  254.         telephone support for registered users. The registered version
  255.         includes the Fortran source code for the window library, for your
  256.         personal use and modification. It may not be freely distributed.
  257.         The source code for the Matrix Spreadsheet demo called MVIEW is
  258.         also included on the registered disk.
  259.  
  260.         Shareware Disk             $ 12.00    Manual on disk
  261.         Registration & Disk        $ 35.00    Manual on disk
  262.                                               & window Fortran source code
  263.         If you bought your share disk from me, I'll register you for $25.00.
  264.         Printed Manual             $ 15.00
  265.         Assembly source, VIDEO.LIB $ 35.00    Requires A86 assembler.
  266.         Upgrade Disk               $ 12.00    Manual on disk
  267.  
  268.         Maryland residents add 5% sales tax.
  269.  
  270.           For Info call 301-441-9235
  271.           To order, send check or mony order, and state items desired, to:
  272.  
  273.                 Marc Norton
  274.                 P.O. Box 425
  275.                 Greenbelt MD  20770
  276.  
  277.         Copyright (c) 1987 Marc A. Norton   All Rights Reserved.
  278.  
  279.  
  280.         APR 1988                FAT-VIDEO 1.21                   Page v
  281.  
  282.  
  283.                                 Introduction
  284.                                 ------------
  285.            The Fortran Accessory Tools for Video(FAT-Video) software
  286.         package offers the Fortran programmer access to the low level
  287.         Video, and Keyboard functions of the ROM-BIOS, providing
  288.         complete control of the screen, and keyboard, as demonstrated
  289.         by the window library demo. FAT-Video requires MS-DOS 2.0 or above,
  290.         and a compatible ROM-BIOS (most are today).
  291.  
  292.           The FAT-Video window library displays text windows in modes 3
  293.         and 7 on the CGA, EGA, and Mono adapter cards. The video graphics
  294.         routines, such as the pixel manipulation routines, use the BIOS
  295.         INT 10h functions and therefore support the full resolution of
  296.         any graphics adapter card used. There are currently 76 low level
  297.         video routines, and 29 window routines.
  298.  
  299.            The FAT-Video libraries are fully compatible with the MS-Fortran
  300.         compiler version 4.0/4.1. The VIDEO.LIB functions are compatible with
  301.         all versions (3.2 thru 4.1). The window library source will
  302.         need to be recompiled for versions prior to 4.0. The Technical Info
  303.         section explains the key modifications required for compiling
  304.         earlier versions.
  305.  
  306.            FAT-Video 1.21 also fully supports the Lahey-F77L compiler. The
  307.         video library functions may be called from Lahey Fortran. You must
  308.         declare each VIDEO.LIB function using the MSEXTERNAL keyword, and
  309.         do so in each module using the VIDEO.LIB functions. The window
  310.         library has been compiled with the Lahey-F77L v2.21 compiler. The
  311.         window functions should NOT be declared as MSEXTERNAL ! There is a
  312.         file called LAHEY.INC on disk which declares all the video routines
  313.         as msexternal. Just put "include LAHEY.INC" in any routine that
  314.         uses the video library, and your ready to compile.
  315.  
  316.            The FAT-Video funcitons have been written specifically for use
  317.         by Fortran programmers. The typical Fortran programmer has had
  318.         little chance to use windows, menus, and screen control, and
  319.         is not generally very familiar with them in routine programming.
  320.         I have attempted to make the window functions feel comfortable to
  321.         the Fortran programmer. The window functions have also been coded
  322.         in Fortran to demonstrate the power and ease of use of the video
  323.         library.
  324.  
  325.            The FAT-Video utilities make windows and menus a snap in
  326.         Fortran. The window library provided is in fact written in Fortran
  327.         using the video library functions. They could have been written in
  328.         assembly as well, but with the video library they are trivial in
  329.         Fortran, and it's my feeling you should always write your code in
  330.         the highest level language you can for maximum productivity. Of
  331.         course, some things are best done in assembly, but I've taken care
  332.         of those things for you.
  333.  
  334.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  335.  
  336.         APR 1988                FAT-VIDEO 1.21                   Page vi
  337.  
  338.  
  339.            The windowing library source code is intended as a source of
  340.         demonstration for the video library functions. The intent is for
  341.         you to understand, and modify the library for your own purposes.
  342.         The windowing library of functions also provides a powerful
  343.         set of windowing functions, menus and string I/O. A demo has
  344.         been included, with source code, to illustrate the use of the
  345.         windowing functions.
  346.  
  347.            The assembly source code for the video library functions is
  348.         available to anyone interested in modifying them, as a separate
  349.         disk for $35.00 . They are copyrighted and are not to be
  350.         distributed. You may modify and use them for personal purposes
  351.         only.
  352.  
  353.            The assembly source requires the A86 assembler written by
  354.         Eric Isaacson, and is also available as shareware. I recommend
  355.         it over all other assemblers. It is very inexpensive compared to
  356.         others, and a superior assembler as well. His manual is also very
  357.         good.
  358.  
  359.            The FAT-Video package will be modified as needed. If you have any
  360.         suggestions please write them down and send them in. Also if you have
  361.         any problems, write or call. If you write, send a sample of the code
  362.         you have trouble with.
  363.  
  364.            The registered users of FAT-Video will be notified of upgrades
  365.         to the package by mail. Upgraded versions of FAT-Video will be
  366.         available on disk for the same charge as the current shareware
  367.         disk. The registered users will also receive telephone support for
  368.         problems and questions related to FAT-Video. Registered owners
  369.         of FAT-Video also receive the window library Fortran source code.
  370.  
  371.            The registered users also get the source code for the Matrix
  372.         Spreadsheet Demo called MVIEW, the executable demo is on the
  373.         shareware disk. The MVIEW spreadsheet is may be called as a sub-
  374.         routine with a real or integer array from your applications using
  375.         this source code. It forms the baisis of a very nice matrix
  376.         viewing utility, it also allows you to edit enter matrix data
  377.         directly.
  378.  
  379.           There are 2-sets of window Fortran source code, one is for the
  380.         MS-Fortran compiler, the other is for the Lahey compiler. I have
  381.         included both sets on the registered disk. If you are using the
  382.         Microsoft Fortran compiler, then use WINDOWM.LIB library in your
  383.         link command. If you are using the Lahey compiler, use WINDOWL.LIB
  384.         in your link command. Again the MS-Library has been compiled with
  385.         the MS-Fortran 4.0/4.1 compiler, and the Lahey-Library has been compiled
  386.         with the Lahey 2.21 compiler. If your compiler version is different,
  387.         then you need to recompile the library source code with your compiler.
  388.  
  389.            The source code for each compiler is in a .ARC file. The MS source
  390.         is in FV121MF.ARC, and the Lahey source is in FV121LF.ARC. Only
  391.         de-archive one of these in any given directory, because they both
  392.         contain files with the same names !!! You really only need to
  393.         de-archive the one you will use ! BE CAREFUL ! The window subroutines
  394.         are called the same for both compilers !
  395.  
  396.         Copyright (c) 1987 Marc A. Norton   All Rights Reserved.
  397.  
  398.         APR 1988                FAT-VIDEO 1.21                  Page vii
  399.  
  400.  
  401.         COMPILER SUPPORT
  402.         ----------------
  403.            Once again, the following compilers are supported and may be used
  404.         with the FAT-Video software libraries:
  405.  
  406.                 1) All Microsoft Fortran compilers, WINDOWM.LIB  can only be
  407.                    used with version MS-FORTRAN 4.0/4.1. Earlier versions
  408.                    of MS-Fortran must recompile the window source code in the
  409.                    FV121MF.ARC file.
  410.  
  411.                 2) All Lahey Fortran  compilers that use the MSEXTERNAL
  412.                    keyword, WINDOWL.LIB may be used with version 2.21 of
  413.                    Lahey Fortran. Earlier versions need to recompile the
  414.                    window source code in th FV121LF.ARC.
  415.  
  416.            The following compilers do not work with the FAT-Video libraries:
  417.                 1) IBM Professional Fortran
  418.                 2) Ryan-McFarland Fortran
  419.  
  420.            Other compilers:
  421.                 See Technical section for details of interfaceing FAT-Video
  422.                 with other compilers.
  423.  
  424.         Order Information:
  425.         ------------------
  426.         Shareware Disk             $ 12.00 Manual on disk
  427.         Registration & Disk        $ 35.00 Manual on disk
  428.                                            & window Fortran source code.
  429.         If you bought your share disk from me, I'll register you for $25.00.
  430.         Printed Manual             $ 15.00
  431.         Assembly source, VIDEO.LIB $ 35.00 Requires A86 assembler
  432.         Upgrade Disk               $ 12.00 Manual on Disk
  433.  
  434.         Maryland residents add 5% sales tax.
  435.  
  436.           For information call 301-441-9235
  437.  
  438.           To order, send check or money order, and state items desired to:
  439.  
  440.                 Marc Norton
  441.                 P.O. Box 425
  442.                 Greenbelt, MD  20770
  443.  
  444.  
  445.  
  446.         Copyright (c) 1987 Marc A. Norton   All Rights Reserved.
  447.  
  448.  
  449.  
  450.         APR 1988                FAT-VIDEO 1.21                   Page viii
  451.  
  452.  
  453.  
  454.                                 Technical Info
  455.                                 --------------
  456.  
  457.            This section is included to give you a brief explanation of
  458.         some of the details involved in the use of the video and window
  459.         libraries. This section is concerned with the details of inter-
  460.         facing assembly subroutines with Fortran, the stack and the stack
  461.         frame. Most of what follows is for your reference and is not
  462.         required reading unless you own some obscure Fortran compiler.
  463.  
  464.            The user is given several references listed at the  end of this
  465.         section for more detailed discussions of the PC and its video
  466.         capabilities. FAT-Video requires DOS 2.0 or above and a compatible
  467.         ROM-BIOS.
  468.  
  469.            The video library was written entirely in assembly language,
  470.         some functions call the ROM-BIOS video, and keyboard routines,
  471.         and others call some DOS routines. The only DOS functions used
  472.         are those required to allocate and free memory dynamically, and
  473.         a keyboard character input routine.
  474.  
  475.            Users of the Lahey 2.21 compiler may use WINDOWL.LIB as is,
  476.         and may skip this section. If you use another version you may
  477.         need to recompile the window library source code.
  478.  
  479.            Users of the MS-Fortran compiler version 4.1/4.0 may use WINDOWM.LIB
  480.         as is, and may skip this section entirely. Those using version 3.3,
  481.         3.2, or below should read this section and pay particular attention
  482.         to the use of character strings, and c-strings (null terminated
  483.         strings). The rest of the technical section is provided to help assist
  484.         the users of other compilers in utilizing this package until I
  485.         generate versions for each compiler.
  486.  
  487.            The assembly language routines are compatible with the MS-Fortran
  488.         default memory model, which is the large memory model. To the program-
  489.         mer it means all subroutine calls are Far calls. In MS-Fortran, the
  490.         address of the subroutine call arguments are placed on the stack from
  491.         left to right, and the use of Far calls means the address is defined
  492.         by a segment word and an offset word. So the address of each argument
  493.         consists of two words, or four bytes. Note that Lahey F77L pushes the
  494.         arguments from right to left, thus the need for msexternal. Also
  495.         MS-Fortran expects the subroutine to POP the arguments off the stack,
  496.         whereas in Lahey-Fortran the calling program POPS the call arguments.
  497.  
  498.            In contrast the small memory model means all code is in one segment
  499.         and all data(arrays,variables) is in one segment. This means only
  500.         an offset is required to identify the address of a variable.
  501.         Therefore, only the offset(one word) is placed on the stack and
  502.         passed to the subroutine.
  503.  
  504.  
  505.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  506.  
  507.         APR 1988                FAT-Video 1.21                  Page ix
  508.  
  509.  
  510.  
  511.            An example will clarify this somewhat. Assume the following call
  512.         is made, we'll examine a small and large model stack.
  513.  
  514.                 call getcp(row,col,page)
  515.  
  516.           The compiler sees the call and pushes the argument addresses on
  517.         the stack in the following order:
  518.  
  519.           Small model stack             Large model stack
  520.  
  521.            row offset=  1 word          row seg:offset= 2 words
  522.            col          1               col             2
  523.            page         1               page            2
  524.  
  525.            As you can see the amount of data on the stack is different for
  526.         the small and large memory models.  The compiler places more infor-
  527.         mation on the stack in the large model, so it is very important to
  528.         know what type memory model is in use.  FAT-Video only supports
  529.         the Far calling procedure. If you use a model other than large and
  530.         it doesn't use Far subroutine calls, you must declare the video
  531.         subroutines as Far subroutines.
  532.  
  533.             For those who want to know if the video library is compatible
  534.         with your compiler and linker, you must know how your stack frame
  535.         is set up in your subroutines, and your linker must accept MS-DOS
  536.         format library files.
  537.            The stack frame pattern is illustrated below for the VIDEO.LIB
  538.         functions. BP is used as the local stack frame pointer.
  539.  
  540.            1)   call getcp(row,col,page)
  541.  
  542.                 page= [bp+6]
  543.                 col = [bp+10]
  544.                 row = [bp+14]
  545.  
  546.            3)   call setab(attr,fore,back,int,blink)
  547.  
  548.                 blink = [bp+6]
  549.                 int   = [bp+10]
  550.                 back  = [bp+14]
  551.                 fore  = [bp+18]
  552.                 attr  = [bp+22]
  553.  
  554.            The FAT-Video subroutines return the following registers after
  555.            a subroutine call without altering them:
  556.            CS, DS, DI, and SI.
  557.  
  558.  
  559.  
  560.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  561.  
  562.         APR 1988                FAT-Video 1.21                  Page x
  563.  
  564.  
  565.  
  566.            When passing values to subroutines, an integer*4 may be passed
  567.         in place of an integer*2. The subroutine will only make use of
  568.         the lowest 2 bytes. When passing a variable to accept a return
  569.         value from a subroutine you should pass a variable of the type
  570.         defined in the subroutine definition. To do otherwise may cause
  571.         problems since the high word is never set by the subroutine.
  572.  
  573.            The video library must be linked any time the window library
  574.         is linked. The video library was written in assembly language and
  575.         is usable by any version of the Fortran compilers of Microsoft.
  576.  
  577.            The window library was written in MS-Fortran 4.0, and Lahey 2.21
  578.         and will not link correctly with other versions of Fortran. However
  579.         the source code can simply be compiled with your compiler and then
  580.         you can use your library manager to make your own library.
  581.  
  582.            There are also some differences in integer passing conventions
  583.         in different Fortran compilers. That is INT2 and INT4 don't exist
  584.         in all compilers. These can be removed from the source code if you
  585.         have such a compiler. They are helpfull in version 4.0 because
  586.         you can't call the same routine twice and use different
  587.         length variables, without getting a warning. Examine the following:
  588.  
  589.                 integer*2 page,row,page
  590.                 page = 2
  591.                 call getcp(row,col,0)   --->  call getcp(row,col,int2(0))
  592.                 call getcp(row,col,page)
  593.  
  594.            The above 2 calls will cause an error 3607 in MS-Fortran 4.0.
  595.            The MS-Fortran 4.0 compiler sees the 0 in the 1st getcp() call
  596.         as a long 4-byte integer (as well as any integer passed in a
  597.         subroutine call) and page as a 2-byte integer. If in fact the
  598.         compiler would ignore this fact it would still work because
  599.         the subroutine only uses the lowest 2-bytes of the page variable
  600.         it's passed, and we've passed that much in both cases. Some Fortran
  601.         compilers don't care about this situation and so they don't need
  602.         an int2, nor do they support it. An alternative to int2 is to use
  603.         the $STORAGE:2 metacommand in MS-Fortran, and declare the default
  604.         integer as an integer*2 or word.  Other versions of Fortran can
  605.         do the same thing, with their own special commands. A substitute
  606.         INT2() function may be of some help. It follows:
  607.  
  608.                 INTEGER*2 FUNCTION INT2(I)
  609.                 INTEGER*4 I
  610.                   INT2 = I
  611.                 RETURN
  612.                 END
  613.  
  614.            One last note regarding strings on various compilers. MS-Fortran
  615.         passes character strings by reference, Lahey and some others pass
  616.         strings by descriptor. This can be a problem when passing strings to
  617.         the VIDEO.LIB functions, from some compilers. Strings must be passed
  618.         by reference for the VIDEO.LIB functions to work, or be declared as
  619.         MSEXTERNAL, as Lahey Fortran allows.
  620.  
  621.  
  622.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  623.  
  624.  
  625.         APR 1988                FAT-VIDEO 1.21                   Page xi
  626.  
  627.  
  628.  
  629.         Using Lahey Fortran with FAT-Video:
  630.         -----------------------------------
  631.  
  632.            The Lahey compiler simply requires that the video library
  633.         functions be declared as MSEXTERNAL as follows, and then called
  634.         normally.
  635.  
  636.                 integer*2  mode,ncols,page,row,col
  637.                 msexternal setcp,getmod,...etc
  638.                 call getmod(mode,ncols,page)
  639.                 row = 10
  640.                 col = 12
  641.                 call setcp(row,col,page)
  642.  
  643.            The file  LAHEY.INC is included on disk to simplify the need for
  644.         the MSEXTERNAL key word. Just put "Include LAHEY.INC" before any
  645.         executable statements in any routine that uses the video library
  646.         and your ready to compile.
  647.  
  648.            The Lahey window library WINDOWL.LIB may be called from Lahey-
  649.         Fortran v2.21 without any special concerns. Other versions may
  650.         require you to recompile the window source code stored in the
  651.         FV121LF.ARC  file.
  652.  
  653.  
  654.  
  655.  
  656.         Where to Get A86:
  657.         -----------------
  658.            I suggest the A86 assembler for any assembly language work,
  659.         novice or pro.  The A86 manual clears up much of the confusion
  660.         surrounding the 80x86 assembly language, and the Microsoft assembler.
  661.            Below is Eric's address & phone number:
  662.  
  663.         Eric Isaacson
  664.         416 E. University Street
  665.         Bloomington, IN 47401
  666.         (812)-339-1811
  667.  
  668.  
  669.  
  670.  
  671.         Useful References:
  672.         ------------------
  673.         The Peter Norton Programmer's Guide to the IBM PC
  674.         by Peter Norton
  675.  
  676.         Advanced MS-DOS
  677.         by Ray Duncan
  678.  
  679.  
  680.  
  681.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  682.  
  683.  
  684.  
  685.         APR 1988                FAT-VIDEO 1.21                   Page xii
  686.  
  687.  
  688.  
  689.                                 VERSION CHANGES
  690.                                 ---------------
  691.  
  692.            The changes made to FAT-Video from one version to the next
  693.         are listed below:
  694.  
  695.         Version 1.1:
  696.         ------------
  697.         I) VIDEO.LIB  ,Requires DOS 2.0
  698.                 1) Peekb(offset,segment,value)
  699.                    a) value must be interger*2
  700.                 2) Setab(attr,fore,back,inten,blink)
  701.                    a) now all inputs, and outputs must be integer*2
  702.                 3) Revab(attr,rattr)
  703.                    a) now both variables, attr & rattr must be
  704.                       integer*2 variables.
  705.                 4) Comlin(string)
  706.                     a) returns the comand line, and works with
  707.                        DOS-2.0 . Should be called at start of program.
  708.                 Note:
  709.                    In general the smallest used data type must
  710.                    be declared as integer*2 now. No integer*1, or
  711.                    character*1 values may be used.
  712.  
  713.         II) WINDOWM.LIB
  714.  
  715.                 1) All windowing routines have been rewritten. There
  716.                    is no need for any common blocks, for any window data.
  717.                    The memory used to store window data is allocated
  718.                    dynamically at run time. To see the structure of the
  719.                    window data block, examine the wopen() header text.
  720.                 2) Wopen() - now accepts 2 attribute integers, one for the
  721.                    border, and one for the text attributes. Both must be
  722.                    declared integer*2, as stated above.
  723.                 3) Wbox() - Wbox0(),Wbox1(),Wbox2() have been condensed
  724.                    into the single Wbox() routine. You may use any of 0,1
  725.                    or 2 borders.
  726.                 4) Control-C : The window routines wgetce,wgetse,wgetsn,
  727.                    and wmenu,menu1,menbar use keyboard BIOS reads and
  728.                    ignore control-c presses. Thus preventing accidental
  729.                    program exits. This makes the menuing appear more in
  730.                    control, and it is.
  731.                 5) Demo - is now functional on most Mono, CGA, and EGA
  732.                    monitors in video modes 3 or 7.
  733.  
  734.  
  735.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  736.  
  737.         APR 1988                FAT-VIDEO 1.21                   Page xiii
  738.  
  739.                                 VERSION CHANGES
  740.  
  741.         Version 1.11:
  742.         -------------
  743.            Bug fixes to v-1.1, the window library was rewritten and
  744.         had several small bugs. The manual had some modifications to the
  745.         Introduction & Technical section. Version 1.0 windows of FAT-Video
  746.         was not Lahey compatable. The windows don't work with Lahey-Fortran
  747.         in version 1.1 and 1.11. The Video library still works with Lahey-
  748.         Fortran. I am working on fixing the problems with using Lahey with
  749.         FAT-Video windows.
  750.  
  751.         Version 1.20:
  752.         -------------
  753.            The window library now works with the Lahey-Fortran compiler.
  754.         FAT-Video now fully supports the Microsoft, and Lahey compilers.
  755.  
  756.         LIBRARY NAMES:
  757.           WINDOWM.LIB - Microsoft window library. NEW NAME !!!
  758.           WINDOWL.LIB - Lahey window library.
  759.           VIDEO.LIB   - Video library.
  760.  
  761.         New Video Library Functions:
  762.  
  763.         GETML- is used to allocate memory dynamically with the
  764.                Lahey compiler. This must not be declared msexternal, either.
  765.         RLSML- is used to release memory dynamically with the
  766.                 Lahey compiler. This must not be declared msexternal, either.
  767.         POKEL- Poke(put) a 4-byte value into memory.
  768.         PEEKL- Peek(get) a 4-byte value from memory.
  769.  
  770.         WRTS-  Write string using current screen attributes, uses BIOS.
  771.         WRTSP- Write string using current screen attributes at position
  772.                given, uses BIOS.
  773.  
  774.         The following routines write directly to video ram, for speed:
  775.  
  776.         CPUTAC-Write attribute and character.
  777.         CPUT-  Write a string to the screen.
  778.         CPUTA- Write a string to the screen using the attribute given.
  779.         CPUTP- Write a string to the screen using the position given.
  780.         CPUTAP-Write a string to the screen using the position and attribute
  781.                given.
  782.  
  783.         New Window Library Functions:
  784.  
  785.         WGETI2- Get(Read) an integer*2 from the user.
  786.         WGETI4- Get(Read) an integer*4 from the user.
  787.         WPUTI2- Write an integer*2 value to the screen.
  788.         WPUTI4- Write an integer*4 value to the screen.
  789.         WGETR4- Get(Read) a Real*4 from the user
  790.         WGETR8- Get(Read) a Real*8 from the user.
  791.  
  792.         Copyright (c) 1987 Marc A. Norton  All Rights Reserved.
  793.  
  794.  
  795.         APR 1988                FAT-VIDEO 1.21                   Page xiii
  796.  
  797.                               VERSION CHANGES
  798.                               ---------------
  799.  
  800.         Version 1.21
  801.         -------------
  802.  
  803.         New Video Library Functions:
  804.  
  805.            The following video functions can really improve the look and
  806.         feel of a user interface. They also help establish some baisic
  807.         input/output/editing functions.
  808.            A NEW demo I 've written, MVIEW.EXE, is also included on the
  809.         shareware disk, it is a spreadsheet for matrices demo. The Fortan
  810.         source code for MVIEW is only on the registered disk. The matrix
  811.         viewing utility used in MVIEW has been implemented as a single
  812.         subroutine allowing you to easily call it with your own matrices.
  813.         This is the first version of MVIEW so its a bit rough, but you
  814.         can see the kind of screen control you can have with VIDEO.LIB.
  815.           This demo also has examples of internal Fortran reads and writes,
  816.         and how they interface with this library, this aspect of Fortran
  817.         is often underutilized in Fortran programs.
  818.  
  819.         CLRSTR() - Clear a string, by filling with blanks.
  820.  
  821.           The following 4 functions clear the input string and wait
  822.           for input from the user.
  823.  
  824.         CGETS()  - Read a string from the keyboard, and echo it, using
  825.                    the ROM BIOS to prevent Ctrl-C presses from interrupting.
  826.         CGETAS() - Same but allows user to define the echo attribute.
  827.         CGETIS() - Same as CGETAS but only allows integers to be entered.
  828.         CGETRS() - Same as CGETRS but only allows integers, e,E,d,D,.,-,+.
  829.  
  830.           The followng functions are similar to the above funtions, but
  831.           these display the string and then allow it to be edited.
  832.  
  833.         CEDAS() - Display string w/attribute, allow user to edit.
  834.         CEDIS() - Display integer string w/ attribute, allow user to edit.
  835.         CEDRS() - Display real  string  w/   "          "     "     "  "
  836.  
  837.            The next function is a windowed requestor.
  838.  
  839.         RQST()  - Displays a message and accepts any ascii input from the
  840.                   user, press ESC to cancel the requestor.
  841.  
  842.         BUG FIXES:
  843.         -----------
  844.         WRTGP() and GETGP() did not work in all video modes, the error
  845.                 has been corrected. These should now support all graphics
  846.                 video modes supported by the BIOS, including CGA, EGA,
  847.                 MCGA, and VGA.
  848.