Intel i960 Jx Developer's Manual page 397

Microprocessor
Table of Contents

Advertisement

Example 12-4. Startup Routine (init.s)
.word
_intx, _intx, _intx, _intx, _intx, _intx, _intx, _intx
.word
_intx, _intx, _intx, _intx,
.word
_nmi,
/* START */
/* Processor starts execution here after reset. */
.text
.globl
_start_ip
.globl
_reinit
_start_ip:
mov
0, g14
/* MON960 requires copying the .data area into RAM. If a user application
* does not require this it is not necessary.
* Copy the .data into RAM. The .data has been packed in the ROM after the
* code area. If the copy is not needed (RAM-based monitor), the symbol
* rom_data can be defined as 0 in the linker directives file.
*/
lda
rom_data, g1
cmpobe
0, g1, 1f
lda
__Bdata, g2
lda
__Edata, g3
init_data:
ldq
(g1), r4
addo
16, g1, g1
stq
r4, (g2)
addo
16, g2, g2
cmpobl
g2, g3, init_data
1:
/* Initialize the BSS area of RAM. */
lda
__Bbss, g2
lda
__Ebss, g3
movq
0,r4
bss_fill:
stq
r4, (g2)
addo
16, g2, g2
cmpobl
g2, g3, bss_fill
_reinit:
ldconst 0x300, r4
lda
1f, r5
lda
_ram_prcb, r6
sysctl
r4, r5, r6
1:
lda
_user_stack, pfp
lda
64(pfp), sp
mov
pfpf, fp
flushreg
ldconst 0x001f2403, r3
ldconst 0x000f0003, r4
modpc r3, r3, r4
INITIALIZATION AND SYSTEM REQUIREMENTS
0,
0,
0, _intx, _intx, _intx, _intx
/* g14 must be 0 for ic960 C compiler */
# load source of copy
# load destination
# start of bss
# end of bss
# reinitialize sys control
/* Lower interrupt priority */
(Sheet 3 of 4)
0,
0,
0,
/* new pfp */
/* PC mask */
/* PC value */
# e8
0
# f0
# f8
12
12-27

Advertisement

Table of Contents
loading

Table of Contents