RS08KA2 PROMO Freescale Semiconductor, RS08KA2 PROMO Datasheet - Page 18

DEMO KIT, SILICON BUNDLE, RS08KA2

RS08KA2 PROMO

Manufacturer Part Number
RS08KA2 PROMO
Description
DEMO KIT, SILICON BUNDLE, RS08KA2
Manufacturer
Freescale Semiconductor
Datasheet

Specifications of RS08KA2 PROMO

Kit Contents
DEMO9RS08KA2 Board, USB Cable, Quick Start Guide, User Manual, Packing List
Svhc
No SVHC (15-Dec-2010)
Development Tool Type
Demonstration Kit
Kit Features
RS08KA2 Microcontroller,
Silicon Manufacturer
Freescale
Core Architecture
RS08
Core Sub-architecture
RS08
Silicon Core Number
MC9RS08
Silicon Family Name
RS08KA
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Introduction to RS08
1.7
The RS08 platform provides only a single level of hardware stacking. When the instruction, JSR or BSR,
is executed, current program counter (PC) value is uploaded to the shadow program counter (SPC) register
before the PC is modified with a new location. In the case when the program encounters the instruction
RTS, the saved PC value is restored from the SPC register. Program execution resumes at the address that
was just restored from SPC register.
Single level of subroutine call may not be sufficient for some applications, multi-level software stacking
can be emulated with the help of SHA/SLA instructions. These instructions exchange the high byte and
the low byte of SPC register with accumulator A respectively. Software stacking can be implemented that
place the SPC content for each level of subroutine call in RAM.
The following code shows how software stacking can be implemented in macro format. In this example,
location $00 is arbitrarily chosen for the stack pointer (STACKPTR) variable and the stack content is
placed from address $4F downwards. The code shown provides no stack overflow checking.
SPInit
FLASHSTART
RESETSP: MACRO
PSH_SPC: MACRO
PUL_SPC: MACRO
STACKPTR
18
Subroutine Call
mov
ENDM
; NOTE: Destructive to X content
ldx
sha
sta
sha
decx
sla
sta
sla
decx
stx
ENDM
; NOTE: Destructive to X content
ldx
incx
sla
lda
sla
incx
sha
lda
sha
stx
ENDM
org
org
equ
equ
#SPInit, STACKPTR
STACKPTR
,X
,X
STACKPTR
STACKPTR
,X
,X
STACKPTR
TINY_RAM
ds.b
FLASHSTART
$4F
$3800
1
Getting Started with RS08, Rev. 1
; Stack block allocation
; For MC9RS08KA2
; Init Stack pointer
; 20 CPU cycles, 14 bytes code
; Load Stack pointer
; Swap SPC high byte
; Push high byte to stack
; Resume A content
; update stack pointer
; Swap SPC low byte
; Push low byte to stack
; Resume A content
; update stack pointer
; Save stack pointer
; 22 CPU cycles, 14 byte code
; Load Stack pointer
; Update stack pointer
; Swap SPC low byte
; Pull low byte
; Resume A and SPCL content
; Update stack pointer
; Swap SPC high byte
; Pull high byte
; Resume A and SPCH content
; Save stack pointer
; Stack pointer location
Freescale Semiconductor

Related parts for RS08KA2 PROMO