ASMB,L,C,R HED BAPS2 - REMOTE DATA BASE ACCESS PROGRAM SEGMENT 2 NAM BAPS2,5 92069-16259 REV.1912 790130 * * ******************************************************************* * (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-18262 * RELOC: 92069-16259 * * PRGMR: CEJ * * ******************************************************************* * * * COM DABUF(2174),RQBUF(21) COM RECRQ,RECDA,SEGNM * * Segment two of the Remote Data Base Access Program. This segment has * the following sequence of operations. * * 1) Determine the type of IMAGE call and branch to the appropriate call * handler. * * A) DBFND * * I ) Perform the DBFND call. * * II) Go to 2. * * B) DBGET * * I ) Perform the DBGET call. * * II) Go to 2. * * C) DBUPD * * I ) Perform the DBUPD call. * * II) Go to 2. * * 2) Send the RDBA reply and any associated data. Ignore any errors. * * 3) Return to class get in main. * SKP ********************************************************************** *** *** * Standard DS/1000 equates * *** *** #STR EQU 0 #SEQ EQU 1 #SRC EQU 2 #DST EQU 3 #RDB EQU 4 #EC1 EQU 4 #EC2 EQU 5 #ENO EQU 6 #REP EQU 7 *** *** ********************************************************************** ********************************************************************** * * * DS/1000 RDBA Communications consist of two descriptive buffers: * * 1) Request buffer * * 2) Reply buffer * * These two static buffers are as described below. * * * ********************************************************************** *** *** * * * Request buffer - one buffer of from 12 to 21 words per RDBA call * * * *** *** RBSTR EQU #STR DS/1000 stream word RBSEQ EQU #SEQ DS/1000 sequence number RBSRC EQU #SRC DS/1000 source node number RBDST EQU #DST DS/1000 destination node number RBIDX EQU #RDB RDBA call Index RBMOD EQU #RDB+1 RDBA call mode RBID EQU #RDB+2 RDBA call item or set number * or for a DBOPN, the level code word RBITM EQU #RDB+3 Search item number for DBFND RBMRT EQU #RDB+5 For DBOPN, the max. returned RT size RBLEN EQU #RDB+6 Word size of ibase parameter RBBAS EQU #RDB+7 Ibase parameter * MAXRQ DEC 21 Maximum request buffer length *** *** *** *** * * * Reply buffer - one buffer of either 17 or 18 words per RDBA call * * * *** * * RBSTR EQU #STR DS 1000 stream word * RBSEQ EQU #SEQ DS/1000 sequence number * RBSRC EQU #SRC DS/1000 source node number * RBDST EQU #DST DS/1000 destination node number RBEC1 EQU #EC1 DS/1000 1st error code word RBEC2 EQU #EC2 DS/1000 2nd error code word RBEC3 EQU #ENO DS/1000 error node number upon an error RBSTA EQU #REP RDBA call status array RBNUM EQU #REP+10 RDBA data base number for DBOPN * RPLEN DEC 17 Standard reply buffer length * 18 for DBOPN *** *** ********************************************************************** ENT BAPS2 EXT BP.GT,DBFND,DBGET,DBUPD EXT RDEXT * DAADR DEF DABUF A EQU 0 B EQU 1 * * Put our name suffix into SEGNM in common. That way, if another request * comes through for this segment, RDBAP (the main) will not reload us. * BAPS2 LDA SUFIX STA SEGNM * * Determine the type of IMAGE call being made by the index calculated * in the main and jump to the proper handling routine. Remember that * this index is: 45 - (RDBA Index). * LDB RQBUF+RBIDX ADB JMPTB JMP B,I * JMPTB DEF *+1 JMP E159 JMP E159 RDBA Index within [45,42] JMP E159 should not happen. JMP E159 JMP UPD RDBA Index = 41, DBUPD JMP GET RDBA Index = 42, DBGET JMP FND RDBA Index = 40, DBFND JMP E159 JMP E159 RDBA Index within [39,36] JMP E159 should not happen. SKP * * A remote DBFND. * The request buffer contains the following information: * FNMOD EQU RQBUF+RBMOD Find mode FNSET EQU RQBUF+RBID Data set number FNITM EQU RQBUF+RBITM Data item number FNBAS EQU RQBUF+RBBAS Data base parameter * * The status array is the 8th through 17th words of the reply buffer. * FNSTA EQU RQBUF+RBSTA * * The key item value is in the data buffer. * FNARG EQU DABUF * * Perform the DBFND call. * FND JSB DBFND DEF *+7 DEF FNBAS DEF FNSET DEF FNMOD DEF FNSTA DEF FNITM DEF FNARG * * There is no data to return, so set reply data length to zero (in B * register) and jump to the exit routine. * CLB JMP EXIT SKP * * A remote DBGET. * The request buffer contains the following information: * GTMOD EQU RQBUF+RBMOD Get mode GTSET EQU RQBUF+RBID Data set number GTBAS EQU RQBUF+RBBAS Data base parameter * * The status array is the 8th through 17th words of the reply buffer. * GTSTA EQU RQBUF+RBSTA * * The item list is the 2nd through ?th words of the data buffer. * GTLST EQU DABUF+1 * * The key item value for a mode 7 get or the record number for a mode * 4 get is in the necessary number of words immediately following the * item list in the data buffer. The first word of the data buffer con- * tains the length of the item list. Therefore, the address of the IARG * parameter is the address of the data buffer plus the length of the list * plus one. * GET LDA DAADR ADA DABUF INA STA GTARG * * Perform the DBGET call, the data read is returned in the data buffer. * JSB DBGET DEF *+8 DEF GTBAS DEF GTSET DEF GTMOD DEF GTSTA DEF GTLST DEF DABUF DEF GTARG,I * * If DBGET did not succeed (i.e. first word of GTSTA NE 0) then the re- * turned data length is zero. Else, the returned data length is in the * 2nd word of the status array. Get this length in the B register and * jump to the exit routine. * CLB LDA GTSTA SZA,RSS LDB GTSTA+1 JMP EXIT * * Constants and variables. * GTARG NOP SKP * * A remote DBUPD. * The request buffer contains the following information: * UPMOD EQU RQBUF+RBMOD Update mode UPSET EQU RQBUF+RBID Data set number UPBAS EQU RQBUF+RBBAS Data base parameter * * The status array is the 8th through 17th words of the reply buffer. * UPSTA EQU RQBUF+RBSTA * * The item list starts in the 2nd word of the data buffer. * UPLST EQU DABUF+1 * * The values for the items in the item list immediately follow the item * list in the data buffer. The first word of the data buffer contains * the length of the item list. Therefore, the address of the value buf- * fer is the address of the data buffer plus the length of the item list * plus one. * UPD LDA DAADR ADA DABUF INA STA UPBUF * * Perform the DBUPD call. * JSB DBUPD DEF *+7 DEF UPBAS DEF UPSET DEF UPMOD DEF UPSTA DEF UPLST DEF UPBUF,I * * There is no return data, so set the length of returned data to zero, * and jump to the exit routine. * CLB JMP EXIT * * Constants and variables. * UPBUF NOP SKP * * The only DS error routine is when the RDBA Index for this segment is * in error. * E159 LDB M159 CLA STA RECDA Set data length to zero. JMP EXIT2 * * This is the exit routine for segment 2 of RDBAP. Its purpose is to * call the necessary subroutines in order to send the RDBA reply to the * originating node and to terminate the program, saving resources. All * DS replies are sent through RDEXT. * EXIT STB RECDA Set returning data length CLA CLB and zero the error code. EXIT2 DST ERROR * JSB RDEXT Then let RDEXT send the reply. DEF *+6 DEF RQBUF It needs: reply buffer DEF RPLEN reply length DEF DABUF data buffer DEF RECDA data length DEF ERROR error code NOP * JMP BP.GT Return to class get in main. * * Constants and variables. * M159 DEC -159 * SUFIX ASC 1,2 * ERROR BSS 2 END BAPS2