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”


本文标签: 字符串 编译 作者 汇编程序