mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2024-11-05 14:04:35 +00:00
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:
parent
078edef880
commit
214e03555f
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user