News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

JWASM is updated.

Started by Ficy, June 25, 2012, 02:14:38 AM

Previous topic - Next topic

TouEnMasm


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

TouEnMasm


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

TouEnMasm

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

QuoteThis 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

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

Hi Jochen,

Quote from: jj2007 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 ;-)

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

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

ragdog

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

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


export {
   Test1='Test1'
   Test2='Test2'
}


Or can i use a .def like Masm?



LIBRARY source.dll
EXPORTS
   Test1
   Test2


japheth

Quote from: ragdog on October 30, 2012, 08:53:56 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

Thanks but i have not found about def files

japheth

Quote from: ragdog on October 30, 2012, 11:18:29 PM
Thanks but i have not found about def files


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


TouEnMasm

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

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

http://sourceforge.net/tracker/?group_id=255677&atid=1126895 is the best address to flag this problem.

TouEnMasm

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