首页 汇编语言代码

汇编语言代码

举报
开通vip

汇编语言代码data segment menu db 0dh,0ah, '********************************************',0dh,0ah db '* menu *' ,0dh,0ah db '*------------------------------------------*',0dh,0ah db '* 1.Create file *',0dh,0ah db '* 2.Write to file *',0dh,0ah db '* 3.Read file *',0dh,0a...

汇编语言代码
data segment menu db 0dh,0ah, '********************************************',0dh,0ah db '* menu *' ,0dh,0ah db '*------------------------------------------*',0dh,0ah db '* 1.Create file *',0dh,0ah db '* 2.Write to file *',0dh,0ah db '* 3.Read file *',0dh,0ah db '* 4.Quit *',0dh,0ah db '*------------------------------------------*',0dh,0ah db '* Choice(1--4) *',0dh,0ah db '********************************************',0dh,0ah,'$' pathname db 'D:\IBM PC.T XT',00 handle dw ? buffer1 db 60,0,60 dup(?) buffer2 db 60,0,60 dup(?) huanhang db '',0dh,0ah,'$' chose db 0dh,0ah,'Please enter the digital from 1-4!',0dh,0ah,'$' entery db 0dh,0ah,'Enter what you want to write to the file!(The length of the strings is under 60) ',0dh,0ah,'$' str_ok1 db 0dh,0ah,'Create file successfully!',0dh,0ah,'$' str_ok2 db 0dh,0ah,'Wtite to file success fully!',0dh,0ah,'$' str_ok3 db 0dh,0ah,'Read from file successfully!',0dh,0ah,'$' str_error1 db 'Crea te file error!$' str_error2 db 'Open file error!$' str_error3 db 'Write to file error!$' str_error4 db ' Read file error!$' str_error5 db 'Exit from file error!$' data ends code segment assume cs:code,ds:data main proc far start: mov ax,data mov ds,ax mov ax,0600h call me call choice ret main endp me proc near mov ah,9 lea dx,menu int 21h me endp choice proc near mov ah,1 int 21h cmp al,31h je next1 cmp al,32h je next2 cmp al,33h je next3 c mp al,34h je next4 jmp back next1: call creath next2: call entry next3: mov ah,9 lea dx,huanhang int 21h call read next4: mov ax,4c00h int 21h back: mov ah,9 lea dx,chose int 21h call me ret choice endp creath proc near mov ah,3ch lea dx,pathname mov cx,0 int 21h jc error1 mov handle,ax jmp exit error1: mov ah,9 lea dx,str_error1 int 21h jmp exit1 exit: mov ah,9 lea dx,str_ok1 int 21h exit1: call choice creath endp 汇编语言课程设计 10 entry proc near mov ah,9 lea dx,entery int 21h lea dx,buffer1 mov ah,0ah int 21h sub ch,ch mov cl,buffer1+1 add dx,2 call writh ret entry endp writh proc near mov ah,3dh lea dx,pathname mov al,1 int 21h jc error2 mov handle,ax mov ah,40h lea dx,buffer1+2 mov bx,handle mov cx,60 int 21h jc error3 mov ah,3eh mov bx,handle int 21h jc error4 jmp back1 error2: mov ah,9 lea dx,str_error2 int 21h jmp exit2 error3: mov ah,9 lea dx,str_error4 int 21h jmp exit2 error4: mov ah,9 lea dx,str_error5 int 21h jmp exit2 back1: mov ah,9 lea dx,str_ok2 int 21h exit2: 汇编语言课程设计 11 call choice writh endp read proc near mov ah,3dh lea dx,pathname mov al,0 int 21h jc error5 mov handle,ax mov ah,3fh lea dx,buffer2 mov bx,hand le mov cx,60 int 21h jc error6 mov ah,9 lea dx,buffer2 int 21h jc error6 mov ah,3eh mov bx,handle int 21h jc error7 jmp back2 error5: mo v ah,9 lea dx,str_error2 int 21h jmp exit3 error6: mov ah,9 lea dx,str_error4 int 21h jmp exit3 error7: mov ah,9 lea dx,str_error5 int 21h jmp exit3 back2: mov ah,9 lea dx,str_ok3 int 21h exit3: call choice read endp code ends end start end main
本文档为【汇编语言代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_597436
暂无简介~
格式:doc
大小:17KB
软件:Word
页数:4
分类:互联网
上传时间:2019-01-18
浏览量:40