Applied patch #2741451 and reorganized mod functions
[fw/sdcc] / device / lib / z80 / modsigned.s
diff --git a/device/lib/z80/modsigned.s b/device/lib/z80/modsigned.s
new file mode 100644 (file)
index 0000000..e852059
--- /dev/null
@@ -0,0 +1,33 @@
+        .area   _CODE
+
+__modschar_rrx_s::
+        ld      hl,#2+1
+        add     hl,sp
+
+        ld      e,(hl)
+        dec     hl
+        ld      l,(hl)
+
+        ;; Fall through
+__modschar_rrx_hds::
+        call    __div8
+
+        ex     de,hl
+        ret
+
+__modsint_rrx_s::
+        pop     af
+        pop     hl
+        pop     de
+        push    de
+        push    hl
+        push    af
+
+        ;; Fall through
+__modsint_rrx_hds::
+        call    __div16
+
+        ex      de,hl
+
+        ret
+