Debian Codegraph @

libsrc/st/fsyvmsd.mar

raw
1 .TITLE FSY_OPNBDF
2 ; @(#)fsyvmsd.mar 19.1 (ESO-IPG) 02/25/03 13:57:17
3 ;++
4 ; OPNBDF - Open Bulk Data File
5 ;
6 ; This routine is used to open an EXISTING Bulk Data File for
7 ; subsequent processing. The filename, logical or physical, is
8 ; supplied by the calling program and the file is opened by RMS
9 ; using the User File Open option. This restricts the access to
10 ; the file (on the assigned channel) to the QIO and file-mapping
11 ; system services; no RMS routines can be used. However, the
12 ; file can still be accessed on another channel for RMS process-
13 ; -ing, (see FSY_EXTBDF), as it is opened for file sharing.
14 ;
15 ; The file will be opened for read/only access if the protection
16 ; does not allow read/write operations to be performed.
17 ;
18 ; If the bulk data file is opened successfully, the I/O channel
19 ; number, FILES-11 file identification and device name string are
20 ; returned to the calling program. These can be used subsequently
21 ; to re-open the file, using the RMS NAM block, for any ancillary
22 ; processing that may be required.
23 ;
24 ; +++
25 ; This is the version of MID_OPNBDF for C modules,
26 ; so character strings are handled more directly.
27 ; +++
28 ; use as FSY_OPNBDF(NAME,LEN,IOCHAN,FILEIDA,FILEIDB,DEVICE,STATUS)
29 ;
30 ; Input argument:
31 ; ---------------
32 ; NAME: CHARACTER expression: Name of Bulk Data File.
33 ; LEN: I*4 Length of NAME
34 ;
35 ; Output arguments:
36 ; -----------------
37 ; IOCHAN: INTEGER variable: I/O channel assigned to file.
38 ; FILEIDA: INTEGER variable: FILES-11 File Identification (part A)
39 ; FILEIDB: INTEGER variable: FILES-11 File Identification (part B)
40 ; DEVICE: CHARACTER variable: Device Identification (20 chars)
41 ; STATUS: INTEGER variable: Status return.
42 ;
43 ;
44 ; K. Banse version 1.00 851120
45 ; K. Banse version 1.10 910917
46 ; K. Banse version 1.30 980616, W_FID is 6 bytes!
47 ;--
48
49 $RMSDEF
50
51 BDFFAB: $FAB FOP=<UFO>, -
52 SHR=<UPI,GET,PUT>, -
53 FAC=<GET,PUT>, -
54 NAM=BDFNAM
55
56 BDFFABR: $FAB FOP=<UFO>, -
57 SHR=<UPI,GET>, -
58 FAC=<GET>, -
59 NAM=BDFNAM
60
61 BDFNAM: $NAM
62
63
64 FSY_OPNBDF::
65
66 .WORD ^M<>
67 MOVL 04(AP),BDFFAB+FAB$L_FNA ;addr of NAME string
68 MOVB 08(AP),BDFFAB+FAB$B_FNS ;size of NAME string
69
70 $OPEN FAB=BDFFAB ;attempt to open file
71 BLBC R0,50$ ;try to open with read only...
72
73
74 MOVL BDFFAB+FAB$L_STV,@12(AP) ;return IOCHAN
75 MOVL BDFNAM+NAM$W_FID,@16(AP) ;return FILEIDA
76 MOVW BDFNAM+NAM$W_FID+4,@20(AP) ;return FILEIDB
77 MOVAL BDFNAM+NAM$T_DVI,R0 ;move to DEVICE string
78 MOVL 24(AP),R1
79 MOVL (R0),(R1)
80 ADDL2 I^#4,R0
81 ADDL2 I^#4,R1
82 MOVL (R0),(R1)
83 ADDL2 I^#4,R0
84 ADDL2 I^#4,R1
85 MOVL (R0),(R1)
86 ADDL2 I^#4,R0
87 ADDL2 I^#4,R1
88 MOVL (R0),(R1)
89
90 20$: MOVL BDFFAB+FAB$L_STS,@28(AP) ;return STATUS
91
92 RET
93
94
95 50$: MOVL 04(AP),BDFFABR+FAB$L_FNA ;addr of NAME string
96 MOVB 08(AP),BDFFABR+FAB$B_FNS ;size of NAME string
97
98 $OPEN FAB=BDFFABR ;attempt to open file
99 BLBC R0,60$ ;abort if open failed
100
101 MOVL BDFFABR+FAB$L_STV,@12(AP) ;return IOCHAN
102 MOVL BDFNAM+NAM$W_FID,@16(AP) ;return FILEIDA
103 MOVW BDFNAM+NAM$W_FID+4,@20(AP) ;return FILEIDB
104 MOVAL BDFNAM+NAM$T_DVI,R0 ;move to DEVICE string
105 MOVL 24(AP),R1
106 MOVL (R0),(R1)
107 ADDL2 I^#4,R0
108 ADDL2 I^#4,R1
109 MOVL (R0),(R1)
110 ADDL2 I^#4,R0
111 ADDL2 I^#4,R1
112 MOVL (R0),(R1)
113 ADDL2 I^#4,R0
114 ADDL2 I^#4,R1
115 MOVL (R0),(R1)
116
117 60$: MOVL BDFFABR+FAB$L_STS,@28(AP) ;return STATUS
118
119 RET
120
121 .END
122
123 .TITLE FSY_OPNFIL