3 ms·
As someone who has been messing around with 8051 controllers because I found a tube of 1989 vintage Signetics P80C550s in a box of stuff I hadn't looked at in 1
by Teknoman117 5y ago
As someone who has been messing around with 8051 controllers because I found a tube of 1989 vintage Signetics P80C550s in a box of stuff I hadn't looked at in 15 years, I'd love to hear about these show stopping bugs in SDCC that were referenced but not explained.
- dmitrygr 5y agomost annoying one: Large model. SDCC v 4.1 or 4.0.4. Place two sequential (do not declare anything between them) uint16 vars in __idata Use both in some math statements Eventually (after 4-5 statements, once compiler has to start spilling intermediates to RAM), on a read access, SDCC will access the first one when you intend to access the second. (emits two unneeded "dec R0" instructions for no reason) Declaring the vars as "volatile" helps sometimes, but changing code shape sometimes brings the bugs back. not placing two u16s in a row into idata seems to avoid it
- Teknoman117 5y agoAh, I'd been using the small model up to this point, so that's probably why I haven't bumped into this.