Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

?ASxxxx-Error - Please help

2007-01-11
2013-03-12
  • Abhishek Dutta
    Abhishek Dutta
    2007-01-11

    I get the following error when compiling a code using sdcc

    ================================ result when compiling the code ===================================
    [root@tlm display_module]# sdcc n3510i_display.c -V
    + "/usr/local/bin/sdcpp" -nostdinc -Wall -std=c99 -obj-ext=.rel -DSDCC_MODEL_SMALL -DSDCC=260 -DSDCC_mcs51 -D__mcs51 -I"/usr/local/bin/../share/sdcc/include/mcs51" -I"/usr/local/share/sdcc/include/mcs51" -I"/usr/local/bin/../share/sdcc/include" -I"/usr/local/share/sdcc/include"  "n3510i_display.c"
    + "/usr/local/bin/asx8051" -plosgff "n3510i_display.asm"
    ?ASxxxx-Error-<o> in line 470 of n3510i_display.asm
                  <o> .org in REL area or directive / mnemonic error
    ?ASxxxx-Error-<o> in line 472 of n3510i_display.asm
                  <o> .org in REL area or directive / mnemonic error
    removing n3510i_display.rel

    ================================ asx8051 version ===================================
    [root@tlm display_module]# /usr/local/bin/asx8051

    ASxxxx Assembler V01.70 + NoICE + SDCC mods + Flat24 Feb-1999  (Intel 8051)

    Usage: [-dqxjgalopsf] file1 [file2 file3 ...]
      d    decimal listing
      q    octal   listing
      x    hex     listing (default)
    .........................
    .........................

    ================================ sdcc version ===================================
    [root@tlm display_module]# sdcc -v
    SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.6.0 #4309 (Dec 15 2006) (UNIX)

    ================================ code I am trying to compile =====================

    #include "sdcc_reg420.h"

    /*
    * sfr bits for all port already defined in sdcc_reg420.h
    * "sbit at 0xA0  P2_0;" ..... see sdcc_reg420.h file for more
    */
    #define SDATA    P2_0;
    #define SCLK    P2_1;
    #define NCS    P2_2;
    #define NRES    P2_3;

    #define BACKLIGHT    P2_7;        // To switch on/off the backlight of LCD

    /*
    * command constants
    */

    #define CMD_NOP           0x00   /* no operation */
    #define CMD_SWRESET       0x01   /* software reset */
    #define CMD_BSTOFF        0x02   /* booster voltage off */
    ....................
    ....................
    #define INI_COLMOD_8      0x02   /* 8 bit / pixel */
    #define INI_COLMOD_12     0x03   /* 12 bit / pixel */
    #define INI_COLMOD_16     0x05   /* 16 bit / pixel */

    /*
    * Function prototypes
    */
    void msleep(unsigned char);    // sleep for 1ms (the function argument determines no of milliseconds to sleep)
    void usleep(unsigned char);    // sleep for 1us (the function argument determines no of microseconds to sleep)

    void main(void)
    {
        while(1)
        {
            msleep(10);
            usleep(10);
        }
    }
    /*
    * Function definations
    */

    /*
    * Sleep for specified number of milliseconds
    * Required by some command of LCD driver to wait for few ms
    */
    void msleep(unsigned char ms)
    {
        unsigned char delay_ms = ms;
        _asm
                MOV R5,_delay_ms;
            L1_ms:    MOV R6,#0A
            L2_ms:    MOV R7,#0FF
            L3_ms:    DJNZ R7,L3_ms
                DJNZ R6,L2_ms
                DJNZ R5,L1_ms
        _endasm;
    }

    ============================== end of code =============================

    Why am I not able to compile my code. There does not seem any problem with the code.

    /*
    * Sleep for specified number of microseconds
    */
    void usleep(unsigned char us)
    {
        unsigned char delay_us = us;
        _asm
                MOV R6,_delay_us
            L1_us:    MOV R7,#3
            L2_us:    DJNZ R7,L2_us
                DJNZ R6,L1_us
        _endasm;
    }

     
    • wek
      wek
      2007-01-11

      AS does not use the Intel-8051-standard "h" suffix to indicate hexadecimal constant (and you don't have them there either...), but uses the "0x" prefix.
      So, modify your code so that:
      L1_ms: MOV R6,#0xA
      L2_ms: MOV R7,#0xFF
      and it stops complaining because of these lines.

      JW

       
    • Abhishek Dutta
      Abhishek Dutta
      2007-01-16

      Thanx wek
      I really appreciate the help

      bye