Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example 1: Assembly command

&pagelevel(4)&pagelevel

A command to assemble an assembly language source program and store the generated object module in an EAM object module library is to be defined and then be implemented via a procedure. The necessary macros may be located in a user macro library. The command is to have the following format:

ASSEMBLE-SOURCE

SOURCE = <filename 1..54>

,MACRO-LIBRARY = *NONE / <filename 1..54>

,TEST-SUPPORT = *NO / *YES

The command is implemented via a procedure. The symbolic operands appear as positional operands in the operand list of the BEGIN-PROCEDURE command. The following procedure appears as the element ASSEMB in the program library $SDFUSR.PROC.LIB.

/BEGIN-PROCEDURE PARAMETERS=*YES(PROC-PARAM=(&SOURCE,&MACROLIB,&TEST))
/DELETE-SYSTEM-FILE FILE-NAME=*OMF
/ASSIGN-SYSDTA TO=*SYSCMD
/START-ASSEMBH
//     COMPILE SOURCE=&SOURCE,//
             MACRO-LIB=&MACROLIB,//
             TEST=&TEST
//     END
/SET-JOB-STEP
/ASSIGN-SYSDTA TO-FILE=*PRIMARY
/END-PROCEDURE 

The command ASSEMBLE-SOURCE is defined in the user syntax file SDF.USER. SYNTAX. It is then tested.

/set-logon-parameters  sdfusr,... —————————————————————————————————————  (1)
/mod-sdf-options syntax-file=*remove(*std) ————————————————————————————  (2)
/start-sdf-a ——————————————————————————————————————————————————————————  (3)
%  BLS0517 MODULE 'SDAMAIN' LOADED
%  SDA0001 'SDF-A' VERSION '04.1E10' STARTED
%//open-syntax-file sdf.user.syntax ———————————————————————————————————  (4)
%//set-glob cont=*new —————————————————————————————————————————————————  (5)
%//add-cmd assemble-source,help=e('Assembles a program'), -
%//domain=programming-support, -
%//implementor=*proc('*lib-elem(lib=$sdfusr.proc.lib,elem=assemb)') ———  (6)
%//add-oper source,res-oper-name=*pos(1) ——————————————————————————————  (7)
%//add-value *filename ————————————————————————————————————————————————  (8)
%//add-oper macro-library,def='*none',res-oper-name=*pos(2) ———————————  (9)
%//add-value *keyw(*mand),value='*none' ——————————————————————————————— (10)

                                                                                                                                                                                                

  1. A task is initiated under the user ID SDF.USER.

  2. The user syntax file SDF.USER.SYNTAX automatically activated during LOGON processing is deactivated.

  3. SDF-A is loaded and started.

  4. The existing user syntax file SDF.USER.SYNTAX is opened.

  5. The global information defines that the continuation character “-” for continuing lines may stand in any column between 2 and 72 when SYSCMD or SYSSTMT is input.

  6. The header of the ASSEMBLE-SOURCE command is defined. The command contains an English help text and is assigned to the domain USER. It is implemented by means of the procedure located as the element ASSEMB in the program library $SDFUSR.PROC.LIB.

  7. The first operand of the ASSEMBLE-SOURCE command is defined. Its name is SOURCE. It stands at the beginning of the string to be passed to the procedure.

  8. It is defined that the value of the SOURCE operand must be of the type FILENAME.

  9. The second operand of the ASSEMBLE-SOURCE command is defined. Its name is MACRO-LIBRARY. Its default value is *NONE. It comes second in the string to be passed to the procedure.

  10. The keyword NONE is defined as a permissible value of the MACRO-LIBRARY operand. When entered, it must be prefixed by an asterisk.

    %//add-value *filename ———————————————————————————————————————————————— (11)
    %//add-oper test-support,def='no',res-oper-name=*pos(3) ——————————————— (12)
    %//add-value *keyw,value='no' ————————————————————————————————————————— (13)
    %//add-value *keyw,value='yes' ———————————————————————————————————————— (14)
    %//close-cmd —————————————————————————————————————————————————————————— (15)
    %//show *com(assemb-source),siz=*max —————————————————————————————————— (16)
    ASSEMBLE-SOURCE

         Assembles a program
         SOURCE =
              filename_1..54
         MACRO-LIBRARY = *NONE
              *NONE or filename_1..54
         TEST-SUPPORT = *NO
              *NO or *YES
    %//end ———————————————————————————————————————————————————————————————— (17)

                                                                                                                                                                                                                    

  11. It is defined that the value of the MACRO-LIBRARY operand may be of the data type FILENAME.

  12. The third global operand of the ASSEMBLE-SOURCE command is defined. Its name is TEST-SUPPORT and it has the default value NO. It comes third in the string to be passed to the procedure.

  13. It is defined that the keyword NO is a permissible value of the TEST-SUPPORT operand.

  14. It is defined that the keyword YES is a permissible value of the TEST-SUPPORT operand.

  15. The definition of the ASSEMBLE-SOURCE command is terminated.

  16. The definition of the ASSEMBLE-SOURCE command created in the user syntax file SDF.USER.SYNTAX is output in its most detailed form. SDF-A has defined a minimum length of 1 and a maximum length of 54 for all file names.

  17. SDF-A is terminated. The user syntax file SDF.USER.SYNTAX is stored implicitly.

    /mod-sdf-opt synt-file=*add(*std),guid=*n ————————————————————————————— (18)
    /assemb-source demo.prog1,macro-lib=demo.maclib.test-support=*yes ————— (19)
    %  BLS0500 PROGRAM 'ASSEMBH', VERSION '1.2B00' OF '1998-04-24' LOADED
    %  BLS0552 COPYRIGHT (C) FUJITSU SIEMENS COMPUTERS GMBH 1990. ALL RIGHTS
    RESERVED

    %  ASS6010 V01.2B02 OF BS2000 ASSTRAN  READY
    %  ASS6011 ASSEMBLY TIME: 302 MSEC
    %  ASS6018 0 FLAGS, 0 PRIVILEGED FLAGS, 0 MNOTES
    %  ASS6019 HIGHEST ERROR-WEIGHT: NOTE
    %  ASS6006 LISTING GENERATOR TIME: 130 MSEC
    %  ASS6012 END OF ASSTRAN
    .

     .

                                                                                                                                                                                                                    

  18. The user syntax file SDF.USER.SYNTAX, in which the ASSEMBLE-SOURCE command is defined, is activated.

  19. The ASSEMBLE-SOURCE command is entered. The user-specific macro library DEMO.MACLIB is specified. Once the command has been executed, the resultant object module has been stored in the EAM object module file.