Slight speed improvement in 6809 LZSA depackers

Switch instruction "tfr x,u" to "leau ,x" which is 2 clock cycles faster on M6809. On H6309 both instruction have same clock cycles.
This commit is contained in:
Doug Masten 2020-06-29 00:36:49 -05:00
parent 078edef880
commit 214e03555f
4 changed files with 8 additions and 8 deletions

View File

@ -88,13 +88,13 @@ lz1declt lsrb ; shift literals count into place
lsrb
lz1gotla clra ; clear A (high part of literals count)
lz1gotlt tfr x,u
lz1gotlt leau ,x
tfr d,x ; transfer 16-bit count into X
lz1cpylt lda ,u+ ; copy literal byte
sta ,y+
leax -1,x ; decrement X and update Z flag
bne lz1cpylt ; loop until all literal bytes are copied
tfr u,x
leax ,u
lz1nolt ldb ,x+ ; load either 8-bit or LSB 16-bit offset (negative, signed)
lda ,s ; get token again, don't pop it from the stack

View File

@ -90,13 +90,13 @@ lz1declt lsrb ; shift literals count into place
lsrb
lz1gotla clra ; clear A (high part of literals count)
lz1gotlt tfr x,u
lz1gotlt leau ,x
tfr d,x ; transfer 16-bit count into X
lz1cpylt lda ,-u ; copy literal byte
sta ,-y
leax -1,x ; decrement X and update Z flag
bne lz1cpylt ; loop until all literal bytes are copied
tfr u,x
leax ,u
lz1nolt ldb ,s ; get token again, don't pop it from the stack
bmi lz1bigof ; test O bit (small or large offset)

View File

@ -51,13 +51,13 @@ lz2declt lsrb ; shift literals count into place
lsrb
lz2gotla clra ; clear A (high part of literals count)
lz2gotlt tfr x,u
lz2gotlt leau ,x
tfr d,x ; transfer 16-bit count into X
lz2cpylt lda ,u+ ; copy literal byte
sta ,y+
leax -1,x ; decrement X and update Z flag
bne lz2cpylt ; loop until all literal bytes are copied
tfr u,x
leax ,u
lz2nolt ldb ,s ; get token again, don't pop it from the stack

View File

@ -52,13 +52,13 @@ lz2declt lsrb ; shift literals count into place
lsrb
lz2gotla clra ; clear A (high part of literals count)
lz2gotlt tfr x,u
lz2gotlt leau ,x
tfr d,x ; transfer 16-bit count into X
lz2cpylt lda ,-u ; copy literal byte
sta ,-y
leax -1,x ; decrement X and update Z flag
bne lz2cpylt ; loop until all literal bytes are copied
tfr u,x
leax ,u
lz2nolt ldb ,s ; get token again, don't pop it from the stack