]> git.sur5r.net Git - cc65/blob - libsrc/runtime/laddeqsp.s
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / libsrc / runtime / laddeqsp.s
1 ;
2 ; Ullrich von Bassewitz, 08.10.1998
3 ;
4 ; CC65 runtime: += operator for longs on the stack
5 ;
6
7         .export         laddeq0sp, laddeqysp
8         .importzp       sp, sreg
9
10 laddeq0sp:
11         ldy     #0
12 laddeqysp:
13         clc
14         adc     (sp),y
15         sta     (sp),y
16         pha
17         iny
18         txa
19         adc     (sp),y
20         sta     (sp),y
21         tax
22         iny
23         lda     sreg
24         adc     (sp),y
25         sta     (sp),y
26         sta     sreg
27         iny
28         lda     sreg+1
29         adc     (sp),y
30         sta     (sp),y
31         sta     sreg+1
32         pla
33         rts
34