6 table reference – NEC PD17062 User Manual

Page 24

Advertising
background image

24

µ

PD17062

2.6 TABLE REFERENCE

The table reference instruction is used to reference the constant data in program memory. If the MOVT

DBF, @AR instruction is executed, data at the program memory address specified in an address register is

placed in a data buffer (DBF).

Because each data item in program memory consists of 16 bits, the constant data placed in the data buffer

by the MOVT instruction also consists of 16 bits (four words). Because the address register consists of eight

bits, the MOVT instruction can reference a program memory address between 0000H and 00FFH.

When table referencing is executed, a single stack is used.

See Sections 8.1 and 10.3.

2.7 NOTES ON USING THE BRANCH INSTRUCTION AND SUBROUTINE CALL INSTRUCTION

The 17K series assembler (AS17K) detects an error if a program memory address (numeric address) is

directly specified in the operand of the branch instruction (BR) or subroutine call instruction (CALL).

The assembler provides this function to minimize the number of bugs arising from program modification.

Examples 1. Instruction causing an error

;

#

BR

0005H

; The assembler detects the error.

;

$

CALL

00F0H

;

2. Instruction causing no error

;

%

LOOP1:

; The BR or CALL instruction is executed for a label used in the

BR

LOOP1

; program.

;

&

SUB1:

;

CALL

SUB1

;

;

(

LOOP2 LAB

0005H

; As a label type, 0005H is assigned to LOOP2.

BR

LOOP2

;

;

)

BR. LD.

0005H

; The numeric value of the operand is converted to a label type.

;

It is recommended that this method not be used to reduce

;

the number of bugs.

For details, refer to the AS17K User’s Manual.

Advertising