Arm/array inc

From ASMBits

Write a function that increments (by 1) each element in an array of integers. The first argument is a pointer to the start of the array. The second argument is the number of elements in the array.

There is no return value.

void array_inc (int *array, unsigned int n);

Expected solution length: Around 10 lines.

Sample Input

[1 2 3 4]

Sample Output

[2 3 4 5] 

Write your solution here

x
 
1
.data 
2
Array: .word 1, 2, 3, 4
3
4
.text
5
.global _start
6
_start:
7
    ldr r0, =Array
8
    mov r1, #4
9
    bl array_inc
10
    1: b 1b    // Done
11
12
.global array_inc
13
array_inc:
14
    
15
    
Upload a source file...