Kernel User Interrupt
- speculatrix
- Posts: 151
- Joined: 03 Apr 2018
- Contact:
Re: Kernel User Interrupt
Coincidentally, I’ve just been grappling with something similar. Although my skills here are basic, I have documented what I did here: https://mansfield-devine.com/speculatri ... ng-system/
It either works or catches fire. Either way is fun.
Zolatron 64 project (on Medium)
Zolatron 64 project (on Medium)
Re: Kernel User Interrupt
Ah, thanks, I see now!
Re: Kernel User Interrupt
Hi
Spotted an error if anybody was looking closely.
the line BCC _exit_irq should be a BCC to _not_via
otherwise the JMP(indirect) for vector3 will be missed.
This is still all work in progress so testing is limited.
Regards
Andre
Spotted an error if anybody was looking closely.
Quote:
...yes it was a 10ms timer interrupt
JMP ($04F0) ; jump to vector1 interrupt
_vector1_return:
INC SYSTEM_TIMER
CLC
LDA SYSTEM_TIMER
CMP #$64 ; HAS TIMER REACHED 100 (0x64)
BCC _exit_irq
LDA #$00
STA SYSTEM_TIMER
INC SYSTEM_SECONDS
JMP ($04F2) ; jump to vector2 interrupt
_vector2_return:
_not_via:
JMP ($04F4) ; jump to vector3 interrupt
_vector3_return:
_exit_irq:
PLA
PLX
PLY
_irq_last_byte_address:
RTI ; Return from IRQ interrupt
JMP ($04F0) ; jump to vector1 interrupt
_vector1_return:
INC SYSTEM_TIMER
CLC
LDA SYSTEM_TIMER
CMP #$64 ; HAS TIMER REACHED 100 (0x64)
BCC _exit_irq
LDA #$00
STA SYSTEM_TIMER
INC SYSTEM_SECONDS
JMP ($04F2) ; jump to vector2 interrupt
_vector2_return:
_not_via:
JMP ($04F4) ; jump to vector3 interrupt
_vector3_return:
_exit_irq:
PLA
PLX
PLY
_irq_last_byte_address:
RTI ; Return from IRQ interrupt
otherwise the JMP(indirect) for vector3 will be missed.
This is still all work in progress so testing is limited.
Regards
Andre
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Kernel User Interrupt
Andre wrote:
Code: Select all
...yes it was a 10ms timer interrupt
JMP ($04F0) ; jump to vector1 interrupt
_vector1_return:
INC SYSTEM_TIMER
CLC
LDA SYSTEM_TIMER
CMP #$64 ; HAS TIMER REACHED 100 (0x64)
BCC _exit_irq
LDA #$00
STA SYSTEM_TIMER
INC SYSTEM_SECONDS
JMP ($04F2) ; jump to vector2 interrupt
_vector2_return:
_not_via:
JMP ($04F4) ; jump to vector3 interrupt
_vector3_return:
_exit_irq:
PLA
PLX
PLY
_irq_last_byte_address:
RTI ; Return from IRQ interruptSurrounding your code snippets with code brackets will make it a little easier to read.
x86? We ain't got no x86. We don't NEED no stinking x86!
-
teamtempest
- Posts: 443
- Joined: 08 Nov 2009
- Location: Minnesota
- Contact:
Re: Kernel User Interrupt
Code: Select all
...yes it was a 10ms timer interrupt
JMP ($04F0) ; jump to vector1 interrupt
_vector1_return:
INC SYSTEM_TIMER
CLC
LDA SYSTEM_TIMER
CMP #$64 ; HAS TIMER REACHED 100 (0x64)
BCC _exit_irq
LDA #$00
STA SYSTEM_TIMER
INC SYSTEM_SECONDSCode: Select all
JMP ($04F0)
_vector1_return:
DEC SYSTEM_TIMER
BNE _exit_irq
INC SYSTEM_SECONDS
LDA #100
STA SYSTEM_TIMER
- Sheep64
- In Memoriam
- Posts: 311
- Joined: 11 Aug 2020
- Location: A magnetic field
Re: Kernel User Interrupt
Andre on Fri 22 Apr 2022 wrote:
Code: Select all
_exit_irq:
PLA
PLX
PLY