Question: I convert python dicts with simplejson, but I'd like to customise the output for some defined keys.

for example, I'd like the keys `callback` and `scope` to be always rendered with **no surrounding quotes** so the javascript can interpret the data and not read it as a string.

example desired output : 

```
"data":{
    "name":"Julien"
    ,"callback":function() {alert('hello, world');}
    ,"params":{
       "target":"div2"
       ,"scope":this
     }
}

```

Notice the `callback` and `scope` keys have no surrounding quotes in their values.

I've tried create a custom class and subclass JSONencoder with no luck.

```
class JsonSpecialKey(object):
    def __init__(self, data):
        self.data = data

class JsonSpecialEncoder(simplejson.JSONEncoder):
     def default(self, obj):
        if isinstance (obj, JsonSpecialKey):
            # how to remove quotes ??
            return obj.data
        return simplejson.JSONEncoder.default(self, obj)

d = {'testKey':JsonSpecialKey('function() {alert(123);}')}
print simplejson.dumps(d, cls=JsonSpecialEncoder, ensure_ascii=False, indent=4)

```

I know the resulting JSON may be invalid in the JSON recommendations but it is important to some JS applications.

I've tried some regex workarounds but it's getting complex for multilines and inline functions with data inside.

Thank you !

Answer: 
What do you think `add $s0,$s0,$s0` does?

It doubles the number. If the iteration count were 6, then it would double the first value six times.

Is this homework? If so, please add that tag to the question.
You are doubling the value every time, not adding the initial value to it as you want. That means it becomes $s0 = 6, $s0 = 12, $s0 = 24, $s0 = 48, $s0 = 96 etc. 

Use a temporary register to hold the initial value of $s0 ($t0) and when you do your add do it like add $s0 $s0 $t0 (or something to this effect) and it will do what you think your code is doing