Am 23.01.2018 um 23:51 schrieb Richard Hodges: > New information: > > The function readint() in peep.c complains because it gets the string > '[_ptr_rx]'. > This is not just with rrc, but also with and, or, ld. Also with numeric > address: > and a,[0x6000] > or a,[0x6000] > ld a,[0x6000] > > I have an easy work-around for "rrc [_ptr_rx]" so I am not stuck. > ldw x,_ptr_rx > rrc (x) > > The assembler seems to be happy with the syntax: > 00011E C6 50 06 [ 1] 266 ld a, 0x5006 > 000121 A4 20 [ 1] 267 and a, #(1 << 5) > 000123 AB FF [ 1] 268 add a, #255 > 000125 CE 00 34 [ 2] 269 ldw x, _ptr_rx > 000128 76 [ 1] 270 rrc (x) > 000129 72 36 00 34 [ 4] 271 rrc [_ptr_rx] > > It seems that the peephole optimizer does not like this addressing mode. > > Anything I can do to help? > > Thanks, > -Richard
It's a bug. I'll fix it and add a few inline asm test cases. In testing, the peephole optimizer mostly sees code generated by SDCC, so not everything gets tested well. In particular, SDCC doesn't use [] adressing modes much (as they rarely provide an advantage). Philipp ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user