From: SourceForge.net <no...@so...> - 2012-01-02 13:57:24
|
Bugs item #2894291, was opened at 2009-11-08 13:50 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2894291&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: hc08 port Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: gaui (gaui) Assigned to: Nobody/Anonymous (nobody) Summary: hc08 assembler incorrectly allows move to non-direct destina Initial Comment: The hc08 cpu understands several forms of the mov command, all involving direct (and indexed) addresses. In particular, this is allowed: mov #number, *address while this is not: mov #number, address (because it is not a direct address) When using the second form, the compiler does not complain. It should. What's worse, when using the second form with an address larger than 255, it cannot generate correct code (because that doesn't exist). The programmer is not notified about this, which makes finding the bug extremely hard. The original bug report with example code can be found in the Debian bug tracking system http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422599 and it still persists in sdcc SVN revision 5568 Regards Gudjon ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2012-01-02 05:57 Message: Copied from the original bug report: > Hi, > > On Sun, Nov 08, 2009 at 09:38:32AM +0100, Gudjon I. Gudjonsson wrote: > > Can you please test if this bug has been fixed in the current version? > > It has not. To test this, you can do the following: > > create a file named test.asm, with in it: > > mov #18, *30 > mov #18, 30 > mov #18, 3000 > > Then run as-hc08 -o test.asm. This creates a file called test.rel. It > looks like this: > > XH > H 1 areas 0 global symbols > A _CODE size 9 flags 0 addr 0 > T 00 00 6E 12 1E 6E 12 1E 6E 12 B8 > R 00 00 00 00 > > The line starting with T shows that (at address 0), there is 3 times the > same 3-byte command (6e 12 xx), where xx is 1e for 30, and b8 for 3000 > (3000 & 0xff = 0xb8a). > > If you only want to test, you don't even need to look at the output; if > "mov #18, 3000" compiles without errors, this bug is still present. > There should be an error for "mov #18, 30" as well, but it is not a big > problem if there isn't (it is obvious that it really means > "mov #18, *30", because there is no other option). > > Thanks, > Bas ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2894291&group_id=599 |