]> git.sur5r.net Git - cc65/commitdiff
Added library reference em_libref to EMD interface.
authorOliver Schmidt <ol.sc@web.de>
Fri, 31 May 2013 22:11:31 +0000 (00:11 +0200)
committerOliver Schmidt <ol.sc@web.de>
Fri, 31 May 2013 22:11:31 +0000 (00:11 +0200)
Occasionally dynamically drivers suffer from not being to refer to
content in the C library. Therefore I added a mechanism to allow
a C library for a certian target to define a symbol that will be
handed over to dynamic drivers for that target. Then the drivers
can use their refernce to that symbol to access content in the C
library.

31 files changed:
asminc/em-kernel.inc
libsrc/apple2/emd/a2.auxmem.s
libsrc/apple2/libref.s [new file with mode: 0644]
libsrc/atari/emd/atr130.s
libsrc/atari/libref.s [new file with mode: 0644]
libsrc/c128/emd/c128-georam.s
libsrc/c128/emd/c128-ram.s
libsrc/c128/emd/c128-ram2.s
libsrc/c128/emd/c128-ramcart.s
libsrc/c128/emd/c128-reu.s
libsrc/c128/emd/c128-vdc.s
libsrc/c128/libref.s [new file with mode: 0644]
libsrc/c16/emd/c16-ram.s
libsrc/c16/libref.s [new file with mode: 0644]
libsrc/c64/emd/c64-c256k.s
libsrc/c64/emd/c64-dqbb.s
libsrc/c64/emd/c64-georam.s
libsrc/c64/emd/c64-isepic.s
libsrc/c64/emd/c64-ram.s
libsrc/c64/emd/c64-ramcart.s
libsrc/c64/emd/c64-reu.s
libsrc/c64/emd/c64-vdc.s
libsrc/c64/emd/dtv-himem.s
libsrc/c64/libref.s [new file with mode: 0644]
libsrc/cbm510/emd/cbm510-ram.s
libsrc/cbm510/libref.s [new file with mode: 0644]
libsrc/cbm610/emd/cbm610-ram.s
libsrc/cbm610/libref.s [new file with mode: 0644]
libsrc/em/em-kernel.s
libsrc/geos-cbm/emd/geos-vdc.s
libsrc/geos-cbm/system/libref.s [new file with mode: 0644]

index 1df969225f55ae5337ea0e1f888250ba15b8773b..313bfc0bf04c1464553d6891ff11b28f8aa995cd 100644 (file)
 .struct EMD_HDR
         ID      .byte   3       ; Contains 0x65, 0x6d, 0x64 ("emd")
         VERSION .byte   1       ; Interface version
+        LIBREF  .addr           ; Library reference
         JUMPTAB .struct
-            INSTALL     .word   ; INSTALL routine
-            UNINSTALL   .word   ; UNINSTALL routine
-            PAGECOUNT   .word   ; PAGECOUNT routine
-            MAP .word   ; MAP routine
-            USE .word   ; USE routine
-            MAPCLEAN    .word   ; MAPCLEAN routine
-            COPYFROM    .word   ; COPYFROM routine
-            COPYTO      .word   ; COPYTO routine
+            INSTALL     .addr   ; INSTALL routine
+            UNINSTALL   .addr   ; UNINSTALL routine
+            PAGECOUNT   .addr   ; PAGECOUNT routine
+            MAP         .addr   ; MAP routine
+            USE         .addr   ; USE routine
+            MAPCLEAN    .addr   ; MAPCLEAN routine
+            COPYFROM    .addr   ; COPYFROM routine
+            COPYTO      .addr   ; COPYTO routine
         .endstruct
 .endstruct
 
 ;------------------------------------------------------------------------------
 ; The EMD API version, stored in EMD_HDR::VERSION
 
-EMD_API_VERSION         = $00
+EMD_API_VERSION         = $01
 
 ;------------------------------------------------------------------------------
 ; The asm equivalent to the C em_copy structure
 
 .struct EM_COPY
-        BUF     .word           ; Memory buffer to copy from or to
+        BUF     .addr           ; Memory buffer to copy from or to
         OFFS    .byte           ; Offset into page
         PAGE    .word           ; Starting page to copy from or to
         COUNT   .word           ; Number of bytes to copy
index ecf78fc376a1b937183b143701839f6e4013e308..0ceb083b915e4245ad146a625cc906922545e233 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
+; Library reference
 
-        .word   INSTALL
-        .word   DEINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
@@ -69,11 +73,11 @@ INSTALL:
 ;       rts
 
 ; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
 ; Can do cleanup or whatever. Must not return anything.
 ;
 
-DEINSTALL:
+UNINSTALL:
         rts
 
 
diff --git a/libsrc/apple2/libref.s b/libsrc/apple2/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit
index b3c31a2051b97da29a85f7e09cefc92fd0671e68..7d663e446af58880658b5a670026f6ee5e5fc24f 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
+; Library reference
 
-        .word   INSTALL
-        .word   DEINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
@@ -191,11 +195,11 @@ INSTALL:
         rts
 
 ; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
 ; Can do cleanup or whatever. Must not return anything.
 ;
 
-DEINSTALL:
+UNINSTALL:
         rts
 
 
diff --git a/libsrc/atari/libref.s b/libsrc/atari/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit
index 0c106f406838e735a4f884f3426c006b71c41966..f2de8091646623b208a2b9fedae3ad2a98a971bd 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 02979a6dcd45e249a3a863d1ec3d59427716bc50..f382e9b878c26ee8a627cbb1f81e822ab0571f6e 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 9fb8a2836ca672b312888d81012d336bc9a1b70e..8a0ba0facf35fe835950415c96f50b2c0fa417fb 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 0bf1072de83af073a9eba24738859e56c47c53a5..6d6a91bbe0a9365183cd3c4126c2199fd1fd6874 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index b1a979cb56f278d9b3deb78eba9d78cd20087ade..094ad1d39cc6425757eed3e9afa954d56b6bf6c2 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 29dbb4569a865fe7a75eb5b2bd96c152b53ba180..dd28ae774fe496f3cd23e1d5607a29c22c56b1c3 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
+; Library reference
 
-        .word   INSTALL
-        .word   DEINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
@@ -141,11 +145,11 @@ settestadr2:
         jmp     vdcsetsrcaddr
 
 ; ------------------------------------------------------------------------
-; DEINSTALL routine. Is called before the driver is removed from memory.
+; UNINSTALL routine. Is called before the driver is removed from memory.
 ; Can do cleanup or whatever. Must not return anything.
 ;
 
-DEINSTALL:
+UNINSTALL:
         ;on C128 restore font and clear the screen?
         rts
 
diff --git a/libsrc/c128/libref.s b/libsrc/c128/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit
index 98ba5e909e9380059fa0b6d1581bfcec5d9799e0..1d7d41ae04085ebcf9cf80be55cd56a43a5d5217 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
diff --git a/libsrc/c16/libref.s b/libsrc/c16/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit
index f559bf7f3d4b22b96d090e6c48cc14a2e9b4f86c..8508b8b567fb13515d7ff2dc0370eb6ef93a475c 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index fcfeaeb9b0bc8541f7a03f0067826d22786d0e62..c06a83daffbabe8df35b41fd922630cb1d2455aa 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 0c106f406838e735a4f884f3426c006b71c41966..f2de8091646623b208a2b9fedae3ad2a98a971bd 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index a2a2e4783e65c13c56a9d59962eae29f8512f78a..67a33ecf6718f12d9b3da772eee0e9da2bd8ea3f 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 1c2961591004a3f8290c7b79605a5877d5a0950a..b73ccc5479ca1eb0351a6a44b9ad3d073d4eee76 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index b4192e74bf4c99bafd3ded076069d9ac768ef868..d424024c7dfee2f0d9ece38f8c87e18eab6d4f3c 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 133e0af03cff950c2c1e67e9879c7c5b642f01ba..c397a739d62122f00dd0e73e79423cde5c4ba62f 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index a69c68f1535e53e5689b918239c36c509a91b302..cd09d33f4a49f366c105de9e2cbfc3b375495b5c 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
index 555b0b95a7c40086d24f9b4b656ab9e9ddae0b45..62bc2007b65753eac17d9a28632f4e42ea3a75b3 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
diff --git a/libsrc/c64/libref.s b/libsrc/c64/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit
index 65ebbddf85d28df60c467012f2169c66914e3b1d..df7e17dc75f9075e4f58bcc7eb8a6fc1e778ec36 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
diff --git a/libsrc/cbm510/libref.s b/libsrc/cbm510/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit
index 8f71e405c1e41225d2388013cdeef3491022ccf4..6131d0093156fdeaaf9ef4a41e26b6d231d0f16c 100644 (file)
         .byte   $65, $6d, $64           ; "emd"
         .byte   EMD_API_VERSION         ; EM API version number
 
-; Jump table.
-
-        .word   INSTALL
-        .word   UNINSTALL
-        .word   PAGECOUNT
-        .word   MAP
-        .word   USE
-        .word   COMMIT
-        .word   COPYFROM
-        .word   COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
diff --git a/libsrc/cbm610/libref.s b/libsrc/cbm610/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit
index 9c134296400e7fa3e751c88504028db2051c29bd..21203d25048e26829798ea7a8ae15ca11fbb5168 100644 (file)
@@ -4,7 +4,7 @@
 ; Common functions of the extended memory API.
 ;
 
-        .import         return0
+        .import         return0, em_libref
         .importzp       ptr1
 
         .include        "em-kernel.inc"
@@ -55,6 +55,15 @@ _em_install:
         dey
         bpl     @L0
 
+; Set the library reference
+
+        ldy     #EMD_HDR::LIBREF
+        lda     #<em_libref
+        sta     (ptr1),y
+        iny
+        lda     #>em_libref
+        sta     (ptr1),y
+
 ; Copy the jump vectors
 
         ldy     #EMD_HDR::JUMPTAB
index 7064a78fcf92e752200441cc3764e45d6091fb3c..60a805c4e935d5b2e9e15158c5d87796a0a5d936 100644 (file)
         .byte $65, $6d, $64     ; "emd"
         .byte EMD_API_VERSION   ; EM API version number
 
-; Jump table.
-
-        .word INSTALL
-        .word UNINSTALL
-        .word PAGECOUNT
-        .word MAP
-        .word USE
-        .word COMMIT
-        .word COPYFROM
-        .word COPYTO
+; Library reference
+
+        .addr   $0000
+
+; Jump table
+
+        .addr   INSTALL
+        .addr   UNINSTALL
+        .addr   PAGECOUNT
+        .addr   MAP
+        .addr   USE
+        .addr   COMMIT
+        .addr   COPYFROM
+        .addr   COPYTO
 
 ; ------------------------------------------------------------------------
 ; Constants
diff --git a/libsrc/geos-cbm/system/libref.s b/libsrc/geos-cbm/system/libref.s
new file mode 100644 (file)
index 0000000..507c988
--- /dev/null
@@ -0,0 +1,8 @@
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+        .export         em_libref
+        .import         _exit
+
+em_libref       := _exit