Welcome to Hackers Alliance!

MIPS Command [MADD]

  • Archived

    The forum is archived and used for testing. It is currently read-only to visitors.
    It has been upgraded from vBulletin 3.8.x to XenForo for security purposes and future-proofing. Proprietary code and modifications (such as code database and HA bot) are broken with XenForo and will stay only with vBulletin.

Emu

Coder
Coder
Sep 29, 2010
19
0
0
earth
[Mothers Against Drunk Driving] ;)

The mips command MADD is a Multiply then add command. How to use it is the question. If you have watched Leet's tutorials on multiplying and division then this will be relatively easy for you. Okay here is my example:

$LO & $HI

These registers store the multiplying and division in the $LO & if your division has a remainder then it stores it in the $HI register.

So if I write this little routine:

Code:
lui t0, $0880
Addi t1, zero, $4
Addi t2, zero, $8
Addi t3, zero, $2
Madd t1, t1, t2, t3
Sw t1, $0000(t0)
Jr ra
nop
Madd t1 = t1 x t2 + t3

So what happened was 4 x 8 = 32 + 2 = 34 and 34 is stored into t1.

With madd command you don't need to retrieve the result from the $LO because of the add command :D

Hope I helped out,

-Emu
 
This site has been archived and is no longer accepting new content.

About us

  • Hackers Alliance is a small community forum about gaming and console hacking. Join our humble community to share ideas, game cheats, mods, and be part of an amazing growing community!

Quick Navigation

User Menu