How to initialize 20,000 bytes in the Assembler..
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
What is the difference between various read and find statement,and which one should be used when for better adabas performance ?
explain icm instruction?
what is need of START 0?. In steed of '0' can we use any other numerics?. if we use what will happen?.
Explain about base register?
WHAT WILL HAPPEN IF WE DROP THE BASE REGISTER IN THE PGM WHICH CONTAINS ONLY ONE BASEREG?
Ap wkur,=p5 where wkur is a label?
how to retrieve the instream data in sysin?
Explain the difference in data type "x" and "p"?
Explain about house keeping in assembler?
What is need of start 0?
How to initialize 20,000 bytes in the Assembler..
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