2017년 11월 29일 수요일

STARTUP.A51

The file STARTUP.A51  contains the startup code for a C51 target program. This source file is located in the \FSI\LIB  directory. Include a copy of this file in each 8051 project that needs custom startup code.
STARTUP.A51 파일에는 C51 대상 프로그램의 시작 코드가 들어 있습니다. 이 소스 파일은 \ FSI \ LIB 디렉토리에 있습니다. 사용자 지정 시작 코드가 필요한 각 8051 프로젝트에이 파일의 복사본을 포함시킵니다.

This code is executed immediately upon reset of the target system and optionally performs the following operations in order:
이 코드는 대상 시스템을 다시 설정하면 즉시 실행되며 선택적으로 다음 작업을 순서대로 수행합니다.


  Clears internal data memory
  Clears external data memory
  Clears paged external data memory

  Initializes the small model reentrant stack and pointer
  Initializes the large model reentrant stack and pointer
  Initializes the compact model reentrant stack and pointer

  Initializes the 8051 hardware stack pointer

  Transfers control to the main C function.

STARTUP.A51  provides assembly constants you may change to control the actions taken at startup. These are defined in the following table.
STARTUP.A51은 시작할 때 취하는 동작을 제어하기 위해 변경할 수있는 어셈블리 상수를 제공합니다. 이들은 다음 표에 정의되어 있습니다.

IDATALEN
Indicates the number of bytes of idata that are to be initialized to 0.  The default is 80h because most 8051 derivatives contain at least 128 bytes of internal data memory. Use a value of 100h for the 8052 and other derivatives that have 256 bytes of internal data memory.

If your target system supports a power-down mode and you want to disable internal data memory clearing, set IDATALEN  to 0. However, you must ensure that the byte variable ?C_DSTK_LEVEL is set to zero. This is required by functions included from the library.

 XDATASTART
Specifies the xdata address to start initializing to 0.

 XDATALEN
Indicates the number of bytes of xdata to be initialized to 0. The default is 0.

 PDATASTART
Specifies the pdata address to start initializing to 0.

 PDATALEN
Indicates the number of bytes of pdata to be initialized to 0. The default is 0.

 IBPSTACK
Indicates whether or not the small model reentrant stack pointer (?C_IBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

 IBPSTACKTOP
Specifies the top start address of the small model reentrant stack area. The default is 0xFF in idata memory.

C51 does not check to see if the stack area available satisfies the requirements of the applications. It is your responsibility to perform such a test.

 XBPSTACK
Indicates whether or not the large model reentrant stack pointer (?C_XBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

 XBPSTACKTOP
Specifies the top start address of the large model reentrant stack area. The default is 0xFFFF in xdata memory.

C51 does not check to see if the stack area available satisfies the requirements of the applications. It is your responsibility to perform such a test.

 PBPSTACK
Indicates whether the compact model reentrant stack pointer (?C_PBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

 PBPSTACKTOP
Specifies the top start address of the compact model reentrant stack area. The default is 0xFF in pdata memory.

C51 does not check to see if the stack area available satisfies the requirements of the applications. It is your responsibility to perform such a test.

 PPAGEENABLE
Enables (a value of 1) or disables (a value of 0) the initialization of port 2 of the 8051 device. The default is 0. The addressing of port 2 allows the mapping of 256 byte variable memory in any arbitrary xdata page.

 PPAGE
Specifies the value to write to Port 2 of the 8051 for pdata memory access. This value represents the xdata memory page to use for pdata.  This is the upper 8 bits of the absolute address range to use for pdata.

As an example, if the pdata area begins at address 1000h (page 10h) in the xdata memory, PPAGEENABLE  should be set to 1 and PPAGE  should be set to 10h. The L51 Linker/Locator must contain a value between 1000h and 10FFh in the PDATA control directive. For example:

L51 <input modules> PDATA (1050H)

Neither L51 nor C51 checks to see if the PDATA control directive and the PPAGE  assembler constant are specified correctly. You must ensure that these parameters contain suitable values.


Memory Models (Link)
컴파일러 옵션에서 어떤 모델(Small, Compact, Large) 를 쓸건지 체크를 하면 그에 맞춰서 Complie 이 된다. 보통 XDATA 를 사용하는 Large 를 선택한다.








댓글 없음:

댓글 쓰기