Please answer this question in ASM files. I am taking a class related to Languag
ID: 3825145 • Letter: P
Question
Please answer this question in ASM files. I am taking a class related to Language Assembly programation. So please do it as ASM files to be run by the comand promt in windows. Thank you.
Please do it as siple a posible. Thank you
Using the following form .data .code coding call Create RandomArray call PrintArray call PrintReverseArray call CountArray call PrintCount call PrintCountGraph more coding main endp All methods Write the program to create 25 random numbers from 20 to 30 and print them in an array called TestArray Print the array out with all number that are 25 or less in yellow, the others in white The print the numbers in reverse Print the array out using ptr The count how many of each number there was. Print the count out as numbers Print the counts out a a bar graph Ex 20 **** 21 ****** 25 **** ETC, DO NOT PRINTOUT THE ONES WITH A ZERO COUNT You may use an If for this part) The graph must use a drawline method Extra credit if you can print out the numbers sorted --- for example 20 20 20 20 21 21 21 21 21 25 25 25 25 26 28 30 30Explanation / Answer
add $t0, $a0, $zero # p = addr of array[0]
forp: sw $zero, 0($t0) # memory[p] = 0
addi $t0, $t0, 4 # p = p + 4
sll $t1, $a1, 2 # $t1 = 4 * size
add $t1, $t1, $a0 # $t1 = addr array[size]
slt $t2, $t0, $t1 # p < &array[size] ?
bne $t2, $zero, forp # if so, continue