AnsweredAssumed Answered

ASSEMBLY - Definition and allocation of segments - problem

Question asked by Leojunin on Sep 13, 2015
Latest reply on Sep 22, 2015 by Pascal Irrle

Hello to all forum. First of all I apologize for my English.


I am programming in assembly


I have a problem using a memory segment. Below is my configuration:


In the .prm file...


SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */

    Z_RAM                    =  READ_WRITE   0x0080 TO 0x00EF;

    Z_RAM2                  =  READ_WRITE   0x00F0 TO 0x00FF;

    RAM                      =  READ_WRITE   0x0100 TO 0x06FF;

    RAM2                    =  READ_WRITE   0x0700 TO 0x083F;

    STACK                  =  READ_WRITE   0x0840 TO 0x087F;

    ROM                      =  READ_ONLY    0x8000 TO 0xFFAD;

/* INTVECTS                 =  READ_ONLY    0xFFC0 TO 0xFFFF; Reserved for Interrupt Vectors */



PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */

    _DATA_ZEROPAGE,                     /* zero page variables */

    MY_ZEROPAGE                         INTO  Z_RAM;

    Z_PAGE                                     INTO  Z_RAM2;

    DEFAULT_RAM                         INTO  RAM;

    HIGHPAGE                                 INTO  RAM2;

    SSTACK                              INTO  STACK;

    _PRESTART,                          /* startup code */

    STARTUP,                            /* startup data structures */

    ROM_VAR,                            /* constant variables */

    STRINGS,                            /* string literals */

    VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */


    COPY                                /* copy down information: how to initialize variables */

                                        INTO  ROM;




Then in my code, I add ...


; import symbols



When compiling, I take the following values:


           LDHX #__SEG_END_SSTACK takes LDHX #0x0880 (correct)




           LDX #__SEG_END_DEFAULT_RAM takes LDHX #0x0000 instead of #0x0700



What should I do?


Tanks to all