Skip to content

Commit

Permalink
Merge pull request #1148 from six809/opt-cpu-6809
Browse files Browse the repository at this point in the history
Kernel/cpu-6809/lowlevel-6809.s minor optimisations
  • Loading branch information
EtchedPixels authored Feb 4, 2025
2 parents 12459b6 + dba697e commit 2780def
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Kernel/cpu-6809/lowlevel-6809.s
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,18 @@ interrupt_handler:

; switch stacks
sts istack_switched_sp
lds #istack_top-2
; FIXME: check store/dec order might not need to be -2 here!!!!
lds #istack_top

jsr map_save

ldb U_DATA__U_INSYS ; In a system call ?
bne in_kernel

; we're not in kernel mode, check for signals and fault
lda 0 ; save address 0 contents for checking
cmpa #0x7E ; JMP at 0
beq nofault
lda #0x7E ; put it back
sta 0 ; write
lda #0x7e
cmpa 0 ; JMP at 0?
beq nofault ; yes? not a fault
sta 0 ; fault - put JMP back
jsr map_kernel
ldb #11 ; SIGSEGV
jsr trap_signal ; signal the user with a fault
Expand Down Expand Up @@ -355,7 +353,7 @@ nmimsg: .ascii "[NMI]"
.db 13,10,0

nmi_handler:
lds #istack_top-2 ; We aren't coming back so this is ok
lds #istack_top ; We aren't coming back so this is ok
jsr map_kernel
ldx #nmimsg
jsr outstring
Expand Down

0 comments on commit 2780def

Please sign in to comment.