adspace


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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category