于 2013/5/30 20:53, Alessandro Ghedini 写道:
Older MIPS instruction set has no 'mul' instruction, normally it is mult/multu, which stores the results to hi/lo register pair instead of a general purpose destination register. Then use mfhi/mflo to use the result.And here is the relevant assembly:(gdb) disas [...] 0x380801c4 <+508>: move at,at => 0x380801c8 <+512>: beq v0,t0,0x380801e4 <preen_nsegments+540>
The binary must be compiled with one of the latest instruction set(I don't remember the exact version, maybe mips32r2/mips64r2). Compiling with -mips2 or something like that should be ok.
0x380801cc <+516>: mul a2,v0,t3 0x380801d0 <+520>: addu v0,a2,t2 0x380801d4 <+524>: lbu a2,0(v0) 0x380801d8 <+528>: beqz a2,0x380803b8 <preen_nsegments+1008> 0x380801dc <+532>: li a2,819 0x380801e0 <+536>: sb t1,1(v0) 0x380801e4 <+540>: addiu a0,a0,1I'm not much into MIPS, but there doesn't seem to be anything weird there. Could someone from debian-mips shed some light on this? Cheers