|
>Date: Fri, 16 Nov 2001 19:46:27 -0600 >From: Tadashi Kakefuda <tadashi@ff.iij4u.or.jp> > >I noticed that PEP itself was a kind of (a group of ?) internal object >(s)(system program or procedure). It seems it calls a user program that >we expected. IOW, it indicates the main program that you expected or a >kind of bridge.... Am I right? > >When you execute CRTPGM A ...ENTMOD(B) and if you call program A,the >Module B will be called (activated). Am I right? In any module with a "main" procedure (for example an RPG module that doesn't have NOMAIN, or a C module with a procedure called "main"), the compiler also generates a special procedure called the PEP, whose job (among possibly other things) is to call the actual main procedure, passing the program parameters in a way the procedure can understand. So the PEP is indeed a bridge between the system and the actual main procedure. When a program is created, all the PEPs are discarded except the one for the ENTMOD module. In your example, when you call program A, the system will call the PEP for module B, and that PEP will call the main procedure in module B. But all the modules in the program will be activated, and so will all the modules in all the service programs used by the program (if they are not already activated). "Activated" means something like "having static storage allocated and initialized". (At least that's how I explain it to myself.) The only time you have to worry about the PEP is when you are sending messages beyond the main procedure of your program. You have to include the PEP in your stack offset. Barbara Morris
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.