]> git.sur5r.net Git - cc65/blob - libsrc/runtime/lruntime.s
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / libsrc / runtime / lruntime.s
1 ;
2 ; lruntime.s
3 ;
4 ; Ullrich von Bassewitz, 22.06.1998
5 ;
6
7 ; Runtime support for longs.
8
9         .import         popax, pusheax, staspic
10         .importzp       sp, sreg, tmp2, ptr1
11
12 ;
13 ; leax    (sp),y
14 ;
15         .export         ldeax0sp, ldeaxysp
16
17 ldeax0sp:
18         ldy     #3
19 ldeaxysp:
20         lda     (sp),y
21         sta     sreg+1
22         dey
23         lda     (sp),y
24         sta     sreg
25         dey
26         lda     (sp),y
27         tax
28         dey
29         lda     (sp),y
30         rts
31
32 ;
33 ; push a long from (sp),y
34 ;
35         .export         pushlysp
36
37 pushlysp:
38         iny
39         iny
40         lda     (sp),y
41         iny
42         sta     sreg
43         lda     (sp),y
44         sta     sreg+1
45         dey
46         dey
47         lda     (sp),y
48         dey
49         tax
50         lda     (sp),y
51         jmp     pusheax
52
53 ;
54 ; eax --> ((sp)); pop
55 ;
56         .export         steaxspp
57
58 steaxspp:
59         pha
60         txa
61         pha
62         jsr     popax           ; get address
63         sta     ptr1
64         stx     ptr1+1
65         ldy     #3
66         lda     sreg+1
67         sta     (ptr1),y
68         dey
69         lda     sreg
70         sta     (ptr1),y
71         dey
72         pla
73         tax
74         sta     (ptr1),y
75         dey
76         pla
77         sta     (ptr1),y
78         rts
79
80 ;
81 ; eax --> ((sp)),y
82 ;
83         .export         steaxspidx
84
85 steaxspidx:
86         jsr     staspic         ; Get pointer, store a
87         pha
88         iny
89         lda     tmp2
90         sta     (ptr1),y
91         iny
92         tax
93         lda     sreg
94         sta     (ptr1),y
95         iny
96         lda     sreg+1
97         sta     (ptr1),y
98         pla
99         rts
100