1 ;the ASCII code of the lowercase letter is 20H larger than the uppercase ASCII value. 2 ;For example, the ASCII value of capital A of 01000001 lowercase a is: 011000013 ;Formula A (01100001)-20H (100000) = A (01000001)4 ;A (01000001) + 20H (100000) = A (01100001)5AssumeCS:CODESG,ds:DATASG6 7 DATASG Segment8 9Db'Basic' ;Defining charactersTenDb'Information' One A DATASG ends - - CODESG Segment the - Start: movAx,datasg;passing defined characters into the AX General register in 16-way - movDs,ax;then point to the data segment address - + movBx0 ;set the offset address to 0 so that you get to ds:[0] = ' B ' - + movCx5 ;CX is set to 5 times, loop to get basic characters A S: movAL,[BX];send DS:[BX] memory data to Al low eight-bit registers at andal,11011111B ;Bitwise and operation of data in AL to uppercase letters - mov[Bx],al;returns the converted ASCII to the original unit - IncBx;BX plus 1, add 5 times, point to basic memory address -Loop s;Continue looping - - movBx5 ;set BX offset address to 5, point to basic in movCx One ;Cycle 11 times - to s0: movAL,[BX];, get information + orAl00100000B ;set the ASCII code's fifth bit to 1 and lowercase - mov[Bx],al;write the converted ASCII code back to the original unit the IncBx;add 1 in turn *Loop S0;Continue looping $ movax,4c00hPanax Notoginseng int21H - CODESG ends theEnd Start
Uppercase and lowercase conversions