|
From: SourceForge.net <no...@so...> - 2005-12-05 21:15:49
|
Bugs item #1373846, was opened at 2005-12-05 21:56 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1373846&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: msc51(8051) target >Group: known bugs >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Maarten Brock (maartenbrock) Summary: Risky Startup Code Initial Comment: SDCC -- Version 2.5.0 #1020 Command: SDCC ctest.c I disassembled the ctest.ihx file and found the following code fragment in the startup code: push 00 ; Push 00 to stack, R0 if in BANK 0 mov R0,82 ; move DPL to R0 IN CURRENT REG BANK! mov @R0,A ; Store A where R0 Points pop 00 ; Restore 00 from stack To function correctly, this code and other similar pieces of code in the startup code REQUIRE, that the register bank select bits in the PSW be zero. If they have any non-zero value then R0 in the corresponding register bank will get the value of DPL. If this piece of code was to be called from an interrupt routine using register bank 1, 2 , or 3 then the push/pop sequence would be useless and the value of R0 would be corrupted. I really think that, if you know what addressing model to use at compile time, then this kind of linear search to find the correct addressing mode is pretty lame. That's just my opinion -- I could be wrong. Bruce Graham bg...@hu... ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2005-12-05 22:15 Message: Logged In: YES user_id=888171 Bruce, Yes this was a bug in SDCC 2.5.0. Current development is at 2.5.4 and the bug has been squashed quite some time ago. Maarten ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1373846&group_id=599 |