Optimize rst 8 routine, ld hl,(bc)+
authorNick Downing <nick@ndcode.org>
Mon, 10 Jun 2019 00:27:03 +0000 (10:27 +1000)
committerNick Downing <nick@ndcode.org>
Mon, 10 Jun 2019 00:27:03 +0000 (10:27 +1000)
sm.asm

diff --git a/sm.asm b/sm.asm
index 30237f9..4d6691d 100644 (file)
--- a/sm.asm
+++ b/sm.asm
@@ -196,12 +196,12 @@ print_char:
        .org    0x308
 
 ; ld hl,(bc)+
-       rst     0x10 ; ex bc,hl
-       ld      c,(hl)
-       inc     hl
-       ld      b,(hl)
-       inc     hl
-       rst     0x10 ; ex bc,hl
+       ld      a,(bc)
+       ld      l,a
+       inc     bc
+       ld      a,(bc)
+       ld      h,a
+       inc     bc
        ret
 
        .org    0x310
@@ -479,7 +479,7 @@ dispatch_m4:
 ;      .db     0x3e ; ld a,
 sub_xw: ; same as xchg_w, sub_w
        pop     hl
-       rst     0x10
+       rst     0x10 ; ex bc,hl
        .db     0x3e ; ld a,
 sub_w: ; same as neg_w, add_w
        pop     hl