943,846 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 369
  • Assembly RSS
Apr 9th, 2009
0

Performance issue in code

Expand Post »
I am working on a embedded board with MIPS architecture and i have a requirement to initialize the 128MB RAM by writing zero's onto the memory. I have coded the following thing

ASM Syntax (Toggle Plain Text)
  1. // RAM initialization part
  2. li t2, 0x80000000 //RAM starting address
  3. li t3, 0x02000000 //(RAM size/0x04) ( 0x08000000(128MB)/0x04 )
  4. li t4, 0x00000000 //Value we need to initialize
  5. ram_init:
  6. sw t4, 0(t2)
  7. addi t2, t2, 0x00000004
  8. addi t3, t3, -0x00000004
  9. bgtz t3, ram_init
  10. nop

But with this code i am getting a performance issue where the above code takes about 70 to 80 seconds to write zero's onto the memory location. Is there any better way to do the same operation so that the time taken can be reduced to less than 5 seconds.

-BalaC-
Last edited by cbalu; Apr 9th, 2009 at 10:19 am. Reason: Included code syntax
Similar Threads
Reputation Points: 11
Solved Threads: 1
Newbie Poster
cbalu is offline Offline
6 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: About interrupt 10h? Set video mode?
Next Thread in Assembly Forum Timeline: help in`assembly project





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC