汇编语言(三十二)之读写文件
生活随笔
收集整理的這篇文章主要介紹了
汇编语言(三十二)之读写文件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
讀取文件的內容寫到另一個文件
程序運行:
暫無
?
代碼:
datas segmentfile1 db 'd:\abc.txt',00 handle1 dw 0file2 db 'd:\def.txt',00 handle2 dw 0line_max_len db 0ffhline db 0, 100h dup(?)buffer db 0input db 'input a line:$'output db 0dh,0ah,'move sucessfully$'outputerr db 0dh,0ah,'error deal with file$'datas endsstacks segment stackdb 100h dup(?)stacks endscodes segmentassume cs:codes,ds:datas,ss:stacks main proc far start:push dsmov ax,0hpush axmov ax,datas ;初始化dsmov ds,axlea dx,file1mov cx,0mov ah,3chint 21h jc errmov handle1,ax lea dx,inputmov ah,9int 21hlea dx,line_max_lenmov ah,10int 21hlea dx,line+1mov bx,handle1mov cl,line xor ch,ch mov ah,40hint 21h mov cx,0 mov dx,0 mov al,0 mov bx,handle1mov ah,42hint 21hlea dx,file2mov cx,0 mov ah,3ch int 21h mov handle2,ax s:lea dx,buffermov bx,handle1mov cx,1 mov ah,3fh int 21h jc errcmp ax,0 jz breakcmp buffer,'a'jb nextcmp buffer,'z'ja nextsub buffer,32next:lea dx,buffermov bx,handle2mov cx,1 mov ah,40h int 21h jc err jmp sbreak:lea dx,outputmov ah,9int 21hjmp exiterr:lea dx,outputerrmov ah,9int 21h exit:mov bx ,handle1mov ah,3ehint 21h mov bx ,handle2mov ah,3ehint 21h retmain endp codes endsend main?
總結
以上是生活随笔為你收集整理的汇编语言(三十二)之读写文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 失眠组讨论《毒液》衍生游戏:观察《漫威蜘
- 下一篇: 空调外机降噪处理小妙招 空调外机降噪技巧