大型机汇编(mainframe assembler/HLASM)之显示变量值('DISPLAY' in COBOL)
2012-10-19 15:46
411 查看
In COBOL, we can use DISPLAY to display some variable's value; Instead, we can issue macro WTO(Write To Operator) in assembler to meet it.
WTO MF=(E,LISTMSG1) LTR R15,R15 IS REG-15 = ZERO... BNZ ABEND4 IF NOT, ABEND... * LA R8,LISTMSG2 WTO MF=(E,(R8)) LTR R15,R15 IS REG-15 = ZERO... BNZ ABEND4 IF NOT, ABEND... * *********************************************************************** * WTO using the EXECUTE format with user-coded WTO buffer. This * routine illustrates the use of a single WTO to display different * messages. * BAL R3,DOMSG DISPLAY MESSAGE, RETURN VIA R3 MVC WTOTEXT(76),WTOMSG1 BAL R3,DOMSG DISPLAY MESSAGE, RETURN VIA R3 MVC WTOTEXT(76),WTOMSG2 BAL R3,DOMSG DISPLAY MESSAGE, RETURN VIA R3 * * *********************************************************************** * WTO using the EXECUTE format with user-coded WTO buffer. This * routine illustrates the use of a single WTO to display different * messages. This will cause a length error with WTO execution. * WTO MF=(E,WTOCRASH) LTR R15,R15 IS REG-15 = ZERO... BZ ABEND4 THEN ABEND, SHOULD BE 4... B EOJ * * *********************************************************************** * Common WTO routine to display WTOBLOCK... * DOMSG EQU * WTO MF=(E,WTOBLOCK) LTR R15,R15 IS REG-15 = ZERO... BNZ ABEND4 IF NOT, ABEND... BR R3 Return via Register 3 *********************************************************************** * Return to caller * EOJ EQU * WTO '* ASMWTOA1 is FINISHED...' RETURN (14,12),RC=0 *********************************************************************** * Abnormal termination of program * ABEND4 EQU * WTO '* ASMWTOA1 MLC, is ABENDING, RC=4...' RETURN (14,12),RC=4 *********************************************************************** * The following is an example of a user-coded WTO buffer. * CNOP 0,4 WTOBLOCK DC Y(80,0) * For WTO, the first length of WTO buffer, the second should be binary zeroes. WTOTEXT DC CL76'* ASMWTOA1 WTO with user-coded buffer...' *********************************************************************** * The following is an example of a user-coded WTO buffer that will * cause an error conditions, length of text exceeds 251 bytes. CNOP 0,4 WTOCRASH DC Y(512,0) WTOCTEXT DC CL76'* ASMWTOA1 WTO FOR CRASH TEST...' * DC 436CL1'X' * END Remember, this maybe not the best way to display the contents. ie, how to display all the regs' value at the any time within one program when you debug? Pls refer to ANOTHER subject... Thanks.
MAIN CSECT USING *,12 STM 14,12,12(13) LR 12,15 ST 13,SAVE+4 LA 13,SAVE START EQU * WTO MF=(E,WTOBLOCK) EXIT EQU * L 13,SAVE+4 LM 14,12,12(13) LA 15,0 BR 14 WTOBLOCK DC Y(L'DEF+4,0) DEF DC C'HELLO WORLD' SAVE DS 18F END MAIN
please remember the contents will be displayed in the JESYSMSG data set.
有疑问请联系QQ349106216
相关文章推荐
- 大型机汇编(mainframe assembler/HLASM)之COBOL解惑
- 大型机汇编(mainframe assembler/HLASM)之显示内存实际数据
- 大型机汇编(mainframe assembler/HLASM)之BAS指令
- 大型机汇编(mainframe assembler/HLASM)之经典面试题
- 大型机汇编(mainframe assembler/HLASM)之线程工作栈
- 大型机汇编(mainframe assembler/HLASM)之藏巧于拙
- 大型机汇编(mainframe assembler/HLASM)之S0C4解读
- 大型机汇编(mainframe assembler/HLASM)之C++语言对应
- 大型机汇编(mainframe assembler/HLASM)之加密与解密
- 大型机汇编(mainframe assembler/HLASM)之STCK/STCKE
- 大型机汇编(mainframe assembler/HLASM)之LOCTR
- 大型机汇编(mainframe assembler/HLASM)之DUMP解读
- 大型机汇编(mainframe assembler/HLASM)之RECFM=VBA
- 大型机汇编(mainframe assembler/HLASM)之Branch
- 大型机汇编(mainframe assembler/HLASM)之S0C7错误
- 大型机汇编(mainframe assembler/HLASM)之中断向量表
- 大型机汇编(mainframe assembler/HLASM)之CICS调用
- 大型机汇编(mainframe assembler/HLASM)之代码精简高效
- 大型机汇编(mainframe assembler/HLASM)之代码loop篇
- 大型机汇编(mainframe assembler/HLASM)之LA指令