> From: ian@beathoven.com (paramucho)
> Subject: MACRO March 5, 2005
> Date: Sat, 05 Mar 2005 13:20:27 GMT
> To: info-pdp11@village.org
>
> MACRO crashed on me a little while ago caused by a bug in the date
> code that was triggered by the date, 5-Mar-2005.
>
> Here's the fix I used for a V5.5 (or maybe V5.4) RT-11 version of
> MACRO:
>
> .copy macro.sav macro.y1k ! backup copy
> .r sipp
> macro.sav
> Segment? 10
> Base? 0
> Offset? 36762
> Segment Base Offset Old New?
> 000010 000000 036762 104374
> 000010 000000 036764 010015
> 000010 000000 036766 001421
> 000010 000000 036770 042715 062715
> 000010 000000 036772 177740 4
> 000010 000000 036774 062725 042725
> 000010 000000 036776 000110 177740
> 000010 000000 037000 010015
> 000010 000000 037002 000315
> 000010 000000 037004 006215
> 000010 000000 037006 006215
> 000010 000000 037010 042725
> 000010 000000 037012 177740 177760
> 000010 000000 037014 010015 ^Z
> Offset? ^Z
> Base? ^Z
> Segment? ^Z
>
> The first four locations patched (at 36770) aren't necessary -- they
> just make the year field come out looking a bit better.
>
> old new
> --- ---
> 36770 bic #177740,(r5) add #4,(r5)
> 36772 add #72.,(r5)+ bic #177740,(r5)+
>
>
> The bug is caused by the wrong mask for the month field at location
> 37012. The original mask, 177740, is a five-bit field. Clearly the
> month only has four bits (it's a typo error I've made a few times).
>
> old new
> --- ---
> 37012 bic #177740,(r5)+ bic #177760,(r5)+
>
> The actual locations might be different for other versions of MACRO
> but, except for really early MACRO versions, they should be around the
> same area. I found the location by tracing the program request -- the
> first op code (at 36372) is the .DATE request.


Well, yes, it takes only 4 bits to specify 12 months. But as long
ago as RT11 v2A the month field was specified as being 5 bits wide.
I just looked it up. Of course, the two most significant bits of the
date word were co-opted for 2003 <= year <= 2099 , thus using the 5th
bit of the month field.

Good catch.

carl
--
carl lowenstein marine physical lab u.c. san diego
clowenst@ucsd.edu
----------
To unsubscribe (or subscribe) from (to) this list, send a message to
info-pdp11-request@village.org, with the first line of the message
body being "unsubscribe" or "subscribe", respectively (without the quotes).