beautypg.com

Maxim Integrated MAXQ622 User Manual

Page 248

background image

Maxim Integrated

A1-3

MAXQ612/MAXQ622 User’s Guide

Pointer deactivation
Any time a pointer is activated another is deactivated.
1) Writing addresses to two pointers.
move DP[0], #1234h ; activates pointer DP[0]
move DP[1], #4567h ; pointer DP[0] deactivated, activates pointer DP[1]
2) Auto-Incrementing Pointers (buffer access).
BadLoop:
;
; DP[0]++ activates DP[0] after the data is read from memory
; (activation through address change) however ++DP[1]
; increments DP[1] (activation through address change)
; leaving DP[0] deactivated at the top of the next loop.
move @++DP[1], @DP[0]++
djnz LC[0], BadLoop
The correct usage looks like:
GoodLoop:
move DP[0], DP[0] ; recirculate DP[0] to activate it
move @++DP[1], @DP[0]++
djnz LC[0], GoodLoop

Predefined masks and constants
#define DP0_WORD_MODE_OR_MASK 04h
#define DP0_BYTE_MODE_AND_MASK ~04h
#define DP1_WORD_MODE_OR_MASK 08h
#define DP1_BYTE_MODE_AND_MASK ~08h
#define BP_WORD_MODE_OR_MASK 10h
#define BP_BYTE_MODE_AND_MASK ~10h
#define DP0_SELECT 00h
#define DP1_SELECT 01h
#define BP_SELECT 02h
****************************************************************************
Example 1, Basic Single Pointer Configuration (selecting DP[1] as the
active source pointer)
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 DPC, #BP_WORD_MODE_OR_MASK|BP_WORD_MODE_OR_MASK|DP1_SELECT
; select DP[1] as the active source pointer by setting
; DPC.1:DPC.0 to #1

This manual is related to the following products: