assembly - 在 16 位程序集中创建具有长文件名的文件

标签 assembly dos x86-16 dosbox long-filenames

a 已经制作了一个进程,为我创建了一个文件(在 dos 框中的程序集 16 位中),并且它在短文件名下工作得很好(见下文)。 但是,当名称超过 8 个字符时,所有其他字符都会被删除。 例如对于路径:'logs\log_YYYY_MM_DD.log', 0 它将创建一个名为 log_YYYY.log 的文件 我怎样才能创建一个名称超过8个字符的文件。 谢谢。

;---------------------------CreateFile-----------------------------
; Description:  create a file.
; param 1:      [in] address of File name path.
; Param 2:      [out] address of File handle.
; Return:       File handle.
;------------------------------------------------------------------
proc CreateFile
    pusha
    mov bp, sp

    @CreateFile@FileName        equ [word ptr bp + 20]
    @CreateFile@FileHandle      equ [word ptr bp + 18]

    mov ah, 3ch                     ; create file
    mov cx, 0                       ; file attribute
    mov dx, @CreateFile@FileName    ; file name 
    int 21h

    jc @CreateFile@Error
    mov bx, @CreateFile@FileHandle  
    mov [word ptr bx], ax

    jmp @CreateFile@End
@CreateFile@Error:
    call PrintFileError     ;prints an error msg

@CreateFile@End:    
    popa
    ret 2
endp CreateFile

最佳答案

how can i make a file with name longer than 8 chars

你不能。 DOS 仅支持 8.3 文件名。


更具体地说,DOSBox 中实现的 DOS 版本不支持长文件名。

来自Wikipedia :

Forks such as DOSBox SVN Daum and DOSBox SVN-lfn provide additional features, which include support for save states and long filenames (LFN)

因此,DOSBox 的某些变体确实支持长文件名,但核心版本支持。

关于assembly - 在 16 位程序集中创建具有长文件名的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61364828/

相关文章:

assembly - 8086汇编-DIV变猿,IP无休止地跳到奇怪的位置

assembly - 页表和页目录之间的区别

linux - 在 Perl 中添加默认系统换行符

windows - 批处理文件提取字符串部分

linux - 如何反汇编原始 16 位 x86 机器代码?

assembly - 使用 $ 符号为上一行中存在的变量赋值

visual-c++ - 如何在 asm *without* label 中实现条件跳转?

c - ppc64 的汇编代码

c - C语言初始化数组中的 `movq`和 `movw`是什么意思?

程序集 - 程序按预期工作,但第二次运行时,打印出乱码