File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 1- / *
2- In this code:
1+ ;----------------------------------------------
2+ ; R8 is initialized as the current number (starting from 1).
33
4- R8 is initialized as the current number (starting from 1 ) .
4+ ; R9 is used to keep track of the count of divisible numbers .
55
6- R9 is used to keep track of the count of divisible numbers.
6+ ; The findNumbers loop checks if the current number is divisible by 3 or 4 using the modulus operation
7+ ; and stores it in the array if it is.
78
8- The findNumbers loop checks if the current number is divisible by 3 or 4 using the modulus operation
9- and stores it in the array if it is.
10-
11- This code will populate the arr array with the first 50 positive numbers th at are divisible by either 3 or 4 .
12-
13- You can modify the code to use a different array size or to store the numbers in a different memory location if needed.
14- * /
9+ ; This code will populate the arr array with the first 50 positive numbers that are divisible by either 3 or 4.
1510
11+ ; You can modify the code to use a different array size or to store the numbers in a different memory location if needed.
12+ ;----------------------------------------------
1613
1714; Initialize registers
1815main mov .w #arr , R10 ; Set R10 to the address of the array
You can’t perform that action at this time.
0 commit comments