]> git.gag.com Git - fw/sdcc/blobdiff - src/z80/peeph-gbz80.def
2001-10-21 Michael Hope <michaelh@juju.net.nz>
[fw/sdcc] / src / z80 / peeph-gbz80.def
index 8f1977d5e5db2fdb22164632b05fa26e2f6ec2c5..846e49c9a7b6e00c2393ee318fa64f73ac479ff3 100644 (file)
@@ -1,76 +1,43 @@
-replace restart {
-       ld %1,%1
+replace {
+       ld      (hl),a
+        dec     hl
 } by {
-       ; Removed redundent load
+        ld      (hl-),a
 }
-replace restart {
-       xor a,a
-       or a,%1
-       or a,a
-       jp %2,%3
-} by {
-       ; Removed redundent or a,a
-       xor     a,a
-       or      a,%1
-       jp      %2,%3
-}
-replace restart {
-       cp a,#0x00
-       jp nz,%1
-} by {
-       ; Rule 3
-       or      a,a
-       jp      nz,%1
-}
-replace restart {
-       jp nz,%1
-       jp      %2
-%1:
-       jp      %3
-%2:
+replace {
+       ld      (hl),a
+       inc     hl
 } by {
-       ; Rule 4
-       jp      z,%2
-%1:
-       jp      %3
-%2:
+       ld      (hl+),a
 }
-replace restart {
-       jp      nz,%1
-       jp      %2
-%1:
+replace {
+       ld      a,(hl)
+       inc     hl
 } by {
-       ; Rule 5
-       jp      z,%2
-%1:
+       ld      a,(hl+)
 }
-replace restart {
-       jp      z,%1
-       jp      %2
-%1:
+replace {
+       ld      a,[hl]
+       inc     hl
 } by {
-       ; Rule 6
-       jp      nz,%2
-%1:
+       ld      a,[hl+]
 }
-replace restart {
-%1:
-       jp      %2
-       jp      %3
+replace {
+       ld      a,[hl]
+       inc     hl
 } by {
-       ; Weird Rule 7
-%1:
-       jp      %2
+       ld      a,[hl+]
 }
-replace restart {
-       ld      (hl),a
+replace {
+       ld      [hl],a
        inc     hl
 } by {
-       ld      (hl+),a
+       ld      [hl+],a
 }
-replace restart {
-       ld      a,(hl)
-       inc     hl
+replace {
+       ld      [hl],a
+       dec     hl
 } by {
-       ld      a,(hl+)
+       ld      [hl-],a
 }
+