.struct SER_HDR
ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser")
VERSION .byte 1 ; Interface version
+ LIBREF .addr ; Library reference
JUMPTAB .struct
- INSTALL .word ; INSTALL routine
- UNINSTALL .word ; UNINSTALL routine
- OPEN .word ; OPEN routine
- CLOSE .word ; CLOSE routine
- GET .word ; GET routine
- PUT .word ; PUT routine
- STATUS .word ; STATUS routine
- IOCTL .word ; IOCTL routine
- IRQ .word ; IRQ routine
+ INSTALL .addr ; INSTALL routine
+ UNINSTALL .addr ; UNINSTALL routine
+ OPEN .addr ; OPEN routine
+ CLOSE .addr ; CLOSE routine
+ GET .addr ; GET routine
+ PUT .addr ; PUT routine
+ STATUS .addr ; STATUS routine
+ IOCTL .addr ; IOCTL routine
+ IRQ .addr ; IRQ routine
.endstruct
.endstruct
;------------------------------------------------------------------------------
; The SER API version, stored SER_HDR::VERSION
-SER_API_VERSION = $00
+SER_API_VERSION = $01
;------------------------------------------------------------------------------
; ser_params
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref, mouse_libref
+ .export em_libref, joy_libref, mouse_libref, ser_libref
.import _exit
em_libref := _exit
joy_libref := _exit
mouse_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
- ; Jump table.
+ ; Library reference
+ .addr $0000
+
+ ; Jump table
.addr INSTALL
.addr UNINSTALL
.addr OPEN
; Oliver Schmidt, 2013-05-31
;
- .export joy_libref
+ .export joy_libref, ser_libref
.import _exit
joy_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
- ; Jump table.
+ ; Library reference
+ .addr $0000
+
+ ; Jump table
.addr INSTALL
.addr UNINSTALL
.addr OPEN
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref, mouse_libref
+ .export em_libref, joy_libref, mouse_libref, ser_libref
.import _exit
em_libref := _exit
joy_libref := _exit
mouse_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
-; Jump table.
+; Library reference
+
+ .addr $0000
+
+; Jump table
.word INSTALL
.word UNINSTALL
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref, mouse_libref
+ .export em_libref, joy_libref, mouse_libref, ser_libref
.import _exit
em_libref := _exit
joy_libref := _exit
mouse_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
-; Jump table.
+; Library reference
+
+ .addr $0000
+
+; Jump table
.word INSTALL
.word UNINSTALL
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref
+ .export em_libref, joy_libref, ser_libref
.import _exit
em_libref := _exit
joy_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
-; Jump table.
+; Library reference
+
+ .addr $0000
+
+; Jump table
.word INSTALL
.word UNINSTALL
; Oliver Schmidt, 2013-05-31
;
- .export em_libref
+ .export em_libref, ser_libref
.import _exit
em_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
-; Jump table.
+; Library reference
+
+ .addr $0000
+
+; Jump table
.word INSTALL
.word UNINSTALL
; Oliver Schmidt, 2013-05-31
;
- .export joy_libref
+ .export joy_libref, ser_libref
.import _exit
joy_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
- ; Jump table.
+ ; Library reference
+ .addr $0000
+
+ ; Jump table
.addr INSTALL
.addr UNINSTALL
.addr OPEN
; Oliver Schmidt, 2013-05-31
;
- .export joy_libref
+ .export joy_libref, ser_libref
.import _exit
joy_libref := _exit
+ser_libref := _exit
.byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number
-; Jump table.
+; Library reference
+
+ .addr $0000
+
+; Jump table
.word INSTALL
.word UNINSTALL
; Common functions of the serial drivers
;
- .import return0
+ .import return0, ser_libref
.importzp ptr1
.interruptor ser_irq, 29 ; Export as high priority IRQ handler
dey
bpl @L0
+; Set the library reference
+
+ ldy #SER_HDR::LIBREF
+ lda #<ser_libref
+ sta (ptr1),y
+ iny
+ lda #>ser_libref
+ sta (ptr1),y
+
; Copy the jump vectors
ldy #SER_HDR::JUMPTAB