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

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

423

 

 

Appendix D. Assembler Differences

This appendix lists the differences between the Intel ASM-51 assembler, the

Keil A51 assembler, and the Keil A251/AX51 assembler.

Differences Between A51 and A251/AX51

Assembly modules written for the A51 assembler may be assembled using the A251/AX51 macro assembler. However, since the A251 macro assembler supports the Intel/Atmel WM 251 architecture and the AX51 macro assembler supports extended 8051 variants like the Philips 80C51MX, the following incompatibilities may arise when A51 assembly modules are assembled with the A251/AX51 assembler.

32-Bit Values in Numeric Evaluations

D

 

The A51 assembler uses 16-bit values for all numerical expressions. The

 

A251/AX51 macro assembler uses 32-bit values. This may cause problems

 

when overflows occur in numerical expressions. For example:

 

 

 

 

 

 

 

 

Value

EQU

(8000H + 9000H) / 2

 

 

generates the result 800h in A51 since the result of the addition is only a 16-bit value (1000h). However, the A251/AX51 assembler calculates a value of 8800h.

8051 Pre-defined Special Function Register Symbol Set

The default setting of the A51 assembler pre-defines the Special Function Register (SFR) set of 8051 CPU. This default SFR set can be disabled with the A51 control NOMOD51. Both A251 and AX51 do not pre-define the 8051 SFR set. The control NOMOD51 is accepted by A251/AX51 but does not influence any SFR definitions.

More Reserved Symbols

The A251/AX51 macro assembler has more reserved symbols as A51. Therefore it might be necessary to change user-defined symbol names. For example the symbol ECALL cannot be used as label name in A251/AX51, since it is a mnemonic for a new instruction.

424

Appendix D. Assembler Differences

 

 

 

Object File Differences

 

Ax51 uses the OMF-251/51MX file format for object files. A51 uses an

 

extended version of the Intel OMF-51 file format. The OMF-51 file format

 

limits the numbers of external symbols and segments to 256 per module. The

 

OMF-251 file format does not have such a limit on the segment and external

 

declarations.

Differences between A51 and ASM51

Assembly modules written for the Intel ASM51 macro assembler can be re-translated with the A51 macro assembler. However you have to take care about the following differences:

Enable the MPL Macro Language

 

 

If your assembly module contains Intel ASM51 macros, the A51 MPL macros

 

 

D

 

need to be enable with the MPL control.

 

8051 Pre-defined Interrupt Vectors

 

 

 

The Intel ASM51 pre-defines the following symbol names if MOD51 is

 

 

active: RESET, EXTI0, EXTI1, SINT, TIMER0, TIMER1. A51 does not

 

 

 

 

pre-define this symbol names.

 

 

More Reserved Symbols

 

 

Since the A51 macro assembler supports also conditional assembly and

 

 

standard macros, A51 has more reserved symbols then Intel ASM51.

 

 

Therefore it might be necessary to change user-defined symbol names. For

 

 

example the symbol IF cannot be used as label name in A51, since it is a

 

 

control for conditional assembly.

 

 

Object File Differences

 

 

The A51 assembler generates line number information for source level

debugging and file dependencies. For compatibility to previous A51 versions and to ASM51, the line number information can be disabled with the A51 control NOLINES.

C Preprocessor Side Effects

The integrated C preprocessor in Ax51 has two side effects that are incompatible to the Intel ASM51 macro assembler. If you are using the backslash character at the end of a comment line, the next line will be comment out too. If you are using $INCLUDE in conditional assembly blocks, the file must exist even when the block will not be assembled.

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

425

 

 

Differences between A251/AX51 & ASM51

Assembly modules written for Intel ASM51 can be re-translated with the A251 macro assembler. However, since the A251 macro assembler supports additional 251 features, the following incompatibilities can arise when ASM51 modules are re-translated with A251.

32-Bit Values in Numeric Evaluations

The ASM51 assembler uses 16-bit numbers for all numerical expressions. The A251 macro assembler uses 32-bit values. This can cause problems when overflows occur in numerical expressions. For example:

Value

EQU

(8000H + 9000H) / 2

has the result 800H in ASM51 since the result of the addition is only a 16-bit value (1000H), whereas the A251 calculates Value as 8800H.

8051 Pre-defined Symbols

The default setting of Intel ASM51 pre-defines the Special Function Register D (SFR) set and symbol names for reset and interrupt vectors of 8051 CPU.

This default symbol set can be disabled with the ASM51 control NOMOD51. A251 does not pre-define any of the 8051 SFR or interrupt vector symbols. The control NOMOD51 is accepted by A251 but does not influence any symbol definitions.

More Reserved Symbols

The A251 macro assembler has more reserved symbols as ASM51. Therefore it might be necessary to change user-defined symbol names. For example the symbol ECALL cannot be used as label name in A251, since the Intel/Atmel WM 251 has a new instruction with that mnemonic.

Enable the MPL Macro Language

If your assembly module contains Intel ASM51 macros, the A251 MPL macros need to be enabled with the MPL control.

Object File Differences

The A251 assembler uses the Intel OMF-251 file format for object files. The ASM51 assembler uses the Intel OMF-51 file format. The OMF-51 file format limits the numbers of external symbols and segments to 256 per module. The OMF-251 file format does not have such a limit on the segment and external declarations. The ASM51 assembler generates line number information for source level debugging. For compatibility with ASM51, line number information can be disabled with the A251 control NOLINES.

426

Appendix D. Assembler Differences

 

 

C Preprocessor Side Effects

The integrated C preprocessor in Ax51 has two side effects that are incompatible to the Intel ASM51 macro assembler. If you are using the backslash character at the end of a comment line, the next line will be comment out too. If you are using $INCLUDE in conditional assembly blocks, the file must exist even when the block will not be assembled.

D

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