9d3b04808899b6171d7aa898da7d7b99ef654a43
[fw/sdcc] / device / lib / z80 / mod.s
1         .area   _CODE
2
3 __moduchar_rrx_s::
4         ld      hl,#2+1
5         add     hl,sp
6
7         ld      e,(hl)
8         dec     hl
9         ld      l,(hl)
10
11         ;; Fall through
12 __moduchar_rrx_hds::
13         call    __divu8
14
15         ex      de,hl
16
17         ret
18
19 __moduint_rrx_s::
20         ld      hl,#2+3
21         add     hl,sp
22
23         ld      d,(hl)
24         dec     hl
25         ld      e,(hl)
26         dec     hl
27         ld      a,(hl)
28         dec     hl
29         ld      l,(hl)
30         ld      h,a
31         ;; Fall through
32
33 __moduint_rrx_hds::
34         call    __divu16
35
36         ex      de,hl
37
38         ret
39
40 __moduschar_rrx_s::
41         ld      hl,#2+1
42         add     hl,sp
43
44         ld      e,(hl)
45         ld      d, #0
46         dec     hl
47         ld      l,(hl)
48
49         ld      a,l             ; Sign extend
50         rlca
51         sbc     a
52         ld      h,a
53
54         call    __div16
55
56         ex      de,hl
57
58         ret
59