汇编语言 利用and运算 将字符串中的某个字母变成大写

待运行代码:

assume cs:codesg,ds:datasg

datasg segment
	db '1. file         '
	db '2. Edit         '
	db '3. search       '
	db '4. view         '
	db '5. options      '
	db '6. help         '
datasg ends

codesg segment
f:  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 f

运行之后的结果:

猜你喜欢

转载自blog.csdn.net/weixin_42859280/article/details/107789078