]> git.sur5r.net Git - cc65/blob - libsrc/runtime/subeqsp.s
Rewrite of spaspidx and staxspidx. More module splits.
[cc65] / libsrc / runtime / subeqsp.s
1 ;
2 ; Ullrich von Bassewitz, 08.10.1998
3 ;
4 ; CC65 runtime: -= operator for ints on the stack
5 ;
6
7         .export         subeq0sp, subeqysp
8         .importzp       sp, tmp1, tmp2
9
10 subeq0sp:
11         ldy     #0
12 subeqysp:
13         sec
14         sta     tmp1
15         stx     tmp2
16         lda     (sp),y
17         sbc     tmp1
18         sta     (sp),y
19         pha
20         iny
21         lda     (sp),y
22         sbc     tmp2
23         sta     (sp),y
24         tax
25         pla
26         rts
27