Good afternoon everybody.
I have the worst of problems, I have a set_pixel function which
takes the address to a structure
that I have defined in C code,
the problem is that I want to set the values in
that structure using an assembly block
so that I can circumvent alot of instructions.
Well, its not working, I keep either getting an
error or an exception is generated (access violation)
or it simply just doesn't work.
This is what I have :
typedef struct tagRGBT
{
unsigned char R;
unsigned char G;
unsigned char B;
}RGBT;
void set_pixel(RGBT *screen,int x,int y,unsigned char r,unsigned char g, unsigned char b)
{
int index = (y * W)+x;
__asm{
mov ax, r;
mov bx, [screen];
add bx, index;
mov bx, ax;
mov ax, g;
inc bx;
mov bx, ax;
mov ax, b;
inc bx;
mov bx, ax;
}
}
Any help would be appreciated - thanks...
[/color]