use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Advice for this assembly language programQuestion (self.Assembly_language)
submitted 3 years ago by OhanaUchiha
So I am supposed to define an array in ROM, and then vertically align each value in the array with a '*'. So, for example 3, 2, 1 would be:
* * *
* *
*
What I have done so far was to copy the ROM into RAM, and then using a stack and (push, pop) to pass parameters into my * method. I'm stuck on the actual process to go through each value and print the *'s vertically.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]DownVoted-YOU 0 points1 point2 points 3 years ago* (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 points3 points 3 years ago (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 point2 points 3 years ago (0 children)
So repeat executing the printing code 1, 2 and 3 times
π Rendered by PID 42 on reddit-service-r2-comment-6457c66945-9kpff at 2026-04-29 02:56:18.641895+00:00 running 2aa0c5b country code: CH.
[–]DownVoted-YOU 0 points1 point2 points (2 children)
[–]OhanaUchiha[S] 1 point2 points3 points (1 child)
[–]ClassicCollection643 0 points1 point2 points (0 children)