IBM Assembly 中的 END OF MEMBER 有什么用

What use is END OF MEMBER In IBM Assembly

我正在解析一些 IBM 汇编语言,它也恰好是 BMS 映射。

代码如下所示:

         DFHMSD TYPE=FINAL
         END
END OF MEMBER

END OF MEMBER 语句未在大型机上引起任何语法错误。

为什么它在语法上是正确的?

END OF MEMBER 行提供什么功能?

HLASM 参考指出:

If the END statement is not the last statement in the input stream, and the BATCH option has been specified, the assembler initiates assembly of a new source module when the current assembly is completed.

因此,除非将 BATCH 指定为汇编程序选项,否则一旦达到 END 语句,处理就应该停止。

您还应该能够在您的汇编列表中看到:打印的源代码列表应该在 END-语句处停止,END OF MEBER 不应出现在那里。

所以END OF MEMBER似乎没有用,但应该也没有坏处...

我尝试 assemble 您在问题中提供的内容,这是我发现的内容。

我的示例源代码是:

EOS 来源

EOS      CSECT         
         SR    15,15   
         BR    14      
         END   EOS     
END OF MEMBER          

组装源代码时,assemble 步骤以 return 代码 8 完成。但是,它似乎已经处理了源代码直到 END EOS 陈述。然后它开始将以下文本作为不同的模块处理。

汇编输出列表

  Active Usings: None                                               
  Loc  Object Code    Addr1 Addr2  Stmt   Source Statement          
                                  1 *                           
000000                00000 00004     2 EOS      CSECT              
000000 1BFF                           3          SR    15,15        
000002 07FE                           4          BR    14           
000000                                5          END   EOS          

                                  Diagnostic Cross Reference and Assembler Summary

     No Statements Flagged in this Assembly                                     
HIGH LEVEL ASSEMBLER, 5696-234, RELEASE 6.0, PTF UI50739     

有趣的是,在导致 return 代码为 8 的同一汇编步骤中,我得到了一组独立于第一个 CSECT 的错误。请注意 END OF MEMBER 的行号为 1。这些错误是:

语句错误 post END

   Active Usings: None                                               
   Loc  Object Code    Addr1 Addr2  Stmt   Source Statement          
                                       1 END OF MEMBER               
 ** ASMA057E Undefined operation code - OF                           
 ** ASMA435I Record 6 in USER1.TEST.CNTL(EOS) on volume: T70502      
 ** ASMA140W END record missing                                      
 ** ASMA435I Record 6 in USER1.TEST.CNTL(EOS) on volume: T70502   

在这种情况下,assembled 并生成了 CSECT 没有问题,您可以 link 模块,但显然这是后续步骤的问题。

HLASM 文档中对语句 END OF MEMBER 的唯一引用是它是 HLASM exit processing 的一部分。

The END OF MEMBER call simplifies stack management required in coding a LIBRARY exit which contains READs and FINDs. The exit might use the information provided by this call in the handling of nested FINDs where there is typically a corresponding resume FIND (options=2) for every nested FIND (options=3). For an example of how you can use END OF MEMBER calls to perform stack management, see the code example Use End of Member calls to perform stack management in TERM exit—TRMEXIT.

它不是汇编源代码的有效语法。