asm--文件使用--比较两个文件是否内容相同

这是一个用汇编语言编写的程序,用于比较两个文本文件('hello.txt' 和 'world.txt')的内容是否一致。它首先打开文件,获取文件大小,然后逐块读取并比较文件内容,最后关闭文件并输出比较结果:匹配或不匹配。
摘要由CSDN通过智能技术生成
s1 segment
fn1 db 'hello.txt',0
fn2 db 'world.txt',0
fh1 dw ?
fh2 dw ?
buf1 db ?
buf2 db ?
test1dx dw ?
test1ax dw ?
strerror db 'error',0dh,0ah,24h
strmatch db 'match',0dh,0ah,24h
strnotmatch db 'not match',0dh,0ah,24h
s1 ends

s3 segment stack
    dw 10 dup(?)
top label word
s3 ends

s2 segment
    assume cs:s2,ds:s1,ss:s3
main proc near
    mov ax,s1
    mov ds,ax
    mov ax,s3
    mov ss,ax
    lea sp,top

    lea dx,fn1
    mov al,0
    mov ah,3dh
    int 21h
    jc error
    mov fh1,ax


    lea dx,fn2
    mov al,0
    mov ah,3dh
    int 21h
    jc error
    mov fh2,ax

    mov bx,fh1
    mov al,2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值