You need to use inline assembly with SAM31/SAM64 AMODE switching. All of
our stuff is 64-bit so we do this a lot. Don't forget to allocate the
savearea and parmlist/parms below the bar.
__asm__(
" LLGT 15,%[ep]\n"
" LR 1,%[PARMS]\n"
" LR 13,%[savearea]\n"
" SAM31\n"
" BALR 14,15\n"
" SAM64\n"
" ST 15,%[rc]\n"
: [rc]"=m"(rc)
: {ep"m"(ep), [savearea]"r"(&mem31->savearea), [parms]"r"(&mem31->parms)
: "r0", "r1", "r13", "r14", "r15"
);
On 28/06/2022 10:12 pm, Colin Paice wrote:
I've been working on calling an (amode 31) assembler program from a 64 bit
C program, and have been struggling.Is there is a good guide on how to use
these new instructions?
For example
1)
I've found you need to use a LLGTR R1... instruction to clear the register
before using a L R1... because without it the high part of the register
will have some 64 bit rubbish in it
2)
I used
BAKR R14,0
PR
But it kept returning in amode 24 bit mode. It needs BSM 14,0 before
the BAKR.__
The POP tells you all about the instructions - but not how to use it. The
z/OS doc says use BACK/PR without mentioning the BSM, so this is not
completely trustworthy.
_________________________
Is there a better place to ask?
Colin
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN