Thanks for your suggestion.

I thought currently there are 2 different problems inside the ucSim-stm8,
1. wrong handling of direct addressing inside CPW (which causes bug #2180)
2. lack of handling of indirect addressing (CLR, CPW, CPL, DEC, INC, LD, LDW, NEG, RLC, RRC, SLL, SRA, SRL, SWAP, TNZ)

Problem #1 is simple and already fixed, while problem #2 needs more time to have a careful check.

Shall we merge patch #244 and close bug #2180 first? And I will go on with problem #2.


在2014年06月04 00时27分,"Philipp Klaus Krause"<>写道:

Hash: SHA1

On 03.06.2014 13:24, Ben Shi wrote:
> Hello,
> Does SDCC-stm8 use the pointer serial addressing modes?
> By going though the ucsim-stm8's source code, I find that "ldw x,
> (0x10, y)" is handled, while "ldw x, ([0x10], y)" is not.
> This could cause unexpected errors while do reg-test.
> Ben

You mean the ones called "indirect" in the manual, I assume.
sdcc does not currently use them. Some time ago I looked into them,
but found out that

1) It is somewhat hard for sdcc to generate them other than in the
peephole optimizer), since they implement multiple icodes with one asm
2) For many use cases a sequence of equivalent instructions using
other modes is faster or shorter (the indirect addressing mode seems
to be included in the stm8 mostly for st7 compability).

Still it would be good to have them handled correctly, just in case we
might want to use one in one of the few corner cases, where doing so
makes sense.


Version: GnuPG v1
Comment: Using GnuPG with Icedove -


Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
sdcc-devel mailing list