I essentially have to translate this into asm
"
cDoMath(const int8_t *a, const int16_t *b, int32_t *c, int max, int offset) {
for (int i = 0; i < max; i++) {
c[i] = a[i] * b[i] - offset;
}
}"
what I don't understand is
" c[i] = a[i] * b[i] - offset; "
I know offset is the address of the symbol but what does the c[i] mean
Explain to a retard please. I don't know C
>>60116173
mov ebx, [b+i]
mov eax, [a+i]
mul ebx
sub eax, [offset]
mov [c+i], eax
something like that
>>60116173
These are presumably pointers to arrays of size "max", so you can iterate through them. the [ ] is an access operator, c[0] being the first element of the c array.
Sorry I fucked up on format.
>>60116210
>>60116202
Ahhh okay got it, yes max is an array I cant believe I overlooked that. thank you for that!
>>60116173
Fun fact. You can use
gcc -S MyFile.c
to generate assembly code.
>>60116919
you mean
>gcc -masm=intel -S MyFile.c
>>60116973
Well I prefere intel syntex from AT&T but both commands will generate assembly code.
>>60116919
it's not the most readable output though
>>60117124
Or just compile and use objdump, I suppose.