Inline Assembly code compilation error

Help
Babu
2009-02-19
2013-03-12
  • Babu

    Babu - 2009-02-19

    Hi,

    I am using SDCC ( version 2.8.0) , for developing embedded applications on a AT89C51ED2 8051 chip based board.

    One of the functions in this application has the following inline assembly code

    "
      __xdata unsigned char test_xdata;

            .
            .
            .
            .

            _asm

            mov dptr,#_test_xdata
            mov acc,#0x01

            _endasm;

            EECON |= 0x02;

            _asm

            movx @dptr,acc

            _endasm;

    "

    When trying to buid the executable for this piece of code ( which tries to write data on to the EEPROM of the board),

    Error Message:

    ?ASxxxx-Error-<a> in line 665 of ex23.asm
                  <a> machine specific addressing or addressing mode error
    removing ex23.rel

    is displayed .

    If anyone has come across a similar situation,please guide me.

    Rgds,
    babu

     
    • Frieder Ferlemann

      it would help if you'd show line 665 of ex23.asm :^)

      In this case it's most likely:

      movx @dptr,acc

      though. This addressing mode is not supported on mcs51
      (storing from direct address to xdata address).

      storing from accumulator to xdata address should work:

      movx @dptr,a

      Greetings,
      Frieder

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks