Author Topic: JWASM is updated.  (Read 29754 times)

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: JWASM is updated.
« Reply #30 on: August 12, 2012, 04:50:15 AM »

I am not sure to understand very well this
Quote
The "block nesting error" is a bit misleading, because it claims _TEXT to be the segment causing trouble. In fact, it's a few  "DATA SEGMENT" directives that still occur in the source files that cause this error. It's an error, because the segment is opened but never "closed" ( with a DATA ENDS directive ).

Just replace the "DATA SEGMENT" with ".data" and it should work.
I don't use "DATA SEGMENT" in the richedit source code.
What is sure,is that i have several .data.



Fa is a musical note to play with CL

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: JWASM is updated.
« Reply #31 on: August 12, 2012, 05:15:42 AM »

Don't take care of my last post.
There was "DATA SEGMENT" (a modify for the first problem).
I had forgotten to replace them.
Fa is a musical note to play with CL

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: JWASM is updated.
« Reply #32 on: August 12, 2012, 05:54:03 AM »
This one is a problem with nested MACRO  (compiled ok with ml)

Quote
;.NOLIST         ;signifie: ne rien mettre dans le listing
;------ emplacement des déclarations
;.NOLIST

   .486
   .model flat,stdcall
   option casemap:none   ; case sensitive
   include translate.inc
   include windows.sdk
   IFDEF ERROR
   ECHO error defined
   ENDIF
   includelib kernel32.lib
   ;-----------------------------------------------------------
   PuPo    MACRO Var1, Var2
   push     Var2
   pop     Var1
   ENDM
   REMPLIRnmhdr MACRO hwndFrom:REQ,idFrom:REQ,message:REQ   ;NMHDR
      PuPo nmhdr.hwndFrom,hwndFrom
      PuPo nmhdr.idFrom,idFrom
      mov nmhdr.code,message
   ENDM
        ;-----------------------------------------------------------------

        .data          one dd 0
   two dd 5
   nmhdr NMHDR <>
   
   titre db "Adresse Email trouvĂ©",0

   .code
   

   start:
   REMPLIRnmhdr one,two,526      ;<<<<<<<<<<<<<<<error ?
   PuPo one,two
   invoke ExitProcess,0
;-----------------------------------------------------------------------------------


;################################################################   
end start      
don't accept the line:
REMPLIRnmhdr one,two,526

Quote
test_jwasm.asm(35) : Error A2102: Symbol not defined : one
 PuPo(2)[test_jwasm.asm]: Macro called from
  REMPLIRnmhdr(1)[test_jwasm.asm]: Macro called from
   test_jwasm.asm(35): Main line code
test_jwasm.asm(35) : Error A2102: Symbol not defined : two
 PuPo(2)[test_jwasm.asm]: Macro called from
  REMPLIRnmhdr(2)[test_jwasm.asm]: Macro called from
   test_jwasm.asm(35): Main line code

Fa is a musical note to play with CL

japheth

  • Guest
Re: JWASM is updated.
« Reply #33 on: August 12, 2012, 11:15:29 PM »
Quote
This one is a problem with nested MACRO  (compiled ok with ml)

Yes, this is a small incompatibility. It's not really related to "nested" macros, because the very same behavior also occurs with ECHO and one or two other directives. I call it "small" because it's generally not a very good idea to select argument or local names in a macro that match the names of other items in the namespace. If it works, as in your case, it kind of works "by chance" only. From a technical point of view the problem is that in jwasm the macro argument/local substitution is implemented "one level too deep". It's on my todo list to fix this, but won't happen for v2.08.

jj2007

  • Member
  • *****
  • Posts: 7635
  • Assembler is fun ;-)
    • MasmBasic
Re: JWASM is updated.
« Reply #34 on: October 06, 2012, 07:33:09 AM »
Compliments :t

Short 100-lines proggie, with MasmBasic (includes masm32rt.inc):
JWasm:   *** Assembling and linking took 391 milliseconds ***
ML 6.15: *** Assembling and linking took 765 milliseconds ***
ML 10.0: *** Assembling and linking took 781 milliseconds ***


RichMasm source, 14,000 lines, with MasmBasic (includes masm32rt.inc):
JWasm:   *** Assembling and linking took 1031 milliseconds ***
ML 6.15: *** Assembling and linking took 1650 milliseconds ***
ML 10.0: *** Assembling and linking took 1730 milliseconds ***


For comparison, building a tiny C proggie with VS Express takes almost ten seconds ;-)

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: JWASM is updated.
« Reply #35 on: October 06, 2012, 08:07:00 AM »
Hi Jochen,

Compliments :t

Short 100-lines proggie, with MasmBasic (includes masm32rt.inc):
JWasm:   *** Assembling and linking took 391 milliseconds ***
ML 6.15: *** Assembling and linking took 765 milliseconds ***
ML 10.0: *** Assembling and linking took 781 milliseconds ***


RichMasm source, 14,000 lines, with MasmBasic (includes masm32rt.inc):
JWasm:   *** Assembling and linking took 1031 milliseconds ***
ML 6.15: *** Assembling and linking took 1650 milliseconds ***
ML 10.0: *** Assembling and linking took 1730 milliseconds ***


For comparison, building a tiny C proggie with VS Express takes almost ten seconds ;-)

but you know: compile times are not the only point.

Gunther
Get your facts first, and then you can distort them.

ragdog

  • Member
  • ****
  • Posts: 515
Re: JWASM is updated.
« Reply #36 on: October 30, 2012, 04:10:09 AM »
Hi

I wish Radasm3 is complete Jwasm Compatible
What is the commandline settings for

Standart Builds

This is for Masm

0=Window Release,'/v "$R"',"$R.res",'/c /coff /Cp "$C"',"$C.obj",'/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /OUT:$O $C $M $R',"$C.exe",'',
1=Window Debug,'/v "$R"',"$R.res",'/c /coff /Cp /Zi /Zd "$C"',"$C.obj",'/SUBSYSTEM:WINDOWS /DEBUG /VERSION:4.0 /OUT:$O $C $M $R',"$C.exe",'',
2=Console Release,'/v "$R"',"$R.res",'/c /coff /Cp "$C"',"$C.obj",'/SUBSYSTEM:CONSOLE /RELEASE /VERSION:4.0 /OUT:$O $C $M $R',"$C.exe",'',
3=Console Debug,'/v "$R"',"$R.res",'/c /coff /Cp /Zi /Zd "$C"',"$C.obj",'/SUBSYSTEM:CONSOLE /DEBUG /VERSION:4.0 /OUT:$O $C $M $R',"$C.exe",'',
4=Dll Release,'/v "$R"',"$R.res",'/c /coff /Cp "$C"',"$C.obj",'/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /DLL /DEF:$D /OUT:$O $C $M $R',"$C.dll",'',
5=Dll Debug,'/v "$R"',"$R.res",'/c /coff /Cp /Zi /Zd "$C"',"$C.obj",'/SUBSYSTEM:WINDOWS /DEBUG /VERSION:4.0 /DLL /DEF:$D /OUT:$O $C $M $R',"$C.dll",'',
6=Library,'',,'/c /coff /Cp "$C"',"$C.obj",'',,'/VERBOSE /SUBSYSTEM:WINDOWS /OUT:$O $C $M',"$C.lib"

Greets,

ragdog

  • Member
  • ****
  • Posts: 515
Re: JWASM is updated.
« Reply #37 on: October 30, 2012, 08:53:56 PM »
Ok i have now all figured out

But i have a problem to build dll files

jwasm -coff  "source.asm"
jwlink format windows nt dll file "source.obj" @make.rsp
My rsp

Code: [Select]
export {
   Test1='Test1'
   Test2='Test2'
}

Or can i use a .def like Masm?


Code: [Select]
LIBRARY source.dll
EXPORTS
   Test1
   Test2

japheth

  • Guest
Re: JWASM is updated.
« Reply #38 on: October 30, 2012, 10:56:12 PM »
Or can i use a .def like Masm?

No. This issue is covered pretty detailed on the jwlink site: http://www.japheth.de/JWlink.html

ragdog

  • Member
  • ****
  • Posts: 515
Re: JWASM is updated.
« Reply #39 on: October 30, 2012, 11:18:29 PM »
Thanks but i have not found about def files

japheth

  • Guest
Re: JWASM is updated.
« Reply #40 on: October 31, 2012, 12:04:59 AM »
Thanks but i have not found about def files

Code: [Select]
There's no direct replacement for MS link's /DEF option, which tells the linker to scan a so-called Module Definition File.
However, since the main usage of such files is to define exports, it's simple to replace them with standard linker directive
files.

Here's an example. Module Definition File MYDLL.DEF:

    LIBRARY MYDLL
    EXPORTS
     MyFunction1
     MyFunction2
     MyFunction3

can be replaced by linker directive file MYDLL.RSP:

    OP MODNAME=MYDLL
    OP FUZZYEXPORT
    EXPORT {
     MyFunction1
     MyFunction2
     MyFunction3
    }

and that file is added to JWlink's commandline with the @ directive:

jwlink format win pe dll file mydll.obj @MYDLL.RSP

ragdog

  • Member
  • ****
  • Posts: 515
Re: JWASM is updated.
« Reply #41 on: October 31, 2012, 07:47:09 AM »
Danke japheth




ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: JWASM is updated.
« Reply #42 on: April 07, 2013, 10:48:28 PM »
Hello,
I have a problem with dynamic call.
Quote
;-------- sprintf_s PROTO C :DWORD ,:DWORD ,:DWORD , :VARARG -------------------------
EXTERNDEF ADRsprintf_s:DWORD     ;sprintf_s use a vararg en couldn't be call in the library
Psprintf_s TYPEDEF PROTO C :DWORD ,:DWORD ,:DWORD , :VARARG
Fsprintf_s TYPEDEF PTR Psprintf_s
sprintf_s TEXTEQU <Fsprintf_s ptr ADRsprintf_s>
.code
.LISTALL
invoke sprintf_s,addr sz_buffer,sizeof sz_buffer,write("Friendlyname : %s"), addr buffer               
invoke o_printcrlf,addr sz_buffer         
.NOLIST

Ml is ok
Code: [Select]
Microsoft (R) Macro Assembler Version 6.15.8803     04/07/13 10:40:24
mat_enum.asm      Page 1 - 1

 00000055  0000
      C .LISTALL
     1C LOCAL txt
 00000863      1C .data
 00000863 46 72 69 65 6E     1C ??002D db "Friendlyname : %s",0
   64 6C 79 6E 61
   6D 65 20 3A 20
   25 73 00
     1C align 4
 000009F8      1C .code
     1C EXITM <ADDR ??002D>
      C  invoke sprintf_s,addr sz_buffer,sizeof sz_buffer,write("Friendlyname : %s"), addr buffer
 000009F8  8D 85 FFFFFEDC  *     lea    eax, byte  ptr ss:[ebp]+0DCh
 000009FE  50    *     push   eax
 000009FF  68 00000863 R   *     push   OFFSET ??002D
 00000A04  68 00000100    *     push   +000000100h
 00000A09  68 00000301 R   *     push   OFFSET sz_buffer
 00000A0E  FF 15 00000000 E *     call   dword  ptr ADRsprintf_s
 00000A14  83 C4 10    *     add    esp, 000000010h
      C invoke o_printcrlf,addr sz_buffer
 00000A17  68 00000301 R   *     push   OFFSET sz_buffer
 00000A1C  E8 FFFFFB6A    *     call   o_printcrlf

Jwasm don't agree


JWasm v2.10rc10, Apr  4 2013
mat_enum.asm
                              C          .LISTALL
00000000                     1C    .data
                            *1C _TEXT ends
00000863                    *1C _DATA segment
                            *1C assume cs:ERROR
                             1C    ??002D db "Friendlyname : %s",0
                             1C    align 4
00000000                     1C    .code
                            *1C _DATA ends
00000A13                    *1C _TEXT segment
                            *1C assume cs:FLAT
00000A13                      C          invoke Fsprintf_s ptr ADRsprintf_s,addr sz_buffer,sizeof sz_buffer,ADDR ??002D, addr buffer               
00000A13                    * C  lea eax, buffer               
00000A19                    * C  push eax
00000A1A                    * C  push offset ??002D
00000A1F                    * C  push sizeof sz_buffer
00000A24                    * C  push offset sz_buffer
00000A29                    * C  call Fsprintf_s ptr ADRsprintf_s
 Error A2182: Instruction operand must have size
00000A2F                    * C  add esp, 16
00000A32                      C          invoke o_printcrlf,addr sz_buffer         
00000A32                    * C  push offset sz_buffer         
00000A37                    * C  call o_printcrlf






Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 7635
  • Assembler is fun ;-)
    • MasmBasic
Re: JWASM is updated.
« Reply #43 on: April 08, 2013, 01:15:28 AM »
http://sourceforge.net/tracker/?group_id=255677&atid=1126895 is the best address to flag this problem.

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: JWASM is updated.
« Reply #44 on: April 08, 2013, 01:48:31 AM »
I know,I have an interesing question when trying to "add new"
Quote
Error
Artifact: This ArtifactType Does Not Allow Anonymous Submissions. Please Login. .
How to login ?
Later : In the upper right corner in the page where is this message
Fa is a musical note to play with CL