⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot.asm

📁 在DM642平台上
💻 ASM
字号:
            .title  "Flash bootup utility for DM642 EVM"
            .option D,T
;            .length 102
;            .width  140
;          .sect ".boot_load"
            .global _boot
eprh      .equ 0x01a0ff9c 
ciprh     .equ 0x01a0ffa4  
cierh     .equ 0x01a0ffa8  
ccerh     .equ 0x01a0ffac   
erh       .equ 0x01a0ffb0   
eerh      .equ 0x01a0ffb4   
ecrh      .equ 0x01a0ffb8   
I2COAR0   .equ 0x01b40000
i2cier0   .equ 0x01b40004
i2cstr0   .equ 0x01b40008
i2cclkl0  .equ 0x01b4000c
i2cclkh0  .equ 0x01b40010
i2ccnt0   .equ 0x01b40014
i2cdrr0   .equ 0x01b40018
i2csar0   .equ 0x01b4001c
i2cdxr0   .equ 0x01b40020
i2cmdr0   .equ 0x01b40024
i2cisrc0  .equ 0x01b40028
reserved  .equ 0x01b4002c
i2cpsc0   .equ 0x01b40030
i2cpid10  .equ 0x01b40034
i2cpid20  .equ 0x01b40038
          .def _main
          .def loopwr
          .def loodr
_main: 
;;;;;;;;;i0口程序
           mvkl   00h,a30
           mvkh   00h,a30 
           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;     
           mvkl   00h,a31
           mvkh   0h,a31
          .include   "led.asm"
           nop    5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;;;;开锁程序   
          .include   "unlock.asm"
           nop    5
;;;;;;;;;;;; 开外设I2C ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
;;;;;;;;----------初始化i2c外设
           mvkl   05dh,a31
           mvkh   00h,a31	
          .include  "i2c_config.asm"
           nop    5
      
 ;;;;;--------------------------------------       
       ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
           mvkl   inputdata,b30
           mvkh   inputdata,b30
           mvkl   00h,a30
           mvkh   00h,a30
       ;;;;
       ;
loopwr:    mvkl   00h,b31
           mvkh   00h,b31
           nop    4
 ;;; ;;         mvkl   00h,a30
 ;;;; ;         mvkh   00h,a30
           nop    5
           stw    a30,*b31++;地址
           nop    
           add    a30,1,a30
           nop    9
           ldb    *b30++,b29
           nop    4
           stw    b29,*b31;数据
          .include   "i2c_write.asm"
           mvk    7eh,b1
           cmpeq  a30,b1,a0
    [!a0]  b      loopwr     
           nop
           nop    5
;;;;;;;;;;;;;;;为写数据;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
           mvkl   0ch,b31
           mvkh   00h,b31
           mvkl   01h,a30
           mvkh   00h,a30
loodr:
           mvkl   05dh,a31
           mvkh   00h,a31
           .copy   "i2c_config.asm"
           nop
           .copy   "i2c_read.asm"
           stb   b10,*b31++
           nop    4
           add    a30,1,a30
           nop
           
           nop    5
           mvk    100h,b1
           cmpeq  a30,b1,a0
    [!a0]  b      loodr 
           nop 
           nop    
           nop    4
           b      _main
           nop
           nop
           nop
        
          .data
          .global  inputdata

inputdata: 
           .byte 00h,15h,00h,69h,00h,00h,10h,20h;00-07
           .byte 00h,80h,80h,00h,80h,47h,00h,08h;08-0f
           .byte 00h,00h,00h,00h,00h,03h,80h,00h;10-17
           .byte 00h,00h,0ch,14h,00h,00h,00h,00h;18-1f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;20-27
           .byte 00h,00h,00h,00h,00h,00h,15h,01h;28-2f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;30-37
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;38-3f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;40-47
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;48-4f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;50-57
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;58-5f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;60-67
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;68-6f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;70-77
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;78-7f;while to 7fh,vga stop . way?
           .byte 51h,50h,03h,21h,00h,00h,00h,00h;80-87;
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;88-8f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;90-97
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;98-9f
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;a0-a7
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;a8-af
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;b0-b7
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;b8-bf
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;c0-c7
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;c8-cf
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;d0-d7
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;d8-df
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;e0-e7
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;e8-ef
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;f0-f7
           .byte 00h,00h,00h,00h,00h,00h,00h,00h;f8-ff

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -