Arm/func pack20

From ASMBits

Write a function that stores 20 bytes (char) into consecutive bytes in memory. The function should write b1, b2, and b3, ... b20 (in that order, lowest to highest address) to the array starting at array. The function has 21 parameters. The first is the location of the array, and the remaining 20 parameters are the 20 bytes to store.

There is no return value.

void pack20 (char* array, char b1, char b2, ... , char b20);

Recall that the first 4 parameters of a function are passed through registers r0 to r3, while the rest are passed through the stack.

Expected solution length: Around 15 lines.

Sample Input

pack20 ( 0x20000, 3, 4, 5, 6, ... , 22 ); 

Sample Output

Writes 3 to [0x20000], 4 to [0x20001], ... 22 to [0x20013] 

Write your solution here

Upload a source file...