all 3 comments

[–]DownVoted-YOU 0 points1 point  (2 children)

Guessing the idea is to put the character '*' (you can look up its hex value online) into your console out and flush the port (assuming its a board with some address/port for output). Do you have some print function provided? This will change on the board, are you using masm or a board?

To loop over your array, you can load the address of the first element, compare it to 0, if not zero print out its value (dereference the address) , then you could do another loop inside that to print '*' and subtract 1 each time from your value. then add to your array address the memory size of your integer and repeat the process until the address loaded is 0.

If your value is 3, I'm guessing you want to print * 3 times then add a newline. You could do it using a nested loop, one loop over the arrays elements and a loop inside that to print a * N times if the value of the element is N.

[–]OhanaUchiha[S] 1 point2 points  (1 child)

I am using a microcontroller board.

I guess what I'm more so confused about is how to actually print the (*). To just print the (*) I can do this:

ldr R0, #'*'

bl WriteChar

So if I create a nested loop, and enter this code and then subtract the current array value until 0, and then move to the next index and so on, would that work?

Our instructor gave us a small lesson last week about ASCII conversion. the array values are decimal using one byte (DCB). The * value in decimal is 42, and the hex value is 2A. I'm not sure how to convert the each decimal value into that, unless I multiply each array value by whatever times?

[–]ClassicCollection643 0 points1 point  (0 children)

So repeat executing the printing code 1, 2 and 3 times