/programs/develop/libraries/menuetlibc/src/libc/pc_hw/mem/Makefile |
---|
0,0 → 1,3 |
THIS_SRCS = djmdr.s djmd.s mdb.s mdl.s md.s mdw.s |
include $(MENUET_LIBC_TOPDIR)/Make.rules |
/programs/develop/libraries/menuetlibc/src/libc/pc_hw/mem/djmd.s |
---|
0,0 → 1,40 |
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
# This routine moves %ecx bytes from %ds:%esi to %es:%edi. It clobbers |
# %eax, %ecx, %esi, %edi, and eflags. The memory ranges must not overlap, |
# unless %esi >= %edi. |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
.file "djmd.s" |
.text |
.balign 16,,7 |
MK_C_SYM(__dj_movedata) |
cmpl $15,%ecx |
jle small_move |
jmp mod_4_check |
# Transfer bytes until either %esi or %edi is aligned % 4 |
align_mod_4: |
movsb |
decl %ecx |
mod_4_check: |
testl $3,%esi |
jz big_move |
testl $3,%edi |
jnz align_mod_4 |
big_move: |
movb %cl,%al # We will store leftover count in %al |
shrl $2,%ecx |
andb $3,%al |
rep |
movsl |
# %ecx known to be zero here, so insert the leftover count in %al |
movb %al,%cl |
small_move: |
rep |
movsb |
ret |
/programs/develop/libraries/menuetlibc/src/libc/pc_hw/mem/djmdr.s |
---|
0,0 → 1,58 |
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
/* Modified by SET to copy in reverse order */ |
# This routine moves %ecx bytes from %ds:%esi to %es:%edi. It clobbers |
# %eax, %ecx, %esi, %edi, and eflags. |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
.file "djmdr.s" |
.text |
.balign 16,,7 |
MK_C_SYM(__dj_movedata_rev) |
std |
# Add the counter to the index |
addl %ecx,%edi |
addl %ecx,%esi |
decl %esi |
decl %edi |
cmpl $15,%ecx |
jle small_move |
jmp mod_4_check |
# Transfer bytes until either %esi or %edi is aligned % 3 |
align_mod_4: |
movsb |
decl %ecx |
mod_4_check: |
movl %esi,%eax |
andl $3,%eax |
cmpl $3,%eax |
jz big_move |
movl %edi,%eax |
andl $3,%eax |
cmpl $3,%eax |
jnz align_mod_4 |
big_move: |
movb %cl,%al # We will store leftover count in %al |
shrl $2,%ecx |
andb $3,%al |
# Now retrocess the index 3 positions |
subl $3,%edi |
subl $3,%esi |
rep |
movsl |
# %ecx known to be zero here, so insert the leftover count in %al |
movb %al,%cl |
# advance the index by 3 |
addl $3,%edi |
addl $3,%esi |
small_move: |
rep |
movsb |
ret |
/programs/develop/libraries/menuetlibc/src/libc/pc_hw/mem/md.s |
---|
0,0 → 1,27 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#define USE_ESI |
#define USE_EDI |
#include <libc/asmdefs.h> |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
MK_C_SYM(__movedata) /* src_sel, src_ofs, dest_sel, dest_ofs, len */ |
ENTER |
pushw %ds |
pushw %es |
movw ARG1,%ds |
movw ARG3,%es |
movl ARG2,%esi |
movl ARG4,%edi |
movl ARG5,%ecx |
call C_SYM(__dj_movedata) |
popw %es |
popw %ds |
LEAVE |
/programs/develop/libraries/menuetlibc/src/libc/pc_hw/mem/mdb.s |
---|
0,0 → 1,29 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#define USE_ESI |
#define USE_EDI |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
MK_C_SYM(_movedatab) /* src_sel, src_ofs, dest_sel, dest_ofs, len */ |
ENTER |
pushw %ds |
pushw %es |
movl ARG1,%eax |
movw %ax,%ds |
movl ARG2,%esi |
movl ARG3,%eax |
movw %ax,%es |
movl ARG4,%edi |
movl ARG5,%ecx |
cld |
rep |
movsb |
popw %es |
popw %ds |
LEAVE |
/programs/develop/libraries/menuetlibc/src/libc/pc_hw/mem/mdl.s |
---|
0,0 → 1,29 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#define USE_ESI |
#define USE_EDI |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
MK_C_SYM(_movedatal) /* src_sel, src_ofs, dest_sel, dest_ofs, len */ |
ENTER |
pushw %ds |
pushw %es |
movl ARG1,%eax |
movw %ax,%ds |
movl ARG2,%esi |
movl ARG3,%eax |
movw %ax,%es |
movl ARG4,%edi |
movl ARG5,%ecx |
cld |
rep |
movsl |
popw %es |
popw %ds |
LEAVE |
/programs/develop/libraries/menuetlibc/src/libc/pc_hw/mem/mdw.s |
---|
0,0 → 1,29 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#define USE_ESI |
#define USE_EDI |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
MK_C_SYM(_movedataw) /* src_sel, src_ofs, dest_sel, dest_ofs, len */ |
ENTER |
pushw %ds |
pushw %es |
movl ARG1,%eax |
movw %ax,%ds |
movl ARG2,%esi |
movl ARG3,%eax |
movw %ax,%es |
movl ARG4,%edi |
movl ARG5,%ecx |
cld |
rep |
movsw |
popw %es |
popw %ds |
LEAVE |