admin 管理员组文章数量: 887021
2024年1月16日发(作者:python字符串格式化)
HELLO TITLE 'ASSEMBLER DEMONSTRATION PROGRAM.'
*********************************************************************
* PROGRAM: HELLO. *
* PURPOSE: DEMONSTATION ASSEMBLER PROGRAM *
* DESIGN : HUNTER *
* DATE : APRIL, 2005 *
* DESCRIPTION: *
* 1. COMPILE. *
* USE FOLLOWING SAMPLE JCL TO COMPILE THE PROGRAM *
* *
* //JOBCARD ... *
* //COMPILE EXEC ASMACL *
* // DD DISP=SHR,DSN=(HELLO) <--CHANGE *
* // DD DISP=SHR,DSN= *
* // DD DISP=SHR,DSN= *
* //D DD DISP=SHR,DSN=B <--CHANGE *
* // DD * *
* NAME HELLO(R) *
* /* *
* *
* 2. RUN *
* THE PROGRAM NEEDS SYSPRINT DD TO SHOW THE MESSAGE. *
* *
* //JOBCARD ... *
* //HELLO EXEC PGM=HELLO *
* //STEPLIB DD DISP=SHR,DSN=B *
* //SYSPRINT DD SYSOUT=* *
* *
* 3. SAMPLE OUTPUT *
* THE SAMPLE OUTPUT WILL BE: *
* HELLO, THE WORLD! *
* *
*********************************************************************
HELLO CSECT
* DEFINE REGISTER EQUALS USING IBM STANDARD MACRO YREGS *
YREGS
* BUILD UP BASE REGISTERS FOR THE PROGRAM *
USING HELLO,R15 ;R15 IS CURRENT ADDRESS, USING IT
SAVE (14,12) ;SAVE CALLER'S REGISTERS USING SAVE
LR R12,R15 ;COPY THE CURRENT CSECT LOCATION
DROP R15 ;DROP THE TEMPORARY USING
USING HELLO,R12 ;USE R12 AS BASE REG FROM NOW ON
* BUILD LINKAGE OF THIS PROGRAM AND THE CALLER.
ST R13,SAVEAREA+4 ;SET OUR BACKWARD LINK IN OUR SAVE
LA R15,SAVEAREA ;LOAD ADDR OF OUR SAVEAREA TO R15
ST R15,8(R13) ;SET CALLER(MYSELF)'S FORWARD LINK
LR R13,R15 ;LOAD OUR SAVEAREA ADDR TO R13.
* MAIN PROGRAM BEGINS HERE
OPEN (SYSPRINT,(OUTPUT)) ;OPEN THE SYSPRINT FILE.
PUT SYSPRINT,HELLOMSG ;WRITE THE MESSAGE
CLOSE SYSPRINT ;CLOSE SYSPRINT FILE
* RETURN LINKAGE TO THE CALLER
L R13,4(R13) ;LOAD ADDR OF CALLER'S SAVEAREA
RETURN (14,12),RC=0 ;RESTORE CALLER'S REGS AND RETURN
* STATIC STORAGE AREA
SAVEAREA DS 18F ;REGISTER SAVE AREA
HELLOMSG DC CL133' HELLO, THE WORLD!'
SYSPRINT DCB DSORG=PS,MACRF=PM,DDNAME=SYSPRINT,RECFM=FBA,LRECL=133
END HELLO
第三步、编译汇编程序”HELLO”
版权声明:本文标题:主机OS390汇编程序入门篇 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1705358591h482511.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论