View previous topic :: View next topic
|
Author |
Message |
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Accessing system control blocks is mostly done in assembler. |
|
Back to top |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
@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.. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Thanks a lot Garry!!! It helps... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
There are fewer and fewer solid assembler people in the business
|
Yes Dick,
we (I) belong to a dying breed. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
we should apply UNESCO to be included in the protected world heritage treasures |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
enrico-sorichetti wrote: |
we should apply UNESCO to be included in the protected world heritage treasures |
Absolutely Enrico,
but do we IT people fit in this "Social and Human Sciences" program? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
"Social and Human Sciences" |
more likely, archeology |
|
Back to top |
|
|
|