A2osX/ProDOS.203/ProDOS.S.CCLK.txt

66 lines
2.0 KiB
Plaintext
Raw Normal View History

2019-04-29 20:36:58 +00:00
NEW
AUTO 3,1
* object code = cclock_0
* Cortland clock driver
* $2F80-$2FFC moved to $D742
2019-09-13 20:48:05 +00:00
*--------------------------------------
2019-09-16 06:06:02 +00:00
CCLK.START >SHORTMX 8 bit mode.
2019-09-13 20:48:05 +00:00
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
2019-09-10 15:46:56 +00:00
xce
2019-09-13 20:48:05 +00:00
>LONGMX 16 bit mode.
lda ##$0000 zero out result space.
pha push 4 words for hex time result
2019-09-10 15:46:56 +00:00
pha
pha
pha
2019-09-11 15:53:33 +00:00
>IIGS ReadTimeHex
2019-09-13 20:48:05 +00:00
>SHORTM back to 8 bit to get results from stack
lda savestate restore state register
2019-09-10 20:53:18 +00:00
sta statereg
2019-09-13 20:48:05 +00:00
pla pull off seconds and ignore
2019-09-10 15:46:56 +00:00
pla
2019-09-13 20:48:05 +00:00
sta p8time minutes
2019-09-10 15:46:56 +00:00
pla
2019-09-13 20:48:05 +00:00
sta p8time+1 hours
pla year
2019-09-16 06:06:02 +00:00
.1 cmp #100 out of range?
bcc .2 no, go ahead and store
2019-09-13 20:48:05 +00:00
sbc #$64 else put back in range.
2019-09-16 06:06:02 +00:00
bra .1 try again
.2 sta p8date+1 year
2019-09-10 15:46:56 +00:00
pla
2019-09-13 20:48:05 +00:00
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.
2019-09-10 20:53:18 +00:00
asl
asl
asl
2019-09-13 20:48:05 +00:00
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
2019-09-10 15:46:56 +00:00
rts
2019-09-16 06:06:02 +00:00
savestate .HS 00 state of the state register
2019-09-10 15:46:56 +00:00
.AS "JIMJAYKERRY&MIKE"
2019-09-10 20:53:18 +00:00
.HS 0000000000000000 pad 0's until length
2019-09-13 20:48:05 +00:00
.HS 0000000000000000 of driver = 125 bytes.
2019-09-10 20:53:18 +00:00
.HS 000000000000
2019-09-16 06:06:02 +00:00
CCLK.END .EQ * end of obj cclock_0.
2019-09-13 20:48:05 +00:00
.HS 000000 pad to page boundary
2019-04-29 20:36:58 +00:00
*--------------------------------------
MAN
2019-07-08 12:56:54 +00:00
SAVE USR/SRC/PRODOS.203/PRODOS.S.CCLK
LOAD USR/SRC/PRODOS.203/PRODOS.S
2019-04-29 20:36:58 +00:00
ASM