Step 9: Write the Code to Call the Parser

In this example, we are writing a new command so we will have to write code in the command handler to pass the command to the parser and act on the response from the parser. When coding the invocation of the parser, you should remember to pass an address, where appropriate, or zero.
         HCPGETST LEN=(R0)         Get ASKDSECT area
         LA    R0,LENDSECT         *
         LR    Rx,R1               Base register
         HCPUSING ASKDSECT,Rx      *
         L     R0,=A(DOSYN)        Address of HCPDOSYN

         LA    R1,ASKDSECT         Address of answer plist
         LA    R2,0                Address of add'l bases
         L     R3,=A(CFDEF)        Address of HCPCFDEF
         HCPCALL HCPZPRPC          Parse the command line
         ST    R0,SAVER2           Store returned msg number
         LTR   R15,R15             Check out return code
         BNZ   EXIT                Msg already issued by HCPZPR
         TM    WHO,FDAD            Was it ASK DAD?
         BO    ASKDAD              ..yes
         TM    WHO,FMOM            Was it ASK MOM?
         BO    ASKMOM              ..yes

⋮
         LA    R1,ASKDSECT         Release gotten storage
         HCPRELST BLOCK=(R1)       *
         HCPDROP Rx                Drop base register

For more information on the parser routines and their calling conventions, see CP Parser Macros and Routines.