Article View: bit.listserv.asm370
Article #349Re: SAVE/RETURN macros in AMODE 64
From: john gilmore
Date: Fri, 16 Sep 2005 21:12
Date: Fri, 16 Sep 2005 21:12
87 lines
4681 bytes
4681 bytes
I think it was public-spirited of Ed to provide a non-reentrant example too. I would not have bothered to do so, in part at least because I'm not sure I want people who write non-reentrant code using AMODE(64) just yet. John Gilmore Ashland, MA 01721 USA >From: Steve Comstock <steve@trainersfriend.com> >Reply-To: IBM Mainframe Assembler List <ASSEMBLER-LIST@listserv.uga.edu> >To: ASSEMBLER-LIST@LISTSERV.UGA.EDU >Subject: Re: SAVE/RETURN macros in AMODE 64 >Date: Fri, 16 Sep 2005 15:00:26 -0600 > >Edward E. Jaffe wrote: >>Steve Comstock wrote: >> >>> LARL R12,TEST64 >>> USING *,R12 >> >> >> >>Ignoring the fact that the above USING is wrong, 64-bit programs are >>intended to use relative addressing. Thus, the base register would >>normally cover constants and literals only (for reentrant code) and the >>work area (for non-reentrant code). That is, under normal circumstances, >>the LARL would not point to the start of the program. I believe these >>examples may be somewhat more typical: >> >>Reentrant code: >>| LARL R12,TEST64_Const Point to constants area >>| USING TEST64_Const,R12 Synchronize base register >>| STORAGE OBTAIN, Acquire the work area >>| LENGTH=WKAREA_LEN Acquire work area >>| STG R1,136(,R13) Chain save areas >>| STG R13,128(,R1) (same) >>| LGR R13,R1 Get area address in R13 >>| USING WKAREA,R13 Synchronize WKAREA >>| . >>| . >>| CNOP 0,8 Align to doubleword >>|TEST64_Const DC 0D Begin constants area >>| . >>| . >>| LTORG , Define literals >>| >>|WKAREA DSECT , Program work area DSECT >>| DS 18D Program save area >>| . >>| . >>|WKAREA_LEN EQU *-WKAREA Length of work area >> >> >>Non-reentrant code: >>| LARL R1,TEST64_Const Point to constants area >>| STG R1,136(,R13) Chain save areas >>| STG R13,128(,R1) (same) >>| LGR R13,R1 Get area address in R13 >>| USING TEST64_Const,R13 Synchronize base register >>| . >>| . >>| CNOP 0,8 Align to doubleword >>|TEST64_Const DC 0D Begin constants area >>| DC 18D'0' Define program save area >>| . >>| . >>| LTORG , Define literals > > >Well, good point. But I focus on using the relative addressing >approach in other places. Just trying to respond to the OP >(but blew it with the USING). Otherwise, there was no >context in his example to tell us what was needed. > >[BTW, I thought you only coded reentrant code these days?] > >Kind regards, > >-Steve _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Technical Details
Message-ID:
<BAY104-F23CDD876541E76EF5190A5C6910@phx.gbl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-14!supernews.com!149.173.6.116.MISMATCH!foggy!vm.sas.com!msn.com!john_w_gilmoreShow Full Headers
Complete Article Headers
X-Google-Thread: fcdcb,5aef08407a8abe43
X-Google-Attributes: gidfcdcb,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-14!supernews.com!149.173.6.116.MISMATCH!foggy!vm.sas.com!msn.com!john_w_gilmore
From: john gilmore <john_w_gilmore@msn.com>
Newsgroups: bit.listserv.asm370
Subject: Re: SAVE/RETURN macros in AMODE 64
Date: Fri, 16 Sep 2005 21:12:47 +0000
Organization: SAS Inc.
Lines: 87
Sender: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
Message-ID: <BAY104-F23CDD876541E76EF5190A5C6910@phx.gbl>
NNTP-Posting-Host: mozart.unx.sas.com
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: foggy.unx.sas.com 1126905463 5874 10.19.150.41 (16 Sep 2005 21:17:43 GMT)
X-Complaints-To: usenet@unx.sas.com
NNTP-Posting-Date: Fri, 16 Sep 2005 21:17:43 +0000 (UTC)
Comments: Gated by NETNEWS@VM.SAS.COM
Return-Path: <owner-assembler-list@LISTSERV.UGA.EDU>
X-Originating-IP: [65.54.175.200]
X-Originating-Email: [john_w_gilmore@msn.com]
X-Sender: john_w_gilmore@msn.com
X-OriginalArrivalTime: 16 Sep 2005 21:12:47.0588 (UTC)
FILETIME=[63572A40:01C5BB03]
Approved-By: john gilmore <john_w_gilmore@MSN.COM>
In-Reply-To: <432B326A.30909@trainersfriend.com>
Return-Path: owner-assembler-list@LISTSERV.UGA.EDU
Originator: daemon@mozart.unx.sas.com