Question: Write an ARM assembly program that will generate 20 pseudo-random integers in the range 0 to 2 15 -1 and store the numbers in 20
Write an ARM assembly program that will generate 20 pseudo-random integers in the range 0 to 215-1 and store the numbers in 20 consecutive halfword locations beginning at address 0x40000000. The following pseudocode will help you get started.
randomInteger RN 0
pointer RN 1
counter RN 2
randomInteger = any 32-bit seed value of your choosing;
pointer = 0x40000000;
counter = 20;
do {
randomInteger =(((randomInteger * 214013) + 2531011) >> 16) & 0x7FFF ;
store randomInteger in next available halfword location referenced by pointer;
adjust pointer;
--counter;
} while (counter != 0);
You will need to research the LSR, AND and STRH instructions, and indirect addressing.
Please comment as well
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
