123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- {
- $Id$
- This file is part of the Free Pascal run time library.
- Copyright (c) 1993,97 by the Free Pascal development team
- See the file COPYING.FPC, included in this distribution,
- for details about the copyright.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- **********************************************************************}
- procedure MoveLong(selector:word;dst:pointer;cnt:longint);
- begin
- asm
- movw %fs,%dx
- movw selector,%ax
- movw %ax,%fs
- xorl %esi,%esi
- movl DST,%edi
- movl CNT,%ecx
- shrl $0x2,%ecx
- MOVE1:
- movl %fs:(%esi,%ecx,4),%eax
- movl %eax,(%edi,%ecx,4)
- decl %ecx
- jns MOVE1
- movw %dx,%fs
- end;
- end;
- procedure ScreenToMem(Source,Target,Counter:longint);
- begin
- asm
- pushw %ds
- movl counter,%ecx
- movl %ecx,%ebx
- shrl $0x2,%ecx
- andl $0x3,%ebx
- movl target,%edi
- movl source,%esi
- addl _WBUFFER,%esi
- movw _SEG_WRITE,%ax
- movw %ax,%ds
- rep
- movsl
- movl %ebx,%ecx
- rep
- movsb
- popw %ds
- end;
- end;
- procedure MemToScreen(Source,Target,Counter:longint);
- begin
- asm
- movw %es,%dx
- movl counter,%ecx
- movl %ecx,%ebx
- shrl $0x2,%ecx
- andl $0x3,%ebx
- movl target,%edi
- movl source,%esi
- addl _WBUFFER,%edi
- movw _SEG_WRITE,%ax
- movw %ax,%es
- rep
- movsl
- movl %ebx,%ecx
- rep
- movsb
- movw %dx,%es
- end;
- end;
- procedure MemAndScreen(Source,Target,Counter:longint);
- begin
- asm
- pushw %es
- movl counter,%ecx
- movl %ecx,%ebx
- shrl $0x2,%ecx
- andl $0x3,%ebx
- movl target,%edi
- movl source,%esi
- movl $4,%edx
- addl _WBUFFER,%edi
- movw _SEG_WRITE,%ax
- movw %ax,%es
- mas_lloop:
- movl (%esi),%eax
- andl %eax,%es:(%edi)
- addl %edx,%edi
- addl %edx,%esi
- decl %ecx
- jnz mas_lloop
- orl %ebx,%ecx
- jz mas_end
- mas_bloop:
- movb (%esi),%al
- andb %al,%es:(%edi)
- incl %esi
- incl %edi
- decl %ecx
- jnz mas_bloop
- mas_end:
- popw %es
- end;
- end;
- procedure MemOrScreen(Source,Target,Counter:longint);
- begin
- asm
- pushw %es
- movl counter,%ecx
- movl %ecx,%ebx
- shrl $0x2,%ecx
- andl $0x3,%ebx
- movl target,%edi
- movl source,%esi
- addl _WBUFFER,%edi
- movw _SEG_WRITE,%ax
- movw %ax,%es
- mos_lloop:
- movl (%esi),%eax
- orl %eax,%es:(%edi)
- addl $4,%edi
- addl $4,%esi
- decl %ecx
- jnz mos_lloop
- orl %ebx,%ecx
- jz mos_end
- mos_bloop:
- movb (%esi),%al
- orb %al,%es:(%edi)
- incl %esi
- incl %edi
- decl %ecx
- jnz mos_bloop
- mos_end:
- popw %es
- end;
- end;
- procedure MemXorScreen(Source,Target,Counter:longint);
- begin
- if is_mmx_cpu and (counter>50) then
- asm
- movw %es,%dx
- movl counter,%ecx
- movl %ecx,%ebx
- shrl $0x3,%ecx
- andl $0x7,%ebx
- movl target,%edi
- movl source,%esi
- addl _WBUFFER,%edi
- movw _SEG_WRITE,%ax
- movw %ax,%es
- jecxz mmxmxs_b
- mmxmxs_lloop:
- movq (%esi),%mm0
- addl $8,%esi
- pxor %es:(%edi),%mm0
- movq %mm0,%es:(%edi)
- addl $8,%edi
- decl %ecx
- jnz mmxmxs_lloop
- mmxmxs_b:
- orl %ebx,%ecx
- jz mmxmxs_end
- mmxmxs_bloop:
- movb (%esi),%al
- xorb %al,%es:(%edi)
- incl %esi
- incl %edi
- decl %ecx
- jnz mmxmxs_bloop
- mmxmxs_end:
- movw %dx,%es
- end
- else
- asm
- movw %es,%dx
- movl counter,%ecx
- movl %ecx,%ebx
- shrl $0x2,%ecx
- andl $0x3,%ebx
- movl target,%edi
- movl source,%esi
- addl _WBUFFER,%edi
- movw _SEG_WRITE,%ax
- movw %ax,%es
- jecxz mxs_b
- mxs_lloop:
- movl (%esi),%eax
- xorl %eax,%es:(%edi)
- addl $4,%edi
- addl $4,%esi
- decl %ecx
- jnz mxs_lloop
- mxs_b:
- orl %ebx,%ecx
- jz mxs_end
- mxs_bloop:
- movb (%esi),%al
- xorb %al,%es:(%edi)
- incl %esi
- incl %edi
- decl %ecx
- jnz mxs_bloop
- mxs_end:
- movw %dx,%es
- end;
- end;
- procedure MemNotScreen(Source,Target,Counter:longint);
- begin
- asm
- pushw %es
- movl counter,%ecx
- movl %ecx,%ebx
- shrl $0x2,%ecx
- andl $0x3,%ebx
- movl target,%edi
- movl source,%esi
- addl _WBUFFER,%edi
- movw _SEG_WRITE,%ax
- movw %ax,%es
- jecxz mns_b
- mns_lloop:
- movl (%esi),%eax
- notl %eax
- movl %eax,%es:(%edi)
- addl $4,%edi
- addl $4,%esi
- decl %ecx
- jnz mns_lloop
- mns_b:
- orl %ebx,%ecx
- jz mns_end
- mns_bloop:
- movb (%esi),%al
- notb %al
- movb %al,%es:(%edi)
- incl %esi
- incl %edi
- decl %ecx
- jnz mns_bloop
- mns_end:
- popw %es
- end;
- end;
- {
- $Log$
- Revision 1.1 1998-03-25 11:18:42 root
- Initial revision
- Revision 1.4 1998/03/03 22:48:43 florian
- + graph.drawpoly procedure
- + putimage with xorput uses mmx if available
- Revision 1.3 1998/01/26 11:58:25 michael
- + Added log at the end
-
- Working file: rtl/dos/ppi/move.ppi
- description:
- ----------------------------
- revision 1.2
- date: 1997/12/01 12:21:32; author: michael; state: Exp; lines: +14 -0
- + added copyright reference in header.
- ----------------------------
- revision 1.1
- date: 1997/11/27 08:33:51; author: michael; state: Exp;
- Initial revision
- ----------------------------
- revision 1.1.1.1
- date: 1997/11/27 08:33:51; author: michael; state: Exp; lines: +0 -0
- FPC RTL CVS start
- =============================================================================
- }
|