ARM processor is used in all the Embedded systems that are being built now.ARM has both 32-bit and 64-bit RISC multi-core processors. RISC processors are designed to perform a smaller number of types of computer instructions so that they can operate at a higher speed, performing more millions of instructions per second. By stripping out unneeded instructions and optimizing pathways, RISC processors provide outstanding performance at a fraction of the power demand of CISC (complex instruction set computing) devices.
So, now let’s see how write a ARM assembly program for block transfer of data.
ALGORITHM
- Start
- Create a array of numbers in memory( say internal memory)
- Initialize a counter register to number of elements in memory
- Load base address of array to a register
- Load value to a temporary register from source memory
- Store the value in destination memory
- Decrement counter value
- Repeat steps 5-7 till counter value becomes zero
- Stop
Here is a example code for block transfer of 10 numbers from memory location 0x40000000 to 0x50001000.
CODE
AREA program,CODE,READONLY
ENTRY
LDR R0,=0x40000000 ; Source memory base address
LDR R1,=0x50001000 ; Destination memory base address
MOV R2,#0x0A ; Counter register with value equal to number of elements in source memory
label LDR R3,[R0],#4 ; Loading value to temporary register
STR R3,[R0],#4 ; Storing the value at destination memory
SUB R2,R2,#1
CMP R2.#00
BNE loop
END