Keil Logo

A. Application Examples

This appendix illustrates project development for the Ax51 microcontroller family. The sample programs are found in the ..\Keil\C51\Examples\ASM folder. Each sample program is stored in a separate folder along with µVision project files that help you quickly build each sample program.

The folder ..\Keil\C51\Examples contains several other example programs that are described in the C51 Primer User's Guide.

ASM – Assembler Example

This example shows you how to create an x51 program in assembler language. The program, which outputs the text "PROGRAM TEST" on the serial interface, is three modules that may be translated using the various tool versions.

Using Ax51 and Lx51 from the Command Prompt:

Build the Ax51 application with the following commands:

A51 ASAMPLE1.A51 DEBUG XREF
A51 ASAMPLE2.A51 DEBUG XREF
A51 ASAMPLE3.A51 DEBUG XREF
L51 ASAMPLE1.OBJ, ASAMPLE2.OBJ, ASAMPLE3.OBJ SEGMENTS (VAR1) IXREF

The SEGMENTS control locates the VAR1 segment before other internal data memory segments.

The IXREF control includes a cross reference in the linker listing (MAP) file.

The file ASAMPLE1 is the absolute object module created by the linker. This file can be used as input for debuggers or may be converted into an Intel HEX file using OH51 with the following command:

OH51 ASAMPLE1
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.