"John Small" <zjsmallz@[EMAIL PROTECTED]
> wrote in message
news:4rkzjBzzMnpe-pn2-1LdB81iqud8e@[EMAIL PROTECTED]
> On Sat, 23 Jun 2007 16:29:06 UTC, Steve Myers <noone@[EMAIL PROTECTED]
>
> wrote:
>
>> SkippyPB wrote:
>> > On Fri, 22 Jun 2007 17:07:32 -0400, Steve Myers <noone@[EMAIL PROTECTED]
>
>> > wrote:
>> >
>> >> SkippyPB wrote:
>> >>> On Fri, 22 Jun 2007 01:35:53 -0700, Karan <maranmeetsu@[EMAIL PROTECTED]
>
>> >>> wrote:
>> >>>
>> >>>> Can any one give me the source for macros in assembler with
>> >>>> examples?
>> >>> Most IBM Assembler text books can give you this information.
Here's
>> >>> a
>> >>> simple Macro for getting the system date:
>> >>>
>> >>> MACRO
>> >>> &LABEL GETDATE &FLD
>> >>> * THE OPERAND FIELD SHOULD BE AT LEAST 4 BYTES
>> >>> &LABEL TIME
>> >>> MVC &FLD.(4),0(1)
>> >>> MEND
>> >>>
>> >> Now, if it was only right. Reg 1 contains a date after TIME, not
>> >> the address of the date.
>> >
>> > I believe it is right. The MVC would move the contents of the data
>> > addressed by at 0(1) into the 4 bytes at &fld.
>> >
>>
>> Actually, we're both right, sort of. See
>>
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2A971/75.5.5?SHELF=IEA2BK71&DT=20070126061230&CASE=
>>
>> According to that, the contents of reg 1 are unpredictable if
>> TIME is used the way you showed.
>
> That's not how I read it. According to the page you cite and other
> related pages,
> 1) the default parameter is DEC
> 2) there is no cir***stance that causes the address of the date to be
> returned in register 1
> 3) register 1 is either undefined or it contains the date. This is
> unclear becuase on the page you cite it says this but on another page
> it states unequivocably that "The date is returned in register 1 as
> packed decimal digits of the form..."
>
> So the
> MVC &FLD.(4),0(1)
> cannot be correct according to these docs. If register 1 contains the
> date, then
> ST 1,&FLD
> would be a way to have the macro store it in &FLD.
Never use ST in situations like this (when the alignment of &FLD
is unknown), use STCM instead:
STCM 1,B'1111',&FLD
regards Sven


|