-
Notifications
You must be signed in to change notification settings - Fork 0
/
s1022.mac
102 lines (87 loc) · 2.38 KB
/
s1022.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
UNIVERSAL S1022
SUBTTL JOHN L. MOSS, SOFTWARE HOUSE, 1979
;TO INCLUDE THESE DEFINITIONS IN A MACRO PROGRAM, INVOKE THE
;S1022$ MACRO.
DEFINE S1022$,<
;$1022 - MACRO TO GENERATE 1022 ARGUMENT LISTS FROM MACRO CODE
;
;Call is:
; $1022 (<routine>,<argument list>)
;
;The macro generates a call to the routine via PUSHJ 17, after
;declaring the routine external. The argument list contains the
;addresses of data as in a FORTRAN call. $1022 sets up the argument
;list, points to it in AC16, and calls the routine.
;
;$1022 calls the routine $SAVAC to save ACs on the stack before
;calling the 1022 subroutine. It calls $RETAC to retrieve the ACs
;from the stack when the subroutine returns in line. If the subroutine
;does not return in line, the user must call $RETAC to retrieve the
;stored ACs or subsequent POPJs will not operate properly.
;
DEFINE $1022($DBNAM,$ARGS),<
.ARG.==0
IRP <$ARGS>,<
.ARG.==.ARG.+1
>
MOVEI 16,[ -.ARG.,,0
IRP <$ARGS>,<
$ARGS> ]+1
PUSHJ 17,$SAVAC
PUSHJ 17,$DBNAM##
PUSHJ 17,$RETAC
PURGE .ARG.
>
DEFINE MPUSH(ACS),< IRP <ACS>,<PUSH 17,ACS>>
DEFINE MPOP(ACS),<IRP <ACS>,<POP 17,ACS>>
$SAVAC:
EXCH 0,(17) ;"PUSH" AC0
MPUSH (<1,2,3,4,5,6,7,10,11,12,13,14,15>)
;PUSH THE REST
JRST @0 ;RETURN TO CALLER
$RETAC:
MPOP (<0,15,14,13,12,11,10,7,6,5,4,3,2,1>)
EXCH 0,(17) ;REPLACE AC0 AND RETURN ADDR
POPJ 17, ;RETURN TO CALLER
;DEFINE USEFUL KEYWORDS
;
;A technique which makes argument lists clear and saves time is to
;define the keywords to various commands. Attribute names are also
;defined in this manner.
;
;Define the logicals:
;
.AND.: ASCII/AND /
.OR.: ASCII/OR /
.NOT.: ASCII/NOT /
.EQV.: ASCII/EQV /
.XOR.: ASCII/XOR /
;Define the relationals:
;
.EQ.: ASCII/EQ /
.NE.: ASCII/NE /
.BET.: ASCII/BET /
.NBET.: ASCII/NBET /
.GT.: ASCII/GT /
.GE.: ASCII/GE /
.LT.: ASCII/LT /
.LE.: ASCII/LE /
.CT.: ASCII/CT /
.NCT.: ASCII/NCT /
.BEG.: ASCII/BEG /
.NBEG.: ASCII/NBEG /
;Define special keywords for DBxxxx subroutines:
;
DISP.: ASCII/DISP./ ;FOR CONTROL OVER ARGUMENT CONVERSIONS
BIN.: ASCII/BIN. /
ALL: ASCII/ALL / ;FOR DBAINI, DBFIND
LAST: ASCII/LAST /
SYSID: ASCII/SYSID /
LOGICA: ASCII/LOGICAL / ;FOR DBMAP
NOCLOS: ASCII/NOCLOSE / ;FOR DBOPEN
PASSWO: ASCII/PASSWORD /
ACCESS: ASCII/ACCESS /
PAGE
>;;END OF S1022$ MACRO
END