We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Displaying numbers between two numbers.

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
22 Hours
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
BleepyE
Junior Poster in Training
96 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Self-Answered as of 1 Year Ago

What was your solution?

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7
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
AceStryker
Light Poster
47 posts since Aug 2011
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 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.

BleepyE
Junior Poster in Training
96 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.2912 seconds using 2.68MB