extlinux/main.c: space change
[syslinux.git] / dos / memmove.S
blob1ab2cb236b8ebb5518881a3a7752ebb8a0e86ff5
2 # memmove.S
4 # Simple 16-bit memmove() implementation
7         .text
8         .code16gcc
9         .globl memmove
10         .type memmove, @function
11 memmove:
12         pushw %di
13         pushw %si
14         movw %ax,%di
15         movw %dx,%si
16         cmpw %si,%di
17         ja 1f
18         # The third argument is already in cx
19         cld
20         rep ; movsb
22         popw %si
23         popw %di
24         ret
26 1:      /* si <= di, need reverse copy */
27         add %cx,%di
28         add %cx,%si
29         dec %di
30         dec %si
31         std
32         rep ; movsb
33         cld
34         jmp 2b
36         .size memmove,.-memmove