Author Topic: what is the maximum length of masm 16 file Name  (Read 20622 times)

Ehsanullah

  • Guest
what is the maximum length of masm 16 file Name
« on: November 10, 2013, 01:07:18 AM »
Hi,

in one of my lab task i name my masam file like : "Lab1_Question_1.ams" (which is 15 character long  :biggrin: ) when i assembled that file using make16 it gave this error LINK:fatal error L1093 object not found. but when i renamed the file into lab1q1.asm then it assembled the file. Here i must mention that i didn't bring any changing in the code ;Not a single character was changed..

so my question is that is there a limitation in file name length of masm?
If yes then what is the maximum length?
and which characters should be avoided while naming a file..

Thank you...

jj2007

  • Member
  • *****
  • Posts: 7734
  • Assembler is fun ;-)
    • MasmBasic
Re: what is the maximum length of masm 16 file Name
« Reply #1 on: November 10, 2013, 01:58:10 AM »
Just tried to build a 16-bit app with a long name, and it works with RichMasm, even with the old 6.14 assembler. What is make16, a batch file?

If the problem persists, use these two lines in your batch file:
\masm32\bin\ml /c %1.asm
\masm32\bin\Link16 %1.obj;

Ehsanullah

  • Guest
Re: what is the maximum length of masm 16 file Name
« Reply #2 on: November 10, 2013, 02:04:18 AM »
thanks...

Tedd

  • Member
  • ***
  • Posts: 353
  • Procrastinor Extraordinaire
Re: what is the maximum length of masm 16 file Name
« Reply #3 on: November 13, 2013, 07:18:38 AM »
DOS file names were limited to 8 characters for the 'name,' plus 3 more for the file-type extension.
Valid characters were limited to: ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$%'-_@~`!(){}^#&
And that's all; no lower case, no spaces, no other characters. (Lowercase is automatically converted to upper.)

That was 'old' DOS, and those names should be safe and valid.
However, various attempts at extending compatibility were added to the 'new' DOS functions in Windows, which should allow for most programs to still work correctly with 'long' file names (a 'short' 8+3 file name is automatically generated.) So that may or may not be your problem :P

Potato2

Rockphorr

  • Member
  • **
  • Posts: 50
Re: what is the maximum length of masm 16 file Name
« Reply #4 on: November 17, 2013, 06:58:12 AM »
length of path returned by get_current_folder of int 21h is 40h
length of file name is 0Ch
length of first <drive_name>:\ is 3
length of last zero is 1

total required bytes are 3+40h+0Ch+1 to load something like

db c:\windows\command\edit.com
db 0

Magnum

  • Member
  • *****
  • Posts: 2241
Re: what is the maximum length of masm 16 file Name
« Reply #5 on: November 17, 2013, 10:08:06 AM »
I renamed a com file by a name greater than the 8 + 3 convention.

When run, it returned "Bad command."

Outta here,
                    Andy

But you can use a lot of extended characters in the filename to come up with many thousands of file name possibilities.
Take care,
                   Andy

Ubuntu-mate-16.04-desktop-amd64

http://www.goodnewsnetwork.org

dedndave

  • Member
  • *****
  • Posts: 8749
  • Still using Abacus 2.0
    • DednDave
Re: what is the maximum length of masm 16 file Name
« Reply #6 on: November 17, 2013, 11:59:56 AM »
seems to work here, Andy
Code: [Select]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Masm32\Asm16\16-Bit Templates => blahblahblah
Hello World !

C:\Masm32\Asm16\16-BIT~1 =>

don't forget - if the path/file contains spaces, enclose it with "double quotes"

Gunther

  • Member
  • *****
  • Posts: 3517
  • Forgive your enemies, but never forget their names
Re: what is the maximum length of masm 16 file Name
« Reply #7 on: November 17, 2013, 12:07:14 PM »
Dave,

don't forget - if the path/file contains spaces, enclose it with "double quotes"

That's essential. The problem are the spaces.

Gunther
Get your facts first, and then you can distort them.

Magnum

  • Member
  • *****
  • Posts: 2241
Re: what is the maximum length of masm 16 file Name
« Reply #8 on: November 17, 2013, 12:59:20 PM »
longsnowname.com does not run.

longname8.exe don't run on my system either.

Bad command or filename.

Wait a minute, it's a feature.  :t

Andy
Take care,
                   Andy

Ubuntu-mate-16.04-desktop-amd64

http://www.goodnewsnetwork.org

Magnum

  • Member
  • *****
  • Posts: 2241
Re: what is the maximum length of masm 16 file Name
« Reply #9 on: November 17, 2013, 01:03:36 PM »
seems to work here, Andy
Code: [Select]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Masm32\Asm16\16-Bit Templates => blahblahblah
Hello World !

C:\Masm32\Asm16\16-BIT~1 =>

don't forget - if the path/file contains spaces, enclose it with "double quotes"

I found out that if you are infected with Stuxnet, long filename 16 bit exes run correctly.  :t

Andy
Take care,
                   Andy

Ubuntu-mate-16.04-desktop-amd64

http://www.goodnewsnetwork.org

sinsi

  • Member
  • *****
  • Posts: 1004
Re: what is the maximum length of masm 16 file Name
« Reply #10 on: November 17, 2013, 04:42:34 PM »
seems to work here, Andy
Code: [Select]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Masm32\Asm16\16-Bit Templates => blahblahblah
Hello World !

C:\Masm32\Asm16\16-BIT~1 =>

don't forget - if the path/file contains spaces, enclose it with "double quotes"
NTVDM shouldn't have a problem with a DOS program's long name but the program would (as would real DOS).
Dave, could you debug blahblahblah and look at the environment block? At the end should be the program name.
Wondering if it will be BLAHBL~1.EXE or blahblahblah.exe
I can walk on water but stagger on beer.

Magnum

  • Member
  • *****
  • Posts: 2241
Re: what is the maximum length of masm 16 file Name
« Reply #11 on: November 17, 2013, 05:38:34 PM »
My 16 bit programs are made using Tasm in case that makes a difference.

Later dudes,
                    Andy
Take care,
                   Andy

Ubuntu-mate-16.04-desktop-amd64

http://www.goodnewsnetwork.org

dedndave

  • Member
  • *****
  • Posts: 8749
  • Still using Abacus 2.0
    • DednDave
Re: what is the maximum length of masm 16 file Name
« Reply #12 on: November 17, 2013, 09:40:27 PM »
lemme see....
SymDeb (or Debug) doesn't like the long file name on the command line - understandable
but, i can make the code dump the string
give me a few minutes.....

dedndave

  • Member
  • *****
  • Posts: 8749
  • Still using Abacus 2.0
    • DednDave
Re: what is the maximum length of masm 16 file Name
« Reply #13 on: November 17, 2013, 09:57:41 PM »
Code: [Select]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Masm32\Asm16\16-Bit Templates => blahblahblah
C:\MASM32\ASM16\16-BIT~1\BLAHBL~1.COM

C:\Masm32\Asm16\16-BIT~1 =>
what i expected
notice the command prompt change   :P

Code: [Select]
        .MODEL  Tiny
        .386
        OPTION  CaseMap:None

;####################################################################################

        .CODE

;************************************************************************************

        ORG     100h

_main   PROC    NEAR

        mov     ds,ds:[2Ch]
        xor     si,si

loop00: lodsb
        or      al,al
        jnz     loop00

        lodsb
        or      al,al
        jnz     loop00

        mov     di,offset s$Msg
        add     si,2
        mov     dx,di
        jmp short loop02

loop01: stosb

loop02: lodsb
        or      al,al
        jnz     loop01

        mov     ax,0A0Dh
        stosw
        mov     al,24h
        stosb

        push    cs
        pop     ds
        mov     ah,9
        int     21h

        mov     ax,4C00h
        int     21h

_main   ENDP

;####################################################################################

s$Msg   db 1024 dup(0)

;####################################################################################

        END     _main
don't let Hutch see the code - it uses LODS/STOS   :lol:

Magnum

  • Member
  • *****
  • Posts: 2241
Re: what is the maximum length of masm 16 file Name
« Reply #14 on: November 19, 2013, 12:21:32 AM »
No need to be scared.

Take some deep breaths.

Andy
Take care,
                   Andy

Ubuntu-mate-16.04-desktop-amd64

http://www.goodnewsnetwork.org