Slashdot Mirror


User: MegaManSE

MegaManSE's activity in the archive.

Stories
0
Comments
1
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1

  1. My favorite code snippet... on Where Can I Find Beautiful Code? · · Score: 1

    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 ?