beautypg.com

B.2 special instructions, Special instructions – FUJITSU F2MC-8L F202RA User Manual

Page 403

background image

387

B.2

Special Instructions

This section describes the special instructions other than addressing.

Special Instructions

JMP @A

By this instruction, the control branches to PC (program counter) using the contents of A (accumulator) as

the address. N items of jump destinations have been listed on the table, one of which is selected and

transferred to A. Executing this instruction can achieve N kinds of branch processing.

Figure B.2-1 shows an overview.

Figure B.2-1 JMP @A

MOVW A, PC

This instruction performs the opposite operation of JMP @A. In other words, the contents of the PC are

stored in A. When this instruction has been executed in the main routine and a specific subroutine is to be

called, it is possible to verify that the contents of A are the predetermined value in the subroutine. It is also

possible to verify that the branch was not from an unexpected part, so it is useful in judging that a runaway

has occurred.

Figure B.2-2 shows an overview.

Figure B.2-2 MOVW A, PC

When this instruction is executed, the contents of A are not the address holding the operation code of this

instruction but the same value as the address holding the next instruction. In Figure B.2-2 , therefore, the

value stored in A, 1234

H

, is the same as the address holding the operation code next to the MOVW A, PC.

A

A

(Before execution)

(After execution)

Old PC

New PC

1234

H

1234

H

1234

H

XXXX

H

A

A

(Before execution)

(After execution)

Old PC

New PC

XXXX

H

1234

H

1234

H

1233

H

This manual is related to the following products: