How to initialize 20,000 bytes in the Assembler..

Answers were Sorted based on User's Feedback



How to initialize 20,000 bytes in the Assembler....

Answer / saurabh biswas

To initialize a 20000 byte field you have to use MVCL
instruction. Let's say VAR1 is defined as " VAR1 DS XL20000"
For using MVCL instruction you require two even-odd regiter
pair, even registers will contain the destination and
source address respectively, first odd register will
contain the destination leght and from 2nd to 4th byte of
the second odd register will contain the source length and
the first byte will contain filler(it will come into play
if destination lenghth is shorter than source). Now if we
want to initialize VAR1 with spaces we have to code like
following way:

LA R4,VAR1
LA R5,20000
XR R8,R8
XR R9,R9
ICM R9,B'1000',X'40'
MVCL R4,R8

Here source length is 0 and destination length is 20000. So
no move ment will occur and all the 20000 byte will be
filled by the filler wich is space here. So as result of
this instruction all 20000 byte will be initialized by
spaces.

Is This Answer Correct ?    25 Yes 4 No

How to initialize 20,000 bytes in the Assembler....

Answer / roocarlin

since the machine-code for MVC moves up to 256 bytes, you would need to do a series of MVCs to initialize 20000 bytes. this requires that you maintain a register or two to keep track of how far you've progressed through initialization.

possibly, you could get MVCL to do it; i've never tried...

MVCL uses 2 sets of even-odd pairs of registers to do the move.
you specify source address, destination address, length of source, length of destination, and fill character in the registers. the fill-character goes into the high order byte of (I THINK...) the destination length register (in this case r4)
l r4,=f'20000'
l r6,=f'20000'
la r7,source_field
la r5,dest_field
mvcl r4,r6

Is This Answer Correct ?    10 Yes 3 No

How to initialize 20,000 bytes in the Assembler....

Answer / slantt

How about using a 'getmain' for the storage amount? I believe the macro has the capability to set the requested storage to x'00'. Don't forget the 'freemain' if you're done with the storage but not the program. The storage will be freed during program close.

Is This Answer Correct ?    0 Yes 0 No

How to initialize 20,000 bytes in the Assembler....

Answer / king nahiku

fielda DC C20000’ ’

* The requirement is to initialize 20000 bytes
not "reinitialize" 20000 bytes.

* The above statment initializes 20000 bytes of storage to
spaces. The bonus is that it is done at assembly time and
not run time.

Is This Answer Correct ?    4 Yes 13 No

How to initialize 20,000 bytes in the Assembler....

Answer / munna

initalization done by using below code.
MVI datafield,C' '
MVC datafield+1(L'datafield-1),datafield

Is This Answer Correct ?    5 Yes 27 No

Post New Answer

More Assembler Interview Questions

WHAT WILL HAPPEN IF WE DROP THE BASE REGISTER IN THE PGM WHICH CONTAINS ONLY ONE BASEREG?

4 Answers   IBM, Tech Mahindra,


What is maximum displacement and how to cross this limit?

0 Answers  


What is need of start 0? In steed of can we use anyother numerics? If we use what will happen?

0 Answers  


What does "using" do?

0 Answers  


what is need of START 0?. In steed of '0' can we use any other numerics?. if we use what will happen?.

4 Answers   CSC, TCS,






What is house keeping in assembler?

0 Answers  


How do you initialize a register to 0000?

10 Answers   HCL,


Write the fetch cycle and execute cycle for following instructions:JMPNZ (jump to the given address if the accumulator not equal to zero) RET(return from a subroutine) ADB (add the contents of register B to the accumulator and save result in the accumulator).

1 Answers  


How to initialize 20,000 bytes in the Assembler..

5 Answers   Amdocs, IBM,


How are data passed from JCL parm to assembler program. And how is data passed from a calling program to an assembler called program.

3 Answers   HCL, IBM,


What is the use of TRT instruction and how it is working?

7 Answers   HCL, IBM, Wipro,


How many maximum base registers we can have in a program?

0 Answers  


Categories