KONSTANTINOS HALAKATEVAKIS

Relocatable assembly code help

Discussion created by KONSTANTINOS HALAKATEVAKIS on May 16, 2008
Latest reply on May 19, 2008 by CrasyCat
Hello,

In my assembly code i have define two relocatable code segments (DEFAULT_ROM and NVREG), but
the segment NVREG doesn't appear in the .map file.
This is my sample code:

Code:
INCLUDE "MC9S08QG8.inc"    XDEF    nvDEFAULT_ROM  SECTIONnv  lda    #16    sta    PTADNVREG    SECTIONxxx lda    #67    sta    PTBD    end

 The corresponding .prm file is like this:

Code:
/* This is a linker parameter file for the mc9s08qg8 */NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */    Z_RAM                    =  READ_WRITE   0x0060 TO 0x00FF;    RAM                      =  READ_WRITE   0x0100 TO 0x025F;    ROM                      =  READ_ONLY    0xE000 TO 0xE0FF;    ROM1                     =  READ_ONLY    0xE100 TO 0xE200; /* INTVECTS                 =  READ_ONLY    0xFFD0 TO 0xFFFF; Reserved for Interrupt Vectors */ENDPLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */    DEFAULT_RAM                         /* non-zero page variables */                                        INTO  RAM;    _PRESTART,                          /* startup code */    STARTUP,                            /* startup data structures */    ROM_VAR,                            /* constant variables */    STRINGS,                            /* string literals */    VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */    DEFAULT_ROM,    COPY                                /* copy down information: how to initialize variables */                                        INTO  ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */ NVREG   INTO  ROM1;    _DATA_ZEROPAGE,                     /* zero page variables */    MY_ZEROPAGE                         INTO  Z_RAM;ENDSTACKSIZE 0x50INIT nvVECTOR 0  nv /* Reset vector: this is the default entry point for an application. */


And this is the .map file.

Code:
*********************************************************************************************TARGET SECTION---------------------------------------------------------------------------------------------Processor   : Freescale HC08Memory Model: SMALLFile Format : ELF\DWARF 2.0Linker      : SmartLinker V-5.0.30 Build 7134, May 15 2007*********************************************************************************************FILE SECTION---------------------------------------------------------------------------------------------peripolia.asm.o                         Model: SMALL,         Lang: Assembler*********************************************************************************************STARTUP SECTION---------------------------------------------------------------------------------------------Entry point: 0xE000 (nv)*********************************************************************************************SECTION-ALLOCATION SECTIONSection Name                    Size  Type     From       To       Segment---------------------------------------------------------------------------------------------.init                              4     R     0xE000     0xE003   ROM.stack                            80   R/W      0x100      0x14F   RAM.vectSeg0_vect                     2     R     0xFFFE     0xFFFF   .vectSeg0Summary of section sizes per section type:READ_ONLY (R):           6 (dec:        6)READ_WRITE (R/W):       50 (dec:       80)*********************************************************************************************VECTOR-ALLOCATION SECTION    Address     InitValue   InitFunction---------------------------------------------------------------------------------------------     0xFFFE        0xE000   nv*********************************************************************************************OBJECT-ALLOCATION SECTION     Name               Module                 Addr   hSize   dSize     Ref    Section   RLIB---------------------------------------------------------------------------------------------MODULE:                 -- peripolia.asm.o --- PROCEDURES:     nv                                        E000       4       4       0   .init       - VARIABLES:*********************************************************************************************MODULE STATISTIC  Name                                      Data   Code  Const---------------------------------------------------------------------------------------------  peripolia.asm.o                              0      4      0  other                                       80      2      0*********************************************************************************************SECTION USE IN OBJECT-ALLOCATION SECTION---------------------------------------------------------------------------------------------SECTION: ".init"  nv *********************************************************************************************OBJECT LIST SORTED BY ADDRESS     Name                                      Addr   hSize   dSize     Ref    Section   RLIB---------------------------------------------------------------------------------------------     nv                                        E000       4       4       0   .init       *********************************************************************************************UNUSED-OBJECTS SECTION---------------------------------------------------------------------------------------------*********************************************************************************************COPYDOWN SECTION---------------------------------------------------------------------------------------------*********************************************************************************************OBJECT-DEPENDENCIES SECTION---------------------------------------------------------------------------------------------*********************************************************************************************DEPENDENCY TREE******************************************************************************************************************************************************************************************STATISTIC SECTION---------------------------------------------------------------------------------------------ExeFile:--------Number of blocks to be downloaded: 2Total size of all blocks to be downloaded: 6
 

As you can see, the nv label exists in the .map file, while the label xxx which is in the second section (NVREG) doesn't exist. Do i miss something here?




 

Outcomes