fixed bug in register pair loading
[fw/sdcc] / src / z80 / peeph-gbz80.def
index 178a3fb4d7ea1fe35be240737a4e54789e0dcab3..9341d6b77f0aa28a5ac8152cbca47e1b46c6ce2c 100644 (file)
@@ -1,43 +1,73 @@
-replace restart {
+replace {
+       ld      (hl),a
+       dec     hl
+} by {
+       ld      (hl-),a
+}
+replace {
        ld      (hl),a
        inc     hl
 } by {
        ld      (hl+),a
 }
-replace restart {
+replace {
        ld      a,(hl)
        inc     hl
 } by {
        ld      a,(hl+)
 }
-replace restart {
-        ld      (hl),a
-        dec     hl
-} by {
-        ld      (hl-),a
-}
-replace restart {
+replace {
        ld      a,[hl]
        inc     hl
 } by {
        ld      a,[hl+]
 }
-replace restart {
+replace {
        ld      a,[hl]
        inc     hl
 } by {
        ld      a,[hl+]
 }
-replace restart {
+replace {
        ld      [hl],a
        inc     hl
 } by {
        ld      [hl+],a
 }
-replace restart {
+replace {
        ld      [hl],a
        dec     hl
 } by {
        ld      [hl-],a
 }
-
+replace {
+       ld      (hl+),a
+       ld      (hl),d
+       dec     hl
+       ld      e,(hl)
+       inc     hl
+       ld      d,(hl)
+       ld      a,(de)
+} by {
+       ld      (hl+),a
+       ld      (hl),d
+       ld      e,a
+       ld      a,(de)
+}
+replace {
+       ld      (hl),a
+       ld      %1,(hl)
+} by {
+       ld      (hl),a
+       ld      %1,a
+}
+replace {
+       ld      (hl),a
+       inc     de
+       ld      a,(de)
+       inc     hl
+} by {
+       ld      (hl+),a
+       inc     de
+       ld      a,(de)
+}