25.04.2020 Views

1989_MELPS_7700_Software_Manual

Mitsubishi MELPS 7700 series microcomputer instruction set and addressing mode handbook

Mitsubishi MELPS 7700 series microcomputer instruction set and addressing mode handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Register Configuration

2.9 Processor Status Register (PS)

The processor status register (PS) is an 11-bit register, and it consists of flags that specify the

status immediately after operation and bits that set the processor interrupt priority level. The C,

Z, V and N flags enable execution of branching instructions depending on the flag values. Each

bit of the processor status register is explained below.

bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

10 10 10 10 10 1 IPL 1 N 1 V 1 ml x 1 01 r 1 Z 1 ci Processor Status Register (PS)

(Note) Bits 11-15 are fixed at O.

[Bit-O] Carry Flag (C)

This bit is the carry flag which holds the carry or borrow from the arithmetic logic unit (ALU) after

arithmetic operation. It is also affected by the shift and rotate instructions. This flag can be

directly set by the SEC and SEP, and cleared by CLC and CLP instructions.

[Bit-1] Zero Flag (Z)

This bit is set 1 when the arithmetic operation or data transfer result is 0, and it is set 0 when

such result is not "0". This flaQ is invalid for addition IADC) instruction in the decimal-operation

.!I!.QQ.e.. This flag can be directly set by SEP and cleared by CLP instructions.

[Bit-2] Interrupt Disable Flag (I)

This is the flag that is used to disable all interrupts (except the interrupts by the watchdog timer,

SRK instruction and division by zero). When this flag is "1 ", interrupts are disabled. This flag is

set to "1" automatically when an interrupt is accepted, inhibiting multiple interrupt acceptance.

This flag can be set using the SEI and SEP, and cleared using the CLI and CLP instructions.

[Bit-3] Decimal Operation Mode Flag (D)

This flag is used to determine whether to execute addition and subtraction in the binary-mode

or in the decimal-mode. "0" specifies the ordinary binary mode. When this flag is set to "1 ", addition/subtraction

is executed with 1 word as a 2- or 4-digit decimal value (2- or 4-digit selection

is made by the data length selection flag m). Decimal alignment is performed automatically.

Note that decimal-mode can be used only by the ADC and SSC instructions.

This flag can be set by the SEP and cleared by the CLP instructions.

Because this flaQ directly affects arithmetic operation, it must be initialized whenever the microcomputer

is reset.

[Bit-4] Index Register Length Selection Flag (x)

This flag specifies whether to use the index register X or Y in the 16-biI index register length or

in the 8-bit index register length. "0" specifies the 16-bit length mode, and "1" specifies the 8-

bit length mode. This flag can be set by the SEP, and cleared by the CLP instructions.

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!