亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cstartup.s79

?? IAPBootLoader源程序是單片機ARM的方法3
?? S79
字號:
;-----------------------------------------------------------------------------
; This file contains the startup code used by the ICCARM C compiler.
;
; The modules in this file are included in the libraries, and may be replaced
; by any user-defined modules that define the PUBLIC symbol _program_start or
; a user defined start symbol.
; To override the cstartup defined in the library, simply add your modified
; version to the workbench project.
;
; All code in the modules (except ?RESET) will be placed in the ICODE segment.
;
; $Revision: 1.2 $
;
;-----------------------------------------------------------------------------
	
;
; Naming covention of labels in this file:
;
;  ?xxx	  - External labels only accessed from assembler.
;  __xxx  - External labels accessed from or defined in C.
;  xxx	  - Labels local to one module (note: this file contains
;           several modules).
;  main	  - The starting point of the user program.
;

;---------------------------------------------------------------
; Macros and definitions for the whole file
;---------------------------------------------------------------


; --- Standard definitions of mode bits and interrupt (I & F) flags in PSRs

;#pragma location="ICODE"

Mode_USR           DEFINE   0x10
Mode_FIQ           DEFINE   0x11
Mode_IRQ           DEFINE   0x12
Mode_SVC           DEFINE   0x13
Mode_ABT           DEFINE   0x17
Mode_UNDEF         DEFINE   0x1B
Mode_SYS           DEFINE   0x1F ; available on ARM Arch 4 and later

I_Bit              DEFINE   0x80 ; when I bit is set, IRQ is disabled
F_Bit              DEFINE   0x40 ; when F bit is set, FIQ is disabled


; --- System memory locations

RAM_Base           DEFINE   0x20000000
RAM_Limit          DEFINE   0x20010000
SRAM_Base          DEFINE   0x60000000
Stack_Base         DEFINE   RAM_Limit


USR_Stack_Length   DEFINE   4096
IRQ_Stack_Length   DEFINE   1024
SVC_Stack_Length   DEFINE   256
FIQ_Stack_Length   DEFINE   256
ABT_Stack_Length   DEFINE   256
UNDEF_Stack_Length DEFINE   256


USR_Stack          DEFINE   Stack_Base                 ; USR stack
IRQ_Stack          DEFINE   USR_Stack-USR_Stack_Length ; followed by IRQ stack
SVC_Stack          DEFINE   IRQ_Stack-IRQ_Stack_Length ; followed by SVC stack
FIQ_Stack          DEFINE   SVC_Stack-SVC_Stack_Length ; followed by FIQ stack
ABT_Stack          DEFINE   FIQ_Stack-FIQ_Stack_Length ; followed by ABT stack
UNDEF_Stack        DEFINE   ABT_Stack-ABT_Stack_Length ; followed by UNDEF stack

EIC_Base_addr      DEFINE   0xFFFFF800; EIC base address
ICR_off_addr       DEFINE   0x00      ; Interrupt Control register offset
CIPR_off_addr      DEFINE   0x08      ; Current Interrupt Priority Register offset
IVR_off_addr       DEFINE   0x18      ; Interrupt Vector Register offset
FIR_off_addr       DEFINE   0x1C      ; Fast Interrupt Register offset
IER_off_addr       DEFINE   0x20      ; Interrupt Enable Register offset
IPR_off_addr       DEFINE   0x40      ; Interrupt Pending Bit Register offset
SIR0_off_addr      DEFINE   0x60      ; Source Interrupt Register 0

EMI_Base_addr      DEFINE   0x6C000000; EMI base address
BCON0_off_addr     DEFINE   0x00      ; Bank 0 configuration register offset
BCON1_off_addr     DEFINE   0x04      ; Bank 1 configuration register offset
BCON2_off_addr     DEFINE   0x08      ; Bank 2 configuration register offset
BCON3_off_addr     DEFINE   0x0C      ; Bank 3 configuration register offset

EMI_ENABLE         DEFINE   0x8000
EMI_SIZE_16        DEFINE   0x0001

GPIO2_Base_addr    DEFINE   0xE0005000; GPIO2 base address
PC0_off_addr       DEFINE   0x00      ; Port Configuration Register 0 offset
PC1_off_addr       DEFINE   0x04      ; Port Configuration Register 1 offset
PC2_off_addr       DEFINE   0x08      ; Port Configuration Register 2 offset
PD_off_addr        DEFINE   0x0C      ; Port Data Register offset

CPM_Base_addr      DEFINE   0xA0000040; CPM Base Address
BOOTCR_off_addr    DEFINE   0x10      ; CPM - Boot Configuration Register
FLASH_mask         DEFINE   0x0000    ; to remap FLASH at 0x0
RAM_mask           DEFINE   0x0002    ; to remap RAM at 0x0

;|----------------------------------------------------------------------------------|
;| - APB Bridge  (System Peripheral)                                               |
;|----------------------------------------------------------------------------------|
APB1_base_addr     DEFINE   0xC0000000          ; APB Bridge1 Base Address
APB2_base_addr     DEFINE   0xE0000000          ; APB Bridge2 Base Address
CKDIS_off_addr     DEFINE   0x10                ; APB Bridge1 - Clock Disable  Register
SWRES_off_addr     DEFINE   0x14                ; APB Bridge1 - Software Reset Register
CKDIS1_config_all  DEFINE   0x27FB              ; To enable/disable clock of all APB1's peripherals
SWRES1_config_all  DEFINE   0x27FB              ; To reset all APB1's peripherals
CKDIS2_config_all  DEFINE   0x7FDD              ; To enable/disable clock of all APB2's peripherals
SWRES2_config_all  DEFINE   0x7FDD              ; To reset all APB2's peripherals


;---------------------------------------------------------------
; ?program_start
;---------------------------------------------------------------
		PROGRAM	?program_start

		RSEG	IRQ_STACK:DATA(2)
		RSEG	SVC_STACK:DATA:NOROOT(2)
		RSEG	CSTACK:DATA(2)
		RSEG	ICODE:CODE:NOROOT(2)
		PUBLIC	__program_start
		EXTERN	?main
                CODE32


;*******************************************************************************
;*******                         -- MACROS --                            *******
;*******************************************************************************

;*******************************************************************************
;* Macro Name     : EIC_INIT
;* Description    : This macro Initialize the EIC as following :
;                 - IRQ disabled
;                 - FIQ disabled
;                 - IVR contain the load PC opcode (0xF59FF00)
;                 - Current priority level equal to 0
;                 - All channels are disabled
;                 - All channels priority equal to 0
;                 - All SIR registers contain offset to the related IRQ
;                   table entry
;* Input          : None.
;* Output         : None.
;*******************************************************************************
; no longer use this EIC_INIT macro in application, instead use modified c lib
;function EIC_Init() 
EIC_INIT   MACRO

        LDR     r3, =EIC_Base_addr
        LDR     r4, =0xE59F0000
        STR     r4, [r3, #IVR_off_addr]; Write the LDR pc,[pc,#offset]
                                       ; instruction code in IVR[31:16]
        LDR     r2, =32                ; 32 Channel to initialize
        LDR     r0, =T0TIMI_Addr       ; Read the address of the IRQs
                                       ; address table
        LDR     r1, =0x0000FFFF
        AND     r0,r0,r1
        LDR     r5, =SIR0_off_addr     ; Read SIR0 address
        SUB     r4,r0,#8               ; subtract 8 for prefetch
        LDR     r1, =0xF7E8            ; add the offset to the 0x00000000
                                       ; address(IVR address + 7E8 = 0x00000000)
                                       ; 0xF7E8 used to complete the
                                       ; LDR pc,[pc,#offset] opcode
        ADD     r1,r4,r1               ; compute the jump offset
EIC_INI MOV     r4, r1, LSL #16        ; Left shift the result
        STR     r4, [r3, r5]           ; Store the result in SIRx register
        ADD     r1, r1, #4             ; Next IRQ address
        ADD     r5, r5, #4             ; Next SIR
        SUBS    r2, r2, #1             ; Decrement the number of SIR registers
                                       ; to initialize
        BNE     EIC_INI                ; If more then continue
        ENDM
;*******************************************************************************
;* Macro Name     : PERIPHERAL_INIT
;* Description    : This macro reset all device peripherals.
;* Input          : None.
;* Output         : None.
;*******************************************************************************
PERIPHERAL_INIT MACRO

        LDR     r1, =APB1_base_addr      ; r0= APB1 base address
        LDR     r2, =APB2_base_addr      ; r0= APB2 base address
        LDR     r0, =CKDIS1_config_all
        STRH    r0, [r1, #CKDIS_off_addr]; Clock Disabling for all APB1 peripherals
        LDR     r0, =CKDIS2_config_all
        STRH    r0, [r2, #CKDIS_off_addr]; Clock Disabling for all APB2 peripherals
        LDR     r0, =SWRES1_config_all
        STRH    r0, [r1, #SWRES_off_addr]; Keep under reset all APB1 peropherals
        LDR     r0, =SWRES2_config_all
        STRH    r0, [r2, #SWRES_off_addr]; Keep under reset all APB2 peropherals
        MOV     r7, #10                  ; Wait that the selected macrocells exit from reset
loop1   SUBS    r7, r7, #1
        BNE     loop1
        MOV     r0, #0
        STRH    r0, [r1, #SWRES_off_addr]; Enable all all APB1 peropherals
        STRH    r0, [r2, #SWRES_off_addr]; Enable all all APB2 peropherals
        STRH    r0, [r1, #CKDIS_off_addr]; Clock Enabling for all APB1 peripherals
        STRH    r0, [r2, #CKDIS_off_addr]; Clock Enabling for all APB2 peripherals
        MOV     r7, #10                  ; Wait that the selected macrocells exit from reset
loop2   SUBS    r7, r7, #1
        BNE     loop2
        ENDM

; define remapping
; If you need to remap memory before entring the main program
; uncomment next ligne
;        #define   remapping

; Then define which memory to remap to address 0x00000000
;  Uncomment next line if you want to remap RAM
;        #define  remap_ram

;  Uncomment next line if you want to remap FLASH
;         #define remap_flash


        IMPORT  T0TIMI_Addr
__program_start
         LDR     pc, =NextInst
NextInst
		NOP		; Wait for OSC stabilization
		NOP
		NOP
		NOP
		NOP
		NOP
		NOP
		NOP
		NOP

        MSR     CPSR_c, #Mode_ABT|F_Bit|I_Bit
        LDR     SP, =ABT_Stack

        MSR     CPSR_c, #Mode_UNDEF|F_Bit|I_Bit
        LDR     SP,= UNDEF_Stack

        MSR     CPSR_c, #Mode_SVC|F_Bit|I_Bit
        LDR     SP, =RAM_Limit
; Uncomment next ligne if you need to reset all device pripherals
;       PERIPHERAL_INIT           ; Reset all device peripherals

;Uncomment next ligne if you need to initialize the EIC
;       EIC_INIT                  ; Initialize EIC

;******************************************************************************
;REMAPPING
;Description  : Remapping  memory whether RAM,FLASH
;               at Address 0x0 after the application has started executing.
;               Remapping is generally done to allow RAM  to replace FLASH
;               at 0x0.
;               the remapping of RAM allow copying of vector table into RAM
;******************************************************************************

#ifdef remapping
    #ifdef remap_flash
        MOV     r0, #FLASH_mask
    #endif
    #ifdef remap_ram
        MOV     r0, #RAM_mask
    #endif

        LDR     r1, =CPM_Base_addr
        LDRH    r2, [r1, #BOOTCR_off_addr]; Read BOOTCR Register
        BIC     r2, r2, #0x03             ; Reset the two LSB bits of BOOTCR
        ORR     r2, r2, r0                ; change the two LSB bits of BOOTCR
        STRH    r2, [r1, #BOOTCR_off_addr]; Write BOOTCR Register
#endif

       	MSR     CPSR_c, #Mode_FIQ|I_Bit; Change to FIQ mode
        LDR     SP, =FIQ_Stack            ; Initialize FIQ stack pointer

       	MSR     CPSR_c, #Mode_IRQ|I_Bit; Change to IRQ mode
        LDR     SP, =IRQ_Stack            ; Initialize IRQ stack pointer

        MSR     CPSR_c, #Mode_USR         ; Change to User mode, Enable IRQ and FIQ
        LDR     SP, =USR_Stack            ; Initialize USR stack pointer

        ;EIC_INIT ; (1) move it from "before remap" to "after remap"
        ; (2)over-function above macro to following new self-written c code
    
        
; --- Now branches to a C lib function

        b ?main   ; Note : use B not BL, because an application will
                         ; never return this way

        LTORG

        END








?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区精品在线观看| 日韩一区二区三区三四区视频在线观看 | 福利电影一区二区三区| 国产真实乱子伦精品视频| 免费观看日韩电影| 日本不卡一二三| 蜜臀av性久久久久蜜臀av麻豆| 舔着乳尖日韩一区| 蜜芽一区二区三区| 国产乱码一区二区三区| 国产一区二区视频在线| 丁香激情综合国产| 一本大道久久a久久精品综合| 在线一区二区三区做爰视频网站| 欧美色手机在线观看| 欧美三日本三级三级在线播放| 欧美高清一级片在线| 精品国产三级a在线观看| 久久久久久久久蜜桃| 亚洲视频一区在线观看| 午夜亚洲福利老司机| 黄色资源网久久资源365| 岛国一区二区三区| 欧美色视频在线观看| 欧美精品一区二区三区很污很色的 | 欧美怡红院视频| 欧美成人精品1314www| 欧美激情综合网| 一级精品视频在线观看宜春院| 性久久久久久久久久久久| 国产综合成人久久大片91| 99久久精品费精品国产一区二区| 91成人看片片| 国产亚洲精久久久久久| 亚洲黄色小说网站| 国产一二三精品| 日本久久一区二区| 久久亚洲综合色| 一区二区在线观看视频| 国产一区视频网站| 欧美性猛片aaaaaaa做受| 精品理论电影在线| 五月婷婷色综合| 成人精品视频一区| 欧美成人一区二区三区片免费| 亚洲三级在线免费观看| 精品一区二区在线观看| 91久久免费观看| 中文字幕亚洲精品在线观看| 蜜桃一区二区三区四区| 欧美日免费三级在线| 国产精品人成在线观看免费| 精彩视频一区二区三区| 91精品国产综合久久精品| 亚洲欧美乱综合| 成人在线视频一区| 久久久久88色偷偷免费| 蜜臀久久99精品久久久画质超高清 | 久久精品一区二区三区四区| 日韩电影在线一区二区| 99精品在线免费| 国产精品国产精品国产专区不蜜| 黑人巨大精品欧美一区| 欧美一区二区视频在线观看2020| 亚洲主播在线观看| 日本久久电影网| 一区二区三区欧美亚洲| 99久久免费精品高清特色大片| 国产欧美日韩综合| 成人一区在线看| 国产精品麻豆久久久| 99视频一区二区| 亚洲另类在线制服丝袜| 色老汉一区二区三区| 一区二区成人在线| 欧美综合一区二区| 亚洲午夜精品网| 欧美视频一区在线| 日韩精品欧美成人高清一区二区| 欧美精品乱码久久久久久| 日韩精品五月天| 精品国产乱码久久久久久1区2区 | 国产传媒欧美日韩成人| 久久麻豆一区二区| 成人国产视频在线观看| 亚洲欧美日本韩国| 在线播放国产精品二区一二区四区| 图片区日韩欧美亚洲| 精品久久人人做人人爱| 丁香婷婷深情五月亚洲| 依依成人综合视频| 91麻豆精品国产91久久久资源速度 | 日韩亚洲欧美在线| 国产一区亚洲一区| 中文字幕在线播放不卡一区| 欧美影片第一页| 久久福利资源站| 一区在线观看免费| 欧美日韩国产影片| 国产一区二区在线视频| 亚洲天堂成人网| 欧美一区二区视频网站| 成人永久aaa| 日本视频一区二区| 欧美国产综合色视频| 欧美在线免费观看视频| 久久66热偷产精品| 亚洲精品日韩专区silk| 日韩欧美久久久| 91一区二区在线| 捆绑调教一区二区三区| 亚洲欧美日韩国产成人精品影院| 日韩午夜电影av| 91天堂素人约啪| 激情文学综合插| 亚洲一区二区在线观看视频| 欧美精品一区二区三区在线播放| 在线视频国内自拍亚洲视频| 久久97超碰色| 五月综合激情网| 亚洲免费在线播放| 久久综合精品国产一区二区三区| 欧美视频一二三区| 成人av资源下载| 国产在线播放一区| 蜜桃精品视频在线观看| 一区二区三区蜜桃| 综合网在线视频| 日本一区二区三区四区在线视频| 欧美一区二区三区在线电影 | 7777精品伊人久久久大香线蕉的 | jlzzjlzz亚洲日本少妇| 久久99精品久久久久久| 日韩国产精品久久久| 夜夜爽夜夜爽精品视频| 国产精品视频一区二区三区不卡| 日韩欧美在线观看一区二区三区| 91久久精品网| 色哦色哦哦色天天综合| jvid福利写真一区二区三区| 国产精品亚洲成人| 狠狠色狠狠色综合系列| 美国一区二区三区在线播放| 亚洲成a人v欧美综合天堂 | 国产女同互慰高潮91漫画| 精品嫩草影院久久| 精品精品欲导航| 久久综合色一综合色88| 欧美大片在线观看一区二区| 51精品视频一区二区三区| 欧美日韩精品一二三区| 制服丝袜成人动漫| 欧美日韩国产电影| 日韩欧美一二三区| 亚洲精品在线一区二区| 久久久电影一区二区三区| 国产午夜精品久久久久久免费视| 久久精品视频网| 中文字幕在线观看一区| 亚洲欧美激情视频在线观看一区二区三区 | 国产成人午夜电影网| 国产成人亚洲综合a∨婷婷图片| 国产福利电影一区二区三区| 国产98色在线|日韩| 99久久精品免费看国产免费软件| 91影院在线免费观看| 色吊一区二区三区| 欧美一二三四区在线| 2020日本不卡一区二区视频| 国产精品久久影院| 一区二区三区高清| 美国欧美日韩国产在线播放| 国产精品一区久久久久| 99re6这里只有精品视频在线观看| 在线观看亚洲精品| 欧美电视剧免费全集观看| 国产精品久久久久国产精品日日| 亚洲女同一区二区| 免费黄网站欧美| 99国产精品久久久久久久久久久 | 中文字幕一区三区| 亚洲18女电影在线观看| 国产一区二区三区四区五区美女| fc2成人免费人成在线观看播放| 欧美日韩在线播放三区| 久久夜色精品国产欧美乱极品| 亚洲欧美国产三级| 久久精品噜噜噜成人88aⅴ| 91丨九色丨国产丨porny| 欧美精品少妇一区二区三区| 国产精品网站在线| 肉色丝袜一区二区| 99国产精品久| 亚洲精品一区二区三区影院 | 一区二区三区自拍| 国产美女精品人人做人人爽| 91福利在线导航| 国产精品素人视频| 久久99久久99| 欧美日韩高清一区二区|