#10 assembly code inline : problem with conditionnal jump target

closed-fixed
Kevin Vigor
5
2001-05-02
2000-06-02
robert lacoste
No

When coding in mixed C/asm mode, very difficult bug to find with something like :

_asm
...
jnb $000001
...
_endasm;

// some C code

_asm
$000001:
// some more assembly code
_endasm;

The displacement range of the jnb test is not checked : if the intermediate C code expand to more than 128 bytes the jump is done in the middle of the C code without any warning.

I agree that this is poor programming practises, but as least the assembler should give a warning.

Cheers,
Robert.

Discussion

  • Sandeep Dutta
    Sandeep Dutta
    2000-06-14

    Difficult to fix this. Will check the assembler to see what I can do

     
  • Sandeep Dutta
    Sandeep Dutta
    2000-06-14

    • status: open --> open-later
     
  • Kevin Vigor
    Kevin Vigor
    2001-05-02

    Logged In: YES
    user_id=11484

    Fixed in rev 1.3 of sdcc/as/mcs51/i51mch.c

    The error given is admittedly imperfect (<a> machine
    specific addressing or addressing mode error), but that's
    about as good as asxxx is on any error.

     
  • Kevin Vigor
    Kevin Vigor
    2001-05-02

    • assigned_to: nobody --> kvigor
    • status: open-later --> closed-fixed