Mail Archives: djgpp/1997/07/04/06:54:42
John Eccleston writes:
> asm("movw %%ax, %%es\n\t"
> "movl $0xA0000, %%edi\n\t"
> "movl $16000, %%ecx\n\t"
> "cld\n\t"
> "rep\n\t"
> "movsl\n\t"
> : /* no output registers */
> : "a" (selector), "S" (buffer)
> : "%eax", "%esi", "%edi", "%ecx");
The only thing I can see wrong with that is that you are clobbering %es,
which isn't a good idea because djgpp assumes it will always contain the
same value as %ds. I don't think you can add segment registers to the
clobber list (correct me if I'm wrong, someone!) so you'll have to save
and restore it manually.
>If I comment out the inline assembly and use the movedata statement then
>everything works fine, but when I use the inline assembly version I seem to
>get an awful striping effect on the screen and although the program seems to
>work fine the display never changes.
Well, I just wrote a little test program using your routine, and it
worked flawlessly! Either the problem lies in the clobbering of %es
upsetting the rest of your code, or you are doing something wrong
somewhere else in your program...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -