; Name: Arpan Chavda ; Roll No.:09BCE006 ; Aim: Enter string from user and convert upper case to lower case and ; vice versa without change in entered number in string. ;it runs on tasm assembler read macro str1 mov ah,0ah lea dx,str1 int 21H endm disp macro str mov ah,09h lea dx,str int 21h endm data segment str1 db 20 db 0 db 20 dup('$') msg1 db "Enter the String : $" msg2 db "Coverted string is:$" nl db 0dH,0AH,'$' data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax disp msg1 read str1 lea si,str1 inc si mov cx,[si] dec cx lp1: inc si mov al,[si] cmp al,39H jc skip mov al,[si] cmp al,5aH jnc subt mov al,[si] add al,20H mov [si],al jmp skip subt: mov al,[si] sub al,20H mov [si],al skip: loop lp1 disp nl disp msg2 disp nl disp str1+2 mov ah,4ch int 21h code ends end start Output: D:\BORLANDC\BIN>tasm str.asm Turbo Assembler Version 3.1 Copyright (c) 1988, 1992 Borland International Assembling file: string.asm Error messages: None Warning messages: None Passes: 1 Remaining memory: 459k D:\BORLANDC\BIN>tlink str.obj Turbo Link Version 5.1 Copyright (c) 1992 Borland International Warning: No stack D:\BORLANDC\BIN>str.exe Enter the String : as99DDF Converted string is: AS99ddf
Saturday, September 8, 2012
[Assembley Code]How to convert upper case to lower case and vice versa
Subscribe to:
Post Comments (Atom)
A DOS 2.0 filter for word processing document files assembly programming