Forgot your password?
typodupeerror

Comment My favorite code snippet... (Score 1) 371

When I was in the 11th grade in high school I was coding using borland C++ 4.5 which did not allow me to use 32 bit instructions. So I figured I could cheat the compiler and do something interesting to get maximum performance on a copy from a buffer copy to svga framebuffer:

unsigned long far *dbtemp= dbdw[0];
asm {
push ds; //save regs
push es;
push bx;
mov bx, 0xA000 //get vram seg
mov es, bx //point extra segment to vram
lds si, dbtemp; //get buffer location
mov di, 0 //start at offset 0
mov cx, 16384 //dwords to copy
cld //set dir to forward
}
__emit__(102,243, 165); //32bit movsd

This was 3 years ago now and I still keep the file that this snippet is in around. How many C coders out there know of the __emit__ function anyway ?

Slashdot Top Deals

"Take that, you hostile sons-of-bitches!" -- James Coburn, in the finale of _The_President's_Analyst_

Working...