B.3 special instructions, Special instructions, B.3 "s – FUJITSU Semiconductor Controller MB89950/950A User Manual

Page 288

Advertising
background image

274

APPENDIX

B.3

Special Instructions

This section describes the special instructions used for other than addressing.

Special instructions

JMP @A

This instruction sets the contents of A (accumulator) to PC (program counter) as the address, and causes a

branch to that address. One of the N branch destination addresses is selected from a table, and then

transferred to A. The instruction can be executed to perform N-branch processing.

Figure B.3-1 "JMP @A" shows a summary of the instruction.

Figure B.3-1 JMP @A

MOVW A, PC

This instruction performs the operation which is the reverse of that performed by JMP @A. That is, the

instruction stores the contents of PC in A. When the instruction is executed in the main routine, so that a

specific subroutine is called, whether A contains a predetermined value can be checked by the subroutine.

This can be used to determine that the branch source is not any unexpected section of the program and to

check for program runaway.

Figure B.3-2 "MOVW A, PC" shows a summary of the instruction.

Figure B.3-2 MOVW A, PC

After the MOVW A, PC instruction is executed, A contains the address of the operation code of the next

instruction, rather than the address of the operation code of MOVW A, PC. Accordingly, Figure B.3-2

"MOVW A, PC" shows that A contains 1234

H

, which is the address of the operation code of the instruction

that follows MOVW A, PC.

1 2 3 4

H

A

X X X X

H

Previous PC

A

Current PC

(Before execution)

(After execution)

1 2 3 4

H

1 2 3 4

H

A

A

X X X X

H

1 2 3 4

H

1 2 3 4

H

1 2 3 4

H

Previous PC

Current PC

Advertising