"glen herrmannsfeldt" <gah@[EMAIL PROTECTED]
> wrote in message
news:K6adncbiMeI98njfRVn-pA@[EMAIL PROTECTED]
> Michel Castelein wrote:
>> A DC or DS instruction with a zero duplication factor forces boundary
>> alignment, even when the NOALIGN assembler option is in effect.
>> At the other hand, IMHO, the assembler always aligns machine
instructions
>> on a halfword boundary.
>> So, I'm wondering why the expansion of the SAVE macro begins with a DS
>> 0H.
>> That's redundant, isn't it?
>> Or are there some historical reasons? If yes, which ones?
>> The first one to provide me with the correct information will receive a
>> copy of my new assembler course.
> I believe my first posted answer is correct, and the later one includes
> source from the OS/360 SAVE macro to help verify it.
> Is the offer still active?
> -- glen
I found the answer to my question.
It was actually a "psychological problem".
One assumes the SAVE macro, if used, to be always coded at the very
beginning of a program source.
But what happens if the program starts with an eye catcher (i.e. data)!?!
Case 1:
MYPGM CSECT
DC 'some eye catcher'
XXX STM R14,R12,12(R13)
...
YREGS
END XXX
Whether the eye catcher consists of an even or odd number of bytes,
doesn't
matter.
The assembler automatically aligns machine instructions on 2-byte
boundaries, so XXX is always a valid entry point.
Case 2:
MYPGM CSECT
B XXX (branch around eye catcher)
DC 'some eye catcher'
XXX EQU *
STM R14,R12,12(R13)
...
YREGS
END
If the eye catcher consists of an odd number of bytes, boundary alignment
will cause the assembler to insert one zero byte immediately AFTER XXX
(i.e.
between XXX and the STM instruction).
So, in that case, XXX is NOT aligned on a halfword boundary and can
therefore not be used as branch address!
In MVS-OS/390-z/OS, a specification exception yields a S0C6 ABEND.
Case 3:
MYPGM CSECT
B XXX (branch around eye catcher)
DC 'some eye catcher'
XXX DS 0H
STM R14,R12,12(R13)
...
YREGS
END
Now, boundary alignment may cause one zero byte to be inserted immediately
BEFORE XXX.
XXX will always represent an even address.
So this code is O.K.
Conclusion:
DS 0H is not used to align machine instructions (because that is done
systematically), it is used to align branch addresses.
Anyhow, since you were that kind to reply, you're the one who will get a
copy of my new assembler course.
A little bit patience, it isn't completed yet.
Kind regards,
Michel
--------------------------------------------------
Michel Castelein - Arcis Services
MVS-OS/390-z/OS system engineer & instructor
arcisATadvalvasDOTbe
http://www.geocities.com/michelcastelein/


|