Hello i have this code,
void f () {
static const int array[2][4] = {
{0,1,2,3},
{4,5,6,7}};
int a_bit;
asm(
"movl [array_ptr + 2*column + row], %%eax \n"
"movl %%eax, %0 \n"
: "=g" (a_bit)
: "g" (array[0][0])
: "ax", "memory"
)
}
but this wont work. What I want that is fast f(), thats why `static' is
(is it ok?), and the f() shoud do:
`a_bit = array[column][row];'
but I don't know what should I write in place of:
`[array_ptr + 2*column + row]'.
Can u advise thanx.
void f () {
static const int array[2][4] = {
{0,1,2,3},
{4,5,6,7}};
int a_bit;
asm(
"movl [array_ptr + 2*column + row], %%eax \n"
"movl %%eax, %0 \n"
: "=g" (a_bit)
: "g" (array[0][0])
: "ax", "memory"
)
}
but this wont work. What I want that is fast f(), thats why `static' is
(is it ok?), and the f() shoud do:
`a_bit = array[column][row];'
but I don't know what should I write in place of:
`[array_ptr + 2*column + row]'.
Can u advise thanx.
Comment