z390 assembler option to list all lines of a COPYBOOK

53 views
Skip to first unread message

Luca Masini

unread,
May 2, 2023, 6:37:55 PM5/2/23
to z390
HI,

I'm trying to use the z390 assembler in a cross-toolchain for VM/370.
In some test it worked.
In order to debug the toolchain I need to see the assembler *AFTER* the macro expansion.

I have the following snippet of code produce py the GCCCMS cross compiler

         COPY  PDPTOP
         CSECT
* X-var a
         ENTRY A
* Program data area
         DS    0F
A        EQU   *
         DC    F'5248'
    ....

The COPY PDPTOP is the following assembler fragment that is included at the beginning of every compilation.

**********************************************************************
*  PDPTOP - standard code for the start of every assembler file.     *
*                                                                    *
*  (version customized for S/370 - see PDPTOP/PDPORIG for original)  *
**********************************************************************
*
* Is the GCC or C/370 calling convention being used?
         GBLC &COMP               Declare compiler switch
&COMP    SETC 'GCC'               Indicate that this is for GCC
*
* What system are the compiles being done for?
         GBLC &SYS                Declare variable for system
&SYS     SETC 'S370'              Define either S370, S380 or S390
*
* Which OS are we targetting?
         GBLC &OS                 Declare compiler switch
&OS      SETC 'CMS'               Indicate that this is for CMS

The assembler command used in the toolchain is

    asm $1.s 'SYSMAC(C:\opt\gcccms-3.2.3\mac+)' 'SYSCPY(C:\opt\gcccms-3.2.3\mac+)' BAL NOLISTUSE PRINTALL MCALL

When I look at the .PRN files I see the following fragment
    ....
000000                                        (1/1)1          COPY  PDPTOP
000000                                        (2/1)2+**********************************************************************
000000                                        (2/2)3+*  PDPTOP - standard code for the start of every assembler file.     *
000000                                        (2/3)4+*                                                                    *
000000                                        (2/4)5+*  (version customized for S/370 - see PDPTOP/PDPORIG for original)  *
000000                                        (2/5)6+**********************************************************************
000000                                        (2/6)7+*
000000                                        (2/7)8+* Is the GCC or C/370 calling convention being used?
000000                                       (2/10)9+*
000000                                      (2/11)10+* What system are the compiles being done for?
000000                                      (2/14)11+*
000000                                      (2/15)12+* Which OS are we targetting?
000000                                       (1/2)13          CSECT
000000                                       (1/3)14 * X-var a
000000                                       (1/4)15          ENTRY A
000000                                       (1/5)16 * Program data area
000000                                       (1/6)17          DS    0F
000000                  00000000             (1/7)18 A        EQU   *
000000 00001480                              (1/8)19          DC    F'5248'
    ....

As you can see, the following lines are not sown in the .PRN

         GBLC &COMP               Declare compiler switch
&COMP    SETC 'GCC'               Indicate that this is for GCC

Is there an option to tell the assembler to show all the lines of the COPYBOOK ?

MfG

Aigor

PS: On VM/370 ASMAHL produce the following LISTING fragment

 0                                      1          COPY  PDPTOP                                                
                                        2 **********************************************************************
                                        3 *                                                                    *
                                        4 *  This macro was written by Paul Edwards                            *
                                        5 *  Released to the public domain                                     *
                                        6 *                                                                    *
                                        7 **********************************************************************
                                        8 **********************************************************************
                                        9 *                                                                    *
                                       10 *  PDPTOP - standard code for the start of every assembler file.     *
                                       11 *                                                                    *
                                       12 *  (version customized for S/370 - see PDPTOP/PDPORIG for original)  *
                                       13 *                                                                    *
                                       14 **********************************************************************
                                       15 *                                                                    
                                       16 * Is the GCC or C/370 calling convention being used?                  
                                       17 *                                                                    
                                       18          GBLC &COMP               Declare compiler switch            
                                       19 &COMP    SETC 'GCC'               Indicate that this is for GCC      
                                       20 *                                                                    
                                       21 * What system are the compiles being done for?                        
                                       22 *                                                                    
                                       23          GBLC &SYS                Declare variable for system        
                                       24 &SYS     SETC 'S370'              Define either S370, S380 or S390    
                                       25 *                                                                    
                                       26 * Which OS are we targetting?                                        
                                       27 *                                                                    
                                       28          GBLC &OS                 Declare compiler switch            
                                       29 &OS      SETC 'CMS'               Indicate that this is for CMS      
  000000                               30          CSECT                                                        
                                       31 * X-var a                                                            
                                       32          ENTRY A                                                      
                                       33 * Program data area                                                  
  000000                               34          DS    0F                                                    
 

Jon Perryman

unread,
May 5, 2023, 9:05:11 PM5/5/23
to Luca Masini, z390
Maybe z390 uses the same method for macro tracing as HLASM. If I remember correctly, I think it was a MTRACE statement to change the macro tracing.

--
You received this message because you are subscribed to the Google Groups "z390" group.
To unsubscribe from this group and stop receiving emails from it, send an email to z390+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/z390/868bf0a3-b16d-4bac-a7d6-36cc15dcc686n%40googlegroups.com.

Abe Kornelis

unread,
May 7, 2023, 5:38:34 AM5/7/23
to Jon Perryman, Luca Masini, z390
Hi Luca,

I've been able to reproduce the issue on my development system. This seems to be some incompatibility in z390. 
I have not been able to locate the root cause of the problem, but I did find (a kind of) a workaround:
- I changed the copy members to parameter-less macros (in the macro directory, of course)
- I modified the assembly invocation to bat\asm D:\temp\ave SYSMAC(D:\temp\mac\*.mac) SYSCPY(D:\temp\cpy\*.cpy) tracem
That is: I modified the paths to match those on my system, removed all remaining parameters, and added TRACEM 
The information you're looking for is in the generated .trm file.

By the way: you wrote you were looking for the assembler source after macro expansion. Just to be pedant:
1) macro expansion and copy execution are different processes
2) for z390 (just like HLASM) there is no such thing as 'after macro expansion'. Macro expansion and assembly occur in a combined phase, which may include look-ahead processing. This is what gives the conditional assembly logic its extreme expressive power. It enables your conditional assembly logic to inspect attributes of items defined on assembler instructions. If we had a strict division of macro processing from assembler processing, this would not be possible.

Op za 6 mei 2023 om 03:05 schreef Jon Perryman <jon.pe...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages