Menu

#2227 stm8: subw assembler broken for long operand

closed-fixed
None
sdas
5
2014-02-02
2013-09-25
No

The stm8 assembler does not correctly assemble subw as of revision #8880. E.g. from .lst files:

000016 72 BBu00u00 [ 2] 94 addw x, _i+0

vs.

000025 72 B0u00 [ 2] 115 subw x, _i+0

We can see that the subw only gets one address byte instead of two.

This rpevents using subw with global variables. Once this bug is fixed, generation of subw can be anabled in lines 2266, 2302 and 2343 of gen.c.

Philipp

Discussion

  • Ben Shi

    Ben Shi - 2014-02-02

    It is fixed.

    1. replase sdcc/sdas/asstm8/stm8mch.c
    2. replace sdcc/src/stm8/gen.c

    The 2 files are compressed into the attachment.

     
  • Ben Shi

    Ben Shi - 2014-02-02

    And also a patch is submitted,

    https://sourceforge.net/p/sdcc/patches/215/

     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    Fixed in revision #8393 by applying your patch.

    Philipp

     

Log in to post a comment.