- Thu Sep 09, 2021 1:00 pm
#92284
More notes:
- the stack pointer [a1] is lowered by 32 bytes, 8 32 bit words.
- any argument passed on the stack, is therefore on 32(a1) or higher
- it looks like no arguments are passed over the stack, that seem to be unusual for xtensa (even on call0)
- at 0(a1) = a3 (saved register)
- at 4(a1) = a0 (saved register)
- at 8(a1) = a12 (saved register)
- at 12(a1) = a13 (saved register)
- at 16(a1) = a14 (saved register)
- interesting what 20(a1) - 28(a1) is used for...
- a5 is a 32 bit parameter to the function, it's not set anywhere in the function. It must be either an integer (probable) or a float (less probable). a5 is "moved" to a12 and a12 is then used in a calculation.
- something is also done with a2 and a4, looks also like 32 bit values
- a3 is never used though (only as a result)
- this is interesting:
Code: Select all4000797c: 110260 slli a0, a2, 10
4000797f: 040a add.n a0, a4, a0
40007981: 1120e0 slli a2, a0, 2
it calculates a0 = ((a2 << 10) + a4) << 2. The last shift will probably turn an "index" into a pointer into an array of 32 bit values. Yep, confirmed, they're not integers though, but floats (also 32 bit).
- also there are three s8i instructions, all of them write a single byte from a2 to (a12) with an offset of 0, 1 or 2. Maybe a12 contains a register address at this point. There are no other relevant writes to memory addresses. a12 is set from a5 and definitely not calculated in the function...