Mail Archives: djgpp/1996/07/31/16:01:37
David M Barrett (dbarrett AT news-server DOT engin DOT umich DOT edu) wrote:
: : void VGA_Mode_13h_Normal_Blit_Video_Buffer(Video_Buffer *In_Buf,
: : U16 X, U16 Y){
: : U8 *Data_Ptr;
: : U16 A,B;
: : ASM(" \n
: : pushw %%es \n
: : movw _our_global_selector, %%es \n
: : --------------> movw %%es, %%ds \n
: : movl $0xA0000, %%edi \n
: : imulw $320, %%ax \n (shifts would be faster)
: : addw %%bx, %%ax \n
: : --------------> addw %%ax, %%edi \n
: : next_line: \n (Is that label legal ???)
: : pushw %%cx \n
: : movw %%dx, %%cx \n
: : rep \n
: : movsb \n
: : pop %%cx \n (popw ????)
: : addw $320, %%edi \n
: : loop next_lineb \n
: : popw %%es \n
: : "
: : :
: : : "a" (Y),
: : "b" (X),
: : "c" (In_Buf->Dimensions.Y),
: : "d" (In_Buf->Dimensions.X),
: : "S" (In_Buf->Data));
: : }
Ok, I figured out where my problems were. I'm rather new to asm in
general, and I didn't realize that you couldn't move between es and ds
directly. So, I just did "mov %_our_global_selector, %ds" and all was
well. But, I never did figure out what was wrong with the loop. I just
replaced it with a jnz and did the counter manually. So, I'm still
confused there. Just to keep everyone up to par!
-David :)
-----------------------------------------------------------------------------
David M. Barrett :) | University of Michigan / CAEN Hotline
dbarrett AT engin DOT umich DOT edu | http://www-personal.engin.umich.edu/~dbarrett
-----------------------------------------------------------------------------
- Raw text -