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

why displacement of 12 on STM


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

Active User


Joined: 31 Oct 2006
Posts: 139
Location: brisbane

PostPosted: Thu Jul 13, 2023 11:01 am
Reply with quote

New to HLASM so this may seem a like dumb question, but I couldn't find any answer on google, and the answer from Chat GPT has left me perplexed.

Most commonly I see STM with a displacement of 12, such as:

STM 13,12,12(13)

according to Chat GPT, it's a convention used to force full word alignment, but I can't see how it does that since R13 is set by the caller ... in any case, surely, it's the responsibility of the calling program to establish a save area that is aligned on full words ?
Back to top
View user's profile Send private message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 139
Location: brisbane

PostPosted: Thu Jul 13, 2023 11:52 am
Reply with quote

i think i see it now ... we use the first part of the save area to maintain forward and backward pointers to save areas...
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 730
Location: Denmark

PostPosted: Thu Jul 13, 2023 1:00 pm
Reply with quote

Actually, according to the convention, the first 3 words (=12 bytes) are used as follows
word 1 used to be reserved for PL/1, but is now often used to specify the type of save area, I cant' immediately recall what the specifications are, but I am sure that others can.
word 2 point to previous save area
word 3 point to next save area
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 730
Location: Denmark

PostPosted: Thu Jul 13, 2023 1:21 pm
Reply with quote

See also
HLASM Programmer's Guide - Saving and restoring general register contents

www.ibm.com/docs/en/zos/2.1.0?topic=conventions-standard-call-linkage

Or Google for 'IBM assembler save area chaining'
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 SYSADATA - COBOL - Structure displace... COBOL Programming 3
No new posts base+displacement addressing scheme PL/I & Assembler 3
No new posts To Find Occurs from displacement Mainframe Interview Questions 2
No new posts Hi give me the example for index-disp... COBOL Programming 7
No new posts Displacement in DFSORT OUTREC Fields DFSORT/ICETOOL 3
Search our Forums:

Back to Top