John, here is some sample Assembler code to switch to System Key 0, execute the required instructions, and then switch pack to the original
storage key. IPK , Save Storage Protect Key in R2 SPKA 0 Get System Key 0 ... Your Instructions that need Key 0 * If your code needs to modify R2, R2 must be saved and restored before * executing the following instruction. SPKA 0(R2) Restore Storage Protect Key -- Dale R. Smith "Logic merely enables one to be wrong with authority." - Doctor Who On Thu, 30 Aug 2007 12:53:13 -0400, John Woods <[EMAIL PROTECTED]> wrote : >I have a C application running in user mode that I would like to have ca ll >an assembler subroutine that currently uses the (good old) BALR interfac e >to VCADTLKP to see if a disk mode is accessed... I know, I know... but hey, >the code works and it does what I want. The only problem, of course, is >that the C code is running is user mode and the assembler code would really >like to be in "( SYSTEM" mode. It's been a long time since I wrote a lo t >of CMS code, but I seem to remember that there was a reasonably easy way to >flip in and out of SYSTEM mode (I think I need storage key zero as >well). I know I could restruture everything, but I'm trying to avoid th at >if possible. A few lines of assembler would certainly be easier than >changing a few lines of C because the C application is shared between a >number of different people... weanies, actually. ;-) > >Thanks > >John >======================== ========================= ========================