#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

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks