Add ES/Lab/Lab2/array_reversal.asm
This commit is contained in:
parent
47d2a871e9
commit
b43a1d3360
1 changed files with 28 additions and 0 deletions
28
ES/Lab/Lab2/array_reversal.asm
Normal file
28
ES/Lab/Lab2/array_reversal.asm
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
AREA RESET, DATA, READONLY
|
||||||
|
EXPORT __Vectors
|
||||||
|
__Vectors
|
||||||
|
DCD 0x10001000
|
||||||
|
DCD Reset_Handler
|
||||||
|
ALIGN
|
||||||
|
AREA mycode,CODE,READONLY
|
||||||
|
ENTRY
|
||||||
|
EXPORT Reset_Handler
|
||||||
|
|
||||||
|
Reset_Handler
|
||||||
|
MOV R2, #5
|
||||||
|
LDR R0, =SRC
|
||||||
|
LDR R1, =SRC + 36
|
||||||
|
Loop
|
||||||
|
LDR R3, [R0]
|
||||||
|
LDR R4, [R1]
|
||||||
|
STR R3, [R1], #-4
|
||||||
|
STR R4, [R0], #4
|
||||||
|
SUBS R2, #1
|
||||||
|
|
||||||
|
BNE Loop
|
||||||
|
|
||||||
|
STOP
|
||||||
|
B STOP
|
||||||
|
AREA mydate, DATA, READWRITE
|
||||||
|
SRC DCD 0x00000032, 0x12345644, 0x00000005, 0x00000098, 0x000000AB, 0x000000CD, 0x00000055, 0x00000032, 0x000000CA, 0x00000045
|
||||||
|
END
|
Loading…
Add table
Add a link
Reference in a new issue