]> git.sur5r.net Git - cc65/commitdiff
Splitted the push.s module
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 26 Oct 2000 20:43:54 +0000 (20:43 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 26 Oct 2000 20:43:54 +0000 (20:43 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@397 b7a2c559-68d2-44c3-8de9-860c34a00d81

15 files changed:
libsrc/runtime/Makefile
libsrc/runtime/push.s [deleted file]
libsrc/runtime/push1.s [new file with mode: 0644]
libsrc/runtime/push2.s [new file with mode: 0644]
libsrc/runtime/push3.s [new file with mode: 0644]
libsrc/runtime/push4.s [new file with mode: 0644]
libsrc/runtime/push5.s [new file with mode: 0644]
libsrc/runtime/push6.s [new file with mode: 0644]
libsrc/runtime/push7.s [new file with mode: 0644]
libsrc/runtime/pusha.s [new file with mode: 0644]
libsrc/runtime/pushaff.s [new file with mode: 0644]
libsrc/runtime/pushax.s [new file with mode: 0644]
libsrc/runtime/pushc0.s [new file with mode: 0644]
libsrc/runtime/pushc1.s [new file with mode: 0644]
libsrc/runtime/pushc2.s [new file with mode: 0644]

index c96d55c7b95b9f1d6aa14d38911695cdbb49d596..a9d5e2853006b29bffc43f79fd800fe77afb8f62 100644 (file)
@@ -118,9 +118,21 @@ OBJS =     add.o           \
                or.o            \
        popa.o          \
                popsreg.o       \
-               push.o          \
+       push1.o         \
+               push2.o         \
+       push3.o         \
+       push4.o         \
+       push5.o         \
+       push6.o         \
+       push7.o         \
+       pusha.o         \
+       pushaff.o       \
+       pushax.o        \
                pushb.o         \
                pushbsp.o       \
+       pushc0.o        \
+               pushc1.o        \
+       pushc2.o        \
                pushw.o         \
                pushwsp.o       \
        return0.o       \
diff --git a/libsrc/runtime/push.s b/libsrc/runtime/push.s
deleted file mode 100644 (file)
index 0f2ff3c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-;
-; Ullrich von Bassewitz, 05.08.1998
-;
-; CC65 runtime: Push ints onto the stack
-;
-
-;
-; push/pop things on stack
-;
-       .export         push0, push1, push2, push3, push4, push5
-       .export         push6, push7, pusha0, pushaFF, pushax
-       .export         pusha, pushaysp, pushc0, pushc1, pushc2
-       .importzp       sp
-
-pushaFF:
-       ldx     #$FF
-       bne     pushax
-
-push7: lda     #7
-       bne     pusha0
-push6: lda     #6
-       bne     pusha0
-push5: lda     #5
-       bne     pusha0
-push4: lda     #4
-       bne     pusha0
-push3: lda     #3
-       bne     pusha0
-push2: lda     #2
-       bne     pusha0
-push1: lda     #1
-       bne     pusha0
-push0: lda     #0
-;      beq     pusha0
-pusha0:        ldx     #0
-
-; This function is used *a lot*, so don't call any subroutines here.
-; Beware: The value in ax must not be changed by this function!
-; Beware^2: The optimizer knows about the value of Y after the function
-;           returns!
-
-pushax:        ldy     sp
-               beq     @L1
-               dey
-               beq     @L2
-               dey
-@L0:   sty     sp
-       ldy     #0              ; get index
-       sta     (sp),y          ; store lo byte
-       pha                     ; save it
-       txa                     ; get hi byte
-       iny                     ; bump idx
-       sta     (sp),y          ; store hi byte
-       pla                     ; get A back
-       rts                     ; done
-
-@L1:   dey
-@L2:   dey
-       dec     sp+1
-       bne     @L0             ; Branch always
-
-; Push for chars, same warning as above: The optimizer expects the value
-; 0 in the Y register after this function.
-
-pushc2:        lda     #2
-       bne     pusha
-pushc1:        lda     #1
-       bne     pusha
-pushc0:        lda     #0
-       beq     pusha
-pushaysp:           
-       lda     (sp),y
-pusha: ldy     sp
-               beq     @L1
-       dec     sp
-       ldy     #0
-       sta     (sp),y
-       rts
-
-@L1:   dec     sp+1
-       dec     sp
-       sta     (sp),y
-       rts
diff --git a/libsrc/runtime/push1.s b/libsrc/runtime/push1.s
new file mode 100644 (file)
index 0000000..d58509a
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (int)1 onto the stack
+;
+
+               .export         push1
+       .import         pusha0
+
+; Beware: The optimizer knows about this function!
+
+.proc  push1
+
+       lda     #1
+       jmp     pusha0
+
+.endproc
+
+
diff --git a/libsrc/runtime/push2.s b/libsrc/runtime/push2.s
new file mode 100644 (file)
index 0000000..2bbf815
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (int)2 onto the stack
+;
+
+               .export         push2
+       .import         pusha0
+
+; Beware: The optimizer knows about this function!
+
+.proc  push2
+
+       lda     #2
+       jmp     pusha0
+
+.endproc
+
+
diff --git a/libsrc/runtime/push3.s b/libsrc/runtime/push3.s
new file mode 100644 (file)
index 0000000..d55d1e4
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (int)3 onto the stack
+;
+
+               .export         push3
+       .import         pusha0
+
+; Beware: The optimizer knows about this function!
+
+.proc  push3
+
+       lda     #3
+       jmp     pusha0
+
+.endproc
+
+
diff --git a/libsrc/runtime/push4.s b/libsrc/runtime/push4.s
new file mode 100644 (file)
index 0000000..0ceeeda
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (int)4 onto the stack
+;
+
+               .export         push4
+       .import         pusha0
+
+; Beware: The optimizer knows about this function!
+
+.proc  push4
+
+       lda     #4
+       jmp     pusha0
+
+.endproc
+
+
diff --git a/libsrc/runtime/push5.s b/libsrc/runtime/push5.s
new file mode 100644 (file)
index 0000000..5834864
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (int)5 onto the stack
+;
+
+               .export         push5
+       .import         pusha0
+
+; Beware: The optimizer knows about this function!
+
+.proc  push5
+
+       lda     #5
+       jmp     pusha0
+
+.endproc
+
+
diff --git a/libsrc/runtime/push6.s b/libsrc/runtime/push6.s
new file mode 100644 (file)
index 0000000..7355aea
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (int)6 onto the stack
+;
+
+               .export         push6
+       .import         pusha0
+
+; Beware: The optimizer knows about this function!
+
+.proc  push6
+
+       lda     #6
+       jmp     pusha0
+
+.endproc
+
+
diff --git a/libsrc/runtime/push7.s b/libsrc/runtime/push7.s
new file mode 100644 (file)
index 0000000..2dfc994
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (int)7 onto the stack
+;
+
+               .export         push7
+       .import         pusha0
+
+; Beware: The optimizer knows about this function!
+
+.proc  push7
+
+       lda     #7
+       jmp     pusha0
+
+.endproc
+
+
diff --git a/libsrc/runtime/pusha.s b/libsrc/runtime/pusha.s
new file mode 100644 (file)
index 0000000..d8e90ac
--- /dev/null
@@ -0,0 +1,25 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push value in a onto the stack
+;
+
+               .export         pushaysp, pusha
+       .importzp       sp
+
+; Beware: The optimizer knows about this function!
+
+pushaysp:
+       lda     (sp),y
+pusha: ldy     sp
+               beq     @L1
+       dec     sp
+       ldy     #0
+       sta     (sp),y
+       rts
+
+@L1:   dec     sp+1
+       dec     sp
+       sta     (sp),y
+       rts
+
diff --git a/libsrc/runtime/pushaff.s b/libsrc/runtime/pushaff.s
new file mode 100644 (file)
index 0000000..dd8dc87
--- /dev/null
@@ -0,0 +1,20 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push a extended with FF onto the stack
+;
+
+               .export         pushaFF
+       .import         pushax
+
+; Beware: The optimizer knows about this function!
+
+.proc  pushaFF
+
+       ldx     #$FF
+       jmp     pushax
+
+.endproc
+
+
+                     
diff --git a/libsrc/runtime/pushax.s b/libsrc/runtime/pushax.s
new file mode 100644 (file)
index 0000000..077c52c
--- /dev/null
@@ -0,0 +1,38 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push value in a/x onto the stack
+;
+
+               .export         push0, pusha0, pushax
+       .importzp       sp
+
+push0: lda     #0
+pusha0:        ldx     #0
+
+; This function is used *a lot*, so don't call any subroutines here.
+; Beware: The value in ax must not be changed by this function!
+; Beware^2: The optimizer knows about the value of Y after the function
+;           returns!
+
+pushax:        ldy     sp
+               beq     @L1
+               dey
+               beq     @L2
+               dey
+@L0:   sty     sp
+       ldy     #0              ; get index
+       sta     (sp),y          ; store lo byte
+       pha                     ; save it
+       txa                     ; get hi byte
+       iny                     ; bump idx
+       sta     (sp),y          ; store hi byte
+       pla                     ; get A back
+       rts                     ; done
+
+@L1:   dey
+@L2:   dey
+       dec     sp+1
+       jmp     @L0
+
+                   
diff --git a/libsrc/runtime/pushc0.s b/libsrc/runtime/pushc0.s
new file mode 100644 (file)
index 0000000..fd72064
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (char)0 onto the stack
+;
+
+               .export         pushc0
+       .import         pusha
+
+; Beware: The optimizer knows about this function!
+
+.proc  pushc0
+
+       lda     #0
+       jmp     pusha
+
+.endproc
+
+
diff --git a/libsrc/runtime/pushc1.s b/libsrc/runtime/pushc1.s
new file mode 100644 (file)
index 0000000..9997b56
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (char)1 onto the stack
+;
+
+               .export         pushc1
+       .import         pusha
+
+; Beware: The optimizer knows about this function!
+
+.proc  pushc1
+
+       lda     #1
+       jmp     pusha
+
+.endproc
+
+
diff --git a/libsrc/runtime/pushc2.s b/libsrc/runtime/pushc2.s
new file mode 100644 (file)
index 0000000..4539f30
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 26.10.2000
+;
+; CC65 runtime: Push (char)2 onto the stack
+;
+
+               .export         pushc2
+       .import         pusha
+
+; Beware: The optimizer knows about this function!
+
+.proc  pushc2
+
+       lda     #2
+       jmp     pusha
+
+.endproc
+
+