| |
/*----------------------------------------------------
* 寄存器使用说明:
* R0:源数据地址
* R1:目标数据地址
* R2:源数据行数目(目标数据列数目)
* R3:源数据列数目(目标数据行数目)
*
*----------------------------------------------------*/
.global _start
.equ ROW, 8
.equ
COLUMN, 4
.equ S_SIZE, 16
@源数据每行字节数
.equ
D_SIZE, 32 @目标数据每行字节数
.text
.arm
_start:
LDR
R0,=DataZone
LDR
R1,=Resault
MOV R3,#0
MOV
R4,#S_SIZE
MOV
R5,#D_SIZE
MOV R8,#4
Loop_1:
MOV R2,#0
MLA
R6,R3,R4,R0 @源数据换行
MLA
R7,R3,R8,R1 @目标数据换列
Loop_2:
LDR
R9,[R6]
STR R9,[R7]
ADD R2,R2,#1
MLA
R6,R2,R8,R6 @计算获得下一个源数据地址
MLA R7,R2,R5,R7 @计算获得下一个目标数据地址
TEQ
R2,#COLUMN
BNE Loop_2
ADD
R3,R3,#1
TEQ
R3,#ROW
BNE Loop_1
Stop:
B
Stop
.ltorg
DataZone:
.long
0x12345678,0x87654321,0xABCDEF12,0xCDEFAB45
.long
0x20932197,0xABC99DA3,0x5522AB90,0x338899A2
.long
0x2345FDEA,0x77AD3F61,0x5290C316,0x2728CE2A
.long
0x9AC67D4F,0x8FB247AE,0x2064887C,0xCCB3267A
.long
0x2DFA1947,0xA245861B,0x9235AD78,0xC365A247
.long
0x2F965AA4,0x92348365,0xABC90273,0x47598334
.long
0x453B436A,0x23AE23DD,0x35563242,0x2354CAF2
.long
0x54379652,0xA354EF34,0xBBB32523,0x234B289A
Resault:
.long
0,0,0,0,0,0,0,0
.long
0,0,0,0,0,0,0,0
.long
0,0,0,0,0,0,0,0
.long
0,0,0,0,0,0,0,0
.end @文件结束