View previous topic :: View next topic
|
Author |
Message |
josephineyeow
New User
Joined: 12 Mar 2020 Posts: 11 Location: USA
|
|
|
|
I have assembler program with
ENTRY labelA
ENTRY labelB
LabelA ... assembler code
LabelB ... assembler code
I understand this program can be called for LabelA or LabelB
Question - does execution of LabelA code includes execution of LabelB after or does execution of LabelA result in return to calling program |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
That's entirely up to you. You can code it to do either. |
|
Back to top |
|
|
josephineyeow
New User
Joined: 12 Mar 2020 Posts: 11 Location: USA
|
|
|
|
Thank you. It was the first I’ve seen of an assembler program with more than 1 ENTRY. Guess if I don’t want processing of LabelA to be followed by processing of LabelB I should a conditional Branch. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
As prino says, the mechanics are up to you.
I have one TSO command processor with 3 entry points. 90% of the processing is identical, and the code, obviously, is shared. Each entry point implies options, and the entry point that is used sets the options.
I have another program with 3 entry points. Each entry point is a subroutine with distinct code, There is no shared code between the 3 subroutines. The primary routine is used to format messages. One of its formats converts the decimal time of day as returned by TIME DEC to character strings in various formats. Not too long after I wrote the formatter I started working with SMF data. Its time of day is generally in the time of day format as returned by TIME BIN. The code to convert from binary time of day to packed decimal time of day is tricky enough I don't want to recode it all the time, so I wrote the conversion routine and added it as a fully independent subroutine with its own ENTRY statement. Even then I goofed. It takes its time of day in reg 0 (as from TIME BIN) and returns the decimal time of day in reg 0 (as from TIME DEC). So most of my programs that process SMF data have a subroutine to load the binary time of day from storage into reg 0, call the binary time of day to decimal time of day routine, and store the decimal time of day over the binary time of day.
The third entry point left justifies a character string that is right justified in a fixed length data area. |
|
Back to top |
|
|
josephineyeow
New User
Joined: 12 Mar 2020 Posts: 11 Location: USA
|
|
|
|
Sure learning a lot of assembler. I'm basically a dinosaur cobol programmer now in a project to move assembler to cobol (worked on assembler eons ago and tried to forget the pain). It's nice to know I can count on support. THANK YOU. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
I learned a little FORTRAN in high school (1964).
When I took my first college computer course and learned assembler (Control Data 1604) I really got hooked - fun and also a good challenge.
My programming career was all non-assembler (mostly FORTRAN, COBOL, APL, BASIC, PL/I, SAS), but the few times I taught programming I always included assembler, even if a simple mock up on paper or simulated, so that my students always knew what was really going on.
Of course, languages like SAS are interpreted, rather than being compiled into pure machine language, but that's another issue. |
|
Back to top |
|
|
|