User`s guide
Libraries and Runtime Code
Runtime Initialization
331Targeting MC56F83xx/DSP5685x Controllers
section rtlib
XREF F_stack_addr
org p:
GLOBAL Finit_M56852_
SUBROUTINE "Finit_M56852_",Finit_M56852_,Finit_M56852END-
Finit_M56852_
Finit_M56852_:
;
; setup the OMr with the values required by C
;
bfset #NL_MODE,omr ; ensure NL=1 (enables nsted DO loops)
nop
nop
bfclr #(CM_MODE|XP_MODE|R_MODE|SA_MODE),omr ; ensure CM=0
(optional for C)
; ensure XP=0 to enable harvard architecture
; ensure R=0 (required for C)
; ensure SA=0 (required for C)
; Setup the m01 register for linear addressing
move.w #-1,x0
moveu.w x0,m01 ; Set the m register to linear addressing
moveu.w hws,la ; Clear the hardware stack
moveu.w hws,la
nop
nop
CALLMAIN: ; Initialize compiler environment
;Initialize the Stack
move.l #>>F_Lstack_addr,r0
bftsth #$0001,r0
bcc noinc
adda #1,r0