.TITLE SECT_CHAN Get Section file channel number ;.begin.doc ************************** begin.doc ; ; .c ;MODULE ; .c ;^&SECT_CHAN\& ; .nf ; .x SECT_CHAN>Defined ; Source:SECT_CHAN1.MOD ; TO BECOME PART OF LIBRARY:PRODUCTION ; Designer :EARL LAKIA ; Author : ; Date of last update:23-JAN-86 ; Revision level :1.1 ; ; .C ;Formal Parameter List ; Receives: ; ; FAB STRUCTURE ; FILE ACCESS BLOCK AS PASSED VIA A USER OPEN ; ; RAB STRUCTURE ; RECORD ACESS BLOCK AS PASSED FROM FORTRAN ; USER OPEN ; ; LUN INTEGER*4 ; LOGICAL UNIT NUMBER OF FILE BEING OPENED ; ; Returns: ; ; Accesses common(s): ; ; .X SECT_CHAN>Common ; SECT_CHAN THIS CONTAINS THE CHANNEL NUMBER INDEXED BY ; LOGICAL UNIT NUMBER. ; ; Accesses file(s): ; ; Other modules referenced: ; .SK ; .fill ; .SK ; Description: ; .sk ; ; This subroutine is called because of a FORTRAN user open. This ; subroutine is passed the following: ; .NOFILL ; (AP)= number of arguments ; 4(AP)= address of the FAB ; 8(AP)= address of the RAB ; 12(AP)= address of a longword containing the unit number ; ; .FILL ; This subroutine is intended to be used with the MAKE_SECTION ; subroutine which has setup the useropen parameter in its open ; of a section file. However this subroutine may be ; used by anyone as long as the common is defined and the logical ; unit number used is less than 10. ; The logical unit number is used as an index into the ; common to store the channel number from the FAB. ; end.doc ****************************** end.doc .PAGE .PSECT SECT_CHAN PIC,GBL,SHR,NOEXE,OVR,LONG SEC_CHAN: .BLKW 10 ; 10 CHANNELS or regions maximum ; .PSECT CODE PIC, SHR,NOWRT,LONG ; ; set up fab, open file, and copy channel number to common ; .ENTRY SECT_CHAN,^M ; ; SET UP THE FAB for contingous, etc. ; MOVL 4(AP),R2 ; GET FAB ADDRESS $FAB_STORE FAB=R2,FOP=,SHR= ; ; CREATE THE FILE ; $CREATE FAB=R2 ; OPEN FILE, NEW BLBS R0,10$ ; ERROR RET ; YES, RETURN ; ; USE THE UNIT NUMBER TO STORE THE CHANNEL NUMBER ; IN THE COMMON "CHANNELS" ; 10$: MOVL @12(AP),R3 ; GET UNIT NUMBER DECL R3 ; NORMALIZE MOVZWL FAB$L_STV(R2),SEC_CHAN[R3] MOVL #SS$_NORMAL,R0 ; RETURN GOOD STAUTS RET ; EXIT PROCEEDURE .END