ST10R272L - SYSTEM PROGRAMMING
303/320
18
SYSTEM PROGRAMMING
For software development, constructs for modularity, loops, and context switching have been
included in the instruction set. Commonly used instruction sequences have been simplified
to provide greater flexibility. The following programming features have been designed to
optimize the use of the instruction set.
18.1
Instructions provided as subsets of instructions
Instructions used by other micro-controllers can be provided as subsets of more powerful
instructions in the ST10R272L. This gives the same functionality, while decreasing the
hardware overhead and decode complexity. These instructions can be built into macros.
Directly Substitutable Instructions are instructions known from other micro-controllers
that can be replaced by the following instructions of the ST10R272L:
Modification of System Flags is performed using bit set or bit clear instructions (BSET,
BCLR). All bit and word instructions can access the PSW register, so instructions such as
CLEAR CARRY or ENABLE INTERRUPTS are NOT required.
External Memory Data Access does not require special instructions, to load data pointers
or explicitly load and store external data. The ST10R272L provides a Von-Neumann
memory architecture and its on-chip hardware automatically detects accesses to internal
RAM, GPRs, and SFRs.
18.2
BCD calculations
No direct support for BCD calculations is provided in the ST10R272L. BCD calculations are
performed by converting BCD data to binary data, performing the desired calculations using
standard data types, and converting the result back to BCD data. Due to the enhanced
performance of division instructions binary data is quickly converted to BCD data through
division by 10d. Conversion from BCD data to binary data is enhanced by multiple bit shift
Substituted Instruction
ST10R272L Instruction
Function
CLR
Rn
AND
Rn, #0h
Clear register
CPLB
Bit
BMOVN
Bit, Bit
Complement bit
DEC
Rn
SUB
Rn, #1h
Decrement register
INC
Rn
ADD
Rn, #1h
Increment register
SWAPB
Rn
ROR
Rn, #8h
Swap bytes within word
Table 49 Instructions provided as subsets of instructions