Author Topic: Calling AsmC from batch  (Read 795 times)

HSE

  • Member
  • ****
  • Posts: 552
  • <AMD>< 7-32>
Calling AsmC from batch
« on: April 03, 2017, 12:46:34 AM »
Hi Nidud!!

Why I have problems calling AsmC from Hutch's buildc.bat?:
Code: [Select]
\masm32\bin\ml /c /coff %1.asm                 Ok
\masm32\bin\hjwasm32e /c /coff %1.asm          Ok
\masm32\bin\AsmC /c /coff %1.asm              extension is lost
 

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: Calling AsmC from batch
« Reply #1 on: April 03, 2017, 01:44:13 AM »
I tested the buildc.bat and it seems to work fine here, so it's difficult to say what the problem is.

If you could post the output from the call, there may be some clues there.
>\masm32\bin\buildc test
Code: [Select]
Asmc Macro Assembler Version 2.23H
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.

 Assembling: test.asm
byte:  1
word:  1
dword: 1
qword: 1
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

LINK : error LNK2001: unresolved external symbol _mainCRTStartup
test.exe : fatal error LNK1120: 1 unresolved externals
_
Link error
Press any key to continue . . .

HSE

  • Member
  • ****
  • Posts: 552
  • <AMD>< 7-32>
Re: Calling AsmC from batch
« Reply #2 on: April 03, 2017, 02:57:40 AM »
You are wrigth! There is no problem from prompt, only from qeditor. But hjwasm work without problem. 

Code: [Select]
Asmc Macro Assembler Version 2.22
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.

ASMC : fatal error A1000: cannot open file : \jj\TransposeMatrix2
_
Assembly Error
Presione una tecla para continuar . . .

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Re: Calling AsmC from batch
« Reply #3 on: April 03, 2017, 05:56:19 AM »
I use AsmC from RichMasm all the time, with exactly the same commandline as for ML and HJWasm.

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: Calling AsmC from batch
« Reply #4 on: April 03, 2017, 06:39:00 AM »
One of the first modification done in Asmc (from jwasm) was the handling of file names from the command line. Jwasm expanded the full path of the argument, Asmc preserved the original name given by the user.

The reasoning for this was the 16-bit short/long filename conflict. These tools was feed the short version of the name and it was importen then to use the short name in the object file as well.

This means that the file name is taken more or less as given, and that includes quotes as well apparently. Same problem with -I".." and command line arguments in general.

"test".asm
Code: [Select]
Asmc Macro Assembler Version 2.23H
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.

 Assembling: test
ASMC : fatal error A1000: cannot open file : test
ASMC : fatal error A1000: cannot open file : .asm

HJWasm v2.23, Mar 31 2017, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

byte:  1
word:  1
dword: 1
qword: 1
test.asm: 19 lines, 2 passes, 0 ms, 0 warnings, 0 errors

asmc\"test".asm
Code: [Select]
ASMC : fatal error A1000: cannot open file : asmc\"test".asm

HJWasm:
Error A2106: Cannot open file: "asmc"test.asm" [ENOENT]

asmc\\"test".asm
Code: [Select]
ASMC : fatal error A1000: cannot open file : asmc\\"test".asm

HJWasm:

byte:  1
word:  1
dword: 1
qword: 1
asmc\test.asm: 19 lines, 2 passes, 10 ms, 0 warnings, 0 errors

HSE

  • Member
  • ****
  • Posts: 552
  • <AMD>< 7-32>
Re: Calling AsmC from batch
« Reply #5 on: April 03, 2017, 10:28:38 AM »
I use AsmC from RichMasm all the time, with exactly the same commandline as for ML and HJWasm.
Exactly, I don't see diferences before, RadAsm also use the same commanline. Obviously I never try from qEditor. When source code of RichMasm and qEditor become released we can discover what happen inside both :biggrin:

 
One of the first modification done in Asmc (from jwasm) was the handling of file names from the command line. Jwasm expanded the full path of the argument, Asmc preserved the original name given by the user.

If you know the reason then AsmC "does not have bugs, it just has features you need to understand" (Hutch)  :t Perhaps apply "qEditor... has features..." (or an update?)  8)

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: Calling AsmC from batch
« Reply #6 on: April 04, 2017, 02:29:33 AM »
 :biggrin:

I guess the quotes could be removed here without messing up these "features", so this is now implemented.

HSE

  • Member
  • ****
  • Posts: 552
  • <AMD>< 7-32>
Re: Calling AsmC from batch
« Reply #7 on: April 04, 2017, 03:45:00 AM »
 :t Perfect. Thanks.

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: Calling AsmC from batch
« Reply #8 on: April 04, 2017, 04:19:05 AM »

local_directory\"name".ext
Code: [Select]
Asmc Macro Assembler Version 2.23I
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.

 Assembling: test\test.asm
byte:  1
word:  1
dword: 1
qword: 1

HJWasm v2.23, Mar 31 2017, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

Error A2106: Cannot open file: "test"test.asm" [ENOENT]

local_directory\\"name".ext
Code: [Select]
Asmc:
 Assembling: test\\test.asm
byte:  1
word:  1
dword: 1
qword: 1

HJWasm:
byte:  1
word:  1
dword: 1
qword: 1
test\test.asm: 19 lines, 2 passes, 2 ms, 0 warnings, 0 errors

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4931
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Calling AsmC from batch
« Reply #9 on: April 04, 2017, 03:24:42 PM »
HSE,

Trust me, you don't want to see the guts of QE, it would make you old with grey hair and a walking stick.

> Perhaps apply "qEditor... has features..." (or an update?)

It has its own help file on how all of it works including how to pass a variety of command line data to apps, macros or batch files that it calls.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

HSE

  • Member
  • ****
  • Posts: 552
  • <AMD>< 7-32>
Re: Calling AsmC from batch
« Reply #10 on: April 05, 2017, 09:33:11 AM »
it would make you old with grey hair and a walking stick.
:biggrin: :biggrin: :biggrin: Trust you, but some members perhaps already have grey hair! For sure someone at least want to add some shorcuts (I don't remember who). From time to time I try a little with plugins, but not much advance for now. 

... how to pass a variety of command line data to apps, macros or batch files that it calls.
that feature... I really don't know nothing, surely qEditor work fine, because I was thinking that calling the batch from prompt or qEditor was the same. An alternative idea was some change in CMD because OS is newer than qEditor, but here I have the last qEditor (2016) and cmd 2010. :eusa_snooty:   

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4931
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Calling AsmC from batch
« Reply #11 on: April 05, 2017, 03:05:36 PM »
Its not that type of problem. Look in the QE help file under "Programming Notation" and its simple enough to use.

Code: [Select]
If you have the following file loaded in Quick Editor,
c:\masm\bin\myprog.asm

The following notation is expanded by Quick Editor into the various components of the files path and filename.

full path and name with extension
{a} => c:\masm\bin\myprog.asm

full path and name with NO extension
{b} => c:\masm\bin\myprog

name with extension
{f} => myprog.asm

name with NO extension
{n} => myprog

full path with NO name
{p} => c:\masm\bin\
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

HSE

  • Member
  • ****
  • Posts: 552
  • <AMD>< 7-32>
Re: Calling AsmC from batch
« Reply #12 on: April 06, 2017, 05:22:02 AM »
Of course, what a st*p*d mistake!
Quotes in menus.ini are included in commandline, they are not a requirement of qEditor  ::)

The default menu say:
Code: [Select]
&Console Assemble && Link,\MASM32\BIN\Buildc.bat "{b}"

and ML, HJwasm and AsmC 2.22 work perfect with:
Code: [Select]
&Console Assemble && Link,\MASM32\BIN\Buildc.bat {b}

Thanks Hutch!

Sorry nidud! A lot of work by "a feature I don't understood"  :biggrin:

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: Calling AsmC from batch
« Reply #13 on: April 06, 2017, 10:49:17 PM »
 :biggrin:

No worries, this would have popped up later anyway.