_asm {
les di, buffer;
add di, 63360;
.
.
.
Loop:
mov al, [es:di-1];
.
.
.
}
Josh
_asm {
les di, buffer;
add di, 63360;
.
.
.
Loop:
mov al, [es:di-1];
.
.
.
}
Josh
Josh
Also, there is NO need to load the segments. The les instruction is invalid in 32-bit flat memory model program. Instead use lea if you want the address.
- Chris
I'm using a directdraw 640x480x256 screenmode, lock the area and retrieving the pointer to the screen.
For all intents and purposes there are NO segments. This isn't entirely correct. But, you won't need to be doing anything with them.
- Chris
_asm{
lea edi, buffer
add edi, 640
mov ecx, 305920
xor ax, ax
xor bx, bx
};
Looper:
_asm{
mov al, [edi-1]
mov bl, [edi+1]
add ax, bx
mov bl, [edi-640]
add ax, bx
mov bl, [edi+640]
add ax, bx
shr ax, 2
jz Done
dec ax
};
Done:
_asm{
stosb
loop Looper
};
But it doesn't work. The address of 'buffer' is not loaded into EDI.
MOV EDI, buffer
To move the contents of where the buffer address points
to into EAX, do:
MOV EAX, [EDI]
To increment the buffer address (to just the next byte), do:
ADD EDI, 1
Heathen
asm{
les di, buffer
add di, 320
mov cx, 63360
xor ax, ax
xor bx, bx
};
Loop:
asm{
mov al, [es:di-1]
mov bl, [es:di+1]
add ax, bx
mov bl, [es:di-320]
add ax, bx
mov bl, [es:di+320]
add ax, bx
shr ax, 2
jz Done
dec ax
};
Done:
asm{
stosb
loop Loop
};//a blurring effect in 320x200 rez