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 \
+++ /dev/null
-;
-; 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
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
--- /dev/null
+;
+; 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
+
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+