Monday, May 30, 2016

8051 Program - convert acc to uppercase

; Description:
; Convert Character In Acc To Upper Case
;
; Entry Requirements:
; Acc Has Character To Convert To Upper Case
;
; On Exit:
; Acc Has Upper Case Character, Or Original If Not A..Z Range
;
; Affected:
; PSW.CY, PSW.Z, PSW.P, Acc
;
; Stack:
; X Bytes, Not Including Space Used By Called Routines
;
; Comments:
; None
;
UTIL_TOUPPER:
cjne a,#'a',loop1 ; If < 'a', Don't Change
loop1:jc loop3 ; end if acc < 97
cjne a,#'z',loop2 ; If > 'z', Don't Change
jmp conv ;
loop2:jnc loop3 ; end if acc >= 123
conv:clr c ; Clear For Subtract
subb a,#'a'-'A' ; Make Upper Case
loop3:ret ; Return To Caller


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



Related topics:
8051 Program - convert acc to lowercase   |   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