Many, many improvements made, ususually small ones.

For example: many em-patterns have got alternative code-rules.
This commit is contained in:
garde 1985-02-01 12:51:56 +00:00
parent ca219d89e9
commit 8e154eb826

View file

@ -54,8 +54,8 @@ SETS
reg1 = reg + lbreg + mem . reg1 = reg + lbreg + mem .
bdhsp = regpair + stackpointer . bdhsp = regpair + stackpointer .
bdhpsw = regpair + psword . bdhpsw = regpair + psword .
immediate2 = const2 + label . immediate = const2 + label .
src1 = reg + const1 . src1 = reg .
src2 = hlorde + const2 + label . src2 = hlorde + const2 + label .
src1or2 = src1 + src2 . src1or2 = src1 + src2 .
@ -103,7 +103,7 @@ INSTRUCTIONS
lda label:ro kills a cost(3,13) . lda label:ro kills a cost(3,13) .
ldax regind:ro kills a cost(1,7) . ldax regind:ro kills a cost(1,7) .
lhld label:ro kills hl cost(3,16) . lhld label:ro kills hl cost(3,16) .
lxi bdhsp:wo,immediate2:ro cost(3,10) . lxi bdhsp:wo,immediate:ro cost(3,10) .
mov reg1:wo,reg1:ro cost(1,5) . mov reg1:wo,reg1:ro cost(1,5) .
mvi reg1:wo,const1:ro cost(2,7) . mvi reg1:wo,const1:ro cost(2,7) .
/* nop cost(1,0) . */ /* nop cost(1,0) . */
@ -128,14 +128,14 @@ INSTRUCTIONS
/* rst const1:ro cost(1,11) . */ /* rst const1:ro cost(1,11) . */
/* rz cost(1,8) . */ /* rz cost(1,8) . */
sbb reg1:ro kills a:cc cost(1,4) . sbb reg1:ro kills a:cc cost(1,4) .
sbi const1:ro kills a:cc cost(2,7) . /* sbi const1:ro kills a:cc cost(2,7) . */
shld label:ro cost(3,16) . shld label:ro cost(3,16) .
sphl cost(1,5) . sphl cost(1,5) .
sta label:ro cost(3,13) . sta label:ro cost(3,13) .
stax regind:ro cost(1,7) . stax regind:ro cost(1,7) .
/* stc kills:cc cost(1,4) . */ /* stc kills:cc cost(1,4) . */
sub reg1:ro kills a:cc cost(1,4) . sub reg1:ro kills a:cc cost(1,4) .
/* sui const1:ro kills a:cc cost(2,7) . */ sui const1:ro kills a:cc cost(2,7) .
xchg kills de hl cost(1,4) . xchg kills de hl cost(1,4) .
xra reg1:ro kills a:cc cost(1,4) . xra reg1:ro kills a:cc cost(1,4) .
/* xri const1:ro kills a:cc cost(2,7) . */ /* xri const1:ro kills a:cc cost(2,7) . */
@ -147,16 +147,16 @@ MOVES
from reg to reg from reg to reg
gen mov %2,%1 gen mov %2,%1
from const1 to reg
gen mvi %2,%1
from immediate to bdhsp
gen lxi %2,%1
from reg to regpair from reg to regpair
gen mov %2.2,%1 gen mov %2.2,%1
mvi %2.1,{const1,0} mvi %2.1,{const1,0}
from immediate2 to bdhsp
gen lxi %2,%1
from const1 to reg
gen mvi %2,%1
from regpair to regpair from regpair to regpair
gen mov %2.1,%1.1 gen mov %2.1,%1.1
mov %2.2,%1.2 mov %2.2,%1.2
@ -164,7 +164,7 @@ gen mov %2.1,%1.1
TESTS TESTS
to test areg /* just a dummy test, never used */ to test areg /* just a dummy test, never used */
gen cmp %1 gen ora a
STACKINGRULES STACKINGRULES
@ -181,12 +181,12 @@ gen push hl
move %1,hl move %1,hl
xthl. xthl.
from immediate2 to STACK from immediate to STACK
uses hlorde uses hlorde
gen lxi %a,%1 gen lxi %a,%1
push %a push %a
from immediate2 to STACK from immediate to STACK
gen push hl gen push hl
move %1,hl move %1,hl
xthl. xthl.
@ -207,7 +207,7 @@ gen dcx sp
pop psw pop psw
inx sp yields a inx sp yields a
from immediate2 from immediate
uses regpair uses regpair
gen move %1,%a yields %a gen move %1,%a yields %a
@ -222,6 +222,10 @@ gen mov %a.2,%1
from hlorde yields %1.2 from hlorde yields %1.2
from hlorde
uses areg
gen mov a,%1.2 yields a
PATTERNS PATTERNS
/*********************************************/ /*********************************************/
@ -266,6 +270,7 @@ gen dad lb
pat lof pat lof
with hlorde with hlorde
kills hlorde
uses hlorde={const2,$1} uses hlorde={const2,$1}
gen dad de gen dad de
mov e,m mov e,m
@ -330,13 +335,15 @@ gen move lb,de
dad de yields hl dad de yields hl
pat loi $1==1 pat loi $1==1
with exact label
uses areg
gen lda %1 yields a
with dereg
uses areg
gen ldax de yields a
with hlreg with hlreg
uses reg uses reg
gen mov %a,m yields %a gen mov %a,m yields %a
with dereg
gen ldax de yields a
with exact label
gen lda %1 yields a
pat loi $1==2 pat loi $1==2
with exact label with exact label
@ -352,16 +359,20 @@ with exact label
gen lhld %1 gen lhld %1
xchg. xchg.
lhld {label,%1.off+2} yields hl de lhld {label,%1.off+2} yields hl de
with exact label
gen lhld {label,%1.off+2}
xchg.
lhld %1 yields de hl
with hlreg with hlreg
uses dereg, areg uses dereg, areg
gen mov e,m gen mov e,m
inx %1 inx %1
mov d,m mov d,m
inx %1 inx hl
mov a,m mov a,m
inx %1 inx hl
mov %1.1,m mov h,m
mov %1.2,a yields hl de mov l,a yields hl de
pat loi $1<=510 pat loi $1<=510
with hlorde STACK with hlorde STACK
@ -404,6 +415,16 @@ with STACK
gen lhld {label,$1+2} gen lhld {label,$1+2}
push hl push hl
lhld {label,$1} yields hl lhld {label,$1} yields hl
with
uses dereg, hlreg
gen lhld {label,$1}
xchg.
lhld {label,$1+2} yields hl de
with
uses dereg, hlreg
gen lhld {label,$1+2}
xchg.
lhld {label,$1} yields de hl
pat ldf pat ldf
with hlorde STACK with hlorde STACK
@ -488,12 +509,12 @@ gen dad lb
mov m,e mov m,e
pat lil inc sil $1==$3 pat lil inc sil $1==$3
uses hlreg={const2,$1} uses hlreg={const2,$1}, areg
gen dad lb gen dad lb
mov e,m mov a,m
inx hl inx hl
mov h,m mov h,m
mov l,e mov l,a
inr m inr m
jnz {label,"1f"} jnz {label,"1f"}
inx hl inx hl
@ -501,7 +522,7 @@ gen dad lb
1: 1:
pat lil dec sil $1==$3 pat lil dec sil $1==$3
uses hlreg={const2,$1} uses hlreg={const2,$1}, dereg
gen dad lb gen dad lb
mov e,m mov e,m
inx hl inx hl
@ -527,14 +548,15 @@ gen dad de
pat sti $1==1 pat sti $1==1
with exact label areg with exact label areg
gen sta %1 gen sta %1
with hlreg reg
gen mov m,%2
with exact dereg areg with exact dereg areg
gen stax de gen stax de
with hlreg reg
gen mov m,%2
pat sti $1==2 pat sti $1==2
with exact label hlreg with exact label hlreg
uses hlreg
gen shld %1 gen shld %1
with hlreg dereg with hlreg dereg
gen mov m,e gen mov m,e
@ -552,13 +574,13 @@ with exact label dereg hlreg
shld %1 shld %1
with hlreg dereg STACK with hlreg dereg STACK
gen mov m,e gen mov m,e
inx %1 inx hl
mov m,d
inx hl
pop de
mov m,e
inx hl
mov m,d mov m,d
inx %1
pop %2
mov m,%2.2
inx %1
mov m,%2.1
pat sti $1<511 pat sti $1<511
with hlreg STACK with hlreg STACK
@ -566,9 +588,9 @@ uses areg ={const1,$1/2}, dereg
gen 1: gen 1:
pop de pop de
mov m,e mov m,e
inx %1 inx hl
mov m,d mov m,d
inx %1 inx hl
dcr a dcr a
jnz {label,"1b"} jnz {label,"1b"}
@ -599,6 +621,14 @@ with hlreg STACK
gen shld {label,$1} gen shld {label,$1}
pop hl pop hl
shld {label,$1+2} shld {label,$1+2}
with hlreg dereg STACK
gen shld {label,$1}
xchg.
shld {label,$1+2}
with dereg hlreg STACK
gen shld {label,$1+2}
xchg.
shld {label,$1}
pat sdf pat sdf
with hlorde STACK with hlorde STACK
@ -639,6 +669,14 @@ gen mov a,%2.2
mov a,%2.1 mov a,%2.1
sbb %1.1 sbb %1.1
mov %2.1,a yields %2 mov %2.1,a yields %2
with hlorde hlorde
uses areg
gen mov a,%2.2
sub %1.2
mov %1.2,a
mov a,%2.1
sbb %1.1
mov %1.1,a yields %1
pat sbi $1==4 pat sbi $1==4
with STACK with STACK
@ -712,7 +750,13 @@ pat adu leaving adi $1
pat sbu leaving sbi $1 pat sbu leaving sbi $1
pat mlu leaving mli $1 pat mlu $1==2
with STACK
gen Call {label,".mlu2"} yields de
pat mlu $1==4
with STACK
gen Call {label,".mli4"}
pat dvu $1==2 pat dvu $1==2
with STACK with STACK
@ -788,7 +832,7 @@ with hlorde
gen inx %1 yields %1 gen inx %1 yields %1
pat inl pat inl
uses hlreg={const2,$1}, dereg uses hlreg={const2,$1}
gen dad lb gen dad lb
inr m inr m
jnz {label,"1f"} jnz {label,"1f"}
@ -868,34 +912,31 @@ gen xra a
pat loc loc cii $1==$2 pat loc loc cii $1==$2
pat loc loc cii $1==2 && $2==4 pat loc loc cii $1==2 && $2==4
with dereg with hlorde
uses hlreg uses hlorde={const2,0}, areg
gen move {const2,0},hl gen mov a,%1.1
mov a,d ora a
ral. jp {label,"1f"}
jnc {label,"1f"} lxi %a,{const2,0-1}
lxi hl,{const2,0-1} 1: yields %a %1
1: yields hl de
pat loc loc cii $1==4 && $2==2 pat loc loc cii $1==4 && $2==2
with hlreg dereg yields hl with hlorde hlorde yields %1
with dereg hlreg yields de
pat loc loc cii $1==1 && $2==2 pat loc loc cii $1==1 && $2==2
with reg with reg
uses areg, hlorde uses areg=%1, hlorde
gen move %1,a gen move {const1,0},%b.1
move {const1,0},%b.1
move a,%b.2 move a,%b.2
ral. ora a
jnc {label,"1f"} jp {label,"1f"}
mvi %b.1,{const1,255} mvi %b.1,{const1,255}
1: yields %b 1: yields %b
with hlorde with hlorde
uses areg=%1.2
gen move {const1,0},%1.1 gen move {const1,0},%1.1
move %1.2,a ora a
ral. jp {label,"1f"}
jnc {label,"1f"}
mvi %1.1,{const1,255} mvi %1.1,{const1,255}
1: yields %1 1: yields %1
@ -905,11 +946,11 @@ with reg
gen move %1,l yields hl gen move %1,l yields hl
leaving loc $1 loc $2 cii leaving loc $1 loc $2 cii
with hlreg with hlreg
uses dereg uses dereg, areg
gen move {const1,0},h gen move {const1,0},%1.1
move l,a move l,a
ral. ora a
jnc {label,"1f"} jp {label,"1f"}
mvi h,{const1,255} mvi h,{const1,255}
1: 1:
mov e,h mov e,h
@ -930,22 +971,21 @@ pat ciu leaving cuu $1
pat loc loc cuu $1==$2 pat loc loc cuu $1==$2
pat loc loc cuu $1==2 && $2==4 pat loc loc cuu $1==2 && $2==4
with dereg yields {const2,0} de with src1or2 yields {const2,0} %1
pat loc loc cuu $1==4 && $1==2 pat loc loc cuu $1==4 && $1==2
with hlreg dereg yields hl with src1or2 src1or2 yields %1
with dereg hlreg yields de
pat loc loc cuu $1==1 && $2==2 pat loc loc cuu $1==1 && $2==2
with reg with reg
uses hlorde uses reusing %1, hlorde
gen move %1,%a yields %a gen move %1,%a yields %a
with hlorde with hlorde
gen move {const1,0},%1.1 yields %1 gen move {const1,0},%1.1 yields %1
pat loc loc cuu $1==1 && $2==4 pat loc loc cuu $1==1 && $2==4
with reg with reg
uses hlorde uses reusing %1, hlorde
gen move %1,%a yields {const2,0} %a gen move %1,%a yields {const2,0} %a
with hlorde with hlorde
gen move {const1,0},%1.1 yields {const2,0} %1 gen move {const1,0},%1.1 yields {const2,0} %1
@ -968,6 +1008,14 @@ gen mov a,%1.2
mov a,%1.1 mov a,%1.1
ana %2.1 ana %2.1
mov %2.1,a yields %2 mov %2.1,a yields %2
with hlorde hlorde
uses areg
gen mov a,%1.2
ana %2.2
mov %1.2,a
mov a,%1.1
ana %2.1
mov %1.1,a yields %1
pat and defined($1) pat and defined($1)
with STACK with STACK
@ -987,6 +1035,14 @@ gen mov a,%1.2
mov a,%1.1 mov a,%1.1
ora %2.1 ora %2.1
mov %2.1,a yields %2 mov %2.1,a yields %2
with hlorde hlorde
uses areg
gen mov a,%1.2
ora %2.2
mov %1.2,a
mov a,%1.1
ora %2.1
mov %1.1,a yields %1
pat ior defined($1) pat ior defined($1)
with STACK with STACK
@ -1006,6 +1062,14 @@ gen mov a,%1.2
mov a,%1.1 mov a,%1.1
xra %2.1 xra %2.1
mov %2.1,a yields %2 mov %2.1,a yields %2
with hlorde hlorde
uses areg
gen mov a,%1.2
xra %2.2
mov %1.2,a
mov a,%1.1
xra %2.1
mov %1.1,a yields %1
pat xor defined($1) pat xor defined($1)
with STACK with STACK
@ -1026,11 +1090,15 @@ gen mov a,%1.2
cma. cma.
mov %1.1,a yields %1 mov %1.1,a yields %1
pat com pat com defined($1)
with STACK with STACK
uses dereg={const2,$1} uses dereg={const2,$1}
gen Call {label,".com"} gen Call {label,".com"}
pat com !defined($1)
with dereg STACK
gen Call {label,".com"}
pat rol $1==2 pat rol $1==2
with dereg hlreg STACK with dereg hlreg STACK
uses areg uses areg
@ -1047,33 +1115,8 @@ gen mov a,e
3: yields hl 3: yields hl
pat rol $1==4 pat rol $1==4
with hlorde hlorde STACK with dereg STACK
uses areg gen Call {label,".rol4"}
gen mov a,%1.2
pop %1
push lb
ani {const1,31}
jz {label,"2f"}
mov c,a
mov a,%1.1
ral. /* set carry bit iff bit 31 is set */
1:
mov a,%2.2
ral.
mov %2.2,a
mov a,%2.1
ral.
mov %2.1,a
mov a,%1.2
ral.
mov %1.2,a
mov a,%1.1
ral.
mov %1.1,a
dcr c
jnz {label,"1b"}
2:
pop lb yields %1 %2
pat ror $1==2 pat ror $1==2
with dereg hlreg STACK with dereg hlreg STACK
@ -1096,33 +1139,8 @@ gen mov a,e
2: yields hl 2: yields hl
pat ror $1==4 pat ror $1==4
with hlorde hlorde STACK with dereg STACK
uses areg gen Call {label,".ror4"}
gen mov a,%1.2
pop %1
push lb
ani {const1,31}
jz {label,"2f"}
mov c,a
mov a,%2.2
rar.
1:
mov a,%1.1
rar.
mov %1.1,a
mov a,%1.2
rar.
mov %1.2,a
mov a,%2.1
rar.
mov %2.1,a
mov a,%2.2
rar.
mov %2.2,a
dcr c
jnz {label,"1b"}
2:
pop lb yields %1 %2
/***********************************************/ /***********************************************/
/* Group 10: Set instructions */ /* Group 10: Set instructions */
@ -1132,8 +1150,13 @@ pat inn $1==2
with STACK with STACK
gen Call {label,".inn2"} yields de gen Call {label,".inn2"} yields de
pat inn pat inn defined($1)
with STACK with STACK
uses dereg={const2,$1}
gen Call {label,".inn"} yields de
pat inn !defined($1)
with dereg STACK
gen Call {label,".inn"} yields de gen Call {label,".inn"} yields de
pat set $1==2 pat set $1==2
@ -1201,6 +1224,7 @@ gen Call {label,"eunimpl"}
pat lar !defined($1) pat lar !defined($1)
with hlorde STACK with hlorde STACK
uses areg
gen mov a,%1.2 gen mov a,%1.2
cpi {const1,2} cpi {const1,2}
cnz {label,"eunimpl"} cnz {label,"eunimpl"}
@ -1218,6 +1242,7 @@ gen Call {label,"eunimpl"}
pat sar !defined($1) pat sar !defined($1)
with hlorde STACK with hlorde STACK
uses areg
gen mov a,%1.2 gen mov a,%1.2
cpi {const1,2} cpi {const1,2}
cnz {label,"eunimpl"} cnz {label,"eunimpl"}
@ -1235,6 +1260,7 @@ gen Call {label,"eunimpl"}
pat aar !defined($1) pat aar !defined($1)
with hlorde STACK with hlorde STACK
uses areg
gen mov a,%1.2 gen mov a,%1.2
cpi {const1,2} cpi {const1,2}
cnz {label,"eunimpl"} cnz {label,"eunimpl"}
@ -1295,6 +1321,7 @@ pat cmp leaving cmu 2
pat tlt pat tlt
with hlorde with hlorde
uses areg
gen mov a,%1.1 gen mov a,%1.1
ral. ral.
mvi a,{const1,0} mvi a,{const1,0}
@ -1318,6 +1345,7 @@ gen xra a
pat teq pat teq
with hlorde with hlorde
uses areg
gen mov a,%1.1 gen mov a,%1.1
ora %1.2 ora %1.2
move {const2,0},%1 move {const2,0},%1
@ -1327,6 +1355,7 @@ gen mov a,%1.1
pat tne pat tne
with hlorde with hlorde
uses areg
gen mov a,%1.1 gen mov a,%1.1
ora %1.2 ora %1.2
move {const2,0},%1 move {const2,0},%1
@ -1336,6 +1365,7 @@ gen mov a,%1.1
pat tge pat tge
with hlorde with hlorde
uses areg
gen mov a,%1.1 gen mov a,%1.1
ral. ral.
cmc. cmc.
@ -1364,8 +1394,17 @@ gen cpi {const1,$1}
jz {label,"1f"} jz {label,"1f"}
move {const2,0},%2 move {const2,0},%2
1: yields %2 1: yields %2
with yields {const2,$1} with hlorde hlorde
leaving cmi 2 teq and 2 uses areg
gen mov a,%1.2
cpi {const1,$1}
jnz {label,"1f"}
mov a,%1.1
ora a
jz {label,"2f"}
1:
move {const2,0},%2
2: yields %2
pat loc cmi tne and $1>=0 && $1<=255 && $2==2 && $4==2 pat loc cmi tne and $1>=0 && $1<=255 && $2==2 && $4==2
with exact areg hlorde with exact areg hlorde
@ -1373,26 +1412,51 @@ gen cpi {const1,$1}
jnz {label,"1f"} jnz {label,"1f"}
move {const2,0},%2 move {const2,0},%2
1: yields %2 1: yields %2
with yields {const2,$1} with hlorde hlorde
leaving cmi 2 tne and 2 uses areg
gen mov a,%1.2
cpi {const1,$1}
jnz {label,"1f"}
mov a,%1.1
ora a
jnz {label,"1f"}
move {const2,0},%2
1: yields %2
pat loc cmi teq ior $1>=0 && $1<=255 && $2==2 && $4==2 pat loc cmi teq ior $1>=0 && $1<=255 && $2==2 && $4==2
with exact areg hlorde with exact areg hlorde
gen cpi {const1,$1} gen cpi {const1,$1}
jnz {label,"1f"} jnz {label,"1f"}
move {const1,1},%2.2 move {const2,1},%2
1: yields %2
with hlorde hlorde
uses areg
gen mov a,%1.2
cpi {const1,$1}
jnz {label,"1f"}
mov a,%1.1
ora a
jnz {label,"1f"}
move {const2,1},%2
1: yields %2 1: yields %2
with yields {const2,$1}
leaving cmi 2 teq ior 2
pat loc cmi tne ior $1>=0 && $1<=255 && $2==2 && $4==2 pat loc cmi tne ior $1>=0 && $1<=255 && $2==2 && $4==2
with exact areg hlorde with exact areg hlorde
gen cpi {const1,$1} gen cpi {const1,$1}
jz {label,"1f"} jz {label,"1f"}
move {const1,1},%2.2 move {const2,1},%2
1: yields %2 1: yields %2
with yields {const2,$1} with hlorde hlorde
leaving cmi 2 tne ior 2 uses areg
gen mov a,%1.2
cpi {const1,$1}
jnz {label,"1f"}
mov a,%1.1
ora a
jz {label,"2f"}
1:
move {const2,1},%2
2: yields %2
pat loc cmi teq $1>=0 && $1<=255 && $2==2 pat loc cmi teq $1>=0 && $1<=255 && $2==2
with exact areg with exact areg
@ -1401,8 +1465,16 @@ gen cpi {const1,$1}
jnz {label,"1f"} jnz {label,"1f"}
inx %a inx %a
1: yields %a 1: yields %a
with yields {const2,$1} with hlorde
leaving cmi 2 teq uses hlorde={const2,0}, areg
gen mov a,%1.2
cpi {const1,$1}
jnz {label,"1f"}
mov a,%1.1
ora a
jnz {label,"1f"}
inx %a
1: yields %a
pat loc cmi tne $1>=0 && $1<=255 && $2==2 pat loc cmi tne $1>=0 && $1<=255 && $2==2
@ -1412,13 +1484,21 @@ gen cpi {const1,$1}
jz {label,"1f"} jz {label,"1f"}
inx %a inx %a
1: yields %a 1: yields %a
with yields {const2,$1} with hlorde
leaving cmi 2 tne uses hlorde={const2,1}, areg
gen mov a,%1.2
cpi {const1,$1}
jnz {label,"1f"}
mov a,%1.1
ora a
jnz {label,"1f"}
dcx %a
1: yields %a
pat loc cmi $1>=0 && $1<=255 && $2==2 pat loc cmi $1>=0 && $1<=255 && $2==2
with exact areg with exact areg
uses hlorde uses hlorde
gen sbi {const1,$1} gen sui {const1,$1}
mov %a.2,a mov %a.2,a
rar. rar.
mov %a.1,a yields %a mov %a.1,a yields %a
@ -1500,10 +1580,10 @@ with STACK
gen pop psw gen pop psw
ral. ral.
jc {label,$1} jc {label,$1}
with hlorde with hlorde STACK
gen mov a,%1.1 gen mov a,%1.1
ral. ora a
jc {label,$1} jm {label,$1}
pat zle pat zle
with hlorde STACK with hlorde STACK
@ -1536,10 +1616,10 @@ with STACK
gen pop psw gen pop psw
ral. ral.
jnc {label,$1} jnc {label,$1}
with hlorde with hlorde STACK
gen mov a,%1.1 gen mov a,%1.1
ral. ora a
jnc {label,$1} jp {label,$1}
pat zgt pat zgt
with hlorde STACK with hlorde STACK
@ -1554,7 +1634,8 @@ gen xra a
1: 1:
pat lol zeq pat lol zeq
uses hlreg={const2,$1} with STACK
uses hlreg={const2,$1}, areg
gen dad lb gen dad lb
mov a,m mov a,m
inx hl inx hl
@ -1562,7 +1643,8 @@ gen dad lb
jz {label,$2} jz {label,$2}
pat lol zne pat lol zne
uses hlreg={const2,$1} with STACK
uses hlreg={const2,$1}, areg
gen dad lb gen dad lb
mov a,m mov a,m
inx hl inx hl
@ -1570,7 +1652,8 @@ gen dad lb
jnz {label,$2} jnz {label,$2}
pat ior zeq $1==2 pat ior zeq $1==2
with hlorde hlorde with hlorde hlorde STACK
uses areg
gen mov a,%1.1 gen mov a,%1.1
ora %1.2 ora %1.2
ora %2.1 ora %2.1
@ -1578,7 +1661,8 @@ gen mov a,%1.1
jz {label,$2} jz {label,$2}
pat ior zne $1==2 pat ior zne $1==2
with hlorde hlorde with hlorde hlorde STACK
uses areg
gen mov a,%1.1 gen mov a,%1.1
ora %1.2 ora %1.2
ora %2.1 ora %2.1
@ -1605,7 +1689,7 @@ pat lfr $1==2 yields de
pat lfr $1<=8 pat lfr $1<=8
with STACK with STACK
uses areg={const1,$1/2}, hlreg={label,".fra"+$1} uses areg={const1,$1/2}, hlreg={label,".fra"+$1}, dereg
gen 1: gen 1:
dcx hl dcx hl
mov d,m mov d,m
@ -1635,7 +1719,7 @@ gen move lb,hl
pat ret $1<=8 pat ret $1<=8
with STACK with STACK
uses areg={const1,$1/2}, hlreg={label,".fra"} uses areg={const1,$1/2}, hlreg={label,".fra"}, dereg
gen 1: gen 1:
pop de pop de
mov m,e mov m,e
@ -1719,10 +1803,10 @@ gen jmp {label,".csb"}
pat dch leaving loi 2 pat dch leaving loi 2
pat dup $1==2 pat dup $1==2
with hlorde yields %1 %1 with src1or2 yields %1 %1
pat dup $1==4 pat dup $1==4
with hlorde hlorde yields %2 %1 %2 %1 with src1or2 src1or2 yields %2 %1 %2 %1
pat dup pat dup
with STACK with STACK
@ -1734,7 +1818,7 @@ with dereg STACK
gen Call {label,".dup"} gen Call {label,".dup"}
pat exg $1==2 pat exg $1==2
with src2 src2 yields %1 %2 with src1or2 src1or2 yields %1 %2
pat exg defined($1) pat exg defined($1)
with STACK with STACK
@ -1742,6 +1826,7 @@ uses dereg={const2,1}
gen Call {label,".exg"} gen Call {label,".exg"}
pat fil pat fil
uses hlreg
gen lxi hl,{label,$1} gen lxi hl,{label,$1}
shld {label,"hol0"+4} shld {label,"hol0"+4}
@ -1755,6 +1840,7 @@ gen lhld {label,$1+2}
pchl. pchl.
pat lim pat lim
uses hlreg
gen lhld {label,".ignmask"} yields hl gen lhld {label,".ignmask"} yields hl
pat lin pat lin
@ -1762,6 +1848,7 @@ uses hlreg={const2,$1}
gen shld {label,"hol0"} gen shld {label,"hol0"}
pat lni pat lni
uses hlreg
gen lhld {label,"hol0"} gen lhld {label,"hol0"}
inx hl inx hl
shld {label,"hol0"} shld {label,"hol0"}
@ -1774,6 +1861,7 @@ uses hlreg={const2,0}
gen dad sp yields hl gen dad sp yields hl
pat lor $1==2 pat lor $1==2
uses hlreg
gen lhld {label,".reghp"} yields hl gen lhld {label,".reghp"} yields hl
pat lpb leaving adp SL pat lpb leaving adp SL
@ -1793,10 +1881,12 @@ pat rtt leaving ret 0
pat sig pat sig
with dereg with dereg
uses hlreg
gen lhld {label,".trapproc"} gen lhld {label,".trapproc"}
xchg. xchg.
shld {label,".trapproc"} yields de shld {label,".trapproc"} yields de
with STACK with STACK
uses hlreg
gen lhld {label,".trapproc"} gen lhld {label,".trapproc"}
xthl. xthl.
shld {label,".trapproc"} shld {label,".trapproc"}
@ -1809,8 +1899,8 @@ pat str $1==0
with localbase with localbase
pat str $1==1 pat str $1==1
with STACK with hlreg
gen pop psw gen sphl.
pat str $1==2 pat str $1==2
with hlreg with hlreg