Notes On Using Data Memory - NEC PD17062 Datasheet

Mos integrated circuit 4-bit single-chip microcontroller containing pll frequency synthesizer and image display controller
Table of Contents

Advertisement

5.3 NOTES ON USING DATA MEMORY

5.3.1 Addressing Data Memory
If the 17K series assembler is being used and a numeric representing a data memory address is specified
directly in an operand of a data memory manipulation instruction, as shown in example 1, an error will occur.
This error occurs to facilitate the maintainability of programs and to reduce the number of causes of bugs
when a program is modified. In this data sheet, however, real-address notation is used in the sample programs
to make them easy to understand. When coding an actual program, refer to the assembler instruction manual.
Example 1.
Instructions that result in an error
#
;
MOV 2FH, #0001B
$
;
MOV 0.2FH, #0001B
Instructions that do not cause an error
%
;
M02F MEM 0.2FH
MOV M02F, #0001B
&
;
MOV .MD.2FH, #0001B ; Address 2FH is converted into a memory-type
Using an assembler pseudo instruction, namely the MEM instruction (symbol definition pseudo instruc-
tion), symbolically define a data memory address in advance.
If a data memory address is defined symbolically, a data memory bank must also be specified, as shown
in example 2.
This data memory bank specification is used when a data memory map is automatically created in the
assembler.
Note that if a symbolically defined data memory address for BANK2 is used in the range of BANK1 in a
program, as shown in example 2, the operation is performed in BANK1 data memory.
38
; Address 2FH is specified directly.
; Address 2FH in BANK0 is specified directly.
; Address 2FH of BANK0 is defined symbolically in
; M02F as a memory-type address.
; address by using .MD.. However, the use of this type of
; instruction should be avoided to reduce the
; likelihood of bugs arising.
PD17062

Advertisement

Table of Contents
loading

Table of Contents