0

Im using MIPS and im looking to display the numbers between two other numbers.

For example;
$t1 = 5
$t2 = 9

Display = 56789

Ive only just started learning the language so im still struggling to get used to it.

Thanks

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by BleepyE
0
xor eax, eax
mov eax, 5 ;min value
Looping:
push eax ;move eax to the stack
call crt_printf ;same as C function, use msvcrt library
inc eax
cmp eax, 9 ;max value
jz Looping

Final:
ret
0

Mine was bit more long winded as I only know a few commands, but I got there in the end.
It just consisted of branching off to a plus 1 loop until the number equalled the second number.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.