From:	SMTP%"MACRO32@WKUVX1.BITNET" 22-JUL-1993 10:03:31.88
To:	EVERHART
CC:	
Subj:	Re: CHMx codes

X-ListName: "VMS Internals, MACRO, & BLISS Discussions" <MACRO32@WKUVX1.BITNET>
Warnings-To: <>
Errors-To: MacroMan@WKUVX1.BITNET
Sender: MacroMan@WKUVX1.BITNET
Date: 22 Jul 1993 09:56:19 -0500 (EST)
From: "Brian J. Schenkenberger, VAXman"
      <SCHENKENBERG@MONMOUTH-ETDL1.ARMY.MIL>
Reply-To: MACRO32@WKUVX1.BITNET
Subject: Re: CHMx codes
To: MACRO32 <MACRO32@WKUVX1.BITNET>
Message-ID: <01H0U6HR3PUQ90MXB7@MONMOUTH-ETDL1.ARMY.MIL>
X-VMS-To: IN%"@ulkyvm.louisville.edu:MACRO32@WKUVX1.BITNET"
MIME-Version: 1.0
Content-Transfer-Encoding: 7BIT

>The subject line doesn't say all that much about it.
>Can anyone tell me where to find the CHMx codes?
>IE. If you see the instruction CHMK #5, where to find out
>what routine the 5 refers to. I'm looking specificially
>for CHMS codes in this case, but have wanted to know the
>CHMK codes before too. I know the CHMS vectors are handled
>differently (CTL$GL_CMSUPR?) than the CHMK vectors, but
>I can't find any obvious mapping between the numbers and
>the routines. I've looked all through the [v55.sys*.lis]
>files and don't see any obvious place where it is layed out.

I read the above posting again and regret that the information that I
and others have given concerns only the CHMK and CHME codes and their
dispatchers.

The CHMS codes are quite a bit different!

(Hey Eric, here it goes again!)

The CHMS operand symbolic definitions can be found in $CLISERVDEF.  The
instruction (in VAX/VMS DCL terms) is used by the system service SYS$CLI
thru a cli-callback vector.  When calling SYS$CLI, a request block is
built defining the service functions requested and passed to the system
service.  (The format for the request block is in $CLIDEF)  The SYS$CLI
service jumps to the callback routine which checks the fields of the
request block.  If the service requested is to be handled by the CLI, the
address of the request block is moved to R9 and the CHMS instruction is
executed which the service request code as the target.  In fact, looking
thru the callback code you'll see the change mode super instruction as:
CHMS CLI$W_SERVCOD(R9) which, without looking, I believe is CHMS 1(R9).

Anyway, here a little code demo which may help you.

        $CLIDEF                 ; CLI service request codes
        $CLISERVDEF             ; CLI interface definitions

CALLBACK:       .BLKB   CLI$S_CLIDEF1           ; CLI callback block
COMMAND:        .ASCII  /SHOW SYSTEM/
CMD_LEN=        .-COMMAND

        .ENTRY  DEMO_CHMS,0

        MOVZBL  #CLI$K_CLISERV,CALLBACK+CLI$B_RQTYPE
        MOVW    #CLI$K_COMMAND,CALLBACK+CLI$W_SERVCOD
        MOVZBW  #CMD_LEN,CALLBACK+CLI$W_RQSIZE
        MOVAL   COMMAND,CALLBACK+CLI$A_RQADDR
; Then

        MOVAB   CALLBACK,R9
        CHMS    CLI$W_SERVCOD(R9)
; or...
;       PUSHAB  CALLBACK
;       CALLS   #1,G^SYS$CLI

        MOVL    #1,R0
        RET
        .END    DEMO_CHMS

BTW- Check out DCL\CLINT.LIS on the source listings for more specifics.

BJS- /Brian Schenkenberger/Schenkenberg@Eisner.DECUS.Org/ VMS is Bliss /
    /VMS Software Support/Vitronics, Inc./Eatontown, NJ/(908) 542-0600/
   /Independent Consult./Tmesis Consulting/Jackson, NJ/(908) 363-7551/
  /<VAXman or Schenkenberger>@Monmouth-ETDL1.Army.Mil/CIS: 70253,114/
