[comp.lang.asm370] info on ipk and spka instructions

VMAN@PACEVM.BITNET (cliff brenner) (01/18/90)

 can anyone explain the syntax and operation of these statements for me?
 i cannot find their definition in my favorite text (assembly language,
 george struble, third edition, 1984).  i gather they manipulate the psw,
 but in the only example i've seen of their use, i don't understand how:

                   ipk   ,         * get psw key into r2
                   st    2,key     * save key
                   spka  0(0)      * set key to 0

 any help would be appreciated.  thank you in advance.

C134BCS@UTARLVM1.BITNET (01/19/90)

Refer to POP. IBM 370 Principles of Operation.  Manual #: GA22-7000-10
The chapter CONTROL INSTRUCTIONS should tell you what you need to know.



                                                Brad

terry@uts.amdahl.com (Lewis T. Flynn) (01/19/90)

In article <9001181830.AA15303@lilac.berkeley.edu> IBM 370 Assembly Programming Discussion List <ASM370%UCF1VM.bitnet@lilac.berkeley.edu> writes:
>
> can anyone explain the syntax and operation of these statements for me?
> i cannot find their definition in my favorite text (assembly language,
> george struble, third edition, 1984).  i gather they manipulate the psw,
> but in the only example i've seen of their use, i don't understand how:
>
>                   ipk   ,         * get psw key into r2
>                   st    2,key     * save key
>                   spka  0(0)      * set key to 0
>
> any help would be appreciated.  thank you in advance.

This code extracts the currect protect key from the PSW and puts it into
register 2 (by definition of the instruction), saves it, and then sets the 
PSW protect key to 0. These are "semi priveledged" instructions, which means
that either you are in supervisor state or have the appropriate bits in
the control registers set (in this case cr0 bit 4 and cr3 the psw key mask).
These are documented in any recent Principles of Operation (370, XA, or
ESA). You really should have a POO if you are working in assembler.

Terry

terry@amdahl.UUCP ("Lewis T. Flynn") (01/19/90)

In article <9001181830.AA15303@lilac.berkeley.edu> IBM 370 Assembly Programming
        Discussion List <ASM370%UCF1VM.bitnet@lilac.berkeley.edu> writes:
>
> can anyone explain the syntax and operation of these statements for me?
> i cannot find their definition in my favorite text (assembly language,
> george struble, third edition, 1984).  i gather they manipulate the psw,
> but in the only example i've seen of their use, i don't understand how:
>
>                   ipk   ,         * get psw key into r2
>                   st    2,key     * save key
>                   spka  0(0)      * set key to 0
>
> any help would be appreciated.  thank you in advance.

This code extracts the currect protect key from the PSW and puts it into
register 2 (by definition of the instruction), saves it, and then sets the
PSW protect key to 0. These are "semi priveledged" instructions, which means
that either you are in supervisor state or have the appropriate bits in
the control registers set (in this case cr0 bit 4 and cr3 the psw key mask).
These are documented in any recent Principles of Operation (370, XA, or
ESA). You really should have a POO if you are working in assembler.

Terry