asm汇编源代码之文件操作相关

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 提供7个子程序:   1. 关闭文件 FCLOSE   2. 打开文件 FOPEN   3. 文件大小 FSIZE   4. 读文件 FREAD   5. 写文件 FWRITE   6. 建立文件 FCREATE   7. 读取或设置文件指针 FPOS 具体功能及参数描述如下 |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ; ---------------------------- FCLOSE PROC  FAR ; IN: ;   AX=FILE NUMBER ; ____________________________ FOPEN  PROC  FAR ; IN: ;   DS:DX=FILE NAME ;   AL=OPEN MODE ; OUT: ;   CF=0  AX=FILE NUM ;   CF=1  AX=ERROR CODE ; ____________________________ FSIZE  PROC  FAR ; IN: ;   AX=FILE NUM ; OUT: ;   CF=0 DX:AX=FILE_SIZE ;   CF=1 AX=ERROR CODE ; ____________________________ FREAD  PROC  NEAR ; IN: ;   DS:DX=DATA BUFFER ;   AX=FILE NUM ;   CX=LENGTH ;   CF=0 AX=READ SIZE ;   CF=1 AX=ERROR CODE ; ____________________________ FWRITE PROC  FAR ; IN: ;   DS:DX=DATA BUFFER ;   AX=FILE NUM ;   CX=LENGTH ; OUT: ;   CF=0 AX=WRITE SIZE ;   CF=1 AX=ERROR CODE ; ____________________________ FCREATE PROC  FAR ; IN: ;   DS:DX=FILE NAME ; OUT: ;   CF=0 AX=FILE NUM ;   CF=1 AX=ERROR CODE ; ____________________________ FPOS  PROC  FAR ; IN: ;   AL=MODE ;   BX=FILE NUM ;   CX:DX=NEW POSITION ; OUT: ;   DX:AX=NEW POSITION   | ; more source code at http://www.ahjoe.com/source/srcdown.asp PUBLIC FOPEN, FSIZE, FREAD, FWRITE, FCREATE, FPOS, FCLOSE CODE SEGMENT ASSUME CS:CODE FCLOSE PROC FAR ; IN: ; AX=FILE NO. PUSH BX MOV BX, AX MOV AH, 3EH INT 21H POP BX RETF FCLOSE ENDP FOPEN PROC FAR ; IN: ; DS:DX=FILE NAME ; AL=OPEN MODE ; OUT: ; CF=0 AX=FILE NUM ; CF=1 AX=ERROR CODE MOV AH, 3DH INT 21H RETF FOPEN ENDP FSIZE PROC FAR ; IN: ; AX=FILE NUM ; OUT: ; CF=0 DX:AX=FILE_SIZE ; CF=1 AX=ERROR CODE PUSH BX PUSH CX MOV BX, AX MOV AX, 4202H XOR CX, CX MOV DX, CX INT 21H PUSH AX PUSH DX MOV CX, 0 MOV DX, 0 MOV AX, 4200H INT 21H POP DX POP AX POP CX POP BX RETF FSIZE ENDP FREAD PROC NEAR ; IN: ; DS:DX=DATA BUFFER ; AX=FILE NUM ; CX=LENGTH ; OUT: ; CF=0 AX=READ SIZE ; CF=1 AX=ERROR CODE PUSH BX MOV BX, AX MOV AH, 3FH INT 21H POP BX RETF FREAD ENDP FWRITE PROC FAR ; IN: ; DS:DX=DATA BUFFER ; AX=FILE NUM ; CX=LENGTH ; OUT: ; CF=0 AX=WRITE SIZE ; CF=1 AX=ERROR CODE PUSH BX MOV BX, AX MOV AH, 40H INT 21H POP BX RETF FWRITE ENDP FCREATE PROC FAR ; IN: ; DS:DX=FILE NAME ; OUT: ; CF=0 AX=FILE NUM ; CF=1 AX=ERROR CODE MOV CX, 0 MOV AH, 3CH INT 21H RETF FCREATE ENDP FPOS PROC FAR ; IN: ; AL=MODE ; BX=FILE NUM ; CX:DX=NEW POSITION ; OUT: ; DX:AX=NEW POSITION MOV AH,42H INT 21H RETF FPOS ENDP CODE ENDS END FOPEN |

相关推荐
smaller_maple8 分钟前
linux问题记录1
linux·运维·服务器
报错小能手1 小时前
讲讲libevent底层机制
linux·服务器
阿星智力囊2 小时前
Thinkphp6+nginx环境报错信息不显示,接口直接报500和CORS跨域(错误的引导方向),真坑啊
运维·nginx·php·thinkphp6
代码AC不AC4 小时前
【Linux】计算机的基石:从冯·诺依曼体系结构到操作系统管理
linux·操作系统·冯诺依曼体系结构
大柏怎么被偷了4 小时前
【Linux】进程等待
linux·运维·服务器
云和数据.ChenGuang5 小时前
运维面试题之oracle和mysql单表最大容量
运维·mysql·oracle
偶像你挑的噻5 小时前
12-Linux驱动开发- SPI子系统
linux·驱动开发·stm32·嵌入式硬件
酷柚易汛智推官5 小时前
Fastlane赋能移动研发:从全流程自动化到工程效能升级
运维·自动化·酷柚易汛
落798.5 小时前
Genlogin × Bright Data,一键解锁自动化采集的高成功率方案
运维·自动化·数据采集·亮数据
羑悻的小杀马特5 小时前
轻量跨云·掌控无界:Portainer CE + cpolar 让远程容器运维像点外卖一样简单——免复杂配置,安全直达对应集群
运维·网络·安全·docker·cpolar