Monday, May 30, 2016

8051 Program - convert acc to lowercase

; Description:
; Convert Character In Acc To Lower Case
;
; Entry Requirements:
; Acc Has Character To Convert To Lower Case
;
; On Exit:
; Acc Has Lower Case Character, Or Original If Not A..Z Range
;
; Affected:
; PSW.CY, PSW.Z, PSW.P, Acc
;
; Stack:
; 0 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; None
;
UTIL_TOLOWER:
cjne a,#'A',loop1 ; If < 'A', Don't Change
loop1:jc loop3 ; end if acc < 65
cjne a,#'Z',loop2 ; If > 'Z', Don't Change
jmp conv ;
loop2:jnc loop3 ; end if acc >= 91
conv:add a,#'a'-'A' ; Make Lower Case
loop3:ret ; Return To Caller


Source: Assorted Utilities, John C. Wren 11/23/96



Related topics:
8051 Program - convert acc to uppercase   |   8051 Program - call function dptr points to   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment