ASMB,L,C,R
      HED RBINF SUBROUTINE OF RDBA-IMAGE/1000 
      NAM RBINF,7 92069-16217 REV.1912 790214 
* 
* 
******************************************************************* 
* (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1979. ALL RIGHTS RESERVED.
* NO PART OF THIS PROGRAM MAY BE PHOTOCOPIED, REPRODUCED, OR
* TRANSLATED TO ANOTHER PROGRAM LANGUAGE WITHOUT THE PRIOR WRITTEN
* CONSENT OF HEWLETT-PACKARD COMPANY. 
******************************************************************* 
* 
* 
*     SOURCE:    92069-18217
*     RELOC:     92069-16217
* 
*     PRGMR:     CEJ
* 
* 
******************************************************************* 
* 
* 
* 
*  Remote DBINF processor.  The following transforms the DBINF request
*  into an RDBA request and sends the request through RBMST to the remote 
*  node.
* 
*  The calling sequence for RBINF is: 
* 
*         JSB DBINF 
*          DEF *+6        return point
*          DEF BASE       data base parameter from DBINF call 
*          DEF ID         set or item parameter from DBINF call 
*          DEF MODE       mode from DBINF call
*          DEF STAT       10 word status array from DBINF call
*          DEF BUF        buffer parameter from DBINF call
* 
**********************************************************************
*                                                                    *
*  Run Table for local machine in Remote Data Base Access            *
*                                                                    *
*  The local copy of the Run Table used by the RDBA master subrou-   *
*  tines consists of the following sections:                         *
*                                                                    *
*    1) Data Base Control Block                                      *
*    2) Data Item Table                                              *
*    3) Data Set Table                                               *
*    4) Sort Table                                                   *
*                                                                    *
*  These sections are in the order stated.  Details of each section  *
*  follow.                                                           *
*                                                                    *
**********************************************************************
***                                                                ***
*                                                                    *
*  Data Base Control Block - one 17 word entry per data base         *
*                                                                    *
***                                                                ***
RDCBS DEC 17        DBCB size 
* 
RDNAM DEC 0         data base name - three words
      DEC 1 
      DEC 2 
RDRBN DEC 3         remote data base number 
      DEC 4 
RDDSN DEC 5         DS node number
      DEC 6 
RDITC DEC 7         data item count 
RDITP DEC 8         data item table pointer 
RDDSC DEC 9         data set count
RDDSP DEC 10        data set table pointer
RDSOP DEC 11        sort table pointer
      DEC 12
RDLMD DEC 13        lock flag/open mode 
RDLFG EQU RDLMD     1st byte: lock flag 
RDMOD EQU RDLMD     2nd byte: open mode 
      DEC 14
RDCBC DEC 15        # of DCBs desired = 0 
RDMDL DEC 16        maximum data length 
* 
ZERO  EQU RDNAM     base of zero for future equates 
***                                                                ***
*                                                                    *
*  Data Item Table - one 5 word entry per item in a 1000 data base   *
*                                                                    *
***                                                                ***
RI1LN EQU ZERO+5    length of a 1000 entry
* 
RI1NM EQU ZERO      item name - 3 words 
RI1NO EQU ZERO+3    item number 
RI1IL EQU ZERO+4    item length 
***                                                                ***
*                                                                    *
*  Data Set Table - one 6 word entry per set in a 1000 data base     *
*                                                                    *
***                                                                ***
RS1LN EQU ZERO+6    length of a 1000 entry
* 
RS1NM EQU ZERO      set name - 3 words
RS1NO EQU ZERO+3    set number
RS1EL EQU ZERO+4    entry length (in words) 
RS1KL EQU ZERO+5    key item length for a master
***                                                                ***
*                                                                    *
*  Sort Table - one 1 word entry per item and per set.  Each entry   *
*               is a pointer to the respective item or set table     *
*               entry relative to the start of the Run Table         *
*                                                                    *
***                                                                ***
      SKP 
A     EQU 0 
B     EQU 1 
* 
      ENT RBINF 
      EXT .ENTR,RBCIT,RBCST,RBMST 
* 
BASE  NOP 
ID    NOP 
MODE  NOP 
STAT  NOP 
BUF   NOP 
* 
*  Get true parameter and return point addresses. 
* 
RBINF NOP 
      JSB .ENTR 
       DEF BASE 
* 
*  Case on the mode parameter (MODE) to determine what kind of information
*  the user requests and where to process the request.  The case is per-
*  formed by dividing the mode parameter by 100 and checking the bounds 
*  of the quotient and remainder.  The quotient must be within [1..4],
*  the remainder within [1..4].  Then, use the two values as an index 
*  into the jump table.  Four entries in this table are actually error
*  returns since any combination of quotient within [3,4] and remainder 
*  within [3,4] is invalid. 
* 
      LDA MODE,I    Is mode < 0 
      SSA 
      JMP E124        Yes - illegal mode
* 
      CLB 
      DIV D100
* 
      SZA,RSS       Is quotient > 0 
      JMP E124
      CMA,INA 
      ADA D4          and <= 4? 
      SSA 
      JMP E124        No - illegal mode.
* 
      SZB,RSS       Is remainder > 0
      JMP E124
      CMB,INB 
      ADB D4          and <= 4? 
      SSB 
      JMP E124        No - illegal mode.
* 
*  Put quotient into bits 2 & 3 of A register and remainder in bits 0 & 1.
*  This becomes, then a four bit index within [0..15] into the jump table.
*  The index number 0,1,4, and 5 are illegal. 
* 
      ALS,ALS 
      IOR B 
      STA TEMP
* 
      ADA RJMTB 
      JMP A,I 
* 
RJMTB DEF *+1 
      JMP E124      Mode = 404
      JMP E124      Mode = 403
      JMP RM2       Mode = 402
      JMP RM2       Mode = 401
* 
      JMP E124      Mode = 304
      JMP E124      Mode = 303
      JMP RM2       Mode = 302
      JMP RM2       Mode = 301
* 
      JMP RM1       Mode = 204
      JMP RM4       Mode = 203
      JMP RM2       Mode = 202
      JMP RM2       Mode = 201
* 
      JMP RM2       Mode = 104
      JMP RM4       Mode = 103
      JMP RM1       Mode = 102
      JMP RM1       Mode = 101
      SKP 
* 
*  For all modes that branch here, the ID parameter is either a data item 
*  name or a data item number.  Ask RBCIT to check this item reference and
*  give us the item's number. 
* 
RM1   JSB RBCIT 
       DEF *+4
       DEF ID,I     RBCIT needs: item reference 
       DEF NUMBR        returns: item number
       DEF ADDRS                 item's Item Table entry address
      JMP E125      Illegal item return point.
* 
      JMP RM4       Item okay.
* 
*  For all modes that branch here, the ID parameter is either a data set
*  name or number.  Ask RBCST to check the set reference and give us the
*  set's number, if valid.
* 
RM2   JSB RBCST 
       DEF *+4
       DEF ID,I     RBCST needs: set reference
       DEF NUMBR        returns: set's number 
       DEF ADDRS                 set's Set Table entry address
      JMP E125      Illegal set return point
* 
*  All modes rejoin here.  We do another case on the mode parameter to
*  determine the maximum length of data we want returned to us. 
* 
RM4   LDA TEMP      Saved calculated index in TEMP. 
      ADA LNTAB 
      LDB A,I 
* 
      CLA 
      STA OUTDA 
      JMP RM5 
* 
LNTAB DEF *+1 
      DEC 0         Mode = 404
      DEC 0         Mode = 403
      DEC 7         Mode = 402
      DEC 7         Mode = 401
* 
      DEC 0         Mode = 304
      DEC 0         Mode = 303
      DEC 2         Mode = 302
      DEC 49        Mode = 301
* 
      DEC 51        Mode = 204
      DEC 51        Mode = 203
      DEC 17        Mode = 202
      DEC 1         Mode = 201
* 
      DEC 128       Mode = 104
      DEC 256       Mode = 103
      DEC 13        Mode = 102
      DEC 1         Mode = 101
* 
*  There is one special case, however.  If the mode is 402 (index = 2)
*  there is no returned data only outgoing data, so the integer we picked 
*  up is the OUTDA size and INDA is zero. 
* 
RM5   LDA TEMP
      CPA D2
      RSS 
      JMP RM7 
* 
      STB OUTDA 
      CLB 
* 
*  Put the value in INDA and call RBMST to build the request, sent it,
*  and await the reply. 
* 
RM7   STB INDA
* 
      JSB RBMST 
       DEF *+11 
       DEF D37      RBMST needs: RDBA Index 
       DEF MODE,I                Info mode
       DEF NUMBR                 set or item number 
       DEF D0                    dummy
       DEF BASE,I                data base parameter
       DEF STAT,I                status array 
       DEF BUF,I                 outgoing data buffer 
       DEF OUTDA                 outgoing data length 
       DEF BUF,I                 incoming data buffer 
       DEF INDA                  incoming data length 
      NOP             error return
RM8   JMP RBINF,I     normal return 
* 
*  Error return points. 
* 
E124  LDB D124      Illegal DBINF mode. 
      RSS 
* 
E125  LDB D125      Illegal item or set reference.
* 
      STB STAT,I    Put error code in STAT
      JMP RM8         and return to user. 
* 
*  Constants and variables
* 
D0    EQU ZERO
D2    EQU ZERO+2
D4    EQU ZERO+4
D37   DEC 37
D100  DEC 100 
D124  DEC 124 
D125  DEC 125 
* 
NUMBR NOP 
ADDRS NOP 
TEMP  NOP 
* 
INDA  NOP 
OUTDA NOP 
      END 
                                                                  