#989 asx8051 does not compile 'ajmp' correctly

closed-rejected
nobody
assembler (26)
5
2005-09-26
2005-09-26
Bruce Hall
No

If the 'asx8051' assembler is invoked on a file with a 'ajmp'
command in it (which corresponds to assembly code 01h),
the assembler will incorrectly associate an assembly code
of 00h to the command, which is the assembly code for
a 'nop' on an 8051 microprocessor.

Discussion

  • Bruce Hall

    Bruce Hall - 2005-09-26

    Demonstration code for AJMP problem

     
  • Jesus Calvino-Fraga

    • status: open --> closed-rejected
     
  • Jesus Calvino-Fraga

    Logged In: YES
    user_id=603650

    Did you link after assembling? This is .lst file I get after
    assembling:

    0000s00r03 1 start: ajmp target
    0002 00 2 nop
    0003s00r00 3 target: ajmp start
    0005 00 4 nop
    5
    Are the "s00" you are worried about? They will be replaced
    with the right opcode after linking. Remember, the three
    most significant bits of the ajmp opcode are part of the page
    address. This is the .rst file I get after linking:

    0000 01 03 1 start: ajmp target
    0002 00 2 nop
    0003 01 00 3 target: ajmp start
    0005 00 4 nop
    5
    Jesus

     
  • Bruce Hall

    Bruce Hall - 2005-09-26

    Logged In: YES
    user_id=1351642

    Jesus -

    I have attached the .lst file I get after assembling. I don't get
    the 's' or 'r' characters in my .lst file. How did you get them in
    yours? I compiled the code and created the .lst file with the
    following command:

    asx8051 -los test.asm

    - Bruce

     
  • Bruce Hall

    Bruce Hall - 2005-09-26

    .lst file that does NOT exhibit the 's' or 'r' characters

     
  • Jesus Calvino-Fraga

    Logged In: YES
    user_id=603650

    I assembled using:

    asx8051 -plosgff ajmp_err.asm

    My link script is (ajmp_err.lnk):

    -myuxi
    -Y
    ajmp_err.rel

    -e

    And I linked using:

    aslink -nf ajmp_err.lnk

    Off course, if you use inline assembly with sdcc, all those
    steps are unnecessary. For example if your file is test.c:

    void main (void)
    {
    _asm
    start: ajmp target
    nop
    target: ajmp start
    nop
    _endasm;
    }

    Compile using:

    sdcc test.c

    or:

    sdcc -V test.c

    if you want to see all the commands and options sdcc
    executes: compiling, assembling, and linking.

    Jesus

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks