JWasm version v2.0 now really beta

Started by japheth, August 26, 2009, 04:46:35 PM

Previous topic - Next topic

jj2007

Minor problem: Sometimes an empty echo repeats the previous text:

Quoteecho This line should appear only once
echo

Output:
QuoteThis line should appear only once
This line should appear only once

Even a blank after the empty echo solves this "microbug".

jj2007

Here is a slightlly bigger problem (assembles fine under ml).
Quote
include \masm32\include\masm32rt.inc

Dim MACRO NewMac:REQ   ;; with ideas from Greg Falen
LOCAL isL, isR, MacName$
  isL INSTR <NewMac>, <(>
  isR INSTR <NewMac>, <)>
  if isL
   MacName$ SUBSTR <NewMac>, 1, isL-1
   MacName$ macro arrayElement
      invoke MessageBox, 0, str$(arrayElement), chr$("You asked for element:"), MB_YESNO
      EXITM <eax>
   endm
  endif
ENDM

Problem MACRO arg
LOCAL tmp$, oa, is
  is INSTR <arg>, <=>
  dest SUBSTR <arg>, 1, is-1
  src SUBSTR <arg>, is+1
  oa = opattr(dest)   AND 127
  tmp$ CATSTR <Dest=>, dest, <, source=>, src, <, opat=>, %oa
  % echo tmp$
  ifdifi dest, <eax>
     tmp$ CATSTR <chr$(">, dest, <")>
   invoke MessageBox, 0, tmp$, chr$("Undefined array:"), MB_YESNO
   tmp$ CATSTR <Dim >, dest
   % echo tmp$
   tmp$
  endif
ENDM

.code
start:
   Problem Arr1$(44)="aaa"
   Dim Arr1$(100)
   Dim Arr2$(100)
   Problem Arr2$(55)="bbb"
   invoke ExitProcess, 0

end start

Output:
Tmp_File.asm(40) : Error A2072: Constant operand is expected
Problem(5)[Tmp_File.asm]: Macro called from
  Tmp_File.asm(1852140901): Main line code

GregL

QuoteAnd how can you make some syntax highlighting in VS ?? Roll Eyes BigGrin

There is always the usertype.dat file.  MASM Syntax Highlighting (Kip Irvine).



japheth,

The symbolic debugging info is a nice improvement and so is the 64-bit support. :thumbu


japheth

Hi,

> echo This line should appear only once
> echo

fixed.

> Problem Arr1$(44)="aaa"
> Dim Arr1$(100)

The line which causes the problems is your beloved OPATTR:

>  oa = opattr(dest)   AND 127

One issue is that JWasm deliberately behaves slightly differently because it's rather easy to write wrong code with OPATTR - Masm almost never complains. You probably did want to write:

>  oa = (opattr(dest))  AND 127

This code is ok. However, there was another issue - OPATTR combined with the '(' operator - which had to be fixed before JWasm accepted your precious macros.

> The symbolic debugging info is a nice improvement and so is the 64-bit support. ThumbsUp

Thanks! Usable Win64 include files in Masm syntax are still missing, however. I adjusted Win32Inc to work with 64-bit, but since I don't own a 64-bit Windows. it will have to be tested by someone else.

http://www.japheth.de/Win32Inc/Download/Win32Inc200.zip



jj2007

Quote from: japheth on September 17, 2009, 12:59:22 PM
The line which causes the problems is your beloved OPATTR:

>  oa = opattr(dest)   AND 127

One issue is that JWasm deliberately behaves slightly differently because it's rather easy to write wrong code with OPATTR - Masm almost never complains. You probably did want to write:

>  oa = (opattr(dest))  AND 127

This code is ok. However, there was another issue - OPATTR combined with the '(' operator - which had to be fixed before JWasm accepted your precious macros.


Thanks a lot, Japheth - it works like a charm now.
I had tried double brackets, too. The double brackets issue is counter-intuitive - imho it might be worth a more explicit error message à la "Error XX: You probably meant (opattr(dest))  AND 127

Jimg

There's a new version out today (10/10/09).  Fixed several things.

In my torture test, I found it fails with this code-

.586
.model flat, stdcall
option casemap:none ; case sensitive

include 1394bus.inc
includelib 1394bus.lib

.code
Program:
ret
End Program

with this error:

Tests.Asm(6) : Error A2193: General Failure



japheth


> Tests.Asm(6) : Error A2193: General Failure

Nice find!

fixed.



japheth


Jimg

The following works in masm but not in jwasm-
.686
.model Flat, Stdcall
option Casemap :None
.code
tst22 proc
ret
tst22 endp
program:
    baseroutine = tst22
    invoke tst22        ; this works
    invoke baseroutine  ; gives Error! E232: INVOKE requires prototype for procedure
    ret
end program


Is this on the to do list for the next version, or do you consider this a bug in masm that shouldn't work and won't be changed?

japheth

Quote from: Jimg on October 12, 2009, 04:01:21 PM
The following works in masm but not in jwasm-

...


Is this on the to do list for the next version, or do you consider this a bug in masm that shouldn't work and won't be changed?

Yes  :toothy

Seriously, it's on the todo list ( requires a change of the SYM_PROC handling, see 1. in Doc/fixes.txt ).

However, I'll take a break from JWasm development now.


Alloy

#25
Thanks japheth for bringing us a free assembler that can emit source level codeview debug info.
We all used to be something else. Nature has always recycled.

@lx

Hi japeth,
i have a strange bug when running jwasm with the jwasm.rules under VisualStudio 2008. When there are compiler errors, the output is not redirected to the stdout but to a file.err, and VS doesn't know that jwasm failed. Is there someone else having the same problem? I wish i could fully switch to jwasm!

[Edit]who, i just saw that you are taking a break from JWasm, ok, no problem, this is not urgent. With the source, i guess i'm able to patch jwasm!  :wink[/Edit]


Quote from: Ficko on September 08, 2009, 08:59:32 PM
And how can you make some syntax highlighting in VS ?? ::) :bg

hi Ficko, i have developed a x86 ASM syntax highlighter plugin called AsmHighlighter for VS 2008 that may help you (plugins are unfortunately not working for express version).




jj2007

Quote from: @lx on October 29, 2009, 08:58:29 PM
When there are compiler errors,

... and it seems not to return the error code that a DOS batch file expects. Not a big problem, though.

Kyle

Quote from: @lx on October 29, 2009, 08:58:29 PM
Hi japeth,
i have a strange bug when running jwasm with the jwasm.rules under VisualStudio 2008. When there are compiler errors, the output is not redirected to the stdout but to a file.err, and VS doesn't know that jwasm failed. Is there someone else having the same problem? I wish i could fully switch to jwasm!

[Edit]who, i just saw that you are taking a break from JWasm, ok, no problem, this is not urgent. With the source, i guess i'm able to patch jwasm!  :wink[/Edit]


Quote from: Ficko on September 08, 2009, 08:59:32 PM
And how can you make some syntax highlighting in VS ?? ::) :bg

hi Ficko, i have developed a x86 ASM syntax highlighter plugin called AsmHighlighter for VS 2008 that may help you (plugins are unfortunately not working for express version).





Wow this is an awesome tool. Props for making it! I've already installed it and I'm passing the link around to friends. You have an awesome project and I hope you get quite a bit of traffic on your site for it.

japheth

Quote from: @lx on October 29, 2009, 08:58:29 PM
i have a strange bug when running jwasm with the jwasm.rules under VisualStudio 2008. When there are compiler errors, the output is not redirected to the stdout but to a file.err, and VS doesn't know that jwasm failed. Is there someone else having the same problem? I wish i could fully switch to jwasm!

jwasm writes errors to <file>.ERR, but it additionally writes the errors to stdout. So I don't think this is the problem. You'll have to supply a test case, but please test first that it works with Masm and fails with JWasm!

Quote
You have an awesome project and I hope you get quite a bit of traffic on your site for it.

Thanks! However, JWasm was written mainly for myself and the - few - people who love assembly in Masm-syntax. JWasm isn't sold, and there are no ads on my site, so increasing JWasm-related traffic is not a goal. Also, please don't advertise JWasm to assembly noobies. The last thing I want to do is answering dump noobish questions like "How do I install JWasm? There's no setup.exe!" on SourceForge.


japheth