]> git.sur5r.net Git - cc65/commitdiff
Added module with zero page locations
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 26 May 2002 08:29:31 +0000 (08:29 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 26 May 2002 08:29:31 +0000 (08:29 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1288 b7a2c559-68d2-44c3-8de9-860c34a00d81

asminc/zeropage.inc [new file with mode: 0644]
libsrc/runtime/Makefile
libsrc/runtime/zeropage.s [new file with mode: 0644]

diff --git a/asminc/zeropage.inc b/asminc/zeropage.inc
new file mode 100644 (file)
index 0000000..3e651b0
--- /dev/null
@@ -0,0 +1,16 @@
+;
+; zeropage.inc
+;
+; (C) Copyright 2002 Ullrich von Bassewitz (uz@cc65.org)
+;
+
+; Assembler include file that imports the runtime zero page locations used
+; by the compiler, ready for usage in asm code.
+
+
+       .importzp       sp, sreg, regsave
+       .importzp       ptr1, ptr2, ptr3, ptr4
+       .importzp       tmp1, tmp2, tmp3, tmp4
+       .importzp       regbank, zpspace
+
+
index 45a7d1ad6c394a2b8a08856ab525deb5feab2e74..a3e62efb8bcca1cf78eb2e10b6c6bffcf7bd07e3 100644 (file)
@@ -192,7 +192,8 @@ OBJS =      add.o           \
                ule.o           \
                ult.o           \
                umod.o          \
-               xor.o
+               xor.o           \
+        zeropage.o      
 
 all:           $(OBJS)
 
diff --git a/libsrc/runtime/zeropage.s b/libsrc/runtime/zeropage.s
new file mode 100644 (file)
index 0000000..5080cb8
--- /dev/null
@@ -0,0 +1,31 @@
+;
+; Ullrich von Bassewitz, 26.05.2002
+;
+; CC65 runtime: zeropage usage
+;
+
+       .exportzp       sp, sreg, regsave
+       .exportzp       ptr1, ptr2, ptr3, ptr4
+       .exportzp       tmp1, tmp2, tmp3, tmp4
+       .exportzp       regbank, zpspace
+
+; ------------------------------------------------------------------------
+
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+