mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-08-07 22:25:13 +00:00
18 lines
331 B
NASM
18 lines
331 B
NASM
// ROL twice instead of RORing 6 times
|
|
lda {z2} // {z2} low byte to tmp $ff
|
|
sta $ff
|
|
lda {z2}+1 // {z2} high byte to {z1} low byte
|
|
sta {z1}
|
|
lda #0
|
|
bit {z2}+1
|
|
bpl !+ // {z2} high byte positive?
|
|
lda #$ff
|
|
!:
|
|
sta {z1}+1 // sign extended {z2} into {z1} high byte
|
|
// ROL twice
|
|
rol $ff
|
|
rol {z1}
|
|
rol {z1}+1
|
|
rol $ff
|
|
rol {z1}
|
|
rol {z1}+1 |