A2osX/ProDOS.FX/ProDOS.S.CCLK.txt
2019-11-06 14:14:42 +01:00

61 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
* object code = cclock_0
* Cortland clock driver
* $2F80-$2FFC moved to $D742
*--------------------------------------
CCLK.START >SHORTMX 8 bit mode.
lda statereg state register.
sta savestate save for restore after tool call.
and #$CF clear the read/write aux memory bits.
sta statereg make it real
clc set e = 0 to set native mode
xce
>LONGMX 16 bit mode.
lda ##$0000 zero out result space.
pha push 4 words for hex time result
pha
pha
pha
>IIGS ReadTimeHex
>SHORTM back to 8 bit to get results from stack
lda savestate restore state register
sta statereg
pla pull off seconds and ignore
pla
sta p8time minutes
pla
sta p8time+1 hours
pla year
.1 cmp #100 out of range?
bcc .2 no, go ahead and store
sbc #$64 else put back in range.
bra .1 try again
.2 sta p8date+1 year
pla
inc increment day for Prodos 8 format.
sta p8date day
pla month
inc increment month for Prodos 8 format.
asl shift month as it sits in between
asl the year and day values.
asl
asl
asl
ora p8date put all but the top bit of month
sta p8date value in the day byte.
rol p8date+1 put hi bit of month in low bit of year
pla pull of unused byte
pla pull off day of week. stack now clean.
sec go back to emulation mode
xce to continue with Prodos 8
rts
savestate .HS 00 state of the state register
*--------------------------------------
CCLK.LEN .EQ *-CCLK.START
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.CCLK
LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM