Optimize key expansion a bit, removing unnecessary loads.

This commit is contained in:
Stephen Heumann 2017-06-26 22:22:55 -05:00
parent f04000c83d
commit 293828584f

17
aes.asm
View File

@ -209,6 +209,7 @@ ExpandKey128 start
using tables using tables
ldx #16 ldx #16
clc
top anop top anop
ShortRegs ShortRegs
@ -239,26 +240,20 @@ top anop
lda rk+0,x lda rk+0,x
eor rk+0+4-16,x eor rk+0+4-16,x
sta rk+0+4,x sta rk+0+4,x
eor rk+4+4-16,x
sta rk+4+4,x
eor rk+8+4-16,x
sta rk+8+4,x
lda rk+2,x lda rk+2,x
eor rk+2+4-16,x eor rk+2+4-16,x
sta rk+2+4,x sta rk+2+4,x
lda rk+4,x
eor rk+4+4-16,x
sta rk+4+4,x
lda rk+6,x
eor rk+6+4-16,x eor rk+6+4-16,x
sta rk+6+4,x sta rk+6+4,x
lda rk+8,x
eor rk+8+4-16,x
sta rk+8+4,x
lda rk+10,x
eor rk+10+4-16,x eor rk+10+4-16,x
sta rk+10+4,x sta rk+10+4,x
txa txa
clc
adc #16 adc #16
tax tax
cmp #16*12 cmp #16*12