Setting the Geneve clock

From Ninerpedia
Revision as of 10:22, 13 February 2012 by Mizapf (talk | contribs) (Created page with "The following routine can be used to reset the clock to a well-defined state, and then the date may be set using the MDOS command TIME. * Resetting the clock to 24h mode * a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The following routine can be used to reset the clock to a well-defined state, and then the date may be set using the MDOS command TIME.

*  Resetting the clock to 24h mode
*  according to the MM58274C datasheet
*  Time must be set afterwards using the MDOS command TIME

       DEF  START

START  LWPI >F000
       LI   R0,>0F00
       MOVB R0,@>F130    // Write 0x0f into the control register
       SWPB R0
       MOVB R0,@>F13F    // Write 0x00 into the interrupt register
       LI   R0,>0500
       MOVB R0,@>F130    // Write 0x05 into the control register 

       LI   R0,>0100
       LI   R1,>F131
       LI   R2,14
LP01   MOVB R0,*R1+      // Write 0x01 to all registers
       DEC  R2
       JNE  LP01

       MOVB R0,@>F13F    // Set 24h mode
       CLR  R0
       MOVB R0,@>F130    // Write 0x00 into the control register

       BLWP @0

       END