Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Problem with $

Hello, I am a begining ASM programer and I am having a problem with a path name. I am trying to delete a file inside a folder with a $ in its path name, when I try to delete the file the program disregards everything after the $ and assumes that I wanted to end the string there, how can I code around this.

...

OpenFile:

lea dx, [bp+tpath]
mov ah, 41h
int 21h
...

tpath db 'C:PRGMSSQL$LAWSRVStrucTrashOut.jnk'

The problem was that the program kept not working, so I outputed the pathname to the screen and it outputed: C:PRGMSSQL

Thanks for the help
-Red

Comments

  • anthrax11anthrax11 Posts: 511Member
    The DOS printing function assumes that the string ends with a $ character,
    however the file deleting function still assumes the string ends with 0.
    So the $ is not the problem here.

    Adding the 0 will fix one problem:
    [code]tpath db 'C:PRGMSSQL$LAWSRVStrucTrashOut.jnk',[color=Red]0[/color][/code]
    The second thing to note is that DOS can't handle long file names.
    You can use the old 8.3 format here to make it work:
    [code]
    tpath db 'C:PRGMSSQL$[color=Red]~1[/color]StrucTrashOut.jnk',0
    [/code]
    Assuming you have no other bugs in your code, it should work now.


    DOS used to be a great way to start in (asm) programming, but it has become more and
    more obsolete each year. I'd recommend that you switch to Windows and avoid
    the hassle. The above program would be a breeze to write in win32 :)
    For example, Fasm and Masm are very good assemblers for win32 and have plenty of
    material online to get you started.

    I hope this helps!
Sign In or Register to comment.