home *** CD-ROM | disk | FTP | other *** search
-
- { VERY FAST AND SMALL UP/LOW CASE}
- { BY BRAIN PAPE }
-
- Uses CRT;
-
- function LoStr(const s:string):string; assembler;
- asm
- push ds
- lds si,s
- les di,@result
- lodsb { load and store length of string }
- stosb
- xor ch,ch
- mov cl,al
- @LowerLoop:
- lodsb
- cmp al,'A'
- jb @cont
- cmp al,'Z'
- ja @cont
- add al,' '
- @cont:
- stosb
- loop @LowerLoop
- pop ds
- end; { LoStr }
-
- function UpStr(const s:string):string; assembler;
- asm
- push ds
- lds si,s
- les di,@result
- lodsb { load and store length of string }
- stosb
- xor ch,ch
- mov cl,al
- @upperLoop:
- lodsb
- cmp al,'a'
- jb @cont
- cmp al,'z'
- ja @cont
- sub al,' '
- @cont:
- stosb
- loop @UpperLoop
- pop ds
- end; { UpStr }
-
- VAR S : String;
-
- BEGIN
- ClrScr;
- WriteLn(LoStr('GAYLE DAVIS'));
- WriteLn(UpStr('gayle davis'));
- Readkey;
- END.
-
-
-
-