home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
decus
/
RB140
/
grlibfor.arj
/
FGLIB.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-12-11
|
18KB
|
1,012 lines
PAGE ,132
TITLE FGLIB.ASM
;*************************************************************
; Microsoft fortran interface
into GRLIB *
; (Computer Innovations C Graphics library) *
;
*************************************************************
;
; This is really a interface between the LARGE Fortran and
; small C model.
;
; Fortran Parameters are passed by far refere
nce, left to right
;
; C parameters are passed right to left; arra
ys & strings by
; near reference, integers & chars by value.
;
include asmc.h
SEGEND CODE
SEGDEF DATA
EXTRN f_
col_:BYTE, f_style_:BYTE, f_type_:BYTE
EXTRN l_col_:BYTE, l
_type_:BYTE, l_wid_:BYTE
EXTRN m_col_:BYTE, m_sca_:BYTE, m_
type_:BYTE
EXTRN t_col_:BYTE, t_dir_:BYTE, t_font_:BYTE
EXTRN t_sca_:BYTE, ws_number_:BYTE, ws_wmo_:BYTE
public F
_WORK_BUF_
ARRAY DW ?
ARRAY4 DW ?
BLUE DW ?
CEN
TRX DW ?
CENTRY DW ?
CHAR DW ?
COUNT DW ?
ENDDEG
DW ?
GREEN DW ?
INDEX DW ?
RADIUS DW ?
RED DW
?
STARTD DW ?
X DW ?
XEND DW ?
XSTART DW ?
Y
DW ?
YEND DW ?
YSTART DW ?
ZERO DW 0
F_WORK_B
UF_ LABEL BYTE ;external name
STRING LABEL BYTE ;ASCIZ loca
l copy
WORK DW 2048 DUP(?) ;for circles etc
SEGEND
DATA
SEGDEF CODE
Extrn a_wmode_:NEAR, arc_:NEAR, bar_:
NEAR, circle_:NEAR
Extrn color_:NEAR, ltext_:NEAR, g_off_:NEAR, g
_on_:NEAR
Extrn openws_:NEAR, point_:NEAR, polyfill_:NEAR
E
xtrn polyline_:NEAR, polymark_:NEAR, rectangle_:NEAR
Extrn rq_l
ocator_:NEAR, segment_:NEAR, gtext_:NEAR
PUBLIC GRARC, GRBAR
, GRCIRC, GRCLOS, GRCOLR, GRFCOL
PUBLIC GRFSTY, GRFTYP, GRGON,
GRGOFF, GRGTXT, GRHSCR
PUBLIC GRLCOL, GRLTYP, GRLWID, GRMCOL, GRM
SCA, GRMTYP
PUBLIC GROPEN, GRPFIL, GRPLIN, GRPMAR, GRPOIN, GRRECT
PUBLIC GRRQLO, GRSEGM, GRTCOL, GRTDIR, GRTEXT, GRTFON
PUBLI
C GRTSCA, GRVSCR, GRWMOD
;make a local ASCIZ copy of string
;ES:SI must point to source
;CX must contain count
movc PROC
NEAR
PUSH DS
PUSH ES
POP DS ;DS=ES
POP ES
;ES=DS
LEA DI, STRING
REP MOVSB
MOV AL,0 ;add
ASCIZ terminator
STOSB
PUSH DS
PUSH ES
POP DS
;DS=ES
POP ES ;ES=DS
RET
movc ENDP
;***********************************
;* SUBROUTINE GROPEN()
;***********************************
GROPEN PROC FAR
PUSH B
P
MOV BP,SP
LES BX,[BP].06H
MOV AX,ES:[BX]
PUS
H AX
PUSH DS ;call with ES set to DS
POP ES
CALL
openws_ ;open workstation
ADD SP,2 ;C convention remove
params from stack
MOV SP,BP
POP BP
RET
GROPEN END
P
;***********************************
;* SUBROUTINE GRGON()
;***********************************
GRGON PROC FA
R
PUSH BP
MOV BP,SP
PUSH DS ;call with ES set to
DS
POP ES
CALL g_on_ ;turn Graphics ON
MOV SP,B
P
POP BP
RET
GRGON ENDP
;***********************************
;* SUBROUTI
NE GRCIRC()
;***********************************
GRCIRC PROC FAR
PUSH BP
MOV
BP,SP
LES BX,[BP].0EH ;p1
MOV AX,ES:[BX]
MOV CEN
TRX,AX
LES BX,[BP].0AH ;p2
MOV AX,ES:[BX]
MOV CE
NTRY,AX
LES BX,[BP].06H ;p3
MOV AX,ES:[BX]
MOV R
ADIUS,AX
MOV AX,RADIUS
PUSH AX
MOV AX,CENTRY
PUSH AX
MOV AX,CENTRX
PUSH AX
PUSH DS ;call
with ES set to DS
POP ES
CALL circle_
ADD SP,6 ;
C convention remove params from stack
MOV SP,BP
POP BP
RET
GRCIRC ENDP
;***********************************
;* SUBROUTINE GRARC()
;***********************************
GRARC PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP]
.16H
MOV AX,ES:[BX]
MOV CENTRX,AX
LES BX,[BP].12H
MOV AX,ES:[BX]
MOV CENTRY,AX
LES BX,[BP].0EH
MO
V AX,ES:[BX]
MOV RADIUS,AX
LES BX,[BP].0AH
MOV AX
,ES:[BX]
MOV STARTD,AX
LES BX,[BP].06H
MOV AX,ES:[B
X]
MOV ENDDEG,AX
MOV AX,ENDDEG
PUSH AX
MOV A
X,STARTD
PUSH AX
MOV AX,RADIUS
PUSH AX
MOV A
X,CENTRY
PUSH AX
MOV AX,CENTRX
PUSH AX
PUSH
DS ;call with ES set to DS
POP ES
CALL arc_
ADD
SP,10 ;C convention remove params from stack
MOV SP,BP
PO
P BP
RET
GRARC ENDP
;***********************************
;* SUBROUTINE GRSEGM()
;***********************************
GRSEGM PROC FAR
PUSH BP
MOV BP,SP
LE
S BX,[BP].16H
MOV AX,ES:[BX]
MOV CENTRX,AX
LES BX
,[BP].12H
MOV AX,ES:[BX]
MOV CENTRY,AX
LES BX,[BP].
0EH
MOV AX,ES:[BX]
MOV RADIUS,AX
LES BX,[BP].0AH
MOV AX,ES:[BX]
MOV STARTD,AX
LES BX,[BP].06H
MOV
AX,ES:[BX]
MOV ENDDEG,AX
MOV AX,ENDDEG
PUSH AX
MOV AX,STARTD
PUSH AX
MOV AX,RADIUS
PUSH AX
MOV AX,CENTRY
PUSH AX
MOV AX,CENTRX
PUSH AX
PUSH DS ;call with ES set to DS
POP ES
CALL segment_
ADD SP,10 ;C convention remove params from stack
MOV SP,
BP
POP BP
RET
GRSEGM ENDP
;***********************************
;* SUBROUTINE
GRCOLR()
;***********************************
GRCOLR PROC FAR
PUSH BP
MOV BP
,SP
LES BX,[BP].12H
MOV AX,ES:[BX]
MOV INDEX,AX
LES BX,[BP].0EH
MOV AX,ES:[BX]
MOV RED,AX
LES B
X,[BP].0AH
MOV AX,ES:[BX]
MOV GREEN,AX
LES BX,[BP].
06H
MOV AX,ES:[BX]
MOV BLUE,AX
MOV AX,BLUE
PUS
H AX
MOV AX,GREEN
PUSH AX
MOV AX,RED
PUSH
AX
MOV AX,INDEX
PUSH AX
PUSH DS ;call with ES se
t to DS
POP ES
CALL color_
ADD SP,8 ;C conventio
n remove params from stack
MOV SP,BP
POP BP
RET
GR
COLR ENDP
;***********************************
;* SUBROUTINE GRBAR()
;***********************************
GRBAR
PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP].06H
P
USH BX
PUSH DS ;call with ES set to DS
POP ES
CA
LL bar_
ADD SP,2 ;C convention remove params from stack
MOV SP,BP
POP BP
RET
GRBAR ENDP
;***********************************
;* SU
BROUTINE GRPLIN()
;***********************************
GRPLIN PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP].0AH
MOV AX,ES:[BX]
MOV COUN
T,AX
LES BX,[BP].06H
MOV ARRAY,BX
MOV AX,ARRAY
PUSH AX
MOV AX,COUNT
PUSH AX
PUSH DS ;call wit
h ES set to DS
POP ES
CALL polyline_
ADD SP,4 ;C
convention remove params from stack
MOV SP,BP
POP BP
RET
GRPLIN ENDP
;***********************************
;* SUBROUTINE GRPMAR()
;***********************************
GRPMAR PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP].
0AH
MOV AX,ES:[BX]
MOV COUNT,AX
LES BX,[BP].06H
MOV ARRAY,BX
MOV AX,ARRAY
PUSH AX
MOV AX,COUNT
PUSH AX
PUSH DS ;call with ES set to DS
POP ES
CALL polymark_
ADD SP,4 ;C convention remove params from s
tack
MOV SP,BP
POP BP
RET
GRPMAR ENDP
;***********************************
;* SUBROUTINE GRPFIL()
;***********************************
GRPFIL PROC FAR
PUSH
BP
MOV BP,SP
LES BX,[BP].0AH
MOV AX,ES:[BX]
MOV COUNT,AX
LES BX,[BP].06H
MOV ARRAY,BX
MOV AX,
ARRAY
PUSH AX
MOV AX,COUNT
PUSH AX
PUSH DS
;call with ES set to DS
POP ES
CALL polyfill_
ADD S
P,4 ;C convention remove params from stack
MOV SP,BP
POP
BP
RET
GRPFIL ENDP
;***********************************
;* SUBROUTINE GRGTXT()
;
***********************************
GRGTXT PROC FAR
PUSH BP
MOV BP,SP
LES
BX,[BP].12H
MOV AX,ES:[BX]
MOV X,AX
LES BX,[BP].0EH
MOV AX,ES:[BX]
MOV Y,AX
LES SI,[BP].0AH ;ch
aracter string addr
LES BX,[BP].06H ;count
MOV CX,ES:[B
X]
CALL movc
LEA AX, STRING
PUSH AX
MOV
AX,Y
PUSH AX
MOV AX,X
PUSH AX
PUSH DS ;ca
ll with ES set to DS
POP ES
CALL gtext_
ADD SP,6
;C convention remove params from stack
MOV SP,BP
POP BP
RET
GRGTXT ENDP
;***********************************
;* SUBROUTINE GRTEXT()
;***********************************
GRTEXT PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP
].12H
MOV AX,ES:[BX]
MOV X,AX
LES BX,[BP].0EH
MOV AX,ES:[BX]
MOV Y,AX
LES SI,[BP].0AH
LES BX,[B
P].06H
MOV CX,ES:[BX]
CALL movc
LEA AX, STRING
PUSH AX
MOV AX,Y
PUSH AX
MOV AX,X
PUSH AX
PUSH DS ;call with ES set to DS
POP ES
CALL ltext
_
ADD SP,6 ;C convention remove params from stack
MOV S
P,BP
POP BP
RET
GRTEXT ENDP
;***********************************
;* SUBROUTI
NE GRRQLO()
;***********************************
GRRQLO PROC FAR
PUSH BP
MOV
BP,SP
LES BX,[BP].16H
MOV AX,ES:[BX]
MOV XSTART,AX
LES BX,[BP].12H
MOV AX,ES:[BX]
MOV YSTART,AX
LE
S BX,[BP].0EH
MOV AX,ES:[BX]
MOV CHAR,AX
LES BX,[
BP].0AH
MOV AX,ES:[BX]
MOV XEND,AX
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV YEND,AX
MOV AX,YEND
PUSH A
X
MOV AX,XEND
PUSH AX
MOV AX,CHAR
PUSH AX
MOV AX,YSTART
PUSH AX
MOV AX,XSTART
PUSH AX
MOV AX,ZERO
PUSH AX
PUSH DS ;call with ES set to DS
POP ES
CALL rq_locator_
ADD SP,12 ;C convention
remove params from stack
LES BX,[BP].0EH
MOV AX,CHAR
MOV ES:[BX],AL
LES BX,[BP].0AH
MOV AX,XEND
MOV ES
:[BX],AX
LES BX,[BP].06H
MOV AX,YEND
MOV ES:[BX],AX
MOV SP,BP
POP BP
RET
GRRQLO ENDP
;***********************************
;* SUBROUTINE GRVSCR()
;***********************************
GRVSCR PROC FAR
; PUSH
BP
; MOV BP,SP
; MOV SP,BP
; POP BP
RET
GRVSCR
ENDP
;***********************************
;* SUBROUTINE GRHSCR()
;***********************************
GRHSCR PR
OC FAR
; PUSH BP
; MOV BP,SP
; MOV SP,BP
; POP
BP
RET
GRHSCR ENDP
;***********************************
;* SUBROUTINE GRPOIN()
;
***********************************
GRPOIN PROC FAR
PUSH BP
MOV BP,SP
LES
BX,[BP].0AH
MOV AX,ES:[BX]
MOV X,AX
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV Y,AX
MOV AX,Y
PUSH AX
MOV AX,X
PUSH AX
PUSH DS ;call with ES set to DS
POP ES
CALL point_
ADD SP,4 ;C convention remove pa
rams from stack
MOV SP,BP
POP BP
RET
GRPOIN ENDP
;***********************************
;* SUBROUTINE GRRECT()
;***********************************
GRRECT PROC FAR
PUSH BP
MOV BP,SP
LES AX,[BP].06H
MOV ARRAY
4,AX
MOV AX,ARRAY4
PUSH AX
PUSH DS ;call with ES
set to DS
POP ES
CALL rectangle_
ADD SP,2 ;C co
nvention remove params from stack
MOV SP,BP
POP BP
RE
T
GRRECT ENDP
;***********************************
;* SUBROUTINE GRTSCA()
;***********************************
GRTSCA PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP].06
H
MOV AX,ES:[BX]
MOV BYTE PTR t_sca_,AL
MOV SP,BP
POP BP
RET
GRTSCA ENDP
;***********************************
;* SUBROUTINE GRC
LOS()
;***********************************
GRCLOS PROC FAR
PUSH BP
MOV BP,SP
MOV BYTE PTR ws_number_,0
PUSH DS ;call with ES set to D
S
POP ES
CALL g_off_
MOV SP,BP
POP BP
R
ET
GRCLOS ENDP
;***********************************
;* SUBROUTINE GRGOFF()
;***********************************
GRGOFF PROC FAR
PUSH BP
MOV BP,SP
PUSH DS ;
call with ES set to DS
POP ES
CALL g_off_
MOV SP,BP
POP BP
RET
GRGOFF ENDP
;***********************************
;* SUBROUTINE G
RTDIR()
;***********************************
GRTDIR PROC FAR
PUSH BP
MOV BP,S
P
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV BYTE PTR t_dir
_,AL
MOV SP,BP
POP BP
RET
GRTDIR ENDP
;***********************************
;* SUBROUTINE GRFCOL()
;***********************************
GRFCOL PROC FAR
PUSH
BP
MOV BP,SP
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV BYTE PTR f_col_,AL
MOV SP,BP
POP BP
RET
GRFC
OL ENDP
;***********************************
;* SUBROUTINE GRFSTY()
;***********************************
GRFSTY
PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP].06H
M
OV AX,ES:[BX]
MOV BYTE PTR f_style_,AL
MOV SP,BP
PO
P BP
RET
GRFSTY ENDP
;***********************************
;* SUBROUTINE GRFTYP()
;***********************************
GRFTYP PROC FAR
PUSH BP
MOV BP,SP
LE
S BX,[BP].06H
MOV AX,ES:[BX]
MOV BYTE PTR f_type_,AL
MOV SP,BP
POP BP
RET
GRFTYP ENDP
;***********************************
;*
SUBROUTINE GRLCOL()
;***********************************
GRLCOL PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV BY
TE PTR l_col_,AL
MOV SP,BP
POP BP
RET
GRLCOL ENDP
;***********************************
;* SUBROUTINE GRLTYP()
;***********************************
GRLTYP PROC F
AR
PUSH BP
MOV BP,SP
LES BX,[BP].06H
MOV AX,
ES:[BX]
MOV BYTE PTR l_type_,AL
MOV SP,BP
POP BP
RET
GRLTYP ENDP
;***********************************
;* SUBROUTINE GRLWID()
;***********************************
GRLWID PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP
].06H
MOV AX,ES:[BX]
MOV BYTE PTR l_wid_,AL
MOV SP,
BP
POP BP
RET
GRLWID ENDP
;***********************************
;* SUBROUTINE
GRMCOL()
;***********************************
GRMCOL PROC FAR
PUSH BP
MOV BP
,SP
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV BYTE PTR m_c
ol_,AL
MOV SP,BP
POP BP
RET
GRMCOL ENDP
;***********************************
;* SUBROUTINE GRMSCA()
;***********************************
GRMSCA PROC FAR
PUSH
BP
MOV BP,SP
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV BYTE PTR m_sca_,AL
MOV SP,BP
POP BP
RET
GRMS
CA ENDP
;***********************************
;* SUBROUTINE GRMTYP()
;***********************************
GRMTYP
PROC FAR
PUSH BP
MOV BP,SP
LES BX,[BP].06H
M
OV AX,ES:[BX]
MOV BYTE PTR m_type_,AL
MOV SP,BP
POP
BP
RET
GRMTYP ENDP
;***********************************
;* SUBROUTINE GRWMOD()
;***********************************
GRWMOD PROC FAR
PUSH BP
MOV BP,SP
LE
S BX,[BP].06H
MOV AX,ES:[BX]
MOV BYTE PTR ws_wmo_,AL
PUSH DS ;call with ES set to DS
POP ES
CALL a_wmode
_
MOV SP,BP
POP BP
RET
GRWMOD ENDP
;***********************************
;* SUBROUTINE GRTCOL()
;***********************************
GRTCOL PROC FAR
PUSH B
P
MOV BP,SP
LES BX,[BP].06H
MOV AX,ES:[BX]
MOV
BYTE PTR t_col_,AL
MOV SP,BP
POP BP
RET
GRTCOL
ENDP
;***********************************
;* SUBROUTINE GRTFON()
;***********************************
GRTFON PROC
FAR
PUSH BP
MOV BP,SP
LES BX,[BP].06H
MOV
AX,ES:[BX]
MOV BYTE PTR t_font_,AL
MOV SP,BP
POP BP
RET
GRTFON ENDP
include epilogue.h
END