Fixed CII (?) did not handle stack pointer right

This commit is contained in:
ceriel 1993-11-10 12:51:03 +00:00
parent c89c0d2c01
commit 964bf270ab

View file

@ -76,6 +76,12 @@
ex de,hl ! de := difference (> 0) ex de,hl ! de := difference (> 0)
ld hl,0 ld hl,0
add hl,sp ! hl := sp add hl,sp ! hl := sp
dec de ! if difference = 1, don't adjust stack pointer
jr nz, 4f
inc de
jr 5f
4:
inc de
push hl push hl
or a or a
sbc hl,de sbc hl,de
@ -96,6 +102,7 @@
dec hl ! now hl points to dec hl ! now hl points to
! most significant byte ! most significant byte
! of the source ! of the source
5:
or a ! see if we're doing or a ! see if we're doing
! a 'cii' or a 'cuu' ! a 'cii' or a 'cuu'
jr nz,3f ! cuu, expand with zeroes jr nz,3f ! cuu, expand with zeroes