.TITLE FCSVEC .IDENT *28.2X7* ;+ ; TITLE: FCSVEC - Library Transfer Vectors To The FCS Routines ; VERSION: 28.2X7 ; SYSTEM: COMMON DEC ; SUBSYSTEM: RESIDENT LIBRARIES ; SOURCE FILE: FCSVEC.MAC ; SOFTWARE TREE: ZSYSLB.STS ; PROGRAMMER: WAYNE E. BAISLEY ; DATE: NOVEMBER 21, 1984 ; ; REVISION DATE PROGRAMMER DESCRIPTION ; -------- -------- -------------- ----------------------------- ; ; 0) 11/21/84 W. E. Baisley Initial Release. This module is a ; combination of the original FCSVEC ; and the old CRES VECT modules. ; ; NOTES: ; ; This routine is provided to allow routines in resident libraries to call ; routines which for whatever reason are not located in the current ; library. This feat is accomplished by means of a vector table in the ; main task's image, which has the addresses of those routines which are ; known to not be in the library. This module uses that table to transfer ; to the requested routine without modifying either the stack or any ; registers. ; ; If by scurrilous means the user's task has avoided inclusion of .FSRPT ; or .FCSJT, this routine will abort the offender. This drastic action is ; necessary since something in the library needs access to an FCS routine ; which, alas, the user has failed to provide. In this case, the ; following evidence will be presented : ; ; 09:23:48 Task "NOVECT" terminated !Your first hint of trouble ; T-Bit trap or BPT execution ; R0=000000 !Perhaps .fsrpt contains zero ; R1=146200 !Return address of the caller ; R2=100077 ; R3=140700 ; R4=000000 ; R5=001204 ; SP=001172 ; PC=140254 !Address of CRASH in FCSVEC ; PS=170017 ;- .WRITE:: jsr r0,vector ;Transfer Vector Table Offset = 104 .TRNCL:: jsr r0,vector ;Transfer Vector Table Offset = 102 .RENAM:: jsr r0,vector ;Transfer Vector Table Offset = 100 .REMOV:: jsr r0,vector ;Transfer Vector Table Offset = 76 .PRSFN:: jsr r0,vector ;Transfer Vector Table Offset = 74 .PRSDV:: jsr r0,vector ;Transfer Vector Table Offset = 72 .PRSDI:: jsr r0,vector ;Transfer Vector Table Offset = 70 .POSIT:: jsr r0,vector ;Transfer Vector Table Offset = 66 .OPFID:: jsr r0,vector ;Transfer Vector Table Offset = 64 .OPEN:: jsr r0,vector ;Transfer Vector Table Offset = 62 .MARK:: jsr r0,vector ;Transfer Vector Table Offset = 60 .GTDIR:: jsr r0,vector ;Transfer Vector Table Offset = 56 .FLUSH:: jsr r0,vector ;Transfer Vector Table Offset = 54 .FCTYP:: jsr r0,vector ;Transfer Vector Table Offset = 52 .EXTND:: jsr r0,vector ;Transfer Vector Table Offset = 50 .ENTER:: jsr r0,vector ;Transfer Vector Table Offset = 46 .ASLUN:: jsr r0,vector ;Transfer Vector Table Offset = 44 .FIND:: jsr r0,vector ;Transfer Vector Table Offset = 42 .DELET:: jsr r0,vector ;Transfer Vector Table Offset = 40 .WAIT:: jsr r0,vector ;Transfer Vector Table Offset = 36 .READ:: jsr r0,vector ;Transfer Vector Table Offset = 34 .PUT:: .PUTSQ:: jsr r0,vector ;Transfer Vector Table Offset = 32 .PRINT:: jsr r0,vector ;Transfer Vector Table Offset = 30 .POSRC:: jsr r0,vector ;Transfer Vector Table Offset = 26 .POINT:: jsr r0,vector ;Transfer Vector Table Offset = 24 .PARSE:: jsr r0,vector ;Transfer Vector Table Offset = 22 .OPFNB:: jsr r0,vector ;Transfer Vector Table Offset = 20 .MRKDL:: jsr r0,vector ;Transfer Vector Table Offset = 16 .GTDID:: jsr r0,vector ;Transfer Vector Table Offset = 14 .GET:: .GETSQ:: jsr r0,vector ;Transfer Vector Table Offset = 12 .FINIT:: jsr r0,vector ;Transfer Vector Table Offset = 10 .DLFNB:: jsr r0,vector ;Transfer Vector Table Offset = 6 .CSI2:: jsr r0,vector ;Transfer Vector Table Offset = 4 .CSI1:: jsr r0,vector ;Transfer Vector Table Offset = 2 .CLOSE:: jsr r0,vector ;Transfer Vector Table Offset = 0 vector: ;this label must immediately follow the vectors !!! sub pc,r0 ;compute the negative double-word offset plus 2 asr r0 ;halve it for the FSR vector table's word size com r0 ;make it positive and take care of the +2 displacement mov r0,-(sp) ;save the vector table offset for later mov @#.fsrpt,r0 ;does the task have an FSR vector ? beq 20$ ;if eq no, complain bitterly add #a.jump+4,r0 ;point to just after the jump table data cmp (sp),-(r0) ;is this a valid offset ? bhis 20$ ;if his no add -(r0),(sp) ;otherwise, compute the jump table address mov @(sp)+,r0 ;fetch the entry point from the table beq 20$ ;if eq there isn't one rts r0 ;restore the register and jump to the called routine 20$: bpt ;throw a tizzy crash: ;final PC address for error conditions .end