Setting the Geneve clock

From Ninerpedia
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

       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