forked from zuberfowler/HASM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FINISH.ASM
49 lines (49 loc) · 2.21 KB
/
FINISH.ASM
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
MACRO
&LBL FINISH &TYPE=,&RC=
.**********************************************************************
.* *
.* THIS MACRO PROVIDES REENTRANT FINISHING CODE FOR THE FOLLOWING: *
.* 1) A REGULAR ASSEMBLER ROUTINE (EXCEPT HAS 20 WORD SAVE AREA) *
.* 2) AN ASSEMBLER ROUTINE TO BE CALLED FROM PL/I *
.* 3) AN ASSEMBLER MAIN ROUTINE WHICH WILL CALL PL/I SUBROUTINES *
.* *
.* RC IS AN ABSOLUTE RETURN CODE OR IF SET TO (15) RETURN CODE *
.* SHOULD EXIST IN REGISTER 15 *
.* *
.* IT IS INTENDED TO BE USED WITH THE SETUP MACRO. FURTHER *
.* DOCUMENTATION IS CONTAINED WITH THAT MACRO. *
.* *
.**********************************************************************
AIF ('&TYPE' EQ 'PLI').PLI
AIF ('&TYPE' EQ 'ASMPLI').ASMPLI
&LBL LR 1,13
L 13,4(13) RESTORE REGS
AIF ('&RC' NE '(15)').NORC
ST 15,16(13) SAVE RETURN CODE IN CALLER'S SAVE AREA
.NORC ANOP
FREEMAIN R,LV=80,A=(1) GET RID OF SAVE AREA
LM 14,12,12(13) RESTORE REGS
BR 14 RETURN TO CALLER
MEXIT
.PLI ANOP
&LBL LR 1,13
L 13,4(13) RESTORE REGS
AIF ('&RC' NE '(15)').NORCP
ST 15,16(13) SAVE RETURN CODE IN CALLER'S SAVE AREA
.NORCP ANOP
FREEMAIN R,LV=80,A=(1) GET RID OF SAVE AREA
LM 14,11,12(13) ..
BR 14 RETURN TO CALLER
MEXIT
.ASMPLI ANOP
&LBL LR 1,13
L 13,4(13) RESTORE REGS
AIF ('&RC' NE '(15)').NORCA
ST 15,16(13) SAVE RETURN CODE IN CALLER'S SAVE AREA
.NORCA ANOP
FREEMAIN R,LV=80,A=(1) GET RID OF SAVE AREA
LM 14,12,12(13) ..
LR 0,13 GET ADDR OF TERMINATING DSA
BR 14 RETURN TO PL/I TERMINATION ROUTINES
MEND