ST6369 CORE(Continued)
Indirect Registers (X, Y). These two indirect reg-
istersare usedas pointers tothe memorylocations
in the dataspace. They are usedin theregister-indirect addressing mode.These registers can be
addressed in the data space as RAM locations at
the 80H(X)and 81H (Y) addresses.They can also
be accessed with the direct, short direct, or bit direct addressing modes. Accordingly, the ST638x
instructionsetcan use the indirect registers as any
other registerof the data space.
Short Direct Registers (V, W). These two registers are used to save one byte in short direct addressing mode.These registerscan be addressed
in the data spaceas RAM locationsat the82H (V)
and 83H (W) addresses. They can also be accessed with the direct and bit direct addressing
modes. Accordingly, the ST638x instruction set
can use the shortdirect registers as any other register ofthe data space.
Program Counter (PC)
The program counter is a 12-bit registerthat contains the address of the next ROM location to be
processed by thecore.This ROM locationmay be
an opcode, an operand, or an address ofoperand.
The 12-bit length allows the direct addressing of
4096 bytes in the program space. Nevertheless, if
the program space contains more than 4096 locations, thefurtherprogram spacecan be addressed
by using theProgramROMPage Register.The PC
value isincremented,after it is read forthe address
of the current instruction,by sendingit through the
ALU, so giving the address of the nextbyte in the
program.Toexecuterelativejumpsthe PCand the
offset values are shifted through the ALU, where
they will be added, and the result is shifted back
into the PC. The program countercan be changed
in thefollowingways:
JP (Jump)instruction....PC=Jump address
CALL instruction...........PC=Call address
Relative Branch
instructions...................PC=PC+offset
Interrupt........................PC=Interruptvector
Reset............................PC=Resetvector
RET &RETI instructions............PC=Pop (stack)
Normal instruction........PC=PC+1
WHEN CALL
OR
INTERRUPT REQUEST
OCCURS
STACK LEVEL 1
STACK LEVEL 2
STACK LEVEL 3
STACK LEVEL 4
STACK LEVEL 5
STACK LEVEL 6
PROGRAM COUNTER
WHEN
RET OR RETI
OCCURS
VA000424
Figure5. Stack Operation
Flags (C, Z)
The ST6369 Core includesthree pairsof flagsthat
correspondto 3 different modes:normalmode,interrupt mode and Non-Maskable-Interrupt-Mode.
Each pair consistsof a CARRY flag and a ZERO
flag. One pair (CN, ZN) is used duringnormal operation, one pair is used during the interruptmode
(CI,ZI)andone is usedduring thenot-maskableinterruptmode (CNMI, ZNMI).
The ST6369 Core uses the pair of flags that correspondsto the actualmode: as soon as an interrupt
(resp. a Non-Maskable-Interrupt) is generated,the
ST6369Core uses the interruptflags(resp.the NMI
flags)insteadofthenormalflags.Whenthe RETIinstructionis executed,the normalflags(resp.the interrupt flags) are restored if the MCU was in the
normalmode (resp.inthe interruptmode)beforethe
interrupt.Shouldbe observedthateach flag setcan
onlybe addressedin itsownroutine(Not-maskable
interrupt,normalinterruptormainroutine).Theinterruptflags arenot clearedduring the contextswitchingand so,they remainin thestatethey were at the
exitof the lastroutineswitching.
The Carry flag is set when a carry or a borrow occurs during arithmetic operations, otherwise it is
cleared. The Carry flag is also set to the value of
the bit tested in a bit test instruction, and participates in the rotate left instruction.
TheZeroflagissetif theresultofthelastarithmetic
or logical operation wasequal to zero, otherwise it
is cleared.
The switching between these three sets is automaticallyperformedwhen anNMI,an interrupt and
a RETI instructions occur. As the NMI mode is
automatically selected after the reset ofthe MCU,
the ST6369Core uses at first the NMI flags.
ST6369
7/67