ASMB,L,C,R
      HED DBPAR UTILITY SUBROUTINE FOR IMAGE/1000 
      NAM DBPAR,7 92069-16145 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-18145
*     RELOC:     92069-16145
* 
*     PRGMR:     CEJ
* 
* 
******************************************************************* 
* 
* 
* 
*  DBPAR is a utility subroutine for DBOPN which parses the data base 
*  parameter (BASE) into its namr components.  DBPAR puts the name of the 
*  root file into the first three words of the NAME array, the negative 
*  of the cesurity code into the 5th word of NAME, and, if present, the 
*  cartridge number into the 6th word.
* 
*  DBPAR performs the parse by searching through the data base parameter
*  for the first blank or semi-colon counting the number of bytes in the
*  namr string.  It then calls NAMR with the byte count and the string
*  allowing it to do the parse.  DBPAR then picks up the security code
*  and negates it and returns to the caller (DBOPN).
* 
*  The calling sequence for DBPAR is: 
* 
*         JSB DBPAR 
*          DEF *+3      return point
*          DEF NAME     ten word return value array 
*          DEF BASE     data base parameter from call 
*        <error return point> 
* 
A     EQU 0 
B     EQU 1 
* 
      ENT DBPAR 
      EXT .ENTR,NAMR
* 
NAME  NOP 
BASE  NOP 
* 
*  Get true parameter and return point addresses. 
* 
DBPAR NOP 
      JSB .ENTR 
       DEF NAME 
* 
*  There should be no more than 20 characters in the string, but we will
*  set a loop counter to avoid an infinite loop if user forgot trailing 
*  blank or semi-colon. 
* 
      LDA M20 
      STA CNTR
* 
      LDB BASE      Get namr string address by
      INB             skipping over 1st word of param.
      STB TEMP
* 
      CLA           A zero to byte count. 
      STA BYTCT 
* 
      CCA           Set processing 1st byte flag. 
      STA FIRST 
* 
PAR1  LDA B,I       Get 1st byte. 
      ALF,ALF 
PAR2  AND LOBYT 
* 
      CPA ABLNK     Is it a blank?
      JMP PAR4        Yes - we are done.
      CPA SEMI        No - is it a semi-colon?
      JMP PAR4          Yes - we are done.
* 
      ISZ CNTR          No - are we still within legal
      RSS                 string bounds?
      JMP EREXT           No - illegal BASE parameter.
* 
      ISZ BYTCT           Yes - up the byte count.
      ISZ FIRST     1st byte processing?
      JMP PAR3
      LDA B,I         Yes - get 2nd byte
      JMP PAR2          and process it. 
* 
PAR3  INB             No - get next word of namr
      CCA               and process first byte. 
      STA FIRST 
      JMP PAR1
* 
*  We come here when end of string found, call NAMR.
* 
PAR4  CLA,INA       Set starting character to 1.
      STA STCAR 
* 
      JSB NAMR
       DEF *+5
       DEF NAME,I 
       DEF TEMP,I 
       DEF BYTCT
       DEF STCAR
* 
      LDA NAME      Negate security code
      ADA D4
      LDB A,I 
      CMB,INB 
      STB A,I 
* 
      ISZ DBPAR 
EREXT JMP DBPAR,I     and return to DBOPN.
* 
*  Constants and variables. 
* 
M20   DEC -20 
D4    DEC 4 
ABLNK OCT 040 
SEMI  OCT 073 
LOBYT OCT 377 
* 
CNTR  NOP 
TEMP  NOP 
BYTCT NOP 
FIRST NOP 
STCAR NOP 
      END 
      END$
                                                                                                                                                                          