汇编语言:子程序的调用与返回
发布网友
发布时间:2022-05-12 17:17
我来回答
共1个回答
热心网友
时间:2023-10-15 12:01
code segment
assume cs:code
org 100h
start:jmp begin
str1a db 100
str1n db ?
str1 db 100 p(?)
char1 db ?
begin:push cs
pop ds
push cs
pop es
mov ah,10
lea dx,str1a
int 21h
call lfcr
mov ah,1
int 21h
mov byte ptr char1,al
mov cl,str1n
mov ch,0
lea di,str1
cld
repne scasb
cmp cx,0
je @0
inc cx
@0:
call lfcr
mov al,str1n
sub al,cl
mov cl,al
mov ch,0
lea si,str1
cld
@1:
lodsb
mov dl,al
mov ah,2
int 21h
loop @1
mov ah,4ch
int 21h
lfcr proc near
push ax
push dx
mov ah,2
mov dl,13
int 21h
mov dl,10
int 21h
pop dx
pop ax
ret
lfcr endp
code ends
end start