Intel 80C196NU User Manual

Page of 471
4-11
PROGRAMMING CONSIDERATIONS
4.3
ASSEMBLY LANGUAGE ADDRESSING MODE SELECTIONS
The assembly language simplifies the choice of addressing modes. Use these features wherever
possible.
4.3.1
Direct Addressing
The assembly language chooses between direct and zero-indexed addressing depending on the
memory location of the operand. Simply refer to the operand by its symbolic name. If the operand
is in the lower register file, the assembly language chooses a direct reference. If the operand is
elsewhere in memory, it chooses a zero-indexed reference. 
4.3.2
Indexed Addressing 
The assembly language chooses between short-indexed and long-indexed addressing depending
on the value of the index expression. If the value can be expressed in eight bits, the assembly lan-
guage chooses a short-indexed reference. If the value is greater than eight bits, it chooses a long-
indexed reference.
4.3.3
Extended Addressing 
If the operand is outside page 00H, then you must use the extended load and store instructions,
ELD, ELDB, EST, and ESTB.
4.4
DESIGN CONSIDERATIONS FOR 1-MBYTE DEVICES
In general, you should avoid creating tables or arrays that cross page boundaries. For example, if
you are building a large array, start it at a base address that will accommodate the entire array
within the same page. If you cannot avoid crossing a page boundary, keep in mind that you must
use extended instructions to access data outside the original page.
4.5
SOFTWARE STANDARDS AND CONVENTIONS
For a software project of any size, it is a good idea to develop the program in modules and to es-
tablish standards that control communication between the modules. These standards vary with the
needs of the final application. However, all standards must include some mechanism for passing
parameters to procedures and returning results from procedures. We recommend that you use the
conventions adopted by the C programming language for procedure linkage. These standards are
usable for both the assembly language and C programming environments, and they offer compat-
ibility between these environments.