home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
fortran
/
fv121s.zip
/
FAT3.DOC
< prev
next >
Wrap
Text File
|
1988-06-04
|
29KB
|
1,053 lines
APR 1988 FAT-VIDEO 1.21 GETMON Page V-32
GETMON(NRS,NCS,NRE,NCE,SEG) - Copy a screen window to memory at SEG.
Usage:
call getmon(nrs,ncs,nre,nce,seg)
integer*2 nrs,ncs
integer*2 nre,nce
integer*2 seg or integer*4 seg
inputs: nrs,ncs,nre,nce,seg
returns: none
MS-Fortran 4.0 Large Model
Description:
This subroutine stores the window section defined by nrs,ncs
and nre,nce on the screen into the buffer starting at seg. It is
up to the calling program to allocate storage via ALLMEM().
This routine stores the monochrome buffers character and
attribute bytes for the window defined, to memory at SEG.
This routine reads directly from the monochrome video buffer,
and may cause software incompatabilities.
This function does not clear the window after saving it, but
once saved you may do anything to the window area, and restore
the saved window contents using PUTMON().
See also getvid(), putvid(),getcga(),putcga().
nrs = first row of window
ncs = first col of window
nre = last row of window
nce = last col of window
seg = segment of allocated memory, as output from ALLMEM().
Note: To calcualte the number of paragraphs to request from ALLMEM()
calculate the following:
Npar= (((nr*nc)*2)+15)/16 ; nr=nre-nrs+1, nc=nce=ncs+1
Example:
Npar= (((11*41)*2)+15)/16
call ALLMEM(Npar,SEG,MaxPar)
if(SEG.eq.7 .or. SEG.eq.8)Go To 1000 ;Error !
call GETMON(0,0,10,40,SEG)
See Wopen(),Wclose().
Restrictions: 80 column mode only !
Int none
Mono, EGA
APR 1988 FAT-VIDEO 1.21 PUTMON Page V-33
PUTMON(NRS,NCS,NRE,NCE,SEG) - Copy a window in memory at SEG to
the screen.
Usage:
call putmon(nrs,ncs,nre,nce,seg)
integer*2 nrs,ncs
integer*2 nre,nce
integer*2 seg or integer*4 seg
inputs: nrs,ncs,nre,nce,seg
returns: none
MS-Fortran 4.0 Large Model
Description:
This subroutine restores the window section defined by nrs,ncs
and nre,nce onto the screen. It is up to the calling program to
free storage via FREMEM().
This routine restores the monochrome buffers character and
attribute bytes for the window defined.
This routine writes directly to the mono video memory buffer.
See also getvid(), putvid(),getcga(),putcga().
nrs = first row of window
ncs = first col of window
nre = last row of window
nce = last col of window
Seg = segment address used in GETMON()
Example:
call PUTMON(0,0,10,40,seg)
call FREMEM(Seg,Ier)
if(Ier.ne.0)Go To 1000 ; Error !
See Wopen(),Wclose().
Restrictions: 80 column mode only !
Int none
Mono, EGA
APR 1988 FAT-VIDEO 1.21 CLS Page V-34
CLS() - Clear the Screen.
Usage:
call cls()
MS-Fortran 4.0 Large Model
Description:
This subroutine scrolls the entire window up, effectively
clearing the screen.
This function determines the active page, gets the attribute
byte at the cursor, and then scrolls the window, filling the
blank lines with the color defined by the attribute bytes
background color.
See also scwup(), scwdn().
Int 10h, fx-0Fh, 08h, 06h
CGA,Mono
APR 1988 FAT-VIDEO 1.21 RDKBD Page V-35
RDKBD(SCAN,KEY) - Read the keyboard.
Usage:
call rdkbd(SCAN,KEY)
integer*2 scan,key
inputs: none
returns: scan,key
MS-Fortran 4.0 Large Model
Description:
This subroutine returns the ascii code from the keyboard and
its scan code. This function doesn't echo the character read from
the keyboard.
If key is returned as zero then a special key was hit such as
the function keys(F1,F2,..) or the cursor keys, or a combination
of shift,ctrl,alt and a function key. The value
of the special key is returned in the scan variable.
If a normal key is struck then key returns the ascii code.
Once read by rdkbd() a character is removed from the keyboard
buffer. This function cannot be interrupted by a ctrl-c keypress.
See chinp() to allow ctrl-c interrupts during a keyboard read.
See also chinp(), kbdst(), kbdfl().
scan = scan code if ascii, key code if special key
key= ascii code or 0 for special key code
Int 16, fx-00h
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 KBDST Page V-36
KBDST(SCAN,ACHAR) - Get the keyboard status.
Usage:
call kbdst(SCAN,ACHAR)
integer*2 scan,key
inputs: none
returns: scan,key
MS-Fortran 4.0 Large Model
Description:
This subroutine reports whether a character is is ready at
the keyboard. If there are no characters ready then scan and
key are zero. If an ascii character is ready, it is returned in
key. If a special key is present, then key is zero and scan
contains the key code.
This function does not remove characters from the keyboard
buffer though, as rdkbd() does.
The keyboard buffer may be cleared by calling this function,
and if a character is ready, reading it with rdkbd(), and
doing this until no characters are found.
See also rdkbd(), kbdfl(), chinp().
scan = scan code if ascii, key code if special key
key= ascii code or 0 for special key code
Int 16h, fx- 02h
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 KBDFL Page V-37
KBDFL(FLAGS) - Get the keyboard flags.
Usage:
call kbdfl(Flags)
integer*2 Flags
inputs: none
returns: flags
MS-Fortran 4.0 Large Model
Description:
This subroutine returns the keyboard flags byte. The flags
indicate which special keys are pressed, such as left-shift,
right-shift, insert, scroll lock, num lock, and ctrl.
This is not a generally useful function from Fortran,
especially with the other keyboard reads available, since
they can read any key combination. There are some uses for this,
if you are clever.
See also rdkbd(), kbdst(), chinp().
Flag = the low byte of flag has each bit set as defined below.
Bit Set Meaning Dec Value
7 Insert on 128
6 Caps on 64
5 Num Lock on 32
4 Scroll Lock on 16
3 Alt key down 8
2 Ctrl key down 4
1 Left-Shift down 2
0 Right-Shift down 1
Int 16h, fx-02
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 CHINP Page V-38
CHINP(KEY) - Get character from keyboard, no echo.
Usage:
call chinp(key)
integer*2 key
inputs: none
returns: key
MS-Fortran 4.0 Large Model Dos2.0
Description:
This program reads a character from the keyboard. This input is
unfiltered and waits for a keypress. This function doesn't echo
the keypress to the screen.
To read extended key codes, call this routine twice. The first
call returns zero to indicate a special extended code key, such as
F1-F10. A ctrl-c keypress during this function will terminate
a program. Use rdkbd() to prevent ctrl-c interrupts during a
keyboard read operation.
See also rdkbd(), kbdst(), kbdfl().
KEY = 0 Extended char code, call again for key id
KEY > 0 ascii character, use char(key) to reference.
Int 21, fx-08h.
APR 1988 FAT-VIDEO 1.21 ALLMEM Page V-39
ALLMEM(NPAR,SEG,MAXPAR) - Allocate Memory, Dynamically.
Usage:
call allmem(NPAR,SEG,MAXPAR)
integer*2 npar,seg,maxpar
or
integer*4 npar,seg,maxpar
inputs: npar
returns: seg,maxpar
MS-Fortran 4.0 Large Model Dos2.0
Description:
This program attempts to allocate memory dynamically. If
successful it returns the paragraph segment in SEG. If
unsuccessful it returns the maximum available paragraphs in
MAXSEG, and the error code in SEG. Inputting 640k for NPAR
returns available memory in MAXPAR if you want xbytes request
(xbytes+15)/16 paragraphs.
NPAR- No. of paragraphs to allocate.
SEG- Segment address of allocated memory, or error code.
MAXPAR- Maximum available memory, or actual allocated.
See also fremem().
Error Codes:
SEG values if allocation failed.
7 = memory blocks destroyed
8 = insufficient memory
Warning:
SEG should be checked after each allocation.
Int 21h, fx-48h
CGA, Mono, EGA
This only works with the first 640k. It does not work with
extended, expanded, or any other memory additions, just the first
640k !!!
APR 1988 FAT-VIDEO 1.21 FREMEM Page V-40
FREMEM(SEG,IER) - Free Memory.
Usage:
call fremem(SEG,IER)
integer*2 seg,ier or integer*4 seg,ier
inputs: seg
returns: ier
MS-Fortran 4.0 Large Model Dos2.0
Description:
This program frees memory previously allocated. Normally
you should only free memory allocated via allmem(). On input, SEG
is the paragraph segment to free. On return, IER is set to 0 if
memory was deallocated, otherwise IER is set to an error code, as
below.
SEG- Segment address returned by allmem().
IER- Error code, as below
See also allmem().
Error Code:
IER values
0 = no error
7 = memory control blocks destroyed
9 = bad segment id(not allocated?)
Warning:
IER should be checked after every call
to fremem().
Note: DOS will free up any dynamically allocated memory when a
program terminates.
APR 1988 FAT-VIDEO 1.21 SETNUL Page V-41
SETNUL(STRING) Null Terminate a String.
Usage:
call setnul(string)
character*255 string
inputs: string
returns: string
MS-Fortran 4.0 Large Model
Description:
This function replaces the '`' character with a 0 byte, the
null terminator. This forms a c-string which is also equivalent
to appending the char(0) to a string. The following are all identical
strings as far as the video and window library are concerned.
string = 'text'C Used MS-Fortran only.
or
string = 'text'//char(0) Used by many compilers.
or
string = 'text`' Can be used by any compiler.
call setnul(string)
The video library functions can use the string defined as
string = 'text`', it is treated as a null terminated string. The
'`' character is considered equivalent to char(0).
The above string does not have to be passed to setnul() in order
to be usable by the video library. The setnul() function is provided
to assist you in forming true null terminated strings should you
need to. The maximum string length, including the null terminator,
is 255 bytes or anything less.
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 REVAB Page V-42
REVAB(ATTR,RATTR) - Reverse foreground and background in attribute.
Usage:
call revab(attr,rattr)
integer*2 attr,rattr
inputs: attr
returns: rattr
MS-Fortran Large Model
Description:
This function takes the input attribute and reverses the
foreground and background colors. It does not alter the
blink or intensity bits.
attr = input attribute
rattr = output attribute with reverse colors
See also setab(), getab().
APR 1988 FAT-VIDEO 1.21 SETBC Page V-43
SETBC(COLOR) - Set CGA border color in text modes.
Usage:
call setbc(color)
integer*2 color
inputs: color
returns: none
MS-Fortran Large Model
Description:
This function sets the border color in text mode on the
CGA adapter. Do not use with the EGA or mono adapter.
See setpal() to set border colors in graphics mode.
color = 0-15
Colors
------
0 Black 8 Gray
1 Blue 9 Light Blue
2 Green 10 Light Green
3 Cyan 11 Light Cyan
4 Red 12 Pink
5 Magenta 13 Light Magenta
6 Brown 14 Yellow
7 White 15 Bright White
See also setab(), getab(), setpal().
CGA Only !
APR 1988 FAT-VIDEO 1.21 BVEF Page V-44
+
BVEF(Flag) - Get the BIOS video equipment flag.
Usage:
call bvef(bflag)
integer*2 bflag
inputs: none
returns: bflag
MS-Fortran Large Model
Description:
This function returns the BIOS video equipment flag.
See also getadp().
EGAF(Flag) - Get the EGA status flag.
Usage:
call egaf(bflag)
integer*2 egaf
inputs: none
returns: egaf
MS-Fortran Large Model
Description:
This function returns the EGA status flag.
See also getadp().
APR 1988 FAT-VIDEO 1.21 CGACOF Page V-45
CGACOF() - Turn off cursor on CGA adapter.
Usage:
call cgacof()
inputs: none
returns: none
MS-Fortran Large Model
Description:
This function turns the cursor off on the CGA adapter.
See also cgacon(), moncof(), moncon().
CGACON() - Turn on cursor on CGA adapter.
Usage:
call cgacon()
inputs: none
returns: none
MS-Fortran Large Model
Description:
This function turns the CGA cursor on.
See also cgacof(), moncof(), moncon().
APR 1988 FAT-VIDEO 1.21 MONCOF Page V-46
MONCOF() - Turn off cursor on monochrome display.
Usage:
call moncof()
inputs: none
returns: none
MS-Fortran Large Model
Description:
This function turns the mono display cursor off.
See also cgacof(), cgacon(), moncon().
MONCON() - Turn on cursor on monochrome display.
Usage:
call moncon()
inputs: none
returns: none
MS-Fortran Large Model
Description:
This function turns the mono display cursor on.
See also cgacof(), cgacon(), moncof().
APR 1988 FAT-VIDEO 1.21 COMLIN Page V-47
COMLIN(TAIL) - gets the user typed command line tail. DOS 2.0.
Usage:
call comlin(tail)
character*127 tail
inputs: none
returns: tail
MS-Fortran Large Model - DOS 3.0
Description:
This function returns the command line tail used to invoke
the currently active program.
tail - character string containing the command tail from the
MS-DOS command line.
GETDOS(MAJOR,MINOR) - returns does version .
Usage:
call getdos(major,minor)
integer*2 major,minor
inputs: none
returns: major,minor
MS-Fortran Large Model
Description:
This function returns the DOS version number. For DOS 3.20
major=3 and minor = 20.
APR 1988 FAT-VIDEO 1.21 GETTIM Page V-48
GETTIM(HR,MIN,SEC,HSEC)- returns DOS time.
Usage:
call gettim(hr,min,sec,hsec)
integer*2 hr,min,sec,hsec
inputs: none
returns: hr,min,sec,hsec
MS-Fortran Large Model
Description:
This function returns the time as DOS maintains it.
HR= 0-23 , MIN=0-59, SEC=0-59, HSEC= 0-99
CLRKBD() - clears the keyboard type ahead buffer.
Usage: call clrkbd()
inputs: none ; returns: none
BEEP() - Beeps the speaker
Usage: call beep()
inputs: none ; returns: none
CurOff() - Turns the cursor off using the video BIOS.
Usage: call CurOff()
inputs: none ; returns: none
CurOn() - Turns the cursor in using the video BIOS.
Usage: call CurOn()
inputs: none ; returns: none
APR 1988 FAT-VIDEO 1.21 GETML Page V-49
GETML(NBYTES,SEG,OFF) - Allocate memory dynamically in Lahey
Fortran. This memory comes from the Lahey Heap.
Usage:
call getml(nbytes,seg,off)
integer*4 nbytes,seg,off
inputs: nbytes
returns: seg,off
For Lahey Compiler Only !
Description:
This function allocates memory dynamically in Lahey-Fortran
and returns the segment and offset of the allocated memory. This
memory is allocated from the Lahey Heap. That is Lahey allocates
available DOS memory at startup. Any memory not required for
code and data is available as Heap memory. See the Lahey WOPEN().
source code for an example.
Error Checking:
If Seg = 0 and Off = 0 memory not allocated.
RLSML(NBYTES,SEG,OFF) - Free memory dynamically in Lahey
Fortran. This memory is returned to the Lahey Heap.
Usage:
call rlsml(nbytes,seg,off)
integer*4 nbytes,seg,off
inputs: nbytes,seg,off
returns: seg,off
For Lahey Compiler Only !
Description:
This function retruns dynamically allocated memory to the Lahey
Heap. The GETML() routine must have been used to allocate the
memory prior to a call to free Heap memory. See the Lahey Wclose()
routine for an example of this function.
Error checking:
On return: Seg = 0 safe return.
<>0 error return, memory not freed, or bad input.
APR 1988 FAT-VIDEO 1.21 PEEKL Page V-50
PEEKL - Get a Long word value from memory.
integer*2 OFF,SEG
integer*4 VALUE
call PEEKL(OFF,SEG,VALUE)
call with:
OFF - offset value from start of segment, <=64k
SEG - segment value of long word location, <=64k
returns:
VALUE - the long word value is returned in this argument.
example:
call PEEKL(INT2(0),INT2(#0800),VALUE)
This call returns long word stored at SEG= Hex 0800, OFF=0.
Notes: An integer*2 is signed and may range from -32k to +32k.
If the segment or offset values exceed this amount you should
declare the segment and offset as integer*4.
i.e.
integer*4 SEG,OFF
integer*4 VALUE
SEG = #B800 <--- .gt. 32k
OFF = 0
call PEEKL(INT2(OFF),INT2(SEG),VALUE)
POKEL - Store a long word value in memory.
integer*2 OFF,SEG
integer*4 VALUE
call POKEL(OFF,SEG,VALUE)
call with:
OFF - offset value from start of segment, <=64k
SEG - segment value of long word location, <=64k
VALUE - the long word value to store.
returns: nothing
example: VALUE = 128
call POKEL(Int2(0),Int2(#0800),VALUE)
This call stores the value 128 at SEG=Hex 0800, OFF = 0.
Notes: An integer*2 is signed and may be range from -32k to +32k.
If the segment or offset values exceed this amount you should
declare the segment and offset as integer*4.
i.e.
integer*4 SEG,OFF
integer*4 VALUE
SEG = #B800 <--- .gt. 32k
OFF = 0
call POKEL(INT2(OFF),INT2(SEG),VALUE)
APR 1988 FAT-VIDEO 1.21 WRTS Page V-51
WRTS(STRING)
Write a null terminated string to screen using the BIOS.
character*n string
string= 'Hello`' or string='Hello'//char(0)
call wrts(string)
input: string
returns: nothing
Description:
This function writes a null terminated string to the video
screen. The routine works in video modes 3 & 7. This is a text
mode function only. The function writes to screen using the
BIOS, for hardware compatibility.
WRTSP(STRINg,ROW,COL,PAGE)
Write a null terminated string to screen at the position given,
using the BIOS, for compatibility.
integer*2 row,col,page
character*n string
page=0
row=2
col=3
string= 'Hello`' or string='Hello'//char(0)
call wrts(string,row,col,page)
input: string,row,col,page
returns: nothing
Description:
This function writes a null terminated string to the video
screen at the lcoation specified. The routine works in video
modes 3 & 7. This is a text mode function only. The function
writes to screen using the BIOS, for hardware compatibility.
Row = Row starting position of 1st character, 0-24
Col = Col starting position of 1st character, 0-79
APR 1988 FAT-VIDEO 1.21 CPUT Page V-52
CPUT(STRING)
Write a null terminated string to the screen, by writing
directly to video ram.
character*n string
string= 'Hello`' or string='Hello'//char(0)
call cput(string)
inputs: string
returns: none
Description:
This founction writs a null terminated string to the screen
by writing directly to video ram. The routine works in either
mode 7 or mode 3. This is a text mode function only. The direct
video ram writing produces very fast output. This routine writes
one byte per screen character, and is twice as fast as CPUTA, and
CPUTAP.
CPUTA(ATTR,STRING)
Write a null terminated string to the screen using the attribute
given, by writing directly to video ram.
integer*2 attr
character*n string
attr = 7
string= 'Hello`' or string='Hello'//char(0)
call cput(attr,string)
inputs: string,attr
returns: none
Description:
This function writes a null terminated string to the screen
using the attribute given, by writing directly to video ram.
The routine works in either mode 7 or mode 3. This is a text
mode function only. The direct video ram writing produces very
fast output. This routine is slower than CPUT, and CPUTP.
APR 1988 FAT-VIDEO 1.21 CPUTP Page V-53
CPUTP(STRING,ROW,COL)
Write a null terminated string to the screen at the position
specified, by writing directly to video ram.
integer*2 row,col
character*n string
row=2
col=2
string= 'Hello`' or string='Hello'//char(0)
call cputp(string,row,col)
inputs: string,row,col
returns: none
Description:
This founction writes a null terminated string to the screen
at the position specified by writing directly to video ram.
The routine works in either mode 7 or mode 3. This is a text
mode function only. The direct video ram writing produces very
fast output. This routine is faster than CPUTA, and CPUTAP.
Row = Row starting position of 1st character, 0-24
Col = Col starting position of 1st character, 0-79
CPUTAP(ATTR,STRING,ROW,COL)
Write a null terminated string to the screen using the attribute
and location given, by writing directly to video ram.
integer*2 attr,row,col
character*n string
attr = 7
row=2
col=7
string= 'Hello`' or string='Hello'//char(0)
call cput(attr,string)
inputs: string,attr,row,col
returns: none
Description:
This function writes a null terminated string to the screen
using the attribute and location given, by writing directly to
vide ram. The routine works in either mode 7 or mode 3. This is a
text mode function only. The direct video ram writing produces very
fast output. This routine is slower than CPUT, and CPUTP.
Row = Row starting position of 1st character, 0-24
Col = Col starting position of 1st character, 0-79
APR 1988 FAT-VIDEO 1.21 CPUTAC Page V-54
CPUTAC(ATTR,VALUE)
Write a character to the video screen using the attribute given,
by writing directly to video ram.
integer*2 attr
integer*2 value
attr = 7
value= 65
call cputac(attr,value)
inputs: attr,value
returns: none
Description:
This founction writes a character to the screen using the attribute
given, by writing directly to video ram.
The routine works in either mode 7 or mode 3. This is a text
mode function only. The direct video ram writing produces very
fast output. This routine is slower than CPUTC.
ATTR = valid attribute byte.
VALUE= ASCII value of character, or extended value of character.
CPUTC(VALUE)
Write a character to the video screen by writing directly to video
ram, for fast screen output. This routine uses the current screen
attribute.
integer*2 value
value= 65
call cputc(value)
inputs: attr,value
returns: none
Description:
This founction writes a character to the screen, by writing directly
to video ram, and uses the current screen attribute.
The routine works in either mode 7 or mode 3. This is a text
mode function only. The direct video ram writing produces very
fast output. This routine is faster than CPUTAC.
VALUE = ASCII value of character to write, or extended key value.