source:
trunk/libs/newlib/src/newlib/libc/machine/w65/udivhi3.S
@
444
Last change on this file since 444 was 444, checked in by , 6 years ago | |
---|---|
File size: 223 bytes |
Rev | Line | |
---|---|---|
[444] | 1 | .global ___udivhi3 |
2 | ||
3 | ___udivhi3: | |
4 | stz <r0 | |
5 | ldy #1 | |
6 | ldx <r4 | |
7 | lda <r5 | |
8 | ||
9 | div1: | |
10 | asl a | |
11 | bcs div2 | |
12 | iny | |
13 | cpy #17 | |
14 | bne div1 | |
15 | ||
16 | div2: ror a | |
17 | ||
18 | div4: pha | |
19 | txa | |
20 | sec | |
21 | sbc 1,s | |
22 | bcc div3 | |
23 | tax | |
24 | ||
25 | div3: rol <r0 | |
26 | pla | |
27 | lsr a | |
28 | dey | |
29 | bne div4 | |
30 | rtl |
Note: See TracBrowser
for help on using the repository browser.