Call cmps rather than cmpu for bge... make cmps and cmpu rsts. Apply various

other tiny optimisations.
This commit is contained in:
David Given 2019-02-15 00:38:39 +01:00
parent 2924ce8ffa
commit 91c75f81b5
3 changed files with 89 additions and 65 deletions

View file

@ -11,6 +11,10 @@
! 41 call .floadn4
! 34 call .fload4
! 28 call .fstoren2
!
! Also:
! 48 call .cmps_mag
! 25 call .cmpu_mag
.define .rst_init
.rst_init:
@ -18,13 +22,14 @@
lxi d, 0x0008
call copy
lxi h, .floadn4
lxi d, 0x0010
call copy
lxi h, .fload4
lxi d, 0x0018
call copy
lxi h, .fstoren2
lxi d, 0x0020
call copy
lxi h, .cmps_mag
call copy
lxi h, .cmpu_mag
jmp copy
! Copies eight bytes from HL to DE.

View file

@ -1878,7 +1878,11 @@ pat blt
with hlreg dereg STACK
uses areg
gen
Call {label, ".cmps_mag"}
#ifdef USE_I80_RSTS
rst {const1, 5}
#else
Call {label, ".cmps_mag"}
#endif
jm {label, $1}
pat bgt
@ -1890,7 +1894,11 @@ pat bge
with hlreg dereg STACK
uses areg
gen
Call {label, ".cmpu_mag"}
#ifdef USE_I80_RSTS
rst {const1, 5}
#else
Call {label, ".cmps_mag"}
#endif
jp {label, $1}
pat ble
@ -1949,62 +1957,68 @@ pat bne
jnz {label,$1}
pat zlt
with STACK
gen pop psw
ora a
jm {label,$1}
with hl_or_de STACK
gen mov a,%1.1
ora a
jm {label,$1}
with STACK
gen
pop psw
ora a
jm {label,$1}
with regpair STACK
gen
mov a,%1.1
ora a
jm {label,$1}
pat zle
with hl_or_de STACK
uses areg
gen xra a
add %1.1
jm {label,$1}
jnz {label,1f}
xra a
add %1.2
jz {label,$1}
1:
with regpair STACK
uses areg
gen
mov a, %1.1
ora a
jm {label, $1}
jnz {label, 1f}
ora %1.2
jz {label, $1}
1:
pat zeq
with hl_or_de STACK
uses areg
gen mov a,%1.1
ora %1.2
jz {label,$1}
with regpair STACK
uses areg
gen
mov a,%1.1
ora %1.2
jz {label,$1}
pat zne
with hl_or_de STACK
uses areg
gen mov a,%1.1
ora %1.2
jnz {label,$1}
with regpair STACK
uses areg
gen
mov a,%1.1
ora %1.2
jnz {label,$1}
pat zge
with STACK
gen pop psw
ral.
jnc {label,$1}
with hl_or_de STACK
gen mov a,%1.1
ora a
jp {label,$1}
with STACK
gen
pop psw
ral.
jnc {label,$1}
with regpair STACK
gen
mov a,%1.1
ora a
jp {label,$1}
pat zgt
with hl_or_de STACK
uses areg
gen xra a
add %1.1
jm {label,1f}
jnz {label,$1}
xra a
add %1.2
jnz {label,$1}
1:
with regpair STACK
uses areg
gen
mov a, %1.1
ora a
jm {label, 1f}
jnz {label, $1}
ora %1.2
jnz {label, $1}
1:
pat lol zeq
with STACK
@ -2027,22 +2041,24 @@ pat lol zne
jnz {label,$2}
pat ior zeq $1==2
with hl_or_de hl_or_de STACK
uses areg
gen mov a,%1.1
ora %1.2
ora %2.1
ora %2.2
jz {label,$2}
with regpair regpair STACK
uses areg
gen
mov a,%1.1
ora %1.2
ora %2.1
ora %2.2
jz {label,$2}
pat ior zne $1==2
with hl_or_de hl_or_de STACK
uses areg
gen mov a,%1.1
ora %1.2
ora %2.1
ora %2.2
jnz {label,$2}
with regpair regpair STACK
uses areg
gen
mov a,%1.1
ora %1.2
ora %2.1
ora %2.2
jnz {label,$2}
/*********************************************/
/* Group 14: Procedure call instructions */

View file

@ -16,4 +16,7 @@ xchg : inx d : xchg -> inx h ;
cpi 0 -> ora a ;
call X : ret -> jmp X ;
push h : lxi h, X : pop d -> lxi d, X : xchg ;
push d : lxi d, X : pop h -> lxi h, X : xchg ;
%%;