Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Why should we concerned about AMODE?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
praveen.vss

New User


Joined: 02 Sep 2009
Posts: 1
Location: hyearbad

PostPosted: Tue Nov 14, 2017 2:46 pm    Post subject: Why should we concerned about AMODE?
Reply with quote

Why should we concerned about AMODE. Why can’t we just use an addressing mode (31 bit) that fits anywhere in the storage.
Back to top
View user's profile Send private message

steve-myers

Active Member


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

PostPosted: Tue Nov 14, 2017 4:45 pm    Post subject:
Reply with quote

In other words, specify AMODE ANY, or as you say, AMODE 31.

Some instructions and system interfaces work differently in AMODE 24 than in AMODE 31. The issues mainly affect lazy - or unknowledgeable - Assembler programmers. All the high level languages and their libraries are already AMODE agnostic.

For example, this code fragment will work correctly in AM0DE 24, but fail in AMODE 31. Brownie points to the first person that will tell us the problem. A few more brownie points to the first person who tells us how to make the code fragment AMODE agnostic. AMODE agnostic means the code fragment will work in either AMODE 24 or AMODE 31.
Code:
         LA    2,CPARM
FPP      L     1,0(,2)
         FREEPOOL (1)
         TM    0(2),X'80'
         LA    2,4(,2)
         BZ    FPP
         ...
CPARM    CLOSE (DCB1,LEAVE,DCB2),MF=L
The LEAVE option in the CLOSE macro is actually a hint as to the actual problem.

The topic starter does raise a serious issue, one that causes problems for unwary programmers.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8187
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 14, 2017 7:46 pm    Post subject: Reply to: Why should we concerned about AMODE?
Reply with quote

Quote:
Why can’t we just use an addressing mode (31 bit) that fits anywhere in the storage.
And what about AMODE 64 (which is valid on system z machines now)? It does NOT behave like AMODE 24 or 31 but is still valid for C applications and LE.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Tue Nov 14, 2017 10:40 pm    Post subject:
Reply with quote

You're right, of course, but AMODE 64 is essentially non existent for Assembler. Personally, I've never done AMODE 64, so my experience with it is 0. I'm quite certain the usual access methods won't work. The topic starter didn't mention 64, so I decided to leave it alone.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Nov 15, 2017 2:39 pm    Post subject:
Reply with quote

Quote:
but AMODE 64 is essentially non existent for Assembler


AMODE64 is essentially not available for high-level languages. it is available for Assembler - I've written AMODE=64 code in Assembler.

Garry
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1067
Location: Oostende, Belgium

PostPosted: Wed Nov 15, 2017 4:27 pm    Post subject:
Reply with quote

Garry Carroll wrote:
Quote:
but AMODE 64 is essentially non existent for Assembler


AMODE64 is essentially not available for high-level languages. it is available for Assembler - I've written AMODE=64 code in Assembler.

Enterprise PL/I supports AMODE64.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Wed Nov 15, 2017 6:18 pm    Post subject:
Reply with quote

Garry Carroll wrote:

AMODE64 is essentially not available for high-level languages. it is available for Assembler - I've written AMODE=64 code in Assembler.

Garry
I've always thought an AMODE 64 program will be switching between 64 and 31, do some regular I/O, switch back to 64. This strikes me as confusing as programs using access registers; they SAC 512 (if I remember correctly) to go into AR mode, and SAC 0 to go to normal mode. Yuck. At least you don't have access registers in AMODE 64 or the confusing (and nearly undocumented mess) to create a data space and connect it to an LDS!
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Nov 15, 2017 6:44 pm    Post subject:
Reply with quote

AMODE64 programs are RMODE31, so remain "below the bar". They don't need to switch to AMODE31 for I/O &c as they can address those areas an AMODE31 program can access without need for any switching.

Other than the fact that it can address data which is "above the bar", the AMODE64 program can do anything an AMODE31 program can do.

How the storage "above the bar" is managed is another matter and is completely different to AMODE24 / AMODE31 storage.

Garry.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Wed Nov 15, 2017 7:12 pm    Post subject:
Reply with quote

Garry Carroll wrote:
AMODE64 programs are RMODE31, so remain "below the bar". They don't need to switch to AMODE31 for I/O &c as they can address those areas an AMODE31 program can access without need for any switching.

Other than the fact that it can address data which is "above the bar", the AMODE64 program can do anything an AMODE31 program can do. ...

Garry.
Yes, but it is basically impossible to do I/O to areas above the bar or in AMODE 64. This means AMODE switching to do the I/O and MVC between above the bar and I/O buffers below the bar. I'm sure you realize the performance implications of large scale MVC or its equivalents.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1247
Location: Israel

PostPosted: Wed Nov 15, 2017 9:10 pm    Post subject:
Reply with quote

Extract from the CICS TS V5R3 Resource Definition Guide, Chapter 38, "Invoking the DFHCSDUP program from a user program"
Quote:
Responsibilities of the user program
Before invoking the DFHCSDUP program, your calling program must ensure that:
* AMODE(24) and RMODE(24) are in force
* ...

Sometimes, we just can't.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8187
Location: East Dubuque, Illinois, USA

PostPosted: Thu Nov 16, 2017 12:43 am    Post subject: Reply to: Why should we concerned about AMODE?
Reply with quote

My earlier point was that this statement of the OP
Quote:
Why can’t we just use an addressing mode (31 bit) that fits anywhere in the storage.
is not a valid statement -- 64-bit data is part of storage but cannot be addressed by an AMODE 31 program.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts AMODE 64 C system() alternative Eric Olson All Other Mainframe Topics 2 Tue May 21, 2013 8:05 pm
No new posts JCL to list the Load Dataset Members ... Akatsukami JCL & VSAM 1 Mon Aug 29, 2011 11:52 pm
No new posts What is AMODE and RESIDENCY MODE(RMODE) dick scherrer COBOL Programming 13 Sun Aug 21, 2011 5:11 pm
No new posts AMODE issues with Enterprise PL/1 con... Aravind S PL/I & Assembler 3 Thu Feb 18, 2010 12:02 am
No new posts What functionality is lost with AMODE... dcshnier COBOL Programming 5 Fri Jul 10, 2009 7:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us