Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
70
Добавлен:
14.04.2015
Размер:
2.03 Mб
Скачать

410 Appendix A. Application Examples

 

 

Using C51 and LX51

A

 

When you are using the extended LX51 linker/locater the program is generated

 

as shown below:

 

 

 

 

 

LX51 COMMON{P_ROOT.OBJ}, BANK0{P_BANK0.OBJ},

 

 

BANK1{P_BANK1.OBJ}, BANK2{P_BANK2.OBJ}

 

 

BANKAREA(8000H,0FFFFH)

 

 

OHX51 P_ROOT

Philips 80C51MX – Assembler Example

The example Philips 80C51MX\ASM shows how to use the new instructions of the Philips 80C51MX architecture in assembly language. Segments with the memory class ECODE are used to show the ECALL and ERET instructions. Segments with HCONST and HDATA are used to show how to access memory in the 16MB address space of this architecture.

The example program is build with the AX51 macro assembler and the LX51 linker/locater as shown below:

AX51 MX_INST.A51 DEBUG MOD_MX51

LX51 MX_INST.OBJ

OHX51 MX_INST

Keil Software — A51/AX51/A251 Macro Assembler and Utilities

411

 

 

Philips 80C51MX – C Compiler Example

The example Philips 80C51MX\Banking shows how to create large C programs

A

for the Philips 80C51MX architecture. The program uses the code banking

facilities of the LX51 linker/locater to place program code into the code pages

 

0x80:0000 (bank 0) and 0x81:0000 (bank 1). The function of this example is

 

similar to that shown in “BANK_EX1 – Code Banking with C51” on page 404.

 

In addition some variables are declared with the far memory type to show the

 

usage of the HCONST and HDATA memory class.

 

The example program is build with the AX51 macro assembler and the LX51

 

linker/locater as shown below:

 

CX51 C_ROOT.C DEBUG

CX51 C_BANK0.C DEBUG

CX51 C_BANK1.C DEBUG

AX51 START_MX.A51 MOD_MX51

LX51 COMMON {C_ROOT.OBJ, START_MX.OBJ},

BANK0 {C_BANK0.OBJ}, BANK1 {C_BANK1.OBJ}

CLASSES (HCONST (0x810000 - 0x81FFFF), HDATA (0x010000 - 0x01FFFF))

OHX51 C_ROOT

412

Appendix A. Application Examples

 

 

A

Соседние файлы в папке HLP