65/317
4 - Architecture of the ST7 core
4.2.1 Addressing space
The ST7, as said earlier, is based on a Von Neumann architecture. This means that there is
only one addressing space in which the program, the data and the input-output peripherals are
mapped. The advantages are:
Access to any byte (of program, of data or of input-output) using the same instructions
No special instructions to access constant data in program memory or input-output
Ease of programming, due to simplification resulting from the first two advantages
As a typical 8-bit processor, the address bus of the ST7 is 16 bits wide, and thus able to ad-
dress 65,536 bytes. This is enough for most applications within the range of the ST7.
To improve the efficiency of the code, the addressable space is actually divided in two parts:
The addresses ranging from 0 to 255 (
0FFh
) are said to belong to page zero. An 8-bit address
is enough to reach them.
The remainder, from 256 (
80h
) to 65,535 (
0FFFFh
), is accessed using 16-bit addresses.
The use of page zero can greatly improve the speed of the code if the most frequently ac-
cessed data are located in page zero. Also, in the ST7, all input-outputs are always located in
page zero.
4.2.2 Internal registers
The core uses only six registers:
A
,
X
,
Y
,
PC
,
SP
and
CC
.
4.2.2.1 Accumulator (A)
The accumulator is the register where the arithmetic and logic operations are performed. To
perform a two-operand operation between two values stored in memory, one of the values
must first be moved to the accumulator, since the instruction code provides only one address.
It must be moved back to memory when the operation is done.
The instructions that require only one operand, like
INC
rement,
DEC
rement,
C
om
PL
ement,
C
om
P
are,
T
est for
N
egative or
Z
ero,
B
it
C
om
P
are, and so on, can act on the accumulator, or di-
rectly on the data in memory, if so desired.
4.2.2.2 Condition Code register (CC)
This register holds several bits that are actually more or less independent from one another.
These bits are set or reset (or left unchanged) after the execution of certain instructions. For
example, if an addition produces a null result, the
Z
flag is set; otherwise, it is reset. If the result
is negative, the
N
flag is set, otherwise it is reset and so on. The
CC
register remembers the
conditions after each instruction, and these conditions are used by the conditional jump in-
structions. The
CC
is laid out as follows:
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...