5 general-purpose register banks, Toshiba – Toshiba TMP87CP24AF User Manual

Page 11

Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

Advertising
background image

TOSHIBA

TMP87CM24A/P24A

1.5

General-purpose Register Banks

General-purpose

registers

are

mapped

into

addresses

0040

h

to

OOBF

h

in

the

data

memory

as

shown

in

Figure 1-4. There are 16 register banks, and each bank contains 8-bit registers W, A, B, C, D, E, H, and L.

Figure 1-5 shows the general-purpose register bank configuration.

w

A

B

C

D

E

H

L

—' bank 15 (00B8 to OOBF

h

)

—I bank 14 (00B0to00B7H)

—' bank 13 (OOABtoOOAFH)

bank

12

(OOAO to

00A?

h

)

— bank

4

(

0060

to

006

?H)

—I banks

(

0058

to

005

FH)

— bank

2

(

0050

to

0057

H)

cl (

0048

to

004

FH)

bankO

(

0040

to

0047

H)

(a) Configuration

Example

Bank 0

W

A

(0041

h

)

(0040

h

)

B

C

(0043

h

)

(0042

h

)

D

E

(0045

h

)

(0044

h

)

H

L

(0047

h

)

(0046

h

)

(b) Address assignments of registers

Figure 1-5. General-purpose Register Banks

In addition to access in 8-bit units,

the registers can also be accessed in 16-bit units as the register pairs

WA,

BC,

DE,

and

HL.

Besides

its

function

as

a

general-purpose

register,

the

register

also

has

the

following

functions:

(1)

A,WA

The

A

register

functions

as

an

8-bit

accumulator

and

WA

the

register

pair

functions

as

a

16-bit

accumulator

(W

is

high

byte

and

A

is

low

byte).

Registers

other

than

A

can

also

be

used

as

accumulators for 8-bit operations.

Examples:

®

add

a

, B

;

Adds B contents to

a

contents and stores the result into

a

.

®

SUB WA, 1234H

; Subtracts

1234

h

from WA contents and stores the result into WA.

®

SUB E, A

; Subtracts A contents from E contents, and stores the result into E.

(2)

HL,DE

The

HL

and

DE

specify

a

memory

address.

The

HL

register

pair

functions

as

data

pointer

(HL)

/index

register (HL + d) /base register (HL + C), and the DE register pair function as a data pointer (DE). The

HL

also

has

an

auto-post-

increment

and

auto-pre-decrement

functions.

This

function

simplifies

multiple digit data processing, software LIFO (last-in first-out) processing, etc.

Example 1 : ®

LD

A, (HL)

LD

A, (HL + 52H)

(3)

LD

A, (HL + C)

LD

A, (HL + )

LD

A, (-HL)

; Loads the memory contents at the address specified by HL into A.

; Loads the memory contents at the address specified by the value

obtained by adding 52

h

to HL contents into A.

; Loads the memory contents at the address specified by the value

obtained by adding the register C contents to HL contents into A.

; Loads the memory contents at the address specified by HL into A.

Then increments HL.

; Decrements HL. Then loads the memory contents at the address

specified by new HL into A.

3

-

24-11

2002

-

10-03

Advertising
This manual is related to the following products: