📄 prog7_21.asm
字号:
stack segment stack
dw 64 dup(?)
stack ends
data segment
file db 'A:textfile.asc',0
buffer db 128 dup(?)
errmsg db 'error in read file.','$'
data ends
code segment
assume cs:code,ds:data,es:data,ss:stack
start:mov ax,data
mov ds,ax
mov es,ax
mov ah,3dh
lea dx,file
mov al,0
int 21h
mov bx,ax
readin:lea dx,buffer
mov cx,0010h
push cx
mov ax,3fh
int 21h
lea dx,errmsg
jc err
or ax,ax
je exit
pop cx
xor si,si
display:mov dl,buffer[si]
cmp dl,1ah
je exit
mov ah,2
int 21h
inc si
loop display
jmp readin
err: mov ah,9
int 21h
exit: mov ah,3eh
int 21h
mov ah,4ch
int 21h
code ends
end start
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -