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
s:mov al, [bx]
and al, 11011111B ;将al第5位设为0,变为大写字母
mov [bx], al
inc bx
loop s
mov bx, 5
mov cx, 11
s0:mov al, [bx]
or al, 001000000B ;将al第5位设为1,变为小写字母
mov [BX], al
inc bx
loop s0
mov ax, 4C00H
int 21H
codesg ends
end start
;将每行第三个字母变为大写
assume cs:codesg, ds:datasg
datasg segment
db '1. file '
db '2. edit '
db '3. search '
db '4. view '
db '5. option '
db '6. help '
datasg ends
codesg segment
start: mov ax, datasg
mov ds, ax
mov bx, 0
mov cx, 6
s:mov al, [bx+3]
and al, 11011111B ;变为大写字母
mov [bx+3], al
add bx, 16
loop s
mov ax, 4c00H
int 21H
codesg ends
end start