Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to modify this program in assembly language to have this output. Hi! I can count very fast. 00000001 00000002 00000003 00000004 00000005 00000006

I need to modify this program in assembly language to have this output.

Hi! I can count very fast.

00000001

00000002

00000003

00000004

00000005

00000006

00000007

00000008

00000009

00000010

//ASMPGM JOB 1,NOTIFY=&SYSUID

//ASMPGM EXEC ASMACL,MBR=ASMPGM

//C.SYSIN DD *

ASMPGM TITLE 'contest program'

ASMPGM CSECT

*--------------------------------------------------------------------*

* register equates *

*--------------------------------------------------------------------*

R0 EQU 0 register 0

BASEREG EQU 12 base register

SAVEREG EQU 13 save area register

RETREG EQU 14 caller's return address

ENTRYREG EQU 15 entry address

RETCODE EQU 15 return code

EJECT

*---------------------------------------------------------------------*

* standard entry setup, save area chaining, establish *

* base register and addressibility *

*---------------------------------------------------------------------*

USING ASMPGM,ENTRYREG establish addressibility

B SETUP branch around eyecatcher

DC CL8'ASMPGM' program name

DC CL8'&SYSDATE' program assembled date

SETUP STM RETREG,BASEREG,12(SAVEREG) save caller's regs

BALR BASEREG,R0 establish base register

DROP ENTRYREG drop initial base register

USING *,BASEREG establish addressibilty

LA ENTRYREG,SAVEAREA point to this program save area

* ST SAVEREG,16(,14) error

ST SAVEREG,4(,ENTRYREG) save address of caller

ST ENTRYREG,8(,SAVEREG) save address of this program

LR SAVEREG,ENTRYREG point to this program savearea

EJECT

*--------------------------------------------------------------------*

* program body *

*--------------------------------------------------------------------*

OPEN (PRTLINE,OUTPUT)

MVC LINE(26),MSGX

PUT PRTLINE,LINE

MVC LINE,BLANK

LOOPINIT DS 0H

SR 2,2

L 2,=F'10'

L 3,=F'1'

LOOP DS 0H

CVD 3,PACKAREA

UNPK OUT,PACKAREA

MVC LINE(8),OUT

MVZ LINE+7(1),LINE

A 3,=F'1'

PUT PRTLINE,LINE

BCT 2,LOOP

CLOSE (PRTLINE)

*--------------------------------------------------------------------*

* standard exit - restore caller's registers and *

* return to caller *

*--------------------------------------------------------------------*

EXIT DS 0H halfword boundary alignment

L SAVEREG,4(,SAVEREG) restore caller's save area addr

L RETREG,12(,SAVEREG) restore return address register

LM R0,BASEREG,20(SAVEREG) restore all regs. except reg15

BR RETREG return to caller

EJECT

*--------------------------------------------------------------------*

* storage and constant definitions. *

* print output definition. *

*--------------------------------------------------------------------*

LINE DS 0CL80

DC C' '

DC CL79' '

PRTLINE DCB DSORG=PS,DDNAME=PRINT,MACRF=PM, X

RECFM=FB,LRECL=80

OUT DC X'4040404040404040'

MSGX DC CL26'Hi! I can count very fast.'

BLANK DC CL80' '

PACKAREA DC D'0'

SAVEAREA DC 18F'-1' register save area

END ASMPGM

//GO EXEC PGM=ASMPGM

//STEPLIB DD DSN=&SYSUID..LOAD,DISP=SHR

//PRINT DD DSN=&SYSUID..P2.OUTPUT(MYOUTPUT),DISP=SHR

//SYSUDUMP DD SYSOUT=A

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

-16/20 Simplify by hand.

Answered: 1 week ago

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago

Question

What are oxidation and reduction reactions? Explain with examples

Answered: 1 week ago