Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#360 Multibyte constant assignment

open
nobody
hc08 port (9)
5
2012-05-13
2012-05-13
No

Code size could be reduced by resing values in registers, if multiple bytes of a constant are the same. e.g.
return(-1) returning a long value currently results in

mov #0xFF,*___SDCC_hc08_ret3
mov #0xFF,*___SDCC_hc08_ret2
ldx #0xFF
lda #0xFF
rts

while the following would be shorter by three bytes:

lda #0xff
sta *___SDCC_hc08_ret3
sta *___SDCC_hc08_retw
tax
rts

Philipp

Discussion