Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly dos组件可以';不写文件_Assembly_Dos_Createfile_Dosbox - Fatal编程技术网

Assembly dos组件可以';不写文件

Assembly dos组件可以';不写文件,assembly,dos,createfile,dosbox,Assembly,Dos,Createfile,Dosbox,我写了一个16位的.com文件来创建一个文件 但它不会创建任何文件 我在Windows7上试了32位。和在dosbox里面 源代码在这里 如何写入文件 org 100h call open_new_file mov ah, 40h;write mov bx, [new_file_handle] mov cx,2;write 2 bytes mov dx, temp int 21h

我写了一个16位的.com文件来创建一个文件

但它不会创建任何文件

我在Windows7上试了32位。和在dosbox里面

源代码在这里

如何写入文件

org 100h

        call open_new_file
        mov ah, 40h;write
        mov bx, [new_file_handle]
        mov cx,2;write 2 bytes
        mov dx, temp
        int 21h

        mov ah, 3eh;close file
        mov bx, [new_file_handle]
        int 21h

        mov ah, 00
        int 16h;wait key

        mov ax, 4c00h
        int 21h;exit

open_new_file:
        push bp
        mov bp, sp
        mov ah, 3dh;open file
        mov al, 02h;write only
        mov dx, new_file_name ;out.kty
        int 21h
        mov [new_file_handle], ax
        leave
        ret


temp:
        dw 0xffaa

new_file_handle:
        dw 0
new_file_name:
        db "out.bin", 0
谢谢

看起来像是“打开文件”。你的意思是“创建还是截断?”

如果检查返回值,您可能会看到
CF
=1指示错误。我猜会是。。。二?