program flash.asm

来自「ADI 公司的DSP ADSP21369 EZ-KIT LITE开发板的全部源代」· 汇编 代码 · 共 45 行

ASM
45
字号
/* This program Programs the flash with the input file
Input - None
Output - None */


#include <def21369.h>
#include "flashprogrammer.h"

.global PROGRAM_FLASH;
.extern Data_Byte, External_Byte_Address;
.extern WRITE_FLASH_BYTE ;
.extern my_file;

.section/pm seg_pmco;
PROGRAM_FLASH:

    r0 = FLASH_START_ADDRESS;
    dm(External_Byte_Address) = r0;

    i0=my_file;
    m0=1;

    lcntr=@my_file, do PROGRAM_FLASH_LOOP until lce; //each loop iteration writes two 8-bit flash locations
            r6 = dm(i0,m0);         //data is 16 bits wide in 'my_file'
            dm(Data_Byte) = r6;
            call WRITE_FLASH_BYTE ; //write 8 bits of the data
            r0 = dm(External_Byte_Address);
            r0 = r0 + 1;
            dm(External_Byte_Address) = r0; //update flash address for DMA in WRITE_FLASH_BYTE

            r6 = lshift r6 by -8;   //get the other 8 bits
            dm(Data_Byte) = r6;
            call WRITE_FLASH_BYTE ; //write the other 8 bits of the word
            r0 = dm(External_Byte_Address);
            r0 = r0 +1;
            dm(External_Byte_Address) = r0; //update flash address for DMA in WRITE_FLASH_BYTE
            nop;
    PROGRAM_FLASH_LOOP:
        nop;
        nop;

PROGRAM_FLASH.END:
rts;

⌨️ 快捷键说明

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