fixed bit shifting by 0. optimized bitshifting code.

This commit is contained in:
Irmen de Jong
2020-10-18 17:12:52 +02:00
parent 8eb69d6eda
commit e83796b5b9
3 changed files with 155 additions and 22 deletions

View File

@@ -2145,3 +2145,34 @@ func_strcmp .proc
sta P8ESTACK_LO+1,x
rts
.pend
; support for bit shifting that is too large to be unrolled:
lsr_byte_A .proc
; -- lsr signed byte in A times the value in Y (assume >0)
cmp #0
bmi _negative
- lsr a
dey
bne -
rts
_negative lsr a
ora #$80
dey
bne _negative
rts
.pend
lsr_word_AY .proc
.error "make"
.pend
lsr_uword_AY .proc
.error "make"
.pend
asl_word_AY .proc
.error "make"
.pend