News:

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

Main Menu

Advantages and Disadvantages of Using HJWasm

Started by habran, January 31, 2016, 03:43:58 PM

Previous topic - Next topic

habran

Cod-Father

jj2007

Quote from: habran on February 02, 2016, 10:44:50 PM
What is the point of having 25,000+ lines of highly optimised code if no one want to use it :icon_eek:
I wrote some highly optimised code on COMODORE64,
however, I don't think that it is now important, even though I enjoyed so much in writing it :eusa_boohoo:
I believe that you are probably an excellent programmer, however, you cling with your teeth on 32 bit, until you have the last tut left in your mouth :biggrin:

Hey, why are you trying to insult me? I am just showing you where HJWasm is still incompatible to ML. If you are not interested, let me know. And why the hell should I switch to 64 bits? Zero advantage, a thousand headaches.

Btw I don't really need HJWasm, for developing I am using AsmC because it's twice as fast, then I check the final version with ML 6.15 and ML 10.0. And I try to remain compatible with JWasm and HJWasm.

QuoteAll you know about shearing is how to spell it ;)

You probably meant sharing  :P

GoneFishing


johnsa

Quote from: jj2007 on February 02, 2016, 04:33:15 PM
Quote from: johnsa on February 02, 2016, 03:04:00 AMHave you checked opattr with a literal string and -Zg switch? I've tested that with hjwasm and ml and they seem to produce the same macro output via echo.

That's right, same output for the literal string. Not for the rest, though, and unfortunately it doesn't like this:

ife opattr SQWORD
   SQWORD equ QWORD   ; to make signed qwords available in MASM 6.15
endif


Same for SQWORD equ <QWORD> (both are OK for ML). Note that SQWORD is available in ML 8.0 but not earlier; meaning -Zg refers apparently to ML 6.15 (not 6.14, because then no MasmBasic code would assemble)

*** Assemble using hjwasm64 /c /coff -Zg /Fo "Opax" ***
HJWasm v2.13, Feb  1 2016, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

\masm32\MasmBasic\MasmBasic.inc(411) : Error A2209: Syntax error: equ QWORD
\masm32\MasmBasic\MasmBasic.inc(411): Included by
  Tmp_File.asm(1): Main line code
*** using MasmBasic version 01.02.2016 ***
UNKNOWN=0
0 is type 0 with size 4294967295
## "dword ptr [ebx]" in line 16 is a valid argument ##
Tmp_File.asm(17) : Error A2065: Constant expected
opax(1)[Tmp_File.asm]: Macro called from
  Tmp_File.asm(17): Main line code
## sorry, "-dword ptr [ebx]" in line 17 is NOT a valid argument ##
## sorry, ""HJWasm is a perfect MASM clone"" in line 18 is NOT a valid argument ##
## sorry, "HJWasm is a perfect MASM clone" in line 19 is NOT a valid argument ##
Tmp_File.asm: 20 lines, 1 passes, 172 ms, 0 warnings, 2 errors
*** Assembly Error ***


SQWORD being a reserved word cannot be redefined (hence the error). While this is not MASM 6.15 compatible it is MASM 8 compatible which exhibits exactly the same behaviour, the IFE will skip due to SQWORD being defined, and if you try to force the equ the assembly will error.

I've changed it to use switch -Zne instead of -Zg (seems more appropriate) and to work around the fact that i cannot (without immense effort) remove sqword as a reserved word based on a switch, i've specifically excluded SQWORD from the parser change to 0 when using -Zne , so SQWORD will still return 36 and the IFE block will bypass.

This means the source will assemble and be correct, but it's not ML 6.x compatible as that would opattr to 0 AND SQWORD wouldn't exist as a reserved word...

That said.. there is a limit to how much of this sort of "backwards" compatibility we can apply ..
I think the intention of JWASM being completely masm compatible was noble, but it seems a lot of things have never been 100% masm compatible.. I would hope to achieve 98% compatible :) and keep it at that.. especially for 32bit as I don't forsee any changes in that area.. it's not where things are moving.. My only concerns would be things which work in JWASM but no longer in HJWASM, those should rightly work as before without very good reason for changing.

I've uploaded these changes to the site and git. JJ give that a try and see if that allows your block to assemble now.

habran

JJ I was right, you know how to spell it :t I don't.
My intention was not to insult you, I wanted to shake you out of your buts, because I thought we are friends
Now I know that I was barking up to wrong tree.
I enjoy sharing because I am generous person.
I promise you I will not bother you any more 8)

>GoneFishing, I was expecting that they will include project for building 64 bit watcom, however I couldn't find it :(
Cod-Father

GoneFishing

HABRAN,
OW build system is so much sophisticated that no one simple mortal can build it  :biggrin:
I already have experience of compiling OW 1.9 on Linux but v2 is even more complicated .
All is based on makefiles of custom format .
On Linux one is supposed to specify if he wants to use GCC or OW toolchain to compile first binaries :
wmake and builder . After they are built , BUILDER utility does the rest of job :
Quotebuilder build
All this stuff is done in batch mode ...
Save your nerves - don't touch it , at least today ;)

habran

GoneFishing, you are correct, I will let you sweat, and see if you can solve the puzzle, I believe in you :t
Cod-Father

GoneFishing


TouEnMasm

Ok for the compile of simple.asm (win10 64 bits),stay incorrect instructions at run
No other problem (forget FRAME)

Fa is a musical note to play with CL

TouEnMasm

The dumpbin (sdk tool ) show the errors
dumpbin /DISASM simple.exe

VMPSADBW ymm1, ymm2,m256, 0ah

vpbroadcastb xmm1, xmm2 ;<<<<<<<<<<<<<<<<<<<<<< error here

0000000140001045: C4 E3 6D 42 0D B1  vmpsadbw    ymm1,ymm2,ymmword ptr [140019000h],0Ah
                    7F 01 00 0A
  000000014000104F: 62      ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  0000000140001050: F2 7D 08           bnd jge     000000014000105B
  0000000140001053: 78 CA              js          000000014000101F
Fa is a musical note to play with CL

johnsa

Quote from: ToutEnMasm on February 03, 2016, 02:16:03 AM
The dumpbin (sdk tool ) show the errors
dumpbin /DISASM simple.exe

VMPSADBW ymm1, ymm2,m256, 0ah

vpbroadcastb xmm1, xmm2 ;<<<<<<<<<<<<<<<<<<<<<< error here

0000000140001045: C4 E3 6D 42 0D B1  vmpsadbw    ymm1,ymm2,ymmword ptr [140019000h],0Ah
                    7F 01 00 0A
  000000014000104F: 62      ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  0000000140001050: F2 7D 08           bnd jge     000000014000105B
  0000000140001053: 78 CA              js          000000014000101F

I doubt dumpbin has any understanding of AVX512 as yet, the only thing which is going to give you realistic output would be OBJCONV.

Is simple.asm assembling ok and then generating error at runtime or are you getting an assemble time error?

TouEnMasm

I have the Windows sdk 10 and i use only his tools.
the dumpbin  give the same results than the windbg for 64 bits.
I have an "Illegal Instruction" at run AND dumpbin failed to disasm the instruction

wrong instructions
;----------- VMOVHPD xmm21, xmm1, [rcx]
; -------- vpbroadcastb xmm1, xmm2
  ; ----------------- VMOVHPD [rcx],xmm22
Fa is a musical note to play with CL

johnsa

xmm21 isn't a valid register under normal conditions...
that would only apply in AVX512 code where you now have 32 registers..

Habran: what about only enabling AVX512 extensions via a new option, which would also speed up the assembly time?

.mmx
.xmm
.zmm   ;<-- we add this one?

vpbroadcastb xmm1, xmm2 SHOULD work.. but it's not encoding correctly, have logged as a bug.

habran

Cod-Father

GoneFishing

HABRAN,
I've compiled OW v2 . All targets were built which took > 3 Gb of my disk space
Standard lib modules were not merged  , I'll do it tomorrow
Quote./bwcc386  -?
Open Watcom C x86 32-bit Optimizing Compiler
Version 2.0 beta Feb  2 2016 19:43:57 (64-bit)
Copyright (c) 2002-2016 The Open Watcom Contributors. All Rights Reserved.
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.

I noticed that there're no 64 bit targets in LIBC folder. This makes me suspect that I was right about 32-bit nature of v2 .

Precompiled binaries can be found here