A2osX/ProDOS.FX/ProDOS.S.CCLK.txt

65 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-10-16 06:09:13 +00:00
NEW
AUTO 3,1
*--------------------------------------
2023-11-04 14:42:28 +00:00
CCLK.START .PH CLK
CCLK.START1 >SHORTMX 8 bit mode.
lda IO.GS.STATEREG state register.
2019-10-16 06:09:13 +00:00
sta savestate save for restore after tool call.
and #$CF clear the read/write aux memory bits.
2023-11-04 14:42:28 +00:00
sta IO.GS.STATEREG make it real
2019-10-16 06:09:13 +00:00
clc set e = 0 to set native mode
2023-11-04 14:42:28 +00:00
xce
2019-10-16 06:09:13 +00:00
>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
2023-11-04 14:42:28 +00:00
sta IO.GS.STATEREG
2019-10-16 06:09:13 +00:00
pla pull off seconds and ignore
pla
2023-11-04 14:42:28 +00:00
sta GP.TIME minutes
2019-10-16 06:09:13 +00:00
pla
2023-11-04 14:42:28 +00:00
sta GP.TIME+1 hours
2019-10-16 06:09:13 +00:00
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
2023-11-04 14:42:28 +00:00
.2 sta GP.DATE+1 year
2019-10-16 06:09:13 +00:00
pla
inc increment day for Prodos 8 format.
2023-11-04 14:42:28 +00:00
sta GP.DATE day
2019-10-16 06:09:13 +00:00
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
2023-11-04 14:42:28 +00:00
ora GP.DATE put all but the top bit of month
sta GP.DATE value in the day byte.
rol GP.DATE+1 put hi bit of month in low bit of year
2019-10-16 06:09:13 +00:00
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
*--------------------------------------
2023-11-04 14:42:28 +00:00
.EP
*--------------------------------------
* .LIST ON
2019-11-01 20:06:04 +00:00
CCLK.LEN .EQ *-CCLK.START
.LIST OFF
*--------------------------------------
2019-10-16 06:09:13 +00:00
MAN
SAVE usr/src/prodos.fx/prodos.s.cclk
LOAD usr/src/prodos.fx/prodos.s
2019-10-16 06:09:13 +00:00
ASM