📄 memdma_init.asm
字号:
#include "defBF533.h"
.section L1_data_a;
.align 4;
/**************************************************************************************
Memory DMA descriptor
**************************************************************************************/
.global MemDMAQueue;
MemDMAQueue:
.byte4 _MemDMAQueue[16];
MemDMAQueue.end:
.section L1_code;
.align 4;
/***************************************************************************************
The sub_code initializes memory DMA descriptors
Descriptors locates in the memory which label is MemDMAQueue
Use p0 to store the address of the descriptor
Use p1 to stroe the modify address
The loop write the next descriptor address for each descriptor
and the next descriptor address of the last descriptor points to
the first one
***************************************************************************************/
.global memdma_init;
memdma_init:
p0.h = hi(EBIU_AMBCTL0);
p0.l = lo(EBIU_AMBCTL0);
r0.l = 0x7bb0;
r0.h = 0x7bb0;
[p0] = r0;
p0.h = hi(EBIU_AMBCTL1);
p0.l = lo(EBIU_AMBCTL1);
r0.l = 0x7bb0;
r0.h = 0x7bb0;
[p0] = r0;
//Async Memory Global Control Register
p0.h = hi(EBIU_AMGCTL);
p0.l = lo(EBIU_AMGCTL);
r0.l = w[p0];
r1 = 0xf;
r0 = r0 | r1;
w[p0] = r1;
ssync;
p0.l = 0x0000;
p0.h = 0x2020;
r0.l = 0x00ff;
w[p0] = r0.l;
p0.l = 0x0000;
p0.h = 0x2022;
w[p0] = r0.l;
p0.l = 0x0000;
p0.h = 0x2023;
w[p0] = r0.l;
p0.l = MemDMAQueue;
p0.h = MemDMAQueue;
p1 = 16(z);//modify address
r0 = p0;
r1 = p0;
r0 += 16;
p2 = 2;
lsetup(start,end)lc0 = p2;
start:
r0 += 16;
end:
w[p0 ++ p1] = r0.l;//(++): p0 + p1 post_modify
w[p0 ++ p1] = r1.l;
r1 += 16;
[p0] = r1;
rts;
memdma_init.end:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -