NEC PD703114 User Manual page 627

V850e/ia2 32-bit single-chip microcontrollers
Table of Contents

Advertisement

(4) Program example
An example of a program in which the entry program is executed as a subroutine is shown below. In this
example, the return address is saved to the stack and then the device internal processing is called. This
program must be located in memory other than the block 0 space and flash memory area.
ISETUP
130
EntryProgram:
add
st.w
movea
ldsr
mov
st.b
st.b
nop
nop
nop
nop
nop
movea
ldsr
trap
movea
ldsr
mov
st.b
st.b
nop
nop
nop
nop
nop
mov
loop:
divh
add
jne
ld.w
add
jmp
CHAPTER 15 FLASH MEMORY (
-4, sp
lp, 0[sp]
lo(0x00a0), r0, r10
r10, 5
lo(0x0002), r10
r10, PHCMD[r0]
r10, FLPMC[r0]
lo(0x0020), r0, r10
r10, 5
0x1f
lo(0x00a0), r0, r6
r6, 5
lo(0x08), r6
r6, PHCMD[r0]
r6, FLPMC[r0]
ISETUP, lp
r6, r6
-1, lp
loop
0[sp], lp
4, sp
[lp]
User's Manual U15195EJ5V0UD
µ
PD70F3114)
-- Internal manipulation setup parameter
-- Prepare
-- Save return address
--
-- PSW = NP, ID
--
-- PHCMD = 2
-- VPPDIS = 0, FLSPM = 1
--
-- PSW = ID
-- Device Internal Process
--
-- PSW = NP, ID
-- PHCMD = 8
-- VPPDIS = 1, FLSPM = 0
-- loop time = 130
-- To kill time
-- Decrement counter
--
-- Reload lp
-- Dispose
-- Return to caller
627

Advertisement

Table of Contents
loading

Table of Contents