Path: utzoo!attcan!uunet!lll-winken!ames!ncar!hao.ucar.edu!hull From: hull@hao.ucar.edu (Howard Hull) Newsgroups: comp.sys.amiga Subject: Insider RTClock fix detail Keywords: branch offset Message-ID: <1334@ncar.ucar.edu> Date: 27 Jan 89 20:46:01 GMT Sender: news@ncar.ucar.edu Reply-To: hull@hao.ucar.edu (Howard Hull) Organization: High Altitude Observatory/NCAR, Boulder CO Lines: 66 I have the following (via USnail) from Jack Aker, who does not have Usenet posting access. I haven't had a chance yet to check it against my Insider RTClock modules, since I am doing this on my A2000 at work, and the Insiders are installed in my A1000s at home. -soh- January 20, 1989 The RTClock program provided with the Insider memory board from Michigan Software has a "year after leap year" bug. The program reads and displays the correct date, but the DOS value set is one day earlier than the displayed date. The two code segments below show the bug and the correction for it. ?U DoIO+8b0 00c7eb28: 202e ffe4 move.l -1c(a6),d0 00c7eb2c: 7204 moveq #4,d1 00c7eb2e: 4eb9 00c7 f458 jsr c7f458 00c7eb34: 5581 subq.l #2,d1 00c7eb36: 6612 bne.s *+12 ;c7eb4a ;wrong place 00c7eb38: 0cae 0000 0002 ffe8 cmpi.l #2,-18(a6) 00c7eb40: 6f08 ble.s *+8 ;c7eb4a 00c7eb42: 06ae 0001 5180 fffc addi.l #15180,-4(a6) 00c7eb4a: 206e 0008 movea.l 8(a6),a0 00c7eb4e: 20ae fffc move.l -4(a6),(a0) This is what the above code segment should be: ?U DoIO+8b0 00c7eb28: 202e ffe4 move.l -1c(a6),d0 00c7eb2c: 7204 move.q #4,d1 00c7eb2e: 4eb9 00c7 f458 jsr c7f458 00c7eb34: 5581 subq.l #2,d1 00c7eb36: 6608 bne.s *+8 ;c7eb40 ;correct 00c7eb38: 0cae 0000 0002 ffe8 cmpi.l #2,-18(a6) 00c7eb40: 6f08 ble.s *+8 ;c7eb4a 00c7eb42: 06ae 0001 5180 fffc addi.l #15180,-4(a6) 00c7eb4a: 206e 0008 movea.l 8(a6),a0 00c7eb4e: 20ae fffc move.l -4(a6),(a0) Use a binary file zap tool to change the '6612' to '6608', which will correct the wrong branch destination. The byte to change from 12 hex to 08 hex is at the following places in the different versions as shown: RTClock size date offset in file V ?? 8864 12-Feb-87 90F V2.0 8904 16-Sep-87 9CB There may be other versions of RTClock. If your copy doesn't match either of the versions above. Search for the hex string: 5581 6612 0cae 0000 0002 ffe8 6f08 06ae 0001 5180 || 08 goes here There should be only one place in the file with this string. Jack Aker 6944 Burnside Dr. San Jose CA 96120 -eom- Posted by Howard Hull hull@hao.ucar.edu