]> git.sur5r.net Git - cc65/blob - libsrc/runtime/lrsub.s
Added mouse module from C64
[cc65] / libsrc / runtime / lrsub.s
1 ;
2 ; Ullrich von Bassewitz, 05.08.1998
3 ;
4 ; CC65 runtime: long sub reversed
5 ;
6
7 ;
8 ; EAX = EAX - TOS
9 ;
10         .export         tosrsubeax
11         .import         addysp1
12         .importzp       sp, sreg, tmp1
13
14 tosrsubeax:
15         ldy     #0
16         sec
17         sbc     (sp),y          ; byte 0
18         sta     tmp1            ; use as temp storage
19         txa
20         iny
21         sbc     (sp),y          ; byte 1
22         tax
23         iny
24         lda     sreg
25         sbc     (sp),y          ; byte 2
26         sta     sreg
27         iny
28         lda     sreg+1
29         sbc     (sp),y          ; byte 3
30         sta     sreg+1
31         lda     tmp1
32         jmp     addysp1         ; drop TOS
33