90 lines
3.1 KiB
NASM
90 lines
3.1 KiB
NASM
COPY MVSMACS
|
|
COPY PDPTOP
|
|
CSECT ,
|
|
PRINT GEN
|
|
SPACE 1
|
|
*-----------------------ASSEMBLY OPTIONS------------------------------*
|
|
SUBPOOL EQU 0 *
|
|
*---------------------------------------------------------------------*
|
|
SPACE 1
|
|
***********************************************************************
|
|
* *
|
|
* CALL @@SVC99,(rb) *
|
|
* *
|
|
* Execute DYNALLOC (SVC 99) *
|
|
* *
|
|
* Caller must provide a request block, in conformance with the *
|
|
* MVS documentation for this (which is very complicated) *
|
|
* *
|
|
***********************************************************************
|
|
PUSH USING
|
|
DROP ,
|
|
ENTRY @@SVC99
|
|
@@SVC99 DS 0H
|
|
SAVE (14,12),,@@SVC99 Save caller's regs.
|
|
LR R12,R15
|
|
USING @@SVC99,R12
|
|
LR R11,R1
|
|
*
|
|
GETMAIN RU,LV=WORKLEN,SP=SUBPOOL
|
|
ST R13,4(,R1)
|
|
ST R1,8(,R13)
|
|
LR R13,R1
|
|
LR R1,R11
|
|
USING WORKAREA,R13
|
|
*
|
|
* Note that the SVC requires a pointer to the pointer to the RB.
|
|
* Because this function (not SVC) expects to receive a standard
|
|
* parameter list, where R1 so happens to be a pointer to the
|
|
* first parameter, which happens to be the address of the RB,
|
|
* then we already have in R1 exactly what SVC 99 needs.
|
|
*
|
|
* Except for one thing. Technically, you're meant to have the
|
|
* high bit of the pointer on. So we rely on the caller to have
|
|
* the parameter in writable storage so that we can ensure that
|
|
* we set that bit.
|
|
*
|
|
L R2,0(R1)
|
|
O R2,=X'80000000'
|
|
ST R2,0(R1)
|
|
SVC 99
|
|
LR R2,R15
|
|
*
|
|
RETURN99 DS 0H
|
|
LR R1,R13
|
|
L R13,SAVEAREA+4
|
|
FREEMAIN RU,LV=WORKLEN,A=(1),SP=SUBPOOL
|
|
*
|
|
LR R15,R2 Return success
|
|
RETURN (14,12),RC=(15) Return to caller
|
|
*
|
|
DROP R12
|
|
POP USING
|
|
SPACE 2
|
|
COPY CLIBSUPA
|
|
*
|
|
SPACE 2
|
|
PRINT NOGEN
|
|
IHAPSA , MAP LOW STORAGE
|
|
CVT DSECT=YES
|
|
IKJTCB , MAP TASK CONTROL BLOCK
|
|
IKJECT , MAP ENV. CONTROL BLOCK
|
|
IKJPTPB , PUTLINE PARAMETER BLOCK
|
|
IKJCPPL ,
|
|
IKJPSCB ,
|
|
IEZJSCB ,
|
|
IEZIOB ,
|
|
IEFZB4D0 , MAP SVC 99 PARAMETER LIST
|
|
IEFZB4D2 , MAP SVC 99 PARAMETERS
|
|
IEFUCBOB ,
|
|
MYTIOT DSECT ,
|
|
IEFTIOT1 ,
|
|
IHAPDS PDSBLDL=YES
|
|
SPACE 1
|
|
IFGACB , GP14233
|
|
SPACE 1
|
|
IFGRPL , GP14233
|
|
IEFJESCT ,
|
|
IKJUPT ,
|
|
END
|