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

Why/when we go for an assembler program?


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

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Mon May 17, 2010 11:16 am
Reply with quote

Hi Guys,

when/why we go for an assembler program if we can complete the same with other languages like COBOL etc.

If the answer is performance/efficiency, could you pls just elaborate on that with examples?

could you pls give me some examples where we have to use only assembler? ie the things which can't be handled by other languages..

Thanks,
Yuge
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon May 17, 2010 12:57 pm
Reply with quote

If you look at the LIST output from Cobol or PL/1, you can see how generalised the generated code is in certain areas. Writing in Assembler, you can avoid these generalisations and be more specific. This reduces the instruction path-length and this can improve run-time efficiency.

Some exits available in software packages must be written in Assembler, so if these are required you must code Assembler.

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon May 17, 2010 1:24 pm
Reply with quote

Accessing system control blocks is mostly done in assembler.
Back to top
View user's profile Send private message
yugendran

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Mon May 17, 2010 2:40 pm
Reply with quote

@Garry,

Thanks for the reply.. It would be very helpful if you pls explain the below point with example?

"If you look at the LIST output from Cobol or PL/1, you can see how generalised the generated code is in certain areas. Writing in Assembler, you can avoid these generalisations and be more specific. This reduces the instruction path-length and this can improve run-time efficiency."

Thanks again.. icon_smile.gif
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon May 17, 2010 3:07 pm
Reply with quote

The pseudo-assembler from a PL/1 OPEN of a file

Code:
                ST       r1,_temp1(,r13,200)         
                L        r1,MYFILE(,r6,8)           
                ST       r1,_temp1(,r13,196)         
                ST       r0,_temp1(,r13,192)         
                LA       r0,_temp1(,r13,192)         
                L        r15,=V(IBMQOFOP)(,r3,6)     
                LA       r1,#MX_TEMP1(,r13,152)     
                ST       r0,#MX_TEMP1(,r13,152)     
                BASR     r14,r15                     


which involves a call to external routine IBMQOFOP compares with an assembler OPEN macro expansion


Code:
+         CNOP  0,4             
+         BAL   1,*+8           
+         DC    AL1(128)         
+         DC    AL3(MYFILE)       
+         SVC   19               


The generalisation is in the IBMQOFOP routine which caters for many file types.

The same holds true for many code expansions in high-level languages.

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

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Mon May 17, 2010 3:14 pm
Reply with quote

Thanks a lot Garry!!! It helps...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon May 17, 2010 4:47 pm
Reply with quote

One case where assembler comes in handy is when vendors are writing programs to access multiple files of different length records. COBOL, for example, requires at compile time that the record length be known since the FD must be completed. This information can be deferred to run time with assembler.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 17, 2010 7:50 pm
Reply with quote

Hello,

Quote:
when/why we go for an assembler program if we can complete the same with other languages like COBOL etc.
There are many "things" that assembler does and cobol and other high-level languages do not. . . Like the cases Peter and Robert mentioned along with the considerations from Garry.

Usually, assembler is not chosen when the program can be implemented using the "standard" application development language for the organization. There are fewer and fewer solid assembler people in the business icon_sad.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon May 17, 2010 8:51 pm
Reply with quote

Quote:

There are fewer and fewer solid assembler people in the business


Yes Dick,

we (I) belong to a dying breed. icon_eek.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon May 17, 2010 8:57 pm
Reply with quote

we should apply UNESCO to be included in the protected world heritage treasures icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon May 17, 2010 9:58 pm
Reply with quote

enrico-sorichetti wrote:
we should apply UNESCO to be included in the protected world heritage treasures icon_biggrin.gif


Absolutely Enrico,

but do we IT people fit in this "Social and Human Sciences" program?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 17, 2010 10:14 pm
Reply with quote

Quote:
"Social and Human Sciences"


more likely, archeology icon_lol.gif
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 Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top