News:

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

Main Menu

Resource compiler for console applications

Started by nidud, October 24, 2012, 12:59:39 AM

Previous topic - Next topic

nidud

#15
deleted

jj2007

You are right that Masm's behaviour is "wrong", but where to draw the line? JWasm's strong points are full Masm32 compatibility plus more speed and macros for Win64. Adding features is risky with regard to the userbase.

OTOH, checking if a multiline macro is called after an .elseif seems not too difficult. A warning would really be helpful. Who needs it can use -WX aka "Treat all warnings as errors" ;-)

> I tried to follow the download link, but the page seems to be missing or blocked.
Not blocked for me, I just clicked the link in your message.

nidud

#17
deleted

jj2007

> You have to do it without breaking this compatibility: labelling it as a bug
You know that some software depends on bugs functioning properly  :icon_mrgreen:

I thought you meant the SourceFourge link...

MB is online at http://masm32.com/board/index.php?topic=94.0 and active: MasmBasic014Oct12.zip (362.15 kB - downloaded 23 times.)

So who could block a Masm page? AV? Provider? But then, you obviously can post here. I hope the crappy AV brigade has not blocked MasmBasic specifically... :(

nidud

#19
deleted

jj2007

Quote from: nidud on October 25, 2012, 03:13:09 AM
I compiled the sample, it produced a 3 447 641 byte .lst file

Which sample?

I just noticed that the "Simple window" template produces 380k of listing when putting .listall under the include line; however, when assembly option /Fl is specified, it jumps indeed to over 3MB. My testbed arrives at over 10MB of listing with /Fl set. Not exactly MasmBasic's fault, however: A simple MsgBox with masm32rt.inc only also produces 8MB with .listall before the include line...

nidud

#21
deleted

dedndave

if you use /Fl, you may also want to use .XCREF in the source - it makes a big difference   :biggrin:
of course, it also helps to use .NOLIST and .LIST around the includes

japheth

Quote from: jj2007 on October 25, 2012, 12:21:22 AM
OTOH, checking if a multiline macro is called after an .elseif seems not too difficult.

That's indeed very good news! Since it is obviously a child's play, could you please tell me how to do it? With detailed source code, if you don't mind!

jj2007

#24
Quote from: japheth on October 25, 2012, 07:56:06 PM
Quote from: jj2007 on October 25, 2012, 12:21:22 AM
OTOH, checking if a multiline macro is called after an .elseif seems not too difficult.

That's indeed very good news! Since it is obviously a child's play, could you please tell me how to do it? With detailed source code, if you don't mind!

It's not child's play, of course, but IMHO a pretty basic exercise (sorry, can't help you with C code....):

include \masm32\MasmBasic\MasmBasic.inc   ; download
.data
MacTable   dd m1, m2, 0   ; see CreateMacTable
m1   dd 100   ; line count of macro
   db "Instr_", 0
m2   dd 1
   db "Instr1", 0

   SetGlobals posL, mac$
   Init
   SetGlobals
   Recall "TestElseIfDummyCode.asm", L$()
   ; call CreateMacTable      ; JWasm certainly has something like this, right?
   For_ ct=0 To eax-1
      mov edi, L$(ct)
      .if Instr_(edi, ".elseif", 1)
         add edx, 7
         mov posL, edx
         .if Instr_(edx, edi, "(")
            sub edx, posL
            Let mac$=Trim$(Mid$(edi, posL, edx))
            mov esi, offset MacTable
            .While 1
               lodsd
               .Break .if !eax
               mov ecx, [eax]
               add eax, DWORD
               .if !StringsDiffer(eax, mac$)
                  .if ecx>1
                     PrintLine "WARNING: ", mac$, " should not be used after .elseif!!"
                  .else
                     PrintLine "Congrats, using ", mac$, " is OK"
                  .endif
               .endif
            .Endw
         .endif
      .endif
   Next

   Inkey "ok"
   Exit
end start

TestElseIf.asm:

include \masm32\MasmBasic\MasmBasic.inc   ; download

Instr1 MACRO spos, src, match   ; a one-liner
  EXITM <ecx==12345678h>
ENDM
  Init
  mov ecx, 12345678h
  Let esi="This is a stupid test"
  .if Instr_(esi, "stuupid")
   PrintLine "stuupid found"
  .elseif Instr_(esi, "test")   ; useless, will expand before the jump label
   PrintLine "test found"
  .elseif Instr1(esi, "test")   ; will expand at the jump label
   PrintLine "Instr1 found it: ", Hex$(ecx)
  .endif
  Inkey CrLf$, "Found something??", CrLf$
  Exit
end start

nidud

#25
deleted

nidud

#26
deleted

nidud

#27
deleted

MichaelW

Well Microsoft, here's another nice mess you've gotten us into.

nidud

#29
deleted