work on interrupts
This commit is contained in:
parent
a93843b997
commit
2bb0e917bc
|
@ -6,11 +6,23 @@
|
||||||
|
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
|
; Return from a COP interrupt
|
||||||
cop_rti .macro
|
cop_rti .macro
|
||||||
plb
|
plb
|
||||||
rti
|
rti
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
; Set the data bank register to 0.
|
||||||
|
set_dbr_0 .macro
|
||||||
|
pha
|
||||||
|
lda ##0
|
||||||
|
short_a
|
||||||
|
pha
|
||||||
|
plb
|
||||||
|
long_a
|
||||||
|
pla
|
||||||
|
.endm
|
||||||
|
|
||||||
; -----------------------------------------------------------------------------
|
; -----------------------------------------------------------------------------
|
||||||
|
|
||||||
.section near
|
.section near
|
||||||
|
@ -121,18 +133,11 @@ cop_handler_native:
|
||||||
phb
|
phb
|
||||||
long_a
|
long_a
|
||||||
|
|
||||||
; Set the data bank register to 0.
|
set_dbr_0
|
||||||
pha
|
|
||||||
lda ##0
|
|
||||||
short_a
|
|
||||||
pha
|
|
||||||
plb
|
|
||||||
long_a
|
|
||||||
pla
|
|
||||||
|
|
||||||
; First, we multiply the function number by 2, to get the jump
|
; First, we multiply the function number by 2, to get the jump
|
||||||
; table offset.
|
; table offset.
|
||||||
|
pha
|
||||||
txa
|
txa
|
||||||
asl a
|
asl a
|
||||||
tax
|
tax
|
||||||
|
@ -182,8 +187,6 @@ cop_jump_table:
|
||||||
.word .word0 cop_exec
|
.word .word0 cop_exec
|
||||||
.word .word0 cop_exit
|
.word .word0 cop_exit
|
||||||
.word .word0 cop_volume_initialize
|
.word .word0 cop_volume_initialize
|
||||||
.word .word0 cop_get_environment_value
|
|
||||||
.word .word0 cop_set_environment_value
|
|
||||||
.word .word0 cop_ioctl
|
.word .word0 cop_ioctl
|
||||||
|
|
||||||
; -----------------------------------------------------------------------------
|
; -----------------------------------------------------------------------------
|
||||||
|
@ -592,9 +595,9 @@ cop_set_working_directory:
|
||||||
; Given an open file handle, load the file into memory as a PGZ-format binary,
|
; Given an open file handle, load the file into memory as a PGZ-format binary,
|
||||||
; and branch to its entry point. The user program will replace any user program
|
; and branch to its entry point. The user program will replace any user program
|
||||||
; already loaded and running, and will inherit the current environment and
|
; already loaded and running, and will inherit the current environment and
|
||||||
; file handles. This function is used by the shell, which suspends itself and
|
; file handles. This call enters the user program by replacing the "return" vector
|
||||||
; waits for the exit system call to pick up with the exit code of the user
|
; in the stack with the entry point of the user program, altering where the RTI
|
||||||
; program.
|
; instruction "returns" to. The user program exits via a different system call.
|
||||||
;
|
;
|
||||||
; Arguments:
|
; Arguments:
|
||||||
; A: File handle
|
; A: File handle
|
||||||
|
@ -635,11 +638,5 @@ cop_exit:
|
||||||
cop_volume_initialize:
|
cop_volume_initialize:
|
||||||
cop_rti
|
cop_rti
|
||||||
|
|
||||||
cop_get_environment_value:
|
|
||||||
cop_rti
|
|
||||||
|
|
||||||
cop_set_environment_value:
|
|
||||||
cop_rti
|
|
||||||
|
|
||||||
cop_ioctl:
|
cop_ioctl:
|
||||||
cop_rti
|
cop_rti
|
||||||
|
|
Loading…
Reference in New Issue