<s>
The	O
9S08	O
(	O
68HCS08	O
or	O
S08	O
for	O
short	O
)	O
is	O
an	O
8-bit	O
microcontroller	B-Architecture
( µC	O
)	O
family	O
originally	O
produced	O
by	O
Motorola	O
,	O
later	O
by	O
Freescale	O
Semiconductor	O
,	O
and	O
currently	O
by	O
NXP	O
,	O
descended	O
from	O
the	O
Motorola	B-Device
6800	I-Device
microprocessor	O
.	O
</s>
<s>
It	O
is	O
a	O
CISC	B-Architecture
microcontroller	B-Architecture
.	O
</s>
<s>
A	O
slightly	O
extended	O
variant	O
of	O
the	O
68HC08	B-Device
,	O
it	O
shares	O
upward	O
compatibility	O
with	O
the	O
aging	O
68HC05	B-Device
microcontrollers	B-Architecture
,	O
and	O
is	O
found	O
in	O
almost	O
any	O
type	O
of	O
embedded	O
systems	O
.	O
</s>
<s>
The	O
larger	O
members	O
offer	O
up	O
to	O
128KiB	O
of	O
flash	B-Device
,	O
and	O
8KiB	O
of	O
RAM	B-Architecture
via	O
a	O
simple	O
memory	B-General_Concept
management	I-General_Concept
unit	I-General_Concept
(	O
MMU	O
)	O
which	O
allows	O
bank-switching	B-General_Concept
16KiB	O
of	O
the	O
address	O
space	O
and	O
an	O
address/data	O
register	B-General_Concept
pair	O
which	O
allows	O
data	O
fetches	O
from	O
any	O
address	O
.	O
</s>
<s>
The	O
paging	O
scheme	O
used	O
allows	O
for	O
a	O
theoretical	O
maximum	O
of	O
4MB	O
of	O
flash	B-Device
.	O
</s>
<s>
Because	O
of	O
this	O
extra	O
byte	O
,	O
and	O
to	O
also	O
keep	O
the	O
stack	B-General_Concept
balanced	O
,	O
a	O
subroutine	O
ending	O
with	O
RTC	O
must	O
always	O
be	O
called	O
with	O
CALL	O
,	O
even	O
if	O
it	O
resides	O
in	O
the	O
same	O
memory	O
page	O
.	O
</s>
<s>
Internally	O
,	O
the	O
9S08	O
instruction	B-General_Concept
set	I-General_Concept
is	O
upward	O
compatible	O
with	O
the	O
6805	O
,	O
with	O
the	O
addition	O
of	O
stack	B-General_Concept
indexed	B-Language
addressing	I-Language
modes	O
.	O
</s>
<s>
(	O
Instructions	O
using	O
the	O
SP	O
register	B-General_Concept
have	O
opcodes	B-Language
prefixed	O
with	O
the	O
byte	O
0x9E	O
)	O
.	O
</s>
<s>
It	O
has	O
a	O
single	O
eight-bit	O
accumulator	B-General_Concept
,	O
A	O
,	O
one	O
sixteen-bit	O
index	B-General_Concept
register	I-General_Concept
,	O
HX	O
(	O
whose	O
lower	O
half	O
,	O
X	O
,	O
is	O
used	O
in	O
isolation	O
by	O
6805-compatible	O
instructions	O
)	O
,	O
a	O
condition	B-General_Concept
code	I-General_Concept
register	I-General_Concept
,	O
a	O
16-bit	B-Device
stack	B-General_Concept
pointer	O
,	O
and	O
a	O
program	B-General_Concept
counter	I-General_Concept
.	O
</s>
<s>
For	O
compatibility	O
with	O
the	O
6805	O
which	O
does	O
not	O
have	O
an	O
H	O
register	B-General_Concept
,	O
the	O
most	O
significant	O
byte	O
of	O
the	O
HX	O
register	B-General_Concept
,	O
H	O
,	O
is	O
cleared	O
during	O
reset	O
,	O
and	O
H	O
is	O
the	O
only	O
register	B-General_Concept
not	O
stacked	O
automatically	O
when	O
entering	O
any	O
ISR	O
(	O
Interrupt	B-General_Concept
Service	I-General_Concept
Routine	I-General_Concept
)	O
.	O
</s>
<s>
Unlike	O
the	O
6805	O
,	O
the	O
stack	B-General_Concept
can	O
be	O
placed	O
anywhere	O
in	O
memory	O
using	O
appropriate	O
instructions	O
.	O
</s>
<s>
The	O
standard	O
method	O
of	O
programming	O
or	O
debugging	O
the	O
9S08	O
family	O
is	O
via	O
a	O
standard	O
six-pin	O
BDM	B-Application
interface	O
(	O
only	O
one	O
pin	O
is	O
used	O
for	O
communication	O
with	O
the	O
microcontroller	B-Architecture
)	O
.	O
</s>
<s>
The	O
S08	O
is	O
partly	O
supported	O
(	O
e.g.	O
,	O
no	O
MMU	O
support	O
)	O
by	O
the	O
free	O
C	O
compiler	O
SDCC	O
and	O
fully	O
by	O
CodeWarrior	B-Operating_System
.	O
</s>
