From 9d8ea79c7fc763cdb809f35b77e65bdff6c9f469 Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 7 Feb 2019 08:45:20 +0100 Subject: [PATCH] rst 1 now takes an eight-bit parameter, not a 16 bit one. Reduces Star Trek again from 43205 to 42339 bytes. --- mach/i80/libem/rst.s | 15 +++++++++------ mach/i80/ncg/table | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/mach/i80/libem/rst.s b/mach/i80/libem/rst.s index b4ad39bee..37025ef17 100644 --- a/mach/i80/libem/rst.s +++ b/mach/i80/libem/rst.s @@ -13,16 +13,19 @@ shld 0x09 ret - ! de = [bc+const2] (remember bc is the frame pointer) + ! de = [bc+const1] (remember bc is the frame pointer) rst1: pop h - mov e, m - inx h - mov d, m + mov a, m inx h push h - xchg ! hl = offset - dad b + + mov l, a + ral + sbb a + mov h, a + + dad b mov e, m inx h mov d, m diff --git a/mach/i80/ncg/table b/mach/i80/ncg/table index 4101d2772..f24c4d39c 100644 --- a/mach/i80/ncg/table +++ b/mach/i80/ncg/table @@ -131,7 +131,7 @@ INSTRUCTIONS /* rpe cost(1, 8). */ /* rpo cost(1, 8). */ rrc kills a:cc cost(1, 4). - rst const1:ro kills a:cc cost(1,11). + rst const1:ro cost(1,11). /* rz cost(1, 8). */ sbb reg1:ro kills a:cc cost(1, 4). /* sbi const1:ro kills a:cc cost(2, 7). */ @@ -244,24 +244,24 @@ pat ldc yields {const2,highw($1)} {const2,loww($1)} #ifdef USE_I80_RSTS - pat lol + pat lol sfit($1, 8) kills hlreg uses hlreg, dereg gen rst {const1, 1} - data2 {const2, $1} - yields de -#else - pat lol - uses hlreg={const2, $1}, dereg - gen - dad lb - mov e,{m} - inx hl - mov d,{m} + data1 {const1, $1} yields de #endif +pat lol + uses hlreg={const2, $1}, dereg + gen + dad lb + mov e,{m} + inx hl + mov d,{m} + yields de + pat loe uses hlreg gen lhld {label,$1} yields hl