ARM Technical Support Knowledge Articles

OPTIONS FOR CREATING HUGE PROGRAMS

Applies to: L251 Linker/Locator

Answer


Information in this article applies to:


QUESTION

How do I create HUGE programs that use the whole address space on the 251?

ANSWER

Huge programs locate program code in the ECODE memory class. Calls to ECODE require 24-bit addresses and are, therefore, encoded as EJMP instead of LJMP. For this reason ECODE is not as efficient as CODE.

Creating a program that uses the full address space requires that you do several things.

  1. In the START251.A51 file, be sure to define ROMHUGE and assemble for source or binary mode as required. It may be easiest to copy this file from the c251lib directory into your project directory and edit it as follows:
    $SET (ROMHUGE = 1)
    ;------------------------------------------------------------------------------
    ;  This file is part of the C251 Compiler package
    ;  Copyright KEIL ELEKTRONIK GmbH 1995 - 1998
    ;------------------------------------------------------------------------------
    
  2. Set the C compiler option ROM(HUGE). You may do this on the command line or from the uVision IDE. For example:
    c251 mycode.c rom(huge)
    
  3. Specify the range of the ECODE class. Do this using the CLASS directive on the linker command line or from within the IDE. For example:
    l251 mycode.obj class(ecode(0xFE0000-0xFFFFFF))
    

    Check the linker map file to verify the location of the classes and segments in your program. For example, the following excerpt from the MAP file shows that the ECODE class is set from FE0000h to FFFFFFh. It also shows that the main C function is located at FE0000h.

    ACTIVE MEMORY CLASSES OF MODULE:  Y:ROMHUGEROMHUGE (MAIN)
    
    BASE      START     END       MEMORY CLASS
    ==========================================
    000000H   FE0000H   FFFFFFH   ECODE
    FF0000H   FF0000H   FFFFFFH   CODE
    000000H   000000H   00FFFFH   EDATA
    000000H   000000H   00007FH   DATA
    
    
    MEMORY MAP OF MODULE:  Y:ROMHUGEROMHUGE (MAIN)
    
    
    START     STOP      LENGTH    ALIGN  RELOC    MEMORY CLASS   SEGMENT NAME
    =========================================================================
    000000H   000007H   000008H   ---    AT..     DATA           "REG BANK 0"
    000008H   000107H   000100H   BYTE   UNIT     EDATA          ?STACK
    FE0000H   FE0000H   000001H   BYTE   INSEG    ECODE          ?PR?MAIN
    FE0001H   FE0013H   000013H   BYTE   UNIT     ECODE          ?C_C51STARTUPE
    FF0000H   FF0002H   000003H   ---    OFFS..   CODE           ?CO?START251?5
    FF0003H   FF0006H   000004H   BYTE   UNIT     CODE           ?C_C51STARTUP
    FF0007H   FF000AH   000004H   BYTE   UNIT     ECODE          ?C_C51STARTUP?3
    

SEE ALSO

Article last edited on: 2005-07-09 13:01:33

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential