home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
1991
/
04
/
tricks
/
upper.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-01-08
|
2KB
|
58 lines
(* ------------------------------------------------------ *)
(* UPPER.PAS *)
(* (c) 1991 Gerd Cebulla & TOOLBOX *)
(* ------------------------------------------------------ *)
UNIT Upper;
INTERFACE
USES Dos;
FUNCTION UpCase(Zeichen : CHAR) : CHAR;
IMPLEMENTATION
VAR
DosUpCase : Pointer;
FUNCTION UpCase (Zeichen : CHAR) : CHAR;
BEGIN
IF (Zeichen < #128) OR (DosUpCase = NIL) THEN
UpCase := System.UpCase(Zeichen)
ELSE INLINE
($8A/$86/Zeichen/ { mov al, Zeichen[bp] }
$FF/$1E/DosUpCase/ { call far [DosUpCase] }
$88/$86/UpCase); { mov UpCase[bp], al }
END;
PROCEDURE UpCaseInit;
TYPE
CountryBuffer = RECORD
Fill1 : ARRAY [ 0..17] OF BYTE;
UpCasePtr : Pointer;
Fill2 : ARRAY [22..33] OF BYTE;
END;
VAR
CountryBuf : ^CountryBuffer;
Regs : Registers;
BEGIN
Regs.AH := $30;
MsDos(Regs); { DOS-Version abfragen }
IF Regs.AL < 3 THEN
DosUpCase := NIL
ELSE BEGIN
New(CountryBuf);
Regs.AX := $3800;
Regs.DS := Seg(CountryBuf^);
Regs.DX := Ofs(CountryBuf^);
MsDos(Regs);
DosUpCase := CountryBuf^.UpCasePtr;
Dispose(CountryBuf);
END;
END;
BEGIN
UpCaseInit;
END.
(* ------------------------------------------------------ *)
(* Ende von UPPER.PAS *)