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.
- 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
Here is a example code for block transfer of 10 numbers from memory location 0x40000000 to 0x50001000.
<br /> AREA program,CODE,READONLY<br /> ENTRY<br /> LDR R0,=0x40000000 ; Source memory base address <br /> LDR R1,=0x50001000 ; Destination memory base address<br /> MOV R2,#0x0A ; Counter register with value equal to number of elements in source memory<br />label LDR R3,[R0],#4 ; Loading value to temporary register<br /> STR R3,[R0],#4 ; Storing the value at destination memory<br /> SUB R2,R2,#1<br /> CMP R2.#00<br /> BNE loop<br /> END<br />