beautypg.com

Maxim Integrated MAXQ622 User Manual

Page 249

background image

A1-4

Maxim Integrated

MAXQ612/MAXQ622 User’s Guide

move ACC, @DP[1] ; DP[1] is now properly configured properly to read
****************************************************************************
Example 1a, Incorrect Basic Single Pointer configuration
Assumptions: Same as Example 1
****************************************************************************
move DPC, #BP_WORD_MODE_OR_MASK|BP_WORD_MODE_OR_MASK|DP1_SELECT
; *WRONG*. Attempt to change mode and select DP[1] in a
; single instruction
move ACC, @DP[1] ; DP[1] is *NOT* properly configured properly to read
****************************************************************************
Example 2, Basic Single Pointer Configuration with address assignment just
prior to pointer read.
Assumptions: We know the contents of DPC. DPC contains #1ch
(Word mode: DP[0], DP[1], BP[Offs], DP[0] is selected)
****************************************************************************
move DPC, #BP_WORD_MODE_OR_MASK|BP_WORD_MODE_OR_MASK
; change DP[1] to byte mode by setting DPC.3 to 0
move DP[1], #1234h ; writing an address to a pointer register selects that
; pointer as the active source.
move ACC, @DP[1] ; DP[1] is now properly configured properly to read
****************************************************************************
Example 2a, Incorrect Basic Single Pointer Configuration with address
assignment just prior to pointer read.
Assumptions: We know the contents of DPC. DPC contains #1ch
(Word mode: DP[0], DP[1], BP[Offs], DP[0] is selected)
****************************************************************************
move DP[1], #1234h ; *WRONG* writing an address to a pointer register before
; setting the mode will result in an incorrect
; address after the pointer mode is changed.
move DPC, #BP_WORD_MODE_OR_MASK|BP_WORD_MODE_OR_MASK
; *WRONG* writing the DPC register after selecting a
; pointer can de-select the active source pointer
move ACC, @DP[1] ; DP[1] is *NOT* properly configured properly to read
****************************************************************************
Example 3, Basic Single Pointer Configuration
Assumptions: We DO NOT know the contents of DPC.
****************************************************************************
move ACC, DPC ; get the current DPC value
and #DP1_BYTE_MODE_AND_MASK
; change DP[1] to byte mode by setting DPC.3 to 0
move DPC, ACC ; write the new mode value

This manual is related to the following products: