Chapter 1. Introduction
What is an Assembler?
How to Develop A Program
Advantages of Modular Programming
Efficient Program Development
Multiple Use of Subprograms
Ease of Debugging and Modifying
Modular Program Development Process
Segments, Modules, and Programs
Program Entry and Exit
Assembly
Relocation and Linkage
Keeping Track of Files
Writing and Assembling Programs
Chapter 2. 8051 and MCS 251 Architecture
New Features of the MCS 251 Architecture
8051 and MCS 251 Memory Model
8051 Address Space
Program Memory
Internal Data Memory
External Memory
Memory Classes
8051 and MCS 251 Register File
Special Function Registers
Differences to the 8051
8051 Compatibility
Timing Issues
Stack Pointer (SPX)
Program Status Word
PSW Bit Definitions
Chapter 3. Writing Assembly Programs
Assembly Statements
Directives
Controls
Instructions
Comments
Symbols
Symbol Names
Labels
Operands
Special Assembler Symbols
Immediate Data
Indirect Addresses
IDATA
XDATA
CODE and CONST †
EDATA †
HDATA †
Direct Data Addresses
Direct Bit Addresses
Program Addresses
Relative Jumps
In-Block Jumps and Calls (ACALL and AJMP)
Long Jumps and Calls (LJMP and LCALL)
Extended Jumps and Calls (EJMP and ECALL)
Generic Jump and Call (JMP and CALL)
Expressions and Operators
Numbers
Characters
Character Strings
Location Counter
Operators
Arithmetic Operators
Binary Operators
Relational Operators
Class Operators
Type Operators †
Miscellaneous Operators
Operator Precedence
Expressions
Expression Classes
Relocatable Expressions
Simple Relocatable Expressions
Extended Relocatable Expressions
Chapter 4. Assembler Directives
Introduction
Segment Controls
Location Counter
Generic Segments
Stack Segment
Absolute Segments
Default Segment
SEGMENT
RSEG
BSEG, CSEG, DSEG, ISEG, XSEG
Symbol Definition
EQU, SET
CODE, DATA, IDATA, XDATA
LIT †
Memory Initialization
DB
DW
DD †
Memory Reservation
DBIT
DS
DSB †
DSW †
DSD †
Procedure Declaration †
PROC / ENDP †
LABEL †
Program Linkage
PUBLIC
EXTRN / EXTERN
NAME
Address Control
ORG
EVEN †
USING
Other Directives
END
Chapter 5. Standard Macros
Directives
Defining a Macro
Parameters
Labels
Repeating Blocks
REPT
IRP
IRPC
Nested Definitions
Nested Repeating Blocks
Recursive Macros
Operators
NUL Operator
& Operator
< and > Operators
% Operator
;; Operator
! Operator
Invoking a Macro
Chapter 6. Macro Processing Language
Overview
Creating and Calling MPL Macros
Creating Parameterless Macros
MPL Macros with Parameters
Local Symbols List
Macro Processor Language Functions
Comment Function
Escape Function
Bracket Function
METACHAR Function
Numbers and Expressions
Numbers
Character Strings
SET Function
EVAL Function
Logical Expressions and String Comparison
Conditional MPL Processing
IF Function
WHILE Function
REPEAT Function
EXIT Function
String Manipulation Functions
LEN Function
SUBSTR Function
MATCH Function
Console I/O Functions
Advanced Macro Processing
Literal Delimiters
Blank Delimiters
Identifier Delimiters
Literal and Normal Mode
MACRO Errors
Chapter 7. Invocation and Controls
Running A251
Command Files
DOS ERRORLEVEL
Output Files
Assembler Controls
Directives for Conditional Assembly
Conditional Assembly Controls
Chapter 8. Error Messages
Fatal Errors
Fatal Error Messages
Non–Fatal Errors
Appendix A. 8051/251 Instruction Sets
MCS 251 Opcode Map
8051 Microcontroller Instructions
Appendix B. Directive Summary
Appendix F. Listing File Format
Assembler Listing File Format
Listing File Heading
Source Listing
Format for Macros, Include Files, and Save Stack
Symbol Table
Listing File Trailer
Appendix G. Program Template
Appendix H. Assembler Differences
Differences Between A51 and A251
Differences between A51 and ASM51
Differences between A251 and ASM51
Glossary
Index