assume cs:codesg ,ds:datasg
datasg segment
db 'BaSiC'
db 'iNfOrMaTiOn'
datasg ends
codesg segment
start: mov ax,datasg
mov ds,ax
mov bx,0
mov cx,5 //BaSiC有5个字母
s: mov al,[bx] //将ASCII从ds:bx所指向的单元取出
and al,11011111B //意思就是通过与操作(第五位设置为0)将小写字母转化为大写字母
mov [bx],al //将转化后的字母在放回原单元中
inc bx
loop s
//*********************************************************************************************************//
mov bx,5
mov cx,11
s0: mov al,[bx] //将ASCII从ds:bx所指向的单元取出
or al,00100000B //意思就是通过或与操作(第五位设置为1)将大写字母转化为小写字母
mov [bx],al //将转化后的字母在放回原单元中
inc bx
loop s0
mov ax,4c00H
int 21H
codesg ends
end start
运行前:数据库对应的ASICC分别为
运行后:(大小写字母转化之后)