Be more specific about which registers are clobbered by asmsupt.asm

functions. Preserve "ES" for Watcom.
Saves ~150 bytes resident, ~90 bytes nonresident, more for 386 kernels.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@839 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-04-02 00:38:24 +00:00
parent eed84806f8
commit 8e80462093
3 changed files with 41 additions and 2 deletions

View File

@ -105,6 +105,9 @@ pascal_setup:
push bp ; Standard C entry
mov bp,sp
%ifdef WATCOM
push es
%endif
push si
push di
push ds
@ -240,6 +243,9 @@ pascal_return:
pop ds
pop di
pop si
%ifdef WATCOM
pop es
%endif
pop bp
pop cx

View File

@ -58,7 +58,22 @@ VOID ASMPASCAL fmemcpy( void FAR *d, const void FAR *s, size_t n);
VOID ASMPASCAL strcpy(char *d, const char *s);
size_t ASMPASCAL strlen(const char *s);
size_t ASMPASCAL fstrlen(const char FAR *s);
#ifdef __WATCOMC__
/* dx and es not used or clobbered for all asmsupt.asm functions except
(f)memchr/(f)strchr (which preserve es) */
#pragma aux (pascal) pascal_abc modify exact [ax bx cx]
#pragma aux (pascal_abc) init_memset
#pragma aux (pascal_abc) init_fmemset
#pragma aux (pascal_abc) init_memcpy
#pragma aux (pascal_abc) init_fmemcpy
#pragma aux (pascal_abc) init_memcmp modify nomemory
#pragma aux (pascal_abc) init_fmemcmp modify nomemory
#pragma aux (pascal_abc) init_strcpy
#pragma aux (pascal_abc) init_strlen modify nomemory
#pragma aux (pascal_abc) init_fstrlen modify nomemory
#endif
#undef LINESIZE
#define LINESIZE KBD_MAXLENGTH

View File

@ -313,7 +313,25 @@ void * /*ASMCFUNC*/ ASMPASCAL memset(void * s, int ch, size_t n);
int /*ASMCFUNC*/ ASMPASCAL memcmp(const void *m1, const void *m2, size_t n);
int /*ASMCFUNC*/ ASMPASCAL fmemcmp(const void FAR *m1, const void FAR *m2, size_t n);
#ifdef __WATCOMC__
/* dx and es not used or clobbered for all asmsupt.asm functions except
(f)memchr/(f)strchr (which preserve es) */
#pragma aux (pascal) pascal_abc modify exact [ax bx cx]
#pragma aux (pascal_abc) fmemcpy
#pragma aux (pascal_abc) memcpy
#pragma aux (pascal_abc) fmemset
#pragma aux (pascal_abc) memset
#pragma aux (pascal_abc) fmemcmp modify nomemory
#pragma aux (pascal_abc) memcmp modify nomemory
#pragma aux (pascal_abc) fstrcpy
#pragma aux (pascal_abc) strcpy
#pragma aux (pascal_abc) fstrlen modify nomemory
#pragma aux (pascal_abc) strlen modify nomemory
#pragma aux (pascal) memchr modify exact [ax bx cx dx]
#pragma aux (pascal) fmemchr modify exact [ax bx cx dx]
#pragma aux (pascal) strchr modify exact [ax bx cx dx]
#pragma aux (pascal) fstrchr modify exact [ax bx cx dx]
#endif
/* sysclk.c */
COUNT BcdToByte(COUNT x);