This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can I define an array variable in absolute address of code memory?

It's somewhat like look-up table of assembly. I defined an array in header file of C program like this:
unsigned char code volt_2_freq[5]=
{ 100, 200, 300, 400, 500 };
Can I put it in a specific address of code memory ?
I use Phillip LPC900 series MCU and want to set security bits of "MOVC disable" in certain program memory blocks which the array can't be put in.
Does keyword "_at_" work ?
Thanks~

willy

Parents
  • instead of _AT_ I have all XDATA in an ASM module like (extract)

    ;;////////////////////////////////////////////////////////////////////
    ;;
    ;;  FILE:     SLVXDATA.A51
    ;;
    ;;  Copyright TwinVision N.A., 2006
    ;;
    ;;  Xdata buffers (in assembler to force sequence and XendOfMem define)
    
    $NOMOD51
    
    ;$INCLUDE   (sdefs.h)
    ;$INCLUDE   (msstruct.inc)
    
               PUBLIC GCXSinBuf
               PUBLIC GCXSouBuf
    .....
    ?XD?xdataf SEGMENT XDATA
               RSEG ?XD?xdataf
    ......
    
    ;; --- these located as early as possible for the sake of the speed of internal RAM
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; the next 5 buffers MUST be kept in the current order and contiguous
    
    GCX1_2Buf0: ds    01000h  ;byte per dot 256 cols, 4 rows
    GCX1_4Buf0: ds    01000h
    GCX1_8Buf0: ds    01000h
    ....
    


    then my .h file define all XDATA as extern

    Erik

Reply
  • instead of _AT_ I have all XDATA in an ASM module like (extract)

    ;;////////////////////////////////////////////////////////////////////
    ;;
    ;;  FILE:     SLVXDATA.A51
    ;;
    ;;  Copyright TwinVision N.A., 2006
    ;;
    ;;  Xdata buffers (in assembler to force sequence and XendOfMem define)
    
    $NOMOD51
    
    ;$INCLUDE   (sdefs.h)
    ;$INCLUDE   (msstruct.inc)
    
               PUBLIC GCXSinBuf
               PUBLIC GCXSouBuf
    .....
    ?XD?xdataf SEGMENT XDATA
               RSEG ?XD?xdataf
    ......
    
    ;; --- these located as early as possible for the sake of the speed of internal RAM
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; the next 5 buffers MUST be kept in the current order and contiguous
    
    GCX1_2Buf0: ds    01000h  ;byte per dot 256 cols, 4 rows
    GCX1_4Buf0: ds    01000h
    GCX1_8Buf0: ds    01000h
    ....
    


    then my .h file define all XDATA as extern

    Erik

Children
No data