Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   convert an uppercase letter to lowercase with Intel 8085 (http://www.go4expert.com/forums/convert-uppercase-letter-lowercase-t15245/)

panayiotispatra 25Nov2008 17:36

convert an uppercase letter to lowercase with Intel 8085
 
Can somebody help με το change the following program that is written in 8086 in 8085
I want to convert an uppercase letter to lowercase with Intel 8085

org 100h
jmp start
new_line db 0Dh,0Ah, '$' ; new line code.
start:
lea dx, string
mov ah, 0ah
int 21h
mov bx, dx
mov ah, 0
mov al, ds:[bx+1]
add bx, ax ; point to end of string.
mov byte ptr [bx+2], '$' ; put dollar to the end.
lea dx, new_line
mov ah, 09h
int 21h
lea bx, string
mov ch, 0
mov cl, [bx+1] ; get string size.
jcxz null ; is string is empty?
add bx, 2 ; skip control chars.
upper_case:
; check if it's a lower case letter:
cmp byte ptr [bx], 'a'
jb ok
cmp byte ptr [bx], 'z'
ja ok
and byte ptr [bx], 11011111b
ok:
inc bx ; next char.
loop upper_case
lea dx, string+2
mov ah, 09h
int 21h
; wait for any key press....
mov ah, 0
int 16h
null:
ret


All times are GMT +5.5. The time now is 20:44.