English
Language : 

DS89C420-QCL Datasheet, PDF (12/139 Pages) Maxim Integrated Products – Ultra-High-Speed Flash Microcontroller User’s Guide
Ultra-High-Speed Flash
Microcontroller User’s Guide
The 16-bit data pointers (DPTRs) can be used as an absolute off-chip reference. This gives access to the entire 64kB data memory
map. An example is as follows:
MOVX
@DPTR, A
Immediate Addressing
;Write the value in the accumulator
;to the address referenced by the
;selected data pointer.
Immediate addressing is used when one of the operands is predetermined and coded into the software. This mode is commonly used
to initialize SFRs and to mask particular bits without affecting others. An example is as follows:
ORL
A, #40h
;Logical OR the Accumulator with 40h.
Register Indirect with Displacement
Register indirect addressing with displacement is used to access data in lookup tables in program memory space. The location is cre-
ated using a base address with an index. The base address can be either the PC or the DPTR. The index is the accumulator. The result
is stored in the accumulator. An example is as follows:
MOVC
A, @A +DPTR
Relative Addressing
;Load the accumulator with the contents
of program memory
;pointed to by the contents of the DPTR
plus the value in
;the accumulator.
Relative addressing is used to determine a destination address for the conditional branch. Each of these instructions includes an 8-bit
value that contains a two’s complement address offset (-127 to +128), which is added to the PC to determine the destination address.
This destination is branched to when the tested condition is true. The PC points to the program memory location immediately follow-
ing the branch instruction when the offset is added. If the tested condition is not true, the next instruction is performed. An example is
as follows:
JZ
Page Addressing
$–20
;Branch to the location (PC+2)–20
;if the contents of the accumulator = 0.
Page addressing is used by the branching instructions to specify a destination address within the same 2kB block as the next con-
tiguous instruction. The full 16-bit address is calculated by taking the five highest-order bits for the next instruction (PC + 2) and
concatenating them with the lowest order 11-bit field contained in the current instruction. An example is as follows:
0870h
ACALL 100h ;Call to the subroutine at address 100h
plus the
;current page address.
In this example, the current page address is 800h, so the destination address is 900h.
Extended Addressing
Extended addressing is used by the branching instructions to specify a 16-bit destination address within the 64kB address space. The
destination address is fixed in the software as an absolute value. An example is as follows:
LJMP
0F732h
Program Status Flags
;Jump to address 0F732h.
All program status flags are contained in the program status word at SFR location D0h. It contains flags that reflect the status of the CPU
and the result of selected operations. The flags are summarized below. The following table shows the instructions that affect each flag.
Bit Description*:
PSW.7
Carry
C
Set when the previous operation resulted in a carry (during addition) or a borrow (during
subtraction). Otherwise cleared.
_____________________________________________________________________________________________ 12