Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

dynamic calls
I have tried to code an assemblerprogram, which shall call other
programs.
the problem is as follows. in cobol the dynamic call is to slow.
therefore i should write a program in assembler which do the same. but
this assembler program is terrible slow. i have tried to call some
programs 5000000 times, and
i get a time error. the dynaic call in cobol will take this in 1.36
minutes.

in cobol i make

CALL a5po511     USING  Progname  (modul i will call)
parameter 1       (of program i will call)

Report this thread to moderator Post Follow-up to this message
Old Post
j?rg brehe
03-20-04 01:28 AM


Re: dynamic calls
Joerg Brehe writes ...

>I have tried to code an assembler program, which shall call other
>programs.
>the problem is as follows. in cobol the dynamic call is to slow.
>therefore i should write a program in assembler which do the same. but
>this assembler program is terrible slow. i have tried to call some
>programs 5000000 times, and
>i get a time error. the dynaic call in cobol will take this in 1.36
>minutes.
>
>in cobol i make
>
> CALL a5po511     USING  Progname  (modul i will call)
>                         parameter 1       (of program i will call)
>                         .
>                         :
>                         parameter n       (of program i will call)

Well, you don't specify your platform or COBOL compiler version, but my gues
s
is you are calling a COBOL subroutine compiled using COBOL/370 or later; thi
s
compiler uses Language Environment (LE), so that every time the program is
entered an LE run-time is built up, and every time the program is exited the
environment is torn down. There are several solutions but the simplest would
 be
to make your Assembler program LE-conforming. If you do this, the LE run-tim
e
is established at the Assembler program's level and lasts as long as the
Assembler program is running; this way, the COBOL subroutine will find the L
E
run-time already set up and avoid all the overhead of set up and break down 
for
each CALL.

Hope this helps.

Kind regards,


-Steve Comstock
800-993-9716
303-393-8716
www.trainersfriend.com
email: steve@trainersfriend.com
256-B S. Monaco Parkway
Denver, CO 80224
USA

Report this thread to moderator Post Follow-up to this message
Old Post
S Comstock
03-20-04 01:28 AM


Re: dynamic calls
You may also want to ask yourself if you really need a dynamic call when
static would due.


"j?rg brehe" <Joerg.Brehe@set-software.de> wrote in message
news:7f6b3f56.0310150343.5019639a@posting.google.com...
> I have tried to code an assemblerprogram, which shall call other
> programs.
> the problem is as follows. in cobol the dynamic call is to slow.
> therefore i should write a program in assembler which do the same. but
> this assembler program is terrible slow. i have tried to call some
> programs 5000000 times, and
> i get a time error. the dynaic call in cobol will take this in 1.36
> minutes.
>
> in cobol i make
>
>  CALL a5po511     USING  Progname  (modul i will call)
>                          parameter 1       (of program i will call)
>                          .
>                          :
>                          parameter n       (of program i will call)
>
> the assemblerprogram is as follows
>
> *-----------------------------------------------------------------*
> *        PROGRAMMEROEFFNUNG                                       *
> *-----------------------------------------------------------------*
> A5PO511  AMODE 31
> *5PO511  RMODE ANY
> A5PO511  RMODE ANY
> A5PO511  CSECT
> ANFANG   STM   14,12,12(13)      SAVE ENTRY REGS IN CALLERS AREA
>          LR    12,15             LOAD BASE
>          USING ANFANG,12
>          LR    11,13
>          LA    13,SAVEAREA
>          ST    11,4(,13)
>          ST    13,8(,11)
> *-----------------------------------------------------------------*
> *        PARAMETER ERMITTELN UND REGISTER SETZEN                  *
> *-----------------------------------------------------------------*
>          LR    R5,R1             ADRESSE DER PARAMETERLISTE NACH R5
>          L     R4,0(R5)          ADRESSE DES ERSTEN PARAMETERS NACH R4
>          LR    R11,R4            EIGENE PARAMETER IN R11
>          LR    R9,R1
>          AH    R9,=H'4'          PARAMETERLISTE FUER PROGRAMM X IN R9
> *-----------------------------------------------------------------*
> *        PARAMETER ADRESSIEREN UND PRÜFEN                         *
> *-----------------------------------------------------------------*
> *-----------------------------------------------------------------*
>          USING PARMLIST,R11      EIGENE PARAMETER ADRESSIEREN
> *
>          CLC   PRM_ID,=C'A5PO511 '
>          BNE   A9900
> *
> *        CLC   PRM_PROG,=C'A5PO511 '
> *        BE    A9901
> *-----------------------------------------------------------------*
> *        TABELLE DER PROGRAMME ADRESSIEREN                        *
> *-----------------------------------------------------------------*
>          LA    R6,0
>          LA    R7,PROG_LEN
>          LH    R8,PRM_NR           LADE PROGRAMMNR
>          MR    R6,R8               REGISTERPAAR R2/R3 MULTIPLIZIEREN
>          LA    R2,PROGRAMS         ADRESSE DER TABELLE IN R2
>          AR    R2,R7               OFFSET IN R3 ADDIEREN
> *
> *
>          USING PROGGIES,R2         TABELLE ADRESSIEREN ÜBER R2
> *
> A0050    DS    0H
> ***      CLC   PROGADDR,=X'00'     NO ENTRY?
>          OC    PROGADDR,PROGADDR   BINARY ZERO
>          BNE   A2000               PROGRAMM SCHON GELADEN
>          BE    A1000               MODUL LADEN
> *
> *-----------------------------------------------------------------*
> *        MODUL LADEN UND EINPSRUNGSADRESSE ERMITTELN              *
> *-----------------------------------------------------------------*
> A1000    EQU   *
>          AIF   ('&POSOPS' EQ 'BS2').BS2000
> *
>          LOAD  EPLOC=(2),ERRET=LOADFAIL
>          ST    R0,PROGADDR         EINSPRUNGSADRESSE MERKEN
>          B     A2000               IN MODUL SPRINGEN
> *
>
> *       here is some code for bs2000
> *-----------------------------------------------------------------*
> *        AN EINSPRUNGSADRESSE SPRINGEN (MODUL AUSFUEHREN)         *
> *-----------------------------------------------------------------*
> A2000    DS    0H
>          L     R15,PROGADDR        EINSPRUNGSADRESSE LADEN
>          LR    R1,R9               PARAMETERLISTE IN R1
> *
>          BASSM R14,R15             CALL THE MODULE
> *
>          LTR   R15,R15             RETURNCODE OK?
>          BZ    A9999               YES, IT IS DONE
>          B     LOADFAIL            BAD GIRL
> *
> *        DROP  R2
> *-----------------------------------------------------------------*
> *        ABBRUCH BEI FEHLERSITUATIONEN                            *
> *-----------------------------------------------------------------*
> *A9900    DS    0H              UEBERGABEPARAMETER FALSCH
> *         DC    0F
> *-----------------------------------------------------------------*
> *        LADEN VON MODUL IST FEHLGESCHLAGEN                       *
> *-----------------------------------------------------------------*
> LOADFAIL DS    0H
>          MVI   PRM_RC,PRM_RC_MODUL
> *
>          AIF   ('&POSOPS' EQ 'BS2').WEITER
> *
>          C     R1,ERR106            S106 ABEND
>          BE    CHKER106
>          C     R1,ERR806            S806 ABEND
>          BE    NOPROG
> *
> CHKER106 WTO   '*** PROGRAM NOT FOUND ***'
>          B     EXIT
> NOPROG   WTO   '*** INSUFFICIENT VIRTUAL MEMORY ***'
> *
> .WEITER  ANOP
> *
>          B     EXIT
> *-----------------------------------------------------------------*
> *        FEHLERFREIE VERARBEITUNG                                 *
> *-----------------------------------------------------------------*
> A9999    DS    0H
>          MVI   PRM_RC,PRM_RC_OK
>          B     EXIT
> *-----------------------------------------------------------------*
> *        ZURUECK ZUM AUFRUFENDEN PROGRAMM                         *
> *-----------------------------------------------------------------*
>
*-----------------------------------------------------------------*
> EXIT     DS    0H
>          L     R13,4(R13)      PTR TO ENTRY REG SAVE AREA
>          LM    R0,R12,20(R13)  RELOAD REGISTERS 0-12 ONLY
>          L     R14,12(R13)     RESTORE RETURN ADDRESS TO R14
>          BR    R14             RETURN TO CALLER
> *-----------------------------------------------------------------*
>          EJECT
> *-----------------------------------------------------------------*
> *        BEGINN DER KONSTANTEN
> *-----------------------------------------------------------------*
> PROGRAM_ID     DC     CL8'&PGM'
> HEX_NULL       DC     16X'00'
> BLANKS         DC     CL24' '
> PROGRAMM_ID    DC     C'&PGM',C' BEGINN DES DYNAM-SPEICHERS>>'
> *
> PROGRAMS       DS     0F
> *              DC     8XL1'FF',F'0'
>                DC     CL8'TEST    ',F'0'
> PROG_ENT       DS     0F
>                DC     CL8'A5PO901 ',F'0'
>                DC     CL8'A5PO902 ',F'0'
>                DC     CL8'A5PO903 ',F'0'
>                DC     CL8'A5PO904 ',F'0'
>                DC     CL8'A5PO905 ',F'0'
>                DC     CL8'A5PO906 ',F'0'
>                DC     CL8'A5PO907 ',F'0'
>                DC     CL8'A5PO908 ',F'0'
>                DC     CL8'A5PO909 ',F'0'
>                DC     CL8'A5PO910 ',F'0'
> PROG_ENDE      EQU    *
> *ROG_COEP      DC     AL2((PROG_ENDE-PROGRAMS)/PROG_LEN)
> *ROG_LEN       DC     AL2(PROG_ENT-PROGRAMS)
> PROG_LEN       EQU    PROG_ENT-PROGRAMS
>           HIGH_VALUE     DC     16X'FF'
> ERR106         DC     X'00000106'
> ERR806         DC     X'00000806'
> *-----------------------------------------------------
> SAVEAREA       DC    18F'0'
> *
>                LTORG
> *-----------------------------------------------------
> *              DUMMIES
> *-----------------------------------------------------
> PROGGIES       DSECT
> PROGRAMM       DS     CL8
> PROGADDR       DS     F
> *-----------------------------------------------------
> PARMLIST       DSECT
> PRM_ID         DS     CL8'&PGM'   PROGRAM-ID
> PRM_RC         DS     X           RETURNCODE
> PRM_RC_OK      EQU    X'00'
> PRM_RC_MODUL   EQU    X'02'
> PRM_RSRVD      DS     CL1
> PRM_NR         DS     H
> *-----------------------------------------------------
> *-----------------------------------------------------
> PRM2LIST       DSECT
> PRM2_PARM      DS     0X
> *-----------------------------------------------------
>                END    A5PO511
>
> why is this program slower as the dynamic call of cobol
> i hope someone could help me
>
> thanks
>
> j. B.



Report this thread to moderator Post Follow-up to this message
Old Post
Bill Davis
03-20-04 01:28 AM


Re: dynamic calls
Additionally, in the following code:

BE    A1000               MODUL LADEN
*
*-----------------------------------------------------------------*
*        MODUL LADEN UND EINPSRUNGSADRESSE ERMITTELN              *
*-----------------------------------------------------------------*
A1000    EQU   *
AIF   ('&POSOPS' EQ 'BS2').BS2000
*
LOAD  EPLOC=(2),ERRET=LOADFAIL
ST    R0,PROGADDR         EINSPRUNGSADRESSE MERKEN
B     A2000               IN MODUL SPRINGEN
*

*       here is some code for bs2000
*-----------------------------------------------------------------*
*        AN EINSPRUNGSADRESSE SPRINGEN (MODUL AUSFUEHREN)         *
*-----------------------------------------------------------------*
A2000    DS    0H



I would remove the

BE    A1000               MODUL LADEN

and the
B     A2000               IN MODUL SPRINGEN


In both cases, you are just going to fall into the labels anyway.
If what you have stated is correct, IE 5000000 calls, you will have
saved yourself about 5000001 "executed instructions".

Good luck.

S.R.Kayara

Report this thread to moderator Post Follow-up to this message
Old Post
S.R.Kayara
03-20-04 01:28 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASM370 archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:51 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.