assembly - 在汇编语言编程中用星号替换元音
问题描述
我创建了这个程序,但我必须添加代码以将元音替换为字符串中的星号我能得到任何帮助吗?它必须有 BufferedKeyboard Input、打印字符串、打印字符、CMP 和跳转指令。
.model small
.stack
.data
s1 db 'Enter name: $'
s2 db 0ah,0dh,'Hello, $'
buff db 20,?,20 dup(?)
temp db 20 dup(?)
.code
m proc
mov ax,@data
mov ds,ax ; ds is needed for si
mov es,ax ; es is needed for di
mov ah,9 ; display 'Enter name'
mov dx,offset s1
int 21h
mov ah,0ah ; get string input
mov dx,offset buff ; input string will be stored in 'buff'
int 21h
mov si,offset buff ;point si to 'buff' where the string is
mov di,offset temp ;point di to 'temp'
inc si ;point si to the number of characters in the string
lodsb ;load the number pointed to by si into al; al now
will
hold the number of characters in the string
mov ch,0
mov cl,al ;copy al to cl; the number in cl will now serve as the
counter for the loop
ulit: movsb ;copy the character pointed to by si to the
location
pointed to by di in each iteration
loop ulit
mov al,'$' ;append the $ at the end of the string in 'temp'
stosb
mov ah,9 ;display 'Hello'
mov dx,offset s2
int 21h
mov dx,offset temp ; display the string in 'temp'
int 21h
mov ah,4ch ;terminate program
int 21h
m endp
end m
解决方案
推荐阅读
- npm - 如何修复“npm ERR!网络如果你在代理后面”
- python - 基于某些条件的颜色数据框
- azure - 当集合的 TTL 设置为 ON 时,无法通过 Azure 流分析作业更新 Cosmos DB 集合
- java - 每分钟向服务器发送数据(用于检查状态用户)
- linear-algebra - DolphinDB 中矩阵和向量的元素乘法
- javascript - 无法在角度代码中加载 pdf 错误?
- javascript - 这封信进入了谷歌邮件的垃圾邮件文件夹
- kotlin - 为 RecyclerView 声明适配器的最佳方式
- javascript - 如何在两个对象数组之间进行交集
- javascript - 使用通过 API 接收的字体定义作为前端的字符串