This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

About default allocation for 6713

Hello,

Below is the given default setting for linker cmd file. I am using a similar .cmd file to link the example code: Dotp4clasm.

Then in the disassembler window, I found a lot of data mistranslated into instructions, like 0x00040003 end up to be NOP.

Also the section that contain data is named .far in the .map file. Anyone can explain why?I have read the data sheet spur186.

No such information.

What is the use of each section please? especially .far .stack .switch,  etc.

Thank you very much.

Da

 

MEMORY
{
RAM : origin = 0x00000001, length = 0xFFFFFFFE
}
SECTIONS
{
.text : ALIGN(32) {} > RAM
.const : ALIGN(8) {} > RAM
.data : ALIGN(8) {} > RAM
.bss : ALIGN(8) {} > RAM
.cinit : ALIGN(4) {} > RAM ; cflag option only
.pinit : ALIGN(4) {} > RAM ; cflag option only
.stack : ALIGN(8) {} > RAM ; cflag option only
.far : ALIGN(8) {} > RAM ; cflag option only
.sysmem: ALIGN(8) {} > RAM ; cflag option only
.switch: ALIGN(4) {} > RAM ; cflag option only
.cio : ALIGN(4) {} > RAM ; cflag option only

  • da cheng said:

    Also the section that contain data is named .far in the .map file. Anyone can explain why?I have read the data sheet spur186.

    No such information.

    What is the use of each section please? especially .far .stack .switch,  etc.

    Thank you very much.

    SPRU187 also has some more information on the sections. See section 5.4.5.

    http://focus.ti.com/lit/ug/spru187o/spru187o.pdf

    ki

  • can you tell me how to make the data appear correctly?

    because now it appear as instruction even though it is in .far section.

     

    da

  • The .far section should not contain any initialized content.  No code or data.  It is used to merely reserve space in memory.  Forget about your disassembly problem for the moment.  Let's focus on why your .far section contains a NOP (or whatever).  Look in your .map file.  This file is created by the linker with the -m option.  The .far section in a normal map file looks something like this.

    .far       0    000099a0    00000350     UNINITIALIZED
                      000099a0    00000194     rts6200.lib : defs.obj (.far)
                      00009b34    000000d0                 : trgdrv.obj (.far)
                      00009c04    000000cc                 : lowlev.obj (.far)
                      00009cd0    0000000c                 : exit.obj (.far)
                      00009cdc    00000008                 : _lock.obj (.far)
                      00009ce4    00000008                 : memory.obj (.far)
                      00009cec    00000004                 : fopen.obj (.far)
    

    I bet your map file looks different.  Please post that part of your map file here.

    Thanks and regards,

    -George

     

  • Hello,

    Following is my .far part in .map file:

    .far       0    80007a60    00000988     UNINITIALIZED
                      80007a60    00000374     rts6700.lib : defs.obj (.far)
                      80007dd4    00000190                 : _printfi.obj (.far)
                      80007f64    00000190                 : fcvt.obj (.far)
                      800080f4    0000011c                 : lowlev.obj (.far)
                      80008210    000000d0                 : trgdrv.obj (.far)
                      800082e0    0000008c                 : exit.obj (.far)
                      8000836c    00000064                 : ecvt.obj (.far)
                      800083d0    00000008                 : _lock.obj (.far)
                      800083d8    00000008                 : memory.obj (.far)
                      800083e0    00000008     dotp4clasm.obj (.far)
    Then there is the program part:

    80007920          dotp4clasmfunc:
    80007920 0018105A            MV.L2X        A6,B0
    80007924 0290105B            MV.L2X        A4,B5
    80007928 01901058  ||        MV.L1X        B4,A3
    8000792C 020000F8            ZERO.L1       A4
    80007930 021436C6            LDH.D2T2      *B5++[0x1],B4                   // this statement access the data around address 800083e2
    80007934 00006000            NOP           4
    80007938 028C3644            LDH.D1T1      *A3++[0x1],A5
    8000793C 00006000            NOP           4
    80007940 0290BC80            MPY.M1X       A5,B4,A5
    80007944 00000000            NOP          
    80007948 0210A078            ADD.L1        A5,A4,A4
    8000794C 0003E05A            SUB.L2        B0,1,B0
    80007950 2FFFFE10     [ B0]  B.S1          0x80007930
    80007954 00008000            NOP           5
    80007958 000C0362            B.S2          B3
    8000795C 00008000            NOP           5

    Then here is the data part(.far part in disassembly window):

    The bold data{2,3,4,5} is defined by me. They are mistranslated.

    800083B2 7C4B7FFF            .word         0x7c4b7fff
    800083B6 7C477FFF            .word         0x7c477fff
    800083BA 7C437FFF            .word         0x7c437fff
    800083BE 7C3F7FFF            .word         0x7c3f7fff
    800083C2 7C3B7FFF            .word         0x7c3b7fff
    800083C6 7C377FFF            .word         0x7c377fff
    800083CA 7C337FFF            .word         0x7c337fff
    800083CE 79A07FFF            .word         0x79a07fff
    800083D2 79A08000  || [!B2]  NOP           5
    800083D6 04008000            NOP           5
    800083DA 87E80000     [ A1]  NOP          
    800083DE 00028000            .word         0x00028000
    800083E2 00040003            NOP          
    800083E6 7C170005            .word         0x7c170005
    800083EA 7C137FFF            .word         0x7c137fff
    800083EE 7C0F7FFF            .word         0x7c0f7fff
    800083F2 7C0B7FFF            .word         0x7c0b7fff
    800083F6 7C077FFF            .word         0x7c077fff
    800083FA 7C037FFF            .word         0x7c037fff