// HP-01 inspired clock with shortcuts for time operation
//
// [C] start clock; to grab current time exit clock
// XEQ EEX : load current time into X
// XEQ +   : add timecode to timecode
// XEQ -   : subtract timecode from timecode
// XEQ *   : multiply timecode in Y by number in X
// XEQ /   : divide timecode in Y by number in X
// 
// Special processing with no general interest:
// [D] v1 tc1 v2 tc2 → |v2-v1| |tc2-tc2|°

        LBL'CLK'
        LBL C // save to library complains when LBL C is before LBL'CLK'
        LocR 002
1H      KEY? Z
        SKIP <2F>
        SKIP <1F>
2H      CLx
        TIME
        x=? .00
        BACK <1B>
        STO .00
        // screen update happens only when time changes
        TICKS
        STO .01
        x↔ Y
        CLα
        αTIME
        VIEWα
        // PSE 09 is to reduce amount of busy waiting to save battery
        PSE 09
        BACK <1B>
1H      TICKS
        RCL .01
        -
        SDR 005
        +
        RTN

        LBL 21 // "EEX"
        TIME
        RTN
        LBL 65 // "-"
        H.MS-
        RTN
        LBL 75 // "+"
        H.MS+
        RTN

        LBL 45 // "÷"
        1/x
        LBL 55 // "×"
        x↔ Y
        →HR
        ×
        →H.MS
        RTN
        
        // Special
        LBL D
        →HR
        cx↔ Z
        →HR
        x>? Z
        cx↔ Z
        c-
        H.MS
        RTN

// Current timestamp
        LBL A
        DATE
        TIME
// Format and print timestamp
        LBL'[print]DT'
        CLα
        x↔ Y
        αDATE
        α [space]
        x↔ Y
        αTIME
        VIEWα
        [print]α
        END
