1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-20 05:29:39 +00:00

Added library reference ser_libref to SER interface.

This commit is contained in:
Oliver Schmidt 2013-06-01 11:03:14 +02:00
parent 744abda24f
commit ae409e4978
18 changed files with 74 additions and 27 deletions

View File

@ -39,16 +39,17 @@
.struct SER_HDR .struct SER_HDR
ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser") ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser")
VERSION .byte 1 ; Interface version VERSION .byte 1 ; Interface version
LIBREF .addr ; Library reference
JUMPTAB .struct JUMPTAB .struct
INSTALL .word ; INSTALL routine INSTALL .addr ; INSTALL routine
UNINSTALL .word ; UNINSTALL routine UNINSTALL .addr ; UNINSTALL routine
OPEN .word ; OPEN routine OPEN .addr ; OPEN routine
CLOSE .word ; CLOSE routine CLOSE .addr ; CLOSE routine
GET .word ; GET routine GET .addr ; GET routine
PUT .word ; PUT routine PUT .addr ; PUT routine
STATUS .word ; STATUS routine STATUS .addr ; STATUS routine
IOCTL .word ; IOCTL routine IOCTL .addr ; IOCTL routine
IRQ .word ; IRQ routine IRQ .addr ; IRQ routine
.endstruct .endstruct
.endstruct .endstruct
@ -56,7 +57,7 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; The SER API version, stored SER_HDR::VERSION ; The SER API version, stored SER_HDR::VERSION
SER_API_VERSION = $00 SER_API_VERSION = $01
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ser_params ; ser_params

View File

@ -2,9 +2,10 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export em_libref, joy_libref, mouse_libref .export em_libref, joy_libref, mouse_libref, ser_libref
.import _exit .import _exit
em_libref := _exit em_libref := _exit
joy_libref := _exit joy_libref := _exit
mouse_libref := _exit mouse_libref := _exit
ser_libref := _exit

View File

@ -34,7 +34,10 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.addr INSTALL .addr INSTALL
.addr UNINSTALL .addr UNINSTALL
.addr OPEN .addr OPEN

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export joy_libref .export joy_libref, ser_libref
.import _exit .import _exit
joy_libref := _exit joy_libref := _exit
ser_libref := _exit

View File

@ -35,7 +35,10 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.addr INSTALL .addr INSTALL
.addr UNINSTALL .addr UNINSTALL
.addr OPEN .addr OPEN

View File

@ -2,9 +2,10 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export em_libref, joy_libref, mouse_libref .export em_libref, joy_libref, mouse_libref, ser_libref
.import _exit .import _exit
em_libref := _exit em_libref := _exit
joy_libref := _exit joy_libref := _exit
mouse_libref := _exit mouse_libref := _exit
ser_libref := _exit

View File

@ -37,7 +37,11 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.word INSTALL .word INSTALL
.word UNINSTALL .word UNINSTALL

View File

@ -2,9 +2,10 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export em_libref, joy_libref, mouse_libref .export em_libref, joy_libref, mouse_libref, ser_libref
.import _exit .import _exit
em_libref := _exit em_libref := _exit
joy_libref := _exit joy_libref := _exit
mouse_libref := _exit mouse_libref := _exit
ser_libref := _exit

View File

@ -37,7 +37,11 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.word INSTALL .word INSTALL
.word UNINSTALL .word UNINSTALL

View File

@ -2,8 +2,9 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export em_libref, joy_libref .export em_libref, joy_libref, ser_libref
.import _exit .import _exit
em_libref := _exit em_libref := _exit
joy_libref := _exit joy_libref := _exit
ser_libref := _exit

View File

@ -38,7 +38,11 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.word INSTALL .word INSTALL
.word UNINSTALL .word UNINSTALL

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export em_libref .export em_libref, ser_libref
.import _exit .import _exit
em_libref := _exit em_libref := _exit
ser_libref := _exit

View File

@ -38,7 +38,11 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.word INSTALL .word INSTALL
.word UNINSTALL .word UNINSTALL

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export joy_libref .export joy_libref, ser_libref
.import _exit .import _exit
joy_libref := _exit joy_libref := _exit
ser_libref := _exit

View File

@ -18,7 +18,10 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.addr INSTALL .addr INSTALL
.addr UNINSTALL .addr UNINSTALL
.addr OPEN .addr OPEN

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31 ; Oliver Schmidt, 2013-05-31
; ;
.export joy_libref .export joy_libref, ser_libref
.import _exit .import _exit
joy_libref := _exit joy_libref := _exit
ser_libref := _exit

View File

@ -37,7 +37,11 @@
.byte $73, $65, $72 ; "ser" .byte $73, $65, $72 ; "ser"
.byte SER_API_VERSION ; Serial API version number .byte SER_API_VERSION ; Serial API version number
; Jump table. ; Library reference
.addr $0000
; Jump table
.word INSTALL .word INSTALL
.word UNINSTALL .word UNINSTALL

View File

@ -4,7 +4,7 @@
; Common functions of the serial drivers ; Common functions of the serial drivers
; ;
.import return0 .import return0, ser_libref
.importzp ptr1 .importzp ptr1
.interruptor ser_irq, 29 ; Export as high priority IRQ handler .interruptor ser_irq, 29 ; Export as high priority IRQ handler
@ -58,6 +58,15 @@ _ser_install:
dey dey
bpl @L0 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 ; Copy the jump vectors
ldy #SER_HDR::JUMPTAB ldy #SER_HDR::JUMPTAB