comparison os9/level2/clock.asm @ 54:fc10b7ae23d0

clock level2 worked
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 22 Jul 2018 19:41:06 +0900
parents fe88cea67ef0
children 8d151f303bee
comparison
equal deleted inserted replaced
53:fe88cea67ef0 54:fc10b7ae23d0
40 40
41 ClockIRQ ldx #TimerPort 41 ClockIRQ ldx #TimerPort
42 lda ,x 42 lda ,x
43 bita #$10 43 bita #$10
44 beq L00AE 44 beq L00AE
45 L00AE leax ClockIRQ1,pcr
46 stx <D.SvcIRQ
47 jmp [D.XIRQ] Chain through Kernel to continue IRQ handling
48 ClockIRQ1
49 inc <D.Sec go up one second
50 lda <D.Sec grab current second
51 cmpa #60 End of minute?
52 blo VIRQend No, skip time update and alarm check
53 clr <D.Sec Reset second count to zero
54 VIRQend
55 ldx #TimerPort
45 lda #$8f 56 lda #$8f
46 sta >TimerPort 57 sta >TimerPort
47 L00AE jsr [>D.Poll] 58 jmp [>D.Clock]
48 bcc L00AE 59
49 L00B4 jsr [>D.AltIRQ] 60 TkPerTS equ 2
50 rti
51 61
52 ClkEnt equ * 62 ClkEnt equ *
53 pshs cc 63 pshs cc
54 orcc #FIRQMask+IRQMask mask ints 64 orcc #FIRQMask+IRQMask mask ints
55 leax >ClockIRQ,pcr 65 leax >ClockIRQ,pcr
56 stx <D.IRQ 66 stx <D.IRQ
57 * install system calls 67 * install system calls
58 leay >SysTbl,pcr 68 leay >SysTbl,pcr
59 os9 F$SSvc 69 os9 F$SSvc
70 ldd #59*256+TkPerTS last second and time slice in minute
71 std <D.Sec Will prompt RTC read at next time slice
72 stb <D.TSlice set ticks per time slice
73 stb <D.Slice set first time slice
74 lda #TkPerSec Reset to start of second
75 sta <D.Tick
76
60 ldx #TimerPort 77 ldx #TimerPort
61 ldb #$8f start timer 78 ldb #$8f start timer
62 stb ,x 79 stb ,x
63 puls pc,cc 80 puls pc,cc
64 81