Maxim-integrated MAXQ622 Manual de usuario Pagina 246

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 255
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 245
Maxim Integrated A1-1
MAXQ612/MAXQ622 Users Guide
APPENDIX 1: DATA POINTER USAGE EXAMPLES
IMPORTANT: MAXQ20 family pointer mode (DPC.WBS) bits and source select
(DPC.SDPS) bits should not be changed simultaneously.
Writing immediate values to DPC (e.g. MOVE DPC, #4)
without knowing the previous contents can implicitly
setup a situation where the mode and select bits are
changed simultaneously. A function call with
foo:
push DPC
;...
move DPC, #4
;...
pop DPC
ret
will, in many cases, setup a situation where mode and
select bits are changed simultaneously. If you are
ever in doubt about the contents of DPC then read the
contents, change only the desired bits using a bit mask and
write the modified value back to DPC.
NOTE: Compilers already manage DPC correctly. These examples are intended to benefit
people that write assembly language routines, modules or applications.
NOTE: All data pointers are implemented with 17 bits, with sliding windows that expose
the upper 16 bits when the corresponding DPC.WBS is set to 1 (word mode) and expose
the lower 16 bits if the corresponding DPC.WBS is cleared to 0 (byte mode).
MAXQ 17-bit Internal Pointer Representation (DP[0], DP[1], BP[OFFS]
[, CP where applicable]):
internal bit position: 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
word mode window: ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
byte mode window: ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
If you need to preserve a pointer across an interrupt service routine
or a function call and you modify the pointer’s mode then you must
preserve all 17 bits of any pointer used. The most basic form of this
operation looks like (DP[0] example)
foo:
push DPC ; preserve DPC
move DPC, #0h ; save the
push DP[0] ; byte mode version of DP[0]
move DPC, #4h ; save the
push DP[0] ; word mode version of DP[0]
;
Vista de pagina 245
1 2 ... 241 242 243 244 245 246 247 248 249 250 251 ... 254 255

Comentarios a estos manuales

Sin comentarios