void CSurface::SetPixel (int iDestX1, int iDestY1, byte bColor)
{
asm {
les di, dword ptr [m_lpDest]
mov ax, [m_iLinePitch]
mul [iDestY1]
add ax, [iDestX1]
mov di, ax
mov al, byte ptr [bColor]
mov es:di, al
}
}
Where m_lpDest is the address of the surface: byte *m_lpDest;
m_iLinePitch is how wide the surface is: int m_iLinePitch;
Ok, I KNOW there is some way to access member variables inside a class method with inline asm. I just don''t know how! Plz help. Btw, if it helps, I am using Turbo C++ 3.0. Thanks.
Why doesn't this work? Asm question.
i have my surface class, in dos, for screen mode 13h, OLD, i know, but i like it.. anyway, i can''t seem to get access to the member variables in the class.
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement