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

How to access array elemnts in assembler


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

New User


Joined: 19 Nov 2004
Posts: 24
Location: Banglore

PostPosted: Fri Jul 18, 2008 7:47 pm
Reply with quote

can any one please answer to these below instruction questions?

1) How to pass paramters to the sub program? How it will be recieved by calling program? How the control is sent back to called program?
2)How to access array elemnts in assembler?
3)How to suppress leading zeros using edit instruction?

Many thanks in advance
Kalpana
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 18, 2008 8:05 pm
Reply with quote

I am not an Assembler expert, but:
1. Set up an address block in memory. The first parameter's address goes at offset 0, the second parameter's address goes at offset 4, etc. The last address has the high-order bit set to '1' to indicate the end of the list. Load the address of block into register 1. The called program uses register 1 to load the parameter addresses. Under standard register conventions, register 14 contains the return address upon entry into the subroutine.
2. Trick question. There's no such thing as arrays, per se, in Assembler. All Assembler instructions use offsets from registers to determine addresses.
3. Look into the ED or EDMK instructions.
Back to top
View user's profile Send private message
kalpana

New User


Joined: 19 Nov 2004
Posts: 24
Location: Banglore

PostPosted: Fri Jul 18, 2008 8:28 pm
Reply with quote

can you please explain me with sample code for sub program concept.

and array elements accessing
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 Access to non cataloged VSAM file JCL & VSAM 18
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts access the last host command CLIST & REXX 2
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top