]> git.sur5r.net Git - cc65/commitdiff
Split of the lruntime module
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 1 Nov 2000 22:03:22 +0000 (22:03 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 1 Nov 2000 22:03:22 +0000 (22:03 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@427 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/Makefile
libsrc/runtime/ldeaxysp.s [new file with mode: 0644]
libsrc/runtime/lruntime.s [deleted file]
libsrc/runtime/pushlysp.s [new file with mode: 0644]
libsrc/runtime/steaxspi.s [new file with mode: 0644]
libsrc/runtime/steaxspp.s [new file with mode: 0644]

index 98f703160a2319cf5dc7f6a4b6e9b9b39245b106..681ce343191d60d32111c49d426c25ee9c7a1ddf 100644 (file)
@@ -81,6 +81,7 @@ OBJS =        add.o           \
                ldaxsp.o        \
                ldeax.o         \
                ldeaxi.o        \
+       ldeaxysp.o      \
                ldec.o          \
                ldiv.o          \
                le.o            \
@@ -100,7 +101,6 @@ OBJS =      add.o           \
                lpop.o          \
                lpush.o         \
                lrsub.o         \
-               lruntime.o      \
                lsave.o         \
                lshelp.o        \
                lshl.o          \
@@ -143,6 +143,7 @@ OBJS =      add.o           \
        pushc0.o        \
                pushc1.o        \
        pushc2.o        \
+       pushlysp.o      \
                pushw.o         \
                pushwsp.o       \
        return0.o       \
@@ -163,6 +164,7 @@ OBJS =      add.o           \
        staxspidx.o     \
        staxspp.o       \
                steaxsp.o       \
+       steaxspp.o      \
                sub.o           \
                subeqsp.o       \
        subysp.o        \
diff --git a/libsrc/runtime/ldeaxysp.s b/libsrc/runtime/ldeaxysp.s
new file mode 100644 (file)
index 0000000..cf15f3f
--- /dev/null
@@ -0,0 +1,28 @@
+;
+; Ullrich von Bassewitz, 22.06.1998
+;
+; CC65 runtime: Load a long from somewhere in the stack
+;
+; Beware: The optimizer knows about the register contents after calling
+;        this function!
+;
+
+
+       .export         ldeax0sp, ldeaxysp
+       .importzp       sreg, sp
+
+ldeax0sp:
+       ldy     #3
+ldeaxysp:
+       lda     (sp),y
+       sta     sreg+1
+       dey
+       lda     (sp),y
+       sta     sreg
+       dey
+       lda     (sp),y
+       tax
+       dey
+       lda     (sp),y
+       rts
+
diff --git a/libsrc/runtime/lruntime.s b/libsrc/runtime/lruntime.s
deleted file mode 100644 (file)
index 3a8cd01..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-;
-; lruntime.s
-;
-; Ullrich von Bassewitz, 22.06.1998
-;
-
-; Runtime support for longs.
-
-       .import         popax, pusheax
-       .importzp       sp, sreg, tmp1, tmp2, tmp3, ptr1
-
-;
-; leax    (sp),y
-;
-       .export         ldeax0sp, ldeaxysp
-
-ldeax0sp:
-       ldy     #3
-ldeaxysp:
-       lda     (sp),y
-       sta     sreg+1
-       dey
-       lda     (sp),y
-       sta     sreg
-       dey
-       lda     (sp),y
-       tax
-       dey
-       lda     (sp),y
-       rts
-
-;
-; push a long from (sp),y
-;
-       .export         pushlysp
-
-pushlysp:
-       iny
-       iny
-       lda     (sp),y
-       iny
-       sta     sreg
-       lda     (sp),y
-       sta     sreg+1
-       dey
-       dey
-       lda     (sp),y
-       dey
-       tax
-       lda     (sp),y
-       jmp     pusheax
-
-;
-; eax --> ((sp)); pop
-;
-       .export         steaxspp
-
-steaxspp:
-       pha
-       txa
-       pha
-       jsr     popax           ; get address
-       sta     ptr1
-       stx     ptr1+1
-       ldy     #3
-       lda     sreg+1
-       sta     (ptr1),y
-       dey
-       lda     sreg
-       sta     (ptr1),y
-       dey
-       pla
-       tax
-       sta     (ptr1),y
-       dey
-       pla
-       sta     (ptr1),y
-       rts
-
-;
-; eax --> ((sp)),y
-;
-       .export         steaxspidx
-
-steaxspidx:
-       sta     tmp1
-       stx     tmp2
-       sty     tmp3
-       jsr     popax           ; get the pointer
-       sta     ptr1
-       stx     ptr1+1
-       ldy     tmp3
-       lda     tmp1
-       sta     (ptr1),y
-       iny
-       lda     tmp2
-       sta     (ptr1),y
-       iny
-       tax
-       lda     sreg
-       sta     (ptr1),y
-       iny
-       lda     sreg+1
-       sta     (ptr1),y
-       lda     tmp1
-       rts
-
diff --git a/libsrc/runtime/pushlysp.s b/libsrc/runtime/pushlysp.s
new file mode 100644 (file)
index 0000000..a91b9f7
--- /dev/null
@@ -0,0 +1,31 @@
+;
+; Ullrich von Bassewitz, 22.06.1998
+;
+; CC65 runtime: Push a long from somewhere in the stack
+;
+
+
+       .export         pushlysp
+       .import         pusheax
+       .importzp       sreg, sp
+
+.proc  pushlysp
+
+       iny
+       iny
+       lda     (sp),y
+       iny
+       sta     sreg
+       lda     (sp),y
+       sta     sreg+1
+       dey
+       dey
+       lda     (sp),y
+       dey
+       tax
+       lda     (sp),y
+       jmp     pusheax
+
+.endproc
+
+
diff --git a/libsrc/runtime/steaxspi.s b/libsrc/runtime/steaxspi.s
new file mode 100644 (file)
index 0000000..ec1777e
--- /dev/null
@@ -0,0 +1,39 @@
+;
+; Ullrich von Bassewitz, 22.06.1998
+;
+; CC65 runtime: Store eax at the address on top of stack with index
+;
+
+
+       .export         steaxspidx
+       .import         popax
+       .importzp       sreg, ptr1, tmp1, tmp2, tmp3
+
+
+.proc  steaxspidx
+
+       sta     tmp1
+       stx     tmp2
+       sty     tmp3
+       jsr     popax           ; get the pointer
+       sta     ptr1
+       stx     ptr1+1
+       ldy     tmp3
+       lda     tmp1
+       sta     (ptr1),y
+       iny
+       lda     tmp2
+       sta     (ptr1),y
+       iny
+       tax
+       lda     sreg
+       sta     (ptr1),y
+       iny
+       lda     sreg+1
+       sta     (ptr1),y
+       lda     tmp1
+       rts
+
+.endproc
+
+
diff --git a/libsrc/runtime/steaxspp.s b/libsrc/runtime/steaxspp.s
new file mode 100644 (file)
index 0000000..5116556
--- /dev/null
@@ -0,0 +1,37 @@
+;
+; Ullrich von Bassewitz, 22.06.1998
+;
+; CC65 runtime: Store eax at the address on top of stack.
+;
+
+
+       .export         steaxspp
+       .import         popax
+       .importzp       sreg, ptr1
+
+.proc  steaxspp
+
+       pha
+       txa
+       pha
+       jsr     popax           ; get address
+       sta     ptr1
+       stx     ptr1+1
+       ldy     #3
+       lda     sreg+1
+       sta     (ptr1),y
+       dey
+       lda     sreg
+       sta     (ptr1),y
+       dey
+       pla
+       tax
+       sta     (ptr1),y
+       dey
+       pla
+       sta     (ptr1),y
+       rts
+
+.endproc
+
+