1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Looking for MIPS assembly language expert

Discussion in 'Cisco/Linksys Wireless Routers' started by fyellin, Jun 4, 2009.

  1. fyellin

    fyellin LI Guru Member

    I'm familiar with the MIPS instruction set, but have some specific questions about the MIPS chips running on WRTxxx browsers, and one strange gcc assembler question.

    Question 1: The MIPS manual says that one shouldn't use the results of a read in the following instruction (and in older MIPS chips, you couldn't!). Is there any other gotchas I need to know about "lw". Can I do 8 "lw"s in a row (all independent of each other) without stalling a pipeline? Or must there be arithmetic instructions thrown in?

    Question 2: Similar question for "lb". Suppose I need to read 16 sequential bytes. Is there any advantage or disadvantage in reading them 0,1,2,..15 rather than 0,4,8,12,1,5,9,... ? I need to read them as bytes since they are unaligned and I don't know their endianness.

    Question 3: Are there ever any stalls with arithmetic operations? Is the result always available for the next instruction? (Some other architectures have been known to have trouble with shifts. I just wanted to make sure there wasn't anything I was missing.)

    Question 4: I know that a0-a3 hold incoming args. Must these be returned unmodified, or can a method use them as scratch? Online documentation seems confused. I can't find specific documentation for gcc.

    Question 5: Is there something special I need to do to get ".set reorder" and ".set noreorder" to work properly? Are there additional command flags? For example, with reordering turned on, I would expect reordering to convert the assembly language "li v0, 1; jr ra" by swapping the two instructions. Instead, I get a nop after the "jr". Similarly, when I explicitly turn off reordering, the assembler insists on putting "nop"s after my branches, even when I've carefully put something into the delay slot.

    Thanks in advance for any advice.
  2. mstombs

    mstombs Network Guru Member

    Not too sure this is relevant but there is a Star Wars character who reads and patches the MIPS firmware binaries (big endian I believe) on Topfield TV boxes. He has a link to some other MIPS core documentation here

  3. fyellin

    fyellin LI Guru Member

    Can someone at least tell me if the router is big-endian or little-endian??
  4. TVTV

    TVTV LI Guru Member

    AFAIK, WRTs are little-endian.

Share This Page