From 21f2b2ec5e981433e929962d73118345cbcf235b Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sun, 30 Nov 2003 04:08:27 +0000 Subject: [PATCH] Fix nls upcase problem with SS!=DS. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@728 6ac86273-5f31-0410-b378-82cca8765d1b --- hdr/portab.h | 8 ++++++++ kernel/nls.c | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hdr/portab.h b/hdr/portab.h index ab72e18..3e87e73 100644 --- a/hdr/portab.h +++ b/hdr/portab.h @@ -72,6 +72,11 @@ void __int__(int); #define CDECL _cdecl #define PASCAL pascal #define __int__(intno) asm int intno; +#define _SS SS() +static unsigned short __inline SS(void) +{ + asm mov ax, ss; +} #if defined(M_I286) /* /G3 doesn't set M_I386, but sets M_I286 TE */ #define I386 @@ -85,6 +90,9 @@ void __int__(int); #define far __far #define CDECL __cdecl #define PASCAL pascal +#define _SS SS() +unsigned short SS(void); +#pragma aux SS = "mov dx,ss" value [dx]; #if _M_IX86 >= 300 #define I386 diff --git a/kernel/nls.c b/kernel/nls.c index 74a0a39..7aac127 100644 --- a/kernel/nls.c +++ b/kernel/nls.c @@ -475,9 +475,8 @@ VOID DosUpMem(VOID FAR * str, unsigned len) unsigned char ASMCFUNC DosUpChar(unsigned char ch) /* upcase a single character */ { - assertDSeqSS(); /* because "&ch" */ log(("NLS: DosUpChar(): in ch=%u (%c)\n", ch, ch > 32 ? ch : ' ')); - DosUpMem((UBYTE FAR *) & ch, 1); + DosUpMem(MK_FP(_SS, &ch), 1); log(("NLS: DosUpChar(): upcased ch=%u (%c)\n", ch, ch > 32 ? ch : ' ')); return ch; }