]> git.sur5r.net Git - cc65/blob - libsrc/runtime/mulax7.s
goto.c warning fix for implicit truncation
[cc65] / libsrc / runtime / mulax7.s
1 ;
2 ; Piotr Fusik, 24.10.2003
3 ; originally by Ullrich von Bassewitz
4 ;
5 ; CC65 runtime: Multiply the primary register by 7
6 ;
7 ; Don't touch the Y-register here, the optimizer relies on it!
8
9         .export         mulax7
10         .importzp       ptr1
11
12 .proc   mulax7
13
14         sta     ptr1
15         stx     ptr1+1
16         asl     a
17         rol     ptr1+1                  ; * 2
18         asl     a
19         rol     ptr1+1                  ; * 4
20         asl     a
21         rol     ptr1+1                  ; * 8
22         sec
23         sbc     ptr1
24         pha
25         txa
26         eor     #$ff
27         adc     ptr1+1                  ; * (8 - 1)
28         tax
29         pla
30         rts
31
32 .endproc
33
34