🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
2 messages
2 total messages Started by Christophe LE CORFEC Fri, 15 May 1998 00:00
Problem with Assembler in Delphi
#290
Author: Christophe LE CORFEC
Date: Fri, 15 May 1998 00:00
28 lines
1511 bytes
I would like write a function named GetLongPathName (like the function
GetShortPathName in Win32 API).
I have found  "Interrupt 21h Function 7160h  Get Long Path Name" in the
API windows
So I must write it in Assembler in Delphi with the following code

asm
    mov ax, 7160h
    mov cl, 2                  ; Get Long Path Name
    mov ch, SubstExpand
    mov si, seg SourcePath
    mov ds, si
    mov si, offset SourcePath
    mov di, seg DestPath
    mov es, di
    mov di, offset DestPath
    int 21h
end;

But the compiler refuse the lines which contain "seg". It gives me the
message :
SEG is not declared!!!

My question is : where's  the problem?
How can I pass the segment of the variables?

Thank you for your help
Re: Problem with Assembler in Delphi
#291
Author: Stefan Hoffmeister
Date: Sat, 16 May 1998 00:00
47 lines
2184 bytes
: Christophe LE CORFEC <Christophe.Lecorfec@wanadoo.fr> wrote:

>I would like write a function named GetLongPathName (like the function
>GetShortPathName in Win32 API).
>I have found  "Interrupt 21h Function 7160h  Get Long Path Name" in the
>API windows
>So I must write it in Assembler in Delphi with the following code

There is no need to use assembler here.

AFAIR, what you will do is to recursively use FindFirst and FindNext
to identify the long equivalent to a short name.

AFAIR Ray Lischner (http://www.tempest-sw.com) has published a small
routine to do this.

>asm
>    mov ax, 7160h
>    mov cl, 2                  ; Get Long Path Name
>    mov ch, SubstExpand
>    mov si, seg SourcePath
>    mov ds, si
>    mov si, offset SourcePath
>    mov di, seg DestPath
>    mov es, di
>    mov di, offset DestPath
>    int 21h
>end;
>
>But the compiler refuse the lines which contain "seg". It gives me the
>message :
>SEG is not declared!!!
>
>My question is : where's  the problem?

You are (obviously) using a 32bit compiler. Segments are not supported
in 32bit BASM.

>How can I pass the segment of the variables?

You don't do this. You are taking the wrong approach.
--
mailto:Stefan.Hoffmeister (at) Uni-Passau.de
http://kakadu.rz.uni-passau.de/~w4hoff01/
   DIR: Delphi FAQs, KBs, docs
   PGP public key at homepage
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads