⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delete.asm

📁 该软件包中包括了比较经典了几个汇编程序
💻 ASM
字号:
;从键盘输入字符串,再输入待删除的字符,删除并显示


data segment
Msg1 db "please input a serious letters:",0ah,0dh,'$'
Msg2 db 0ah,0dh,"please input the letter you want to delete:",0ah,0dh,'$'
array db 100,?,100 dup(?)
output1 db 0ah,0dh,"No record",0ah,0d,'$'
output2 db 0ah,0dh,"Delete Success",0ah,0dh,'$'
data ends

stack segment para stack
db 20h dup(?)
stack ends

code segment
assume cs:code,ss:stack,ds:data
start:
mov ax,data
mov ds,ax
lea dx,Msg1
mov ah,09h
int 21h
lea dx,array
mov ah,0ah
int 21h
lea dx,Msg2
mov ah,09h
int 21h
mov ah,01h
int 21h
xor cx,cx
mov cl,array+1
lea si,array
add si,2
L10:
cmp al,[si]
jz L11
inc si
loop L10
lea dx,output1
mov ah,09h
int 21h
jmp exit
L11:
.if cl==1
dec array
jmp exit
.endif
call execute
lea dx,output2
mov ah,09h
int 21h
call display
exit:
mov ah,4ch
int 21h

execute proc
push cx
push si
push ax
push bx
L12:
mov al,[si+1]
mov [si],al
inc si
loop L12
dec array
pop bx
pop ax
pop si
pop cx
ret
execute endp

display proc
push dx
push cx
push ax
push si
lea si,array
inc si
mov cl,[si]
inc si
lop:
mov dx,[si]
mov ah,02h
int 21h
inc si
loop lop
pop si
pop ax
pop cx
pop dx
ret
display endp


code ends
end start

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -