source: bootcd/isolinux/syslinux-6.03/dos/memmove.S @ dd1be7c

Last change on this file since dd1be7c was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 425 bytes
Line 
1#
2# memmove.S
3#
4# Simple 16-bit memmove() implementation
5#
6
7        .text
8        .code16gcc
9        .globl memmove
10        .type memmove, @function
11memmove:
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
212:
22        popw %si
23        popw %di
24        ret
25
261:      /* 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
35
36        .size memmove,.-memmove
Note: See TracBrowser for help on using the repository browser.