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?



In the house keeping section of an MVS assembly language program, like the one below STM R14,R12,12..

Answer / Raj Ratna Singh

1. In an MVS assembly program, the USING directive is typically used after BASR (Base Register) to set the base address for the specified register. If you omit the USING directive before BASR, it won't cause an error, but the base address may not be properly set, making the following instructions potentially incorrect or inefficient.

2. Yes, the USING directive tells the assembler to treat a specific register as a base register with the mentioned base address (in this case, the current location counter). The purpose of BASR R12,R0 is to set the register R12 as the base register with the current location counter as its base address.

3. In your example code, there's no issue with address resolution because you are using LA (Load Address) instructions to load an absolute address into a register, bypassing the need for indirect addressing via the base register. However, it might not be the most efficient way in terms of memory usage or performance, since you could potentially overwrite important data stored in other parts of memory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Assembler Interview Questions

What is house keeping in assembler?

1 Answers  


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

1 Answers  


How we can Pass the parameters from JCL to assembler Pgm?

4 Answers   Tech Mahindra,


What is symbol table in assembler?

2 Answers   HCL,


How is data passed from a calling program to an assembler called program?

1 Answers  


How do you round the addition or subtraction of two numbers in assembler? what does the following code do? AP WKUR,=P'5' where WKUR is a label

3 Answers   CSC, IBM,


Explain the difference between various read and find statement?

1 Answers  


What is need of start 0?

1 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,


what is need of start 0? In steed of

1 Answers   IBM,


change process tool( code changes from dev to prd) The changes made to your code should be effected in live. how the process takes place. that is how can you move the code changes from development to production.

1 Answers   EDS,


Explain how to produce soc7 abend?

1 Answers  


Categories