Debian Codegraph @

libsrc/st/fsyalphc.mar

raw
1 .TITLE FSY_EXTBDF
2 ; @(#)fsyalphc.mar 19.1 (ESO-IPG) 02/25/03 13:57:16
3 ;++
4 ; EXTBDF - Extend Bulk Data File
5 ;
6 ; This routine is used to extend an EXISTING Bulk Data File. The
7 ; file is opened using RMS NAM block; the calling program supplies
8 ; the FILES-11 file identification and the device name string.
9 ; (i.e. it is assumed that the file has been opened previously on
10 ; another channel, probably by FSY_OPNBDF).
11 ;
12 ; If the file is opened successfully, the initial file size
13 ; (measured in virtual blocks) is saved and the file extended
14 ; by the specified number of blocks; the new file size is then
15 ; calculated and returned to the calling program.
16 ; (Note that this value is rounded to the next cluster boundary).
17 ; The file's end-of-file marker is NOT automatically updated
18 ; by the RMS $EXTEND macro,
19 ; therefore, a RMS block I/O write is performed on the
20 ; highest virtual block number to accomplish this.
21 ;
22 ; +++
23 ; This is the version of MID_EXTBDF for C modules,
24 ; so character strings are handled more directly.
25 ; +++
26 ;
27 ; use as FSY_EXTBDF(FILEIDA,FILEIDB,DEVICE,EXALQ,NVB,STATUS)
28 ;
29 ; Input parameters:
30 ; ----------------
31 ; FILEIDA: INTEGER variable: FILES-11 File Identification (part A)
32 ; FILEIDB: INTEGER variable: FILES-11 File Identification (part B)
33 ; DEVICE: char. string Device Identification.
34 ; EXALQ: I*4 Extension Allocation Quantity,
35 ; (measured in virtual blocks).
36 ;
37 ; Output parameters:
38 ; -----------------
39 ; NVB: I*4 Total number of Virtual Blocks
40 ; now allocated to file.
41 ; STATUS: I*4 Status return.
42 ;
43 ;
44 ; K. Banse version 2.3 860128
45 ; K. Banse version 2.40 930115, for Alpha Open VMS
46 ; K. Banse version 1.30 980616, W_FID is 6 bytes!
47 ;--
48
49 .PSECT FSYVMSC_1,WRT,NOEXE
50
51 BDFFAB: $FAB FOP=<CBT,NAM>, -
52 FAC=<PUT,GET,BIO>, -
53 RFM=FIX, -
54 MRS=512, -
55 SHR=<UPI,PUT,GET>, -
56 NAM=BDFNAM
57
58 BDFNAM: $NAM
59
60 BDFRAB: $RAB FAB=BDFFAB, -
61 RBF=BUFFER, -
62 RSZ=512, -
63 ROP=BIO
64
65 BUFFER: .BLKB 512
66
67 .PSECT FSYVMSC_2,EXE
68
69 FSY_EXTBDF:: .CALL_ENTRY
70
71 ; .WORD ^M<R2>
72
73 MOVL 04(AP),BDFNAM+NAM$W_FID ;store FILEIDA
74 MOVW 08(AP),BDFNAM+NAM$W_FID+4 ;store FILEIDB
75 MOVL 12(AP),R0 ;addr of DEVICE descr
76 MOVAL BDFNAM+NAM$T_DVI,R1 ;move to DEVICE field in NAM block
77 MOVL (R0),(R1)
78 ADDL2 I^#4,R0
79 ADDL2 I^#4,R1
80 MOVL (R0),(R1)
81 ADDL2 I^#4,R0
82 ADDL2 I^#4,R1
83 MOVL (R0),(R1)
84 ADDL2 I^#4,R0
85 ADDL2 I^#4,R1
86 MOVL (R0),(R1)
87
88 $OPEN FAB=BDFFAB
89 BLBC R0,20$
90
91 MOVL BDFFAB+FAB$L_ALQ,R2 ;save initial file-size
92 MOVL 16(AP),BDFFAB+FAB$L_ALQ ;store EXALQ
93
94 $EXTEND FAB=BDFFAB
95 BLBC R0,20$
96
97 ADDL2 BDFFAB+FAB$L_ALQ,R2 ;determine new file-size
98 MOVL R2,@20(AP) ;return NVB
99 MOVL R2,BDFRAB+RAB$L_BKT ;store highest block #
100
101 $CONNECT RAB=BDFRAB
102 $WRITE RAB=BDFRAB
103
104 20$: MOVL R0,@24(AP) ;return STATUS
105 $CLOSE FAB=BDFFAB
106
107 RET
108 .END