home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1991 July
/
64er_Magazin_91-07_1991_Markt__Technik_de_Side_A.d64
/
ciauhr.src
< prev
next >
Wrap
Text File
|
2022-10-26
|
2KB
|
218 lines
org $c000
:lo =$fa
:hi =$fb
:mi =$fc
:byt=$fd
;--------------
:bytefac=$b3a2
:memmult=$ba28
:memplus=$b867
:facmem =$bbd4
:memfac =$bba2
:facint =$bc9b
;--------------
:todhr =$dc0b
:todmn =$dc0a
:todsc =$dc09
:todth =$dc08
:start
sei
lda #$a0
jsr copy
lda #$e0
jsr copy
ldx #0
:ownrout
lda prg,x
sta $f6dd,x ;Umlenkung auf eigene
inx ;Routine
cpx #16
bne ownrout
lda 1
and #%11111000
ora #%00000101
sta 1
lda $dc0e
ora #%10000000
sta $dc0e
lda #0
sta todhr
sta todmn
sta todsc
sta todth
cli
rts
:copy ;kopiert Rom ins
sta hi ;darunterliegende Ram
lda #0
sta lo
ldx #0
ldy #0
:l1
lda (lo),y
sta (lo),y
iny
bne l1
inc hi
inx
cpx #$20
bne l1
rts
:prg
sei
nop
nop
nop
jmp gettime
sei
jmp settime
:settime
php
ldy #0
lda ($22),y
jsr getbyt
cmp #18
bcc kleiner
sec
sbc #18
ora #%10000000;pm -flg setzen
:kleiner
sta todhr
iny
lda ($22),y
jsr getbyt
sta todmn
iny
lda ($22),y
jsr getbyt
sta todsc
lda #0
sta todth
plp
cli
rts
:getbyt
sec
sbc #48
asl
asl
asl
asl
sta byt
iny
lda ($22),y
sec
sbc #48
ora byt
rts
:bcdconv
tay
and #%00001111
sta smod+1
tya
lsr
lsr
lsr
lsr
tax
lda tab,x
clc
:smod
adc #00
rts
:tab
b 0,10,20,30,40,50,60,70,80,90
:gettime
php
ldx #0
txa
:setzero
sta const,x
inx
cpx #5
bne setzero
lda todhr
bpl notpm
and #%01111111
clc
adc #18
:notpm
ldx #<flp216000
ldy #>flp216000
jsr convhex
lda todmn
ldx #<flp3600
ldy #>flp3600
jsr convhex
lda todsc
ldx #<flp60
ldy #>flp60
jsr convhex
lda todth
ldx #<flp6
ldy #>flp6
jsr convhex
lda #<const
ldy #>const
jsr memfac
lsr $66 ;ohne vz
jsr facint
lda $65
ldx $64
ldy $63
plp
cli
rts
:convhex
stx fakt+1
sty fakt+3
jsr bcdconv
tay
jsr bytefac
:fakt
lda #<flp216000
ldy #>flp216000
jsr memmult
lda #<const
ldy #>const
jsr memplus
ldx #<const
ldy #>const
jsr facmem
rts
:const
b 0,0,0,0,0
:flp216000
b $92,$d2,$f0,0,0 ;= 216000
:flp3600
b $8c,$e1,0,0,0 ;= 3600
:flp60
b $86,$f0,0,0,0 ;= 60
:flp6
b $83,$c0,0,0,0 ;= 6