[an error occurred while processing this directive]
rts.src смотреть не пробовали?
(«Телесистемы»: Конференция «Цифровые сигнальные процессоры (DSP) и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено AntZ 31 января 2006 г. 17:36
В ответ на: инициализация стека c55 (+) отправлено bp 31 января 2006 г. 17:23


;*****************************************************************************
;* BOOT.ASM v2.56 - Initialize the TMS320C55x C/C++ runtime environment
;* Copyright (c) 1993-2002 Texas Instruments Incorporated
;*
;* The user can and often will create a system-specific initialization
;* routine, but must perform the various functions of this routine in order
;* for C/C++ code in the system to operate correctly.
;*****************************************************************************

.model call=internal
.mmregs

; Symbols from C/C++ Runtime
.ref _main
.ref _exit
.ref _auto_init

; Symbols defined by the Linker
.ref cinit
.ref ___bss__
.ref __STACK_SIZE ; can be set with -stack linker option
.ref __SYSSTACK_SIZE ; can be set with -systack linker option

; Symbols defined here (and have special meaning to the linker)
.def _c_int00
.def __stack
.def __sysstack

.if .PHASE3
.noremark 5572 ; safe with respect to Silicon Exception CPU_42
.noremark 5573 ; safe with respect to Silicon Exception CPU_43
.endif


;************************************************************************
; Data Stack (size set by the Linker, not blocked, longword aligned)
;************************************************************************
__stack: .usect .stack, 0, 0, 1


;************************************************************************
; System Stack (size set by the Linker, not blocked, longword aligned)
;************************************************************************
__sysstack: .usect .sysstack, 0, 0, 1


;************************************************************************
; c_int00() - C/C++ Environment Entry Point
;************************************************************************
_c_int00:
.if .PHASE2
SP = SP + #0 ; avoid ECNs 372 and 438
.endif

;------------------------------------------------------------------------
; Initialize the Stack Pointer
; Note: SP must be aligned on doubleword boundary
;------------------------------------------------------------------------
.if .PHASE3
XSP = #((__stack + (__STACK_SIZE >> 1)) & 0x7FFFFE)
.else
SP = #((__stack + (__STACK_SIZE >> 1)) & 0xFFFE)
.endif

;------------------------------------------------------------------------
; Initialize the System Stack Pointer
;------------------------------------------------------------------------
SSP = #((__sysstack + (__SYSSTACK_SIZE >> 1)) & 0xFFFF)

;------------------------------------------------------------------------
; Initialize the Status Registers
;
; Set the value of each status bit that compiled C/C++ code assumes has a
; particular value. Other bits are not touched.
;------------------------------------------------------------------------
.if .PHASE3

; Status Register ST1
; BRAF == don't care
; CPL == 1 Compiler mode on: direct addr via SP
; XF == don't care
; HM == don't care
; INTM == don't care
; M40 == 0 32-bit mode (40-bit off)
; SATD == 0 D-unit saturation off
; SXMD == 1 Sign-extension on
; C16 == 0 Disallow dual arithmetic in C54X mode
; FRCT == 0 Fractional mode off
; C54CM == 0 C54X compatibility off
; ASM == don't care

ST1_ON .equ (1<ST1_OFF .equ (1< ; Status Register ST2
; ARMS == 1 AR Mode: allow short index modes
; DBGM == don't care
; EALLOW == don't care
; RDM == 0 Round toward infinity
; CDPLC == 0 CDP linear (not circular) addressing
; AR0LC == 0 AR0 linear (not circular) addressing
; ...
; AR7LC == 0 AR7 linear (not circular) addressing

ST2_03LC .equ (1<ST2_47LC .equ (1<ST2_ON .equ (1<ST2_OFF .equ (1< ; Status Register ST3
; SATA == 0 A-unit saturation off
; SMUL == 1 Saturation on multiply off
; others == don't care

; Change the bits
@ST1_L = @ST1_L & #(~ST1_OFF) || mmap()
@ST1_L = @ST1_L | #( ST1_ON ) || mmap()

; ATTENTION! If the runtime initialization sequence is modified by the user
; to execute with interrupts enabled at this point then the following
; two instructions are vulnerable to Silicon Exception CPU_75 and
; must be re-written.
.noremark 5601
@ST2_L = @ST2_L & #(~ST2_OFF) || mmap()
@ST2_L = @ST2_L | #( ST2_ON ) || mmap()
.remark 5601

bit(ST3, #ST3_SATA) = #0
bit(ST3, #ST3_SMUL) = #1

.C54CM_off
.CPL_on
.ARMS_on

.else

; Same settings as above except some bits are in different locations
; and some have different names (SMUL => GSM, C54CM => LEAD)

ST1_ON .equ (1<ST1_OFF .equ (1<ST2_03LC .equ (1<ST2_47LC .equ (1<ST2_OFF .equ (1< @ST1_L = @ST1_L & #(~ST1_OFF) || mmap()
@ST1_L = @ST1_L | #( ST1_ON ) || mmap()
@ST2_L = @ST2_L & #(~ST2_OFF) || mmap()

.LEAD_off
.CPL_on
.ARMS_on

bit (ST3, #1) = #0
$1: TC1 = bit(@ST3_L, #1) || mmap()
nop_16
if (TC1) goto $1
nop_16
nop_16

bit (ST3, #0) = #0
$2: TC1 = bit(@ST3_L, #0) || mmap()
nop_16
if (TC1) goto $2
nop_16
nop_16
.endif

;------------------------------------------------------------------------
; Initialize Extended Address Registers
;------------------------------------------------------------------------
.if .PHASE3
XAR0 = #___bss__
XAR1 = XAR0
XAR2 = XAR0
XAR3 = XAR0
XAR4 = XAR0
XAR5 = XAR0
XAR6 = XAR0
XAR7 = XAR0
XCDP = XAR0
XDP = XAR0
.else
MDP = #0
MDP05 = #0
MDP67 = #0
.endif

;------------------------------------------------------------------------
; Perform autoinitialization. Must be after other initialization since
; C++ static initializers may be called.
;------------------------------------------------------------------------
call _auto_init

;------------------------------------------------------------------------
; Call the user's program
;------------------------------------------------------------------------
call _main

;------------------------------------------------------------------------
; Call exit
;------------------------------------------------------------------------
AR1 = #1
call _exit

.end



Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 
NoIX ключ Запомнить

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Rambler's Top100 Рейтинг@Mail.ru
Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание

E-mail: info@telesys.ru