From a91ab5c59995342cbe4a1d7d400ebea6660290f0 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 8 Feb 2019 21:35:14 +0100 Subject: [PATCH] Somehow the implementation of rst 2 got lost, with hilarious results. Also fix some register corruption issues (I hope). --- mach/i80/libem/rst.s | 22 ++++++++++++++++++++++ mach/i80/ncg/table | 7 +++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/mach/i80/libem/rst.s b/mach/i80/libem/rst.s index 37025ef17..c0d5984d8 100644 --- a/mach/i80/libem/rst.s +++ b/mach/i80/libem/rst.s @@ -9,8 +9,11 @@ .rst_init: mvi a, 0xc3 ! jmp sta 0x08 + sta 0x10 lxi h, rst1 shld 0x09 + lxi h, rst2 + shld 0x11 ret ! de = [bc+const1] (remember bc is the frame pointer) @@ -30,3 +33,22 @@ rst1: inx h mov d, m ret + + ! [bc+const1] = de (remember bc is the frame pointer) +rst2: + pop h + mov a, m + inx h + push h + + mov l, a + ral + sbb a + mov h, a + + dad b + mov m, e + inx h + mov m, d + ret + diff --git a/mach/i80/ncg/table b/mach/i80/ncg/table index ab99b882e..0e3864a44 100644 --- a/mach/i80/ncg/table +++ b/mach/i80/ncg/table @@ -245,8 +245,7 @@ pat ldc yields {const2,highw($1)} #ifdef USE_I80_RSTS pat lol sfit($1, 8) - kills hlreg - uses hlreg, dereg + uses hlreg, areg, dereg gen rst {const1, 1} data1 {const1, $1} @@ -462,8 +461,8 @@ with dereg yields de de leaving stl $1 #ifdef USE_I80_RSTS pat stl sfit($1, 8) - with dereg - kills hlreg, areg + with dereg + uses hlreg, areg gen rst {const1, 2} data1 {const1, $1}