Delete / Löschen
Andy
26.05.2010 - 19:52

Unclear on for/do statement

I am not sure how to finish this.
I would like to assemble all the .asm files in a directory at one
time.

Thanks.

for %%d in *.asm do

::tcom.bat
tasm /zn %1.asm
tlink /x /t %1.obj
del %1.obj
if exist %1.map del %1.map


Tom Lavedas
26.05.2010 - 20:08
On May 26, 1:520pm, Andy <chocolatemint77...@yahoo.com> wrote:
I am not sure how to finish this.
I would like to assemble all the .asm files in a directory at one
time.

Thanks.

for %%d in *.asm do

::tcom.bat
tasm /zn %1.asm
tlink /x /t %1.obj
del %1.obj
if exist %1.map del %1.map

Try something like this ...

@echo off
pushd "%~p1"
for %%d in (*.asm) do (
tasm /zn %%~nd.asm
tlink /x /t %%~nd.obj
del %%~nd.obj
if exist %%~nd.map del %%~nd.map
)
popd

It take one optional command line input - the path to the set of asm
files to be processed.
_____________________
Tom Lavedas

Andy
26.05.2010 - 20:12
On May 26, 1:080pm, Tom Lavedas <tglba...@verizon.net> wrote:
On May 26, 1:520pm, Andy <chocolatemint77...@yahoo.com> wrote:

> I am not sure how to finish this.
> I would like to assemble all the .asm files in a directory at one
> time.

> Thanks.

> for %%d in *.asm do

> ::tcom.bat
> tasm /zn %1.asm
> tlink /x /t %1.obj
> del %1.obj
> if exist %1.map del %1.map

Try something like this ...

@echo off
pushd "%~p1"
for %%d in (*.asm) do (
0 tasm /zn %%~nd.asm
0 tlink /x /t %%~nd.obj
0 del %%~nd.obj
0 if exist %%~nd.map del %%~nd.map
)
popd

It take one optional command line input - the path to the set of asm
files to be processed.
_____________________
Tom Lavedas

Thanks Tom, it worked perfect.

Andy


foxidrive
26.05.2010 - 23:51
On Wed, 26 May 2010 11:08:21 -0700 (PDT), Tom Lavedas
<tglbatch@verizon.net> wrote:

Try something like this ...

@echo off
pushd "%~p1"
for %%d in (*.asm) do (
tasm /zn %%~nd.asm
tlink /x /t %%~nd.obj
del %%~nd.obj
if exist %%~nd.map del %%~nd.map
)
popd

It take one optional command line input - the path to the set of asm
files to be processed.

Tom,

I think your code assumes that the path to the asm files is on the same
drive: this might be a better start to make it more robust.

pushd "%~dp1"


--
Regards,
Mic

Tom Lavedas
27.05.2010 - 15:38
On May 26, 5:510pm, foxidrive <got...@woohoo.invalid> wrote:
On Wed, 26 May 2010 11:08:21 -0700 (PDT), TomLavedas

<tglba...@verizon.net> wrote:
>Try something like this ...

>@echo off
>pushd "%~p1"
>for %%d in (*.asm) do (
> 0tasm /zn %%~nd.asm
> 0tlink /x /t %%~nd.obj
> 0del %%~nd.obj
> 0if exist %%~nd.map del %%~nd.map
>)
>popd

>It take one optional command line input - the path to the set of asm
>files to be processed.

Tom,

I think your code assumes that the path to the asm files is on the same
drive: this might be a better start to make it more robust.

pushd "%~dp1"

--
Regards,
Mic

Not only that - it also assumes that the tasm and tlink programs are
located in a folder named in the PATH. To be more robust the
procedure is better written as ...

@echo off
setlocal
path %path%;%~dp1;%~dp0;%cd%
pushd "%~dp1"
for %%d in (*.asm) do (
tasm /zn %%~nd.asm
tlink /x /t %%~nd.obj
del %%~nd.obj
if exist %%~nd.map del %%~nd.map
)
popd
_____________________
Tom Lavedas




Ähnliche Themen

Constitutional Conservatism: A Statement for the 21st Century - The Mount Vernon Statement
18.02.2010 - 16:18 - Posts: 29

Inserting BLOB with "normal" INSERT Statement (not Prerared Statement) , Java
10.07.2009 - 11:12 - Posts: 7

REM Announces Disbandment. Here's THEIR statement, followed by the Jason Todd DVD Extras Statement.
21.09.2011 - 22:24 - Posts: 22

It was unclear who exactly made the decision. ESPN announced that he It was unclear who exactly made the decision. ESPN announced that he It was unclear who exactly made the decision. ESPN announced that he It was unclear who exactly made the decision. ES
07.10.2011 - 18:16 - Posts: 1

Police take DAP youth chief's statement: I deny vehemently that the statement was written by me. I have never written anything that has insulted Islam or the Sultan of Perak.
14.08.2009 - 11:46 - Posts: 1

Unclear suspension
07.08.2011 - 14:39 - Posts: 11

Unclear On The Concept
11.03.2012 - 03:04 - Posts: 0

More

Share/Bookmark

<