source: trunk/libs/newlib/src/newlib/libc/machine/w65/sdivhi3.S @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 364 bytes
Line 
1        .global ___sdivhi3
2
3___sdivhi3:
4        lda     <r4
5        ldx     <r5             
6
7        ldy     #0              !flag positive result
8        rol     a
9        ror     a
10        bpl     L10
11
12        iny                     !flag negative result
13        eor     #0xFFFF
14        inc     a
15
16L10:    pha
17        txa
18        bpl     L20
19
20        dey                     !flag negative/positive result
21        eor     #0xFFFF
22        inc     a
23        tax
24
25L20:    pla
26        phy
27        jsr     >udv
28        ply
29        beq     Lend            !if positive result
30
31        eor     #0xFFFF         !negate result
32        inc     a
33
34Lend:   sta     <r0
35        rtl
Note: See TracBrowser for help on using the repository browser.