offtopic: you shouldn't be learning MIPS by using Bresenham's algorithm, start with something smaller or it is going to be difficult to help you when you need an explanation of what individual instructions are doing.
ontopic: Yes you are correct, main_for is where the the code is drawing multiple lines, w_68 is controling how many lines (how many times the loop is being executed). w_68 is stored in $s0 and compared in every loop with $t0 (initialized in 0 and being incremented while it is less than $s0 (w_68).
desenhaLinha_bom is where the line is being drawn (actual Bresenham). Haven't checked the full algorithm implemented there, but if it's ok it is an improved version of Bresenham's algorithm (not the naive one, will be harder to grasp since it is merging octants in a single loop)
Hope it helps!
manpreet
Best Answer
2 years ago
Note: Please do not downvote this newbie's question to aid learning. Its rather disheartening for someone asking for help to be downvoted.
Hi I have been trying to implement bresenham's algorithm in mips assembly, however I was using an incomplete algorithm i.e. not including error etc. I stumbled upon someone's mips assembly code which uses the algorithm however I do not understand what in the code makes the program output multiple lines. Is main_for part of what's causing the code to output multiple lines?