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 does LA R3,R3 ?

1 Answers   Amdocs,


What is house keeping in assembler?

0 Answers  


Explain the difference between various read and find statement and which one should be used when for better adabas performance?

0 Answers  


HOW MANY MAXIMUM BASE REGISTERS WE CAN HAVE IN A PROGRAM AND ALSO HOW MANY MAXIMUM BASE REGISTERS WE CAN HAVE IN A SINGLE PROGRAM.

5 Answers   IBM, TCS,


about ICM instruction.

4 Answers   EDS,






What does "using" do?

0 Answers  


What is house keeping in assembler? And explain the following code HELLOTSO START 0 * PRINT NOGEN BEGIN SAVE (14,12) LR 12,15 USING TYPE,12 ST 13,SAVE+4 LA 11,SAVE ST 11,8(13) LR 13,11

6 Answers   Mind Tree,


What is the difference in data type "X" and "P"?

5 Answers  


What is maximum displacement and how to cross this limit?

0 Answers  


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

0 Answers  


In the house keeping section of an MVS assembly language program, like the one below STM R14,R12,12(R13) BASR R12,R0 USING *,R12,R11 LA R11,2048 LA R11,2048(R11,R12) .... .... 1. What if BASR R12,R0 IS NOT PRECEDE USING *,R12,R11? 2. USING (base address), REGISTER does USING directive says assembler to treat particular Register as a base register with the mentioned base address..in the above case * i.e current location counter..well if that is the case why we need BASR R12,R0 ? 3. What if I write like STM R14,R12,12(R13) BASR R12,R0 LA R11,2048 LA R11,2048(R11,R12) USING *,R12,R11 there is no address resolution being calculated in both LA statements so is it a right way to set Base register?..will there be any issues with Domain regarding R11 and R12?

0 Answers  


How to pass instream data in sysin with Assembler?

2 Answers   ANZ, IBM,


Categories