DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad) 
Author Message
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)


It took me a while to realize that below is at least a variant of the code that first woke
Cory up to the Year 2000 problem. In 1978 it was supposed to file the table with x'0001979F'
x'0001980F' x'0001981F' and x'0001982F'.  Unfortunately the last three values became x'000197AF'
x'000197BF' and x'000197CF'.  Add packed or EDIT doesn't do too well with those values (can you
say S0C7?).  Assuming that this routine could be executed multiple times and that somehow
count could be changed between executions I think the following would be faster.sumemc 0r7  
     ZAP SLOTS,=P'1' (note that the length of Slots for ZAP and AP purposes is 4, not
*                      16)
     MVC SLOTS+4(12),SLOTS   propagate the value of one by overlapping move
     AP  SLOTS,COUNT         Add count to the first value.
     AP  SLOTS+4(4),SLOTS    Add the incremented count to the second value
     AP  SLOTS+8(4),SLOTS+4(4)  And so forth
     AP  SLOTS+12(4),SLOTS+8(4)
     OI  SLOTS+3,X'0F'       Force F zones on results
     OI  SLOTS+7,X'0F'
     OI  SLOTS+11,X'0F'
     OI  SLOTS+15,X'0F'

Granted this would take 9 more bytes (11 bytes if the unnecessary XR were eliminated) including
the constant but should take the same or less CPU time and it would give decimal results.  Also
there was no provision for chaining the save area, i.e.
      LA R1,SAVE
      ST R1,8(,R13)
      LR R13,R1


<snip>  Note the following included text has been edited to not look like included text
to my email package

 You geeks have had too easy a time, here's some homework for you:

 //ASM    JOB (1234,5678),'C.S.Y2K',CLASS=A,MSGLEVEL=(1,1)
 //       EXEC  ASMFCLG
 //ASM.SYSIN  DD *
 R10      EQU   10
 R11      EQU   11
 R12      EQU   12
 R13      EQU   13
 R14      EQU   14
 R15      EQU   15
 R0       EQU   0
 R1       EQU   1
 R2       EQU   2
 R3       EQU   3
 R4       EQU   4
 R5       EQU   5
 STCK     CSECT
          SAVE  (14,12),,STCK..&SYSDATC
          BALR  R12,0               INIT BASE
          USING *,R12               ADDRESS
          ST    R13,SAVE+4          SAVE OLD SAVE
          LA    R13,SAVE            COPY IN NEW SAVE
 *...
          XR    R4,R4
          L     R4,COUNT
          SRL   R4,4               SHIFT OUT THE SIGN
 *...
          LA    R3,3               R3 = 3
          LA    R5,SLOTS           R5 = &SLOTS
 DOLOOP   DS    0H
          LA    R4,1(,R4)          INCREMENT YEAR BY ONE
          LR    R2,R4              R2 = R4
          SLL   R2,4              
 *...
          ST    R2,0(,R5)          *SLOT = R2
          OI    3(R5),X'0F'        
          LA    R5,4(,R5)          SLOT++
          BCT   R3,DOLOOP          R3--; IF R3 > 0 GOTO DOLOOP;
 EXIT     DS 0H
          L     R13,SAVE+4         RELOAD OLD SAVE
          DC    XL2'0000'          ABEND.
          RETURN (14,12),RC=0
          EJECT
 SAVE     DS 18F
 COUNT    DC PL4'1978'    
 SLOTS    DS 4F
          END     STCK
 //GO.SYSUDUMP DD SYSOUT=A

End included text  

Clark F. Morris, Jr.
CFM Technical Programming Services




Tue, 08 Aug 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)


Yes, unfortunately I don't have a copy of the original code.  I wish I did.

Quote:
>It took me a while to realize that below is at least a variant of the code that first woke
>Cory up to the Year 2000 problem. In 1978 it was supposed to file the table with x'0001979F'
>x'0001980F' x'0001981F' and x'0001982F'.  Unfortunately the last three values became x'000197AF'
>x'000197BF' and x'000197CF'.  Add packed or EDIT doesn't do too well with those values (can you
>say S0C7?).  Assuming that this routine could be executed multiple times and that somehow
>count could be changed between executions I think the following would be faster.sumemc 0r7  
>     ZAP SLOTS,=P'1' (note that the length of Slots for ZAP and AP purposes is 4, not
>*                      16)
>     MVC SLOTS+4(12),SLOTS   propagate the value of one by overlapping move
>     AP  SLOTS,COUNT         Add count to the first value.
>     AP  SLOTS+4(4),SLOTS    Add the incremented count to the second value
>     AP  SLOTS+8(4),SLOTS+4(4)  And so forth
>     AP  SLOTS+12(4),SLOTS+8(4)
>     OI  SLOTS+3,X'0F'       Force F zones on results
>     OI  SLOTS+7,X'0F'
>     OI  SLOTS+11,X'0F'
>     OI  SLOTS+15,X'0F'

-Gasp- You've looked at the output of too many optimizing compilers.

For c.s.y2k'ers,  Clark is 'unrolling the loop', trading space for time.

Quote:
>Granted this would take 9 more bytes (11 bytes if the unnecessary XR were eliminated) including
>the constant but should take the same or less CPU time and it would give decimal results.  Also
>there was no provision for chaining the save area, i.e.
>      LA R1,SAVE
>      ST R1,8(,R13)
>      LR R13,R1

>Clark F. Morris, Jr.
>CFM Technical Programming Services



I'm glad that people are jumping in with technique contributions.  I'm
concentrating on jump-starting non-assembler programmers into being able to
debug dumps.

cory hamasaki



Tue, 08 Aug 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)


   [ snipped ]

:>     OI  SLOTS+3,X'0F'       Force F zones on results
:>     OI  SLOTS+7,X'0F'
:>     OI  SLOTS+11,X'0F'
:>     OI  SLOTS+15,X'0F'

Can be done in one instruction:

       OC  SLOTS,SIGNMASK

SIGNMASK  DC  4X'0000000F'

   [ snipped ]

--


Director, Dissen Software, Bar & Grill - Israel



Tue, 08 Aug 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)

Quote:


>    [ snipped ]

> :>     [ snipped ]

> Can be done in one instruction:

>           OC  SLOTS,SIGNMASK

> SIGNMASK  DC  4X'0000000F'

>    [ snipped ]

Except that it's better if you align SIGNMASK appropriately (yes, I
know that off-boundary stuff is handled well by most 390s, but it
doesn't hurt to help the poor machine if you're really really worred
about nanoseconds):

         DS    0D            (0F if you're a little tight on space)
SIGNMASK DC    X'0000000F'

I would probably have written the "OC" instruction in the slightly
more obscure style of:

         OC   SLOTS,=A(X'F',X'F',X'F',X'F')

--
Peter Ludemann          +1.650.813.6806  (fax: +1.650.813.7400)

Inxight Software, Inc.  http://www.inxight.com
PAHV 118, 3400 Hillview Ave., Palo Alto, CA 94304



Tue, 08 Aug 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)

: :>     OI  SLOTS+3,X'0F'       Force F zones on results
: :>     OI  SLOTS+7,X'0F'
: :>     OI  SLOTS+11,X'0F'
: :>     OI  SLOTS+15,X'0F'

: Can be done in one instruction:

:        OC  SLOTS,SIGNMASK

: SIGNMASK  DC  4X'0000000F'

Better put an explicit length on there:

        OC   SLOTS(16),SIGNMASK

and then we use a literal to make things clearer:

        OC   SLOTS(16),=4X'0000000F'

--





Fri, 11 Aug 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)

Quote:




> >: :>     OI  SLOTS+3,X'0F'       Force F zones on results
> >: :>     OI  SLOTS+7,X'0F'
> >: :>     OI  SLOTS+11,X'0F'
> >: :>     OI  SLOTS+15,X'0F'

> >: Can be done in one instruction:

> >:        OC  SLOTS,SIGNMASK

> >: SIGNMASK  DC  4X'0000000F'

> >Better put an explicit length on there:

> >       OC   SLOTS(16),SIGNMASK

> >and then we use a literal to make things clearer:

> >       OC   SLOTS(16),=4X'0000000F'

> >--



> If you are going to use a literal, do it this way (forces FW alignment):

>           OC   SLOTS(16),=4F(15)  MASK=X'0000000F'

I'm pretty certain (95%+) that the Assembler (H or HLASM) will generate the
4-byte literal on a fullword boundary. Dredging up from memory, the literal
pool starts with 8-byte literals on doubleword boundaries, 4-byte literals
on fullword and 2-byte literals on halfword boundaries. The rest go on a
byte boundary.

In my experience a 4-byte literal has always been on a fullword boundary (I
always have the ALIGN option set, if that matters). If I remember to when
I'm next on my employer's system, I'll check this out to be 100% (or 0%,
just to be fair).

Bill {*filter*}



Fri, 01 Sep 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)





: >
: >: :>     OI  SLOTS+3,X'0F'       Force F zones on results
: >: :>     OI  SLOTS+7,X'0F'
: >: :>     OI  SLOTS+11,X'0F'
: >: :>     OI  SLOTS+15,X'0F'
: >
: >: Can be done in one instruction:
: >
: >:        OC  SLOTS,SIGNMASK
: >
: >: SIGNMASK  DC  4X'0000000F'
: >
: >Better put an explicit length on there:
: >
: >  OC   SLOTS(16),SIGNMASK
: >
: >and then we use a literal to make things clearer:
: >
: >  OC   SLOTS(16),=4X'0000000F'

: If you are going to use a literal, do it this way (forces FW alignment):

:           OC   SLOTS(16),=4F(15)  MASK=X'0000000F'

Literals with a length that is a multiple of four are always fullword
aligned.

--





Sat, 02 Sep 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)

Quote:



> > If you are going to use a literal, do it this way (forces FW alignment):

> >          OC   SLOTS(16),=4F(15)  MASK=X'0000000F'

> Nitpick mode:

>            OC   SLOTS(16),=4A(15)  MASK=X'0000000F'

> or

>            OC   SLOTS(16),=4F'15'  MASK=X'0000000F'

> Personally, I prefer the former, which could also be written:

>            OC   SLOTS(16),=4A(B'1111')   FORCE PACKED SIGNS TO F

> for slightly greater clarity.

With it all said and done, I've decided I prefer:

        OI    SLOT1+3,X'F'
        OI    SLOT2+3,X'F'
        OI    SLOT3+3,X'F'
        OI    SLOT4+3,X'F'

Seems tidy to me, plus, no ambiguity (that I can see). The 4 fullwords
are 16 bytes, just like the 4 OR Immediates.

Bill {*filter*}

- Show quoted text -

Quote:
> --




Sat, 02 Sep 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)

I have to agree with you about the four OI's. I kinda prefer coding hex as
pairs of digits though.

Roy

Quote:
> -- snip --
> With it all said and done, I've decided I prefer:

>         OI    SLOT1+3,X'F'
>         OI    SLOT2+3,X'F'
>         OI    SLOT3+3,X'F'
>         OI    SLOT4+3,X'F'

> Seems tidy to me, plus, no ambiguity (that I can see). The 4 fullwords
> are 16 bytes, just like the 4 OR Immediates.

> Bill {*filter*}



Sat, 02 Sep 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)



Quote:
> If you are going to use a literal, do it this way (forces FW alignment):

>          OC   SLOTS(16),=4F(15)  MASK=X'0000000F'

Nitpick mode:

           OC   SLOTS(16),=4A(15)  MASK=X'0000000F'

or

           OC   SLOTS(16),=4F'15'  MASK=X'0000000F'

Personally, I prefer the former, which could also be written:

           OC   SLOTS(16),=4A(B'1111')   FORCE PACKED SIGNS TO F

for slightly greater clarity.

--



Sun, 03 Sep 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)


Quote:

>: If you are going to use a literal, do it this way (forces FW alignment):

>:           OC   SLOTS(16),=4F(15)  MASK=X'0000000F'
>Literals with a length that is a multiple of four are always fullword
>aligned.

And if you want to keep it in hex because in the general case it might
not be as simple as 15, try:

         OC  SLOTS(16),=4A(X'0000000F')
--


Eastern time.    I speak for myself & my dogs only.        VM'er since CP-67
Canines:Val(Chinook,CGC,TT),Red(Husky,(RIP)),Shasta(Husky,TT) Owner:Chinook-L



Sun, 03 Sep 2000 03:00:00 GMT  
 DC Y2K Weather Report (ALC 9, power, Time Machines, How Bad)


Quote:
>>        OC   SLOTS(16),=4X'0000000F'
>If you are going to use a literal, do it this way (forces FW alignment):

>          OC   SLOTS(16),=4F(15)  MASK=X'0000000F'

The literal will be fullword aligned regardless of whether you use F
or X.

Tony Harminc



Mon, 04 Sep 2000 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. DC Y2K Weather Report (Real GPS, ICBMs, ALC, 250K grant)

2. Available: DC Y2K Weather Report #17

3. DC Y2K Weather Report #3

4. DC Y2K Weather Report # 7

5. DC Y2K Weather Report # 4

6. gatherwrite Re: DC Y2K Weather Report # 4

7. DC Y2K Weather Report # 7

8. Available: DC Y2K Weather Report #17

9. DC Y2K Weather Report # 7

10. DC Y2K Weather Report #6

11. DC Y2K Weather Report # 4

12. DC Y2K Weather Report # 11

 

 
Powered by phpBB® Forum Software