News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

CMD line options, how ?

Started by Ficko, March 06, 2014, 11:02:56 PM

Previous topic - Next topic

Ficko

Hi!
I am trying out "Easy Code" and prefer to use JWASM but can't find how to add some usefull switches JWASM has but ML do not. - Like -Zg,-zlf etc. - :icon_rolleyes:
Any hint ?

Gunther

Hi Ficko,

jwasm -h brings:
Quote
JWasm v2.08a, Sep  7 2012, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

   JWasm [options] asm-file [options] [asm-file] ... [@env_var]

options:
-<0|1|..|10>[p]      Set CPU: 0=8086 (default), 1=80186, 2=80286, 3=80386,
                     4=80486, 5=Pentium, 6=PPro, 7=P2, 8=P3, 9=P4, 10=x86-64.
                     <p> allows privileged instructions.
-c                   Assemble without linking (always set)
-C<p|u|x>            Set OPTION CASEMAP: p=NONE, u=ALL,
                     x=NOTPUBLIC (default).
-D<name>[=text]      Define text macro
-e<number>           Set error limit number (default=50)
-EP                  Output preprocessed listing to stdout
-eq                  don't display error messages
-Fd[=<file_name>]    Write import definition file
-Fi<file_name>       Force <file_name> to be included
-Fl[=<file_name>]    Write listing file
-Fo<file_name>       Set object file name
-Fw<file_name>       Set errors file name
-FPi                 80x87 instructions with emulation fixups
-FPi87               80x87 instructions (default)
-fpc                 Disallow floating-point instructions (.NO87)
-fp<n>               Set FPU, <n> is: 0=8087 (default), 2=80287, 3=80387
-G<c|d|z>            Use Pascal, C or Stdcall calling convention
-I<directory>        Add directory to list of include directories
-m<t|s|c|m|l|h|f>    Set memory model:
                     (Tiny, Small, Compact, Medium, Large, Huge, Flat)
-nc=<name>           Set class name of code segment
-n<d|m|t>=<name>     Set name of data segment, module or text segment
-q, -nologo          Don't display version and copyright information
-Sa                  Maximize source listing
-safeseh             Assert all exception handlers are declared
-Sf                  Generate first pass listing
-Sg                  Display generated code in listing
-Sn                  Suppress symbol-table listing
-Sx                  List false conditionals
-w                   Same as /W0 /WX
-W<number>           Set warning level number (default=2, max=4)
-WX                  Treat all warnings as errors
-X                   Ignore INCLUDE environment path
-zcm                 C names are decorated with '_' prefix (default)
-zcw                 No name decoration for C symbols
-Zd                  Add line number debug info (OMF & COFF only)
-Zf                  Make all symbols public
-zf<0|1>             Set FASTCALL type: 0=MS VC style (default),
                     1=OW register calling convention
-Zg                  Generated code is to exactly match Masm's one
-Zi                  Add symbolic debug info (OMF & COFF only)
-zlc                 No OMF records about data in code
-zld                 No OMF records about far call optimization
-zlf                 No COFF .file entry in symbol table
-zls                 No COFF auxiliary entries for sections in symbol table
-Zm                  Masm v5.1 compatibility
-Zne                 Disable syntax extensions not supported by Masm
-Zp[n]               Set structure alignment, n=<1|2|4|8|16|32>
-Zs                  Perform syntax check only
-zt<0|1|2>           Set STDCALL symbol decoration: 0=No name decoration,
                     1=No '@size' suffix for functions, 2=Full (default)
-Zv8                 Enable Masm v8+ PROC visibility
-zze                 No name decoration for exported symbols
-zzs                 Store decorated name of start address (COFF only)
@env_var             Environment variable or file containing further commands
output formats:
-bin                 plain binary file
-coff                32-bit COFF format object file
-elf                 32-bit ELF format object file
-elf64               64-bit ELF format object file
-mz                  DOS MZ binary file
-omf                 OMF format object file (default)
-win64               64-bit COFF format object file

Hope that helps.

Gunther
You have to know the facts before you can distort them.

ragdog

Hi

Look in the Jwasm examples win32xxx.asm

Quote
;--- a simple Windows GUI program, using Masm32.
;---
;--- to create the binary by using OW Wlink enter:
;---   JWasm Win32_3m.asm
;---   Wlink format win pe ru windows file Win32_3m.obj
;---
;--- alternatively, using MS link:
;---   JWasm -coff Win32_3m.asm
;---   Link Win32_3m.obj /subsystem:windows

Or use this help from Gunther

Ficko

Thanks guys for the reply but I am afraid haven't clearly expressed my self about what I am looking for. :redface:

I was talking about "Easy Code" IDE.
I have found under <Tools><Settings><Compile/Link> the place to change "ML.exe" to "JWASM.exe" but was not able to find the location to modify/add command line switches.

I thought maybe there is place in the "ini" file for it but no luck to find anything so far.

BTW the "Help.chm" in "Easy Code" says:

Quote
IMPORTANT: When calling the wsprintf API function, remember that ml.exe corrects the stack pointer by properly increasing the Esp register after the call (only if called with Invoke). However, JWasm.exe never does this correction, so when using JWasm.exe to compile source code, you will have to manually increase Esp after each call to wsprintf (Add Esp, xx) for the built application to work properly. The xx value will depend on the number of parameters passed to wsprintf (four bytes for each parameter).

Which may could be remedied by using "-Zg" for "JWASM" - but I am not 100% sure about that.-

qWord

Quote from: Ficko on March 07, 2014, 07:32:58 AMBTW the "Help.chm" in "Easy Code" says:

Quote
IMPORTANT: When calling the wsprintf API function, remember that ml.exe corrects the stack pointer by properly increasing the Esp register after the call (only if called with Invoke). However, JWasm.exe never does this correction, so when using JWasm.exe to compile source code, you will have to manually increase Esp after each call to wsprintf (Add Esp, xx) for the built application to work properly. The xx value will depend on the number of parameters passed to wsprintf (four bytes for each parameter).

Which may could be remedied by using "-Zg" for "JWASM" - but I am not 100% sure about that.-
maybe there was a bug in earlier jWasm versions, but the current one does correctly handle the C calling convention.
MREAL macros - when you need floating point arithmetic while assembling!

dedndave

perhaps the include file that he was using prototyped wsprintf as "StdCall" (default type)
in which case, the stack would not be balanced
if it is prototyped as "C", the stack should be balanced
this would be a major compatibility issue, otherwise

rsala

Hi Ficko,

I'm sorry, but there is no way to add/modify compiler switches for visual projects (only for classic projects). That is due to the fact that Easy Code internally does a lot of work when compiling a window/module file for a visual project and any "not expected" switch could fire errors and the window/module file could not be compiled. So, the switches are the same for ml.exe and JWasm.exe:

Debug:      /X /nologo /c /coff /Cp /Zp4 /Zi /Zd
Release:    /X /nologo /c /coff /Cp /Zp4

As EC was thought in that way, it would be very complicated to change this behaviour now. I am planning to program EC 2.0, which would solve this and would be prepared for 64-bit programming, but I really do not know when I will be able to do this as I do not have time enough.

Regards,

Ramon

EC coder

Ficko

I understand Ramon. :(

But what would be if you would put an entry into the "EasyCode.ini" file like "cmdline=" and insert this value into the passing switch$?
That way at least would be possible to add some user switches.

rsala

Hi Ficko,

Please give some time and I will see what I can do!

Ramon

EC coder

rsala

Ok, I found the way and it will be solved for next versions of Easy Code.

Ramon
EC coder