IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ibm ABI specifications


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Catz

New User


Joined: 22 May 2015
Posts: 6
Location: Latvia

PostPosted: Wed Jul 22, 2015 3:29 pm
Reply with quote

Good day.

I'm looking to understand the ABI used by zOS C compilers, so that I can reconstruct the backtrace.
Presently Im looking at something like:

Code:
Called:
                          001145 |       *      dump_x(512, &ima, FORWARD);                                                 
0008A6  5820  3142        001145 |                 L        r2,=A(IMA)(,r3,322)
0008AA  58F0  3146        001145 |                 L        r15,=V(DUMP@X)(,r3,326)
0008AE  4110  D098        001145 |                 LA       r1,#MX_TEMP9(,r13,152)
0008B2  4140  0200        001145 |                 LA       r4,512
0008B6  5040  D098        001145 |                 ST       r4,#MX_TEMP9(,r13,152)
0008BA  5020  D09C        001145 |                 ST       r2,#MX_TEMP9(,r13,156)
0008BE  5000  D0A0        001145 |                 ST       r0,#MX_TEMP9(,r13,160)
0008C2  0DEF              001145 |                 BASR     r14,r15

Prolog:
000148                    000402 |        dump_x   DS       0D             
000148  47F0  F022        000402 |                 B        34(,r15)
00014C  01C3C5C5                                            CEE eyecatcher
000150  000000C0                                            DSA size
000154  00001B60                                            =A(PPA1-dump_x)
000158  47F0  F001        000402 |                 B        1(,r15)
00015C  58F0  C31C        000402 |                 L        r15,796(,r12)
000160  184E              000402 |                 LR       r4,r14
000162  05EF              000402 |                 BALR     r14,r15
000164  00000000                                            =F'0'         
000168  07F3              000402 |                 BR       r3
00016A  90E7  D00C        000402 |                 STM      r14,r7,12(r13)
00016E  58E0  D04C        000402 |                 L        r14,76(,r13)
000172  4100  E0C0        000402 |                 LA       r0,192(,r14)
000176  5500  C314        000402 |                 CL       r0,788(,r12)
00017A  4130  F03A        000402 |                 LA       r3,58(,r15)
00017E  4720  F014        000402 |                 BH       20(,r15)
000182  58F0  C280        000402 |                 L        r15,640(,r12)
000186  90F0  E048        000402 |                 STM      r15,r0,72(r14)
00018A  9210  E000        000402 |                 MVI      0(r14),16
00018E  50D0  E004        000402 |                 ST       r13,4(,r14)
000192  18DE              000402 |                 LR       r13,r14

Epiolog:
0009A0  58D0  D004        001178 |                 L        r13,4(,r13) 
0009A4  58E0  D00C        001178 |                 L        r14,12(,r13)
0009A8  9826  D01C        001178 |                 LM       r2,r6,28(r13)
0009AC  051E              001178 |                 BALR     r1,r14       
0009AE  0707              001178 |                 NOPR     7           


It loosely looks like a savearea chain with some additional detail, expanded on stack.
Presently Im looking into XL documentation. If someone knows a resource/doc, where ABI is specified, or some comments on the subject, please share.


Respectfully,
Catz.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sat Jul 25, 2015 9:20 am
Reply with quote

It appears to me to be the Language Environment model. In turn, this model goes back to 1960s common practice for reenterable programs. In this model, reg 13 points to a "standard" 72 byte register save area followed by a work area.

For better or worse, many working Assembler programmers have abandoned this model. Reg 13 still points to a save area, but a second register points to a work area shared by, at least, all the internal functions in a single program.

Yes, I know any CS101 alumni will point out this model is flawed, but those CS101 professors are seldom working Assembler programmers, and they look down on us as vermin.
Back to top
View user's profile Send private message
Catz

New User


Joined: 22 May 2015
Posts: 6
Location: Latvia

PostPosted: Mon Jul 27, 2015 11:52 am
Reply with quote

Thank you so much for this - was finally able to find docs, explaining this.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts specifications of a small project or ... All Other Mainframe Topics 18
Search our Forums:

Back to Top