From 3f4d6d81eea34770ddb50cfbf589d4d7febf1802 Mon Sep 17 00:00:00 2001 From: hpa Date: Fri, 17 Dec 2004 10:03:47 +0000 Subject: [PATCH] Fix memcpy/memset to match the use of regparm and .code16gcc --- dos/memcpy.S | 16 ++++++++-------- dos/memset.S | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dos/memcpy.S b/dos/memcpy.S index f6d4fd2..d1e65c2 100644 --- a/dos/memcpy.S +++ b/dos/memcpy.S @@ -6,19 +6,19 @@ # .text - .code16 + .code16gcc .globl memcpy .type memcpy, @function memcpy: cld - pushl %edi - pushl %esi - movw 12(%esp),%di - movw 16(%esp),%si - movw 20(%esp),%cx + pushw %di + pushw %si + movw %ax,%di + movw %dx,%si + # The third argument is already in cx rep ; movsb - popl %esi - popl %edi + popw %si + popw %di ret .size memcpy,.-memcpy diff --git a/dos/memset.S b/dos/memset.S index a7f610a..dd534e7 100644 --- a/dos/memset.S +++ b/dos/memset.S @@ -6,17 +6,17 @@ # .text - .code16 + .code16gcc .globl memset .type memset, @function memset: cld - pushl %edi - movw 8(%esp),%di - movb 12(%esp),%al - movw 16(%esp),%cx + pushw %di + movw %ax,%di + movb %dl,%al + # The third argument is already in %cx rep ; stosb - popl %edi - ret + popw %di + retl .size memset,.-memset -- 2.7.4