A251 User's GuideA251 Introduction Assembling Programs Writing Assembly Programs Control Statements Macro Processor Error Messages Appendix A. Application Examples B. Reserved Symbols C. Listing File Format Listing File Heading Source Listing Macro / Include File / Save Stack Format Symbol Table Listing File Trailer D. Assembler Differences Between A51 and A251 Between A251 and ASM51
A. Application Examples
This appendix illustrates project development for the 251 microcontroller family. The sample programs are found in the ..\Keil\C251\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\C251\Examples contains several other example programs that are described in the C251 Primer User's Guide.
ASM – Assembler Example
This example shows you how to create a 251 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 A251 and L251 from the Command Prompt:
Build the 251 application with the following commands:
A251 ASAMPLE1.A51 DEBUG XREF A251 ASAMPLE2.A51 DEBUG XREF A251 ASAMPLE3.A51 DEBUG XREF L251 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 OH251 with the following command:
of your data.