The MASM Forum

Projects => Rarely Used Projects => Archival JWASM postings => Topic started by: habran on December 14, 2014, 08:57:28 PM

Title: JWasm12_AVX2_RIP Source
Post by: habran on December 14, 2014, 08:57:28 PM
Here are sources with Visual Studio Community 2013 Project

If you have Windows 8.1 and you get error "General Failure" than change in main.c, line 72:
long    fh; to intptr_t    fh;
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 14, 2014, 08:59:40 PM
Here are headers
decompress it and drop it in JWasm12_AVX2_RIP folder

This build will work on Windows 8.1 as well as on Windows 7

Edited by habran 15/01/14:
Small bugfix in header instravx.h line 113
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 15, 2014, 06:13:25 AM
Hi Habran,

is there a chance to compile it with other compilers, too?

Gunther
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 15, 2014, 07:03:30 AM
Certainly, you can use gcc
if you want, you can build it with Code::Blocks, just import VC project and build
or decompress this Code::Blocks project and drop it in the folder next to JWasm.vcxproj
and than just double click on it
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 15, 2014, 07:39:03 AM
Thank you Habran. I'll try it.

Gunther
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on December 16, 2014, 01:30:55 AM
 As need for speed underground - my build - without installer with docs and licenses, seh, unicode support ...
Build not himself itself, so full compatibility with MASM as I said before not reached, but excellent as prog, so I was glad that build it ... and as I'm without site now - will put it here, as before was good comments about :icon14:

P.S. Attachment deleted
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 16, 2014, 06:47:38 AM
Hi Adamanteus
Your build is trowing an error:
fatal error LNK1223: invalid or corrupt file: file contains invalid .pdata contributions
It is bloated to 688 KB
My build is 464 KB
It looks like you have built debug version
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 16, 2014, 07:05:47 AM
Here are my builds:
Title: Re: JWasm12_AVX2_RIP Source
Post by: jj2007 on December 16, 2014, 09:51:28 AM
Quote from: habran on December 16, 2014, 07:05:47 AM
Here are my builds:

The 32-bit version builds RichMasm (>16,000 lines) in less than 900ms on my i5, about 10% faster than the original JWasm :t
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 16, 2014, 10:30:52 AM
Hey jj2007 :biggrin:
I am glad to hear that and thank you for testing :t
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on December 17, 2014, 10:40:33 AM
Quote from: habran on December 16, 2014, 06:47:38 AM
Hi Adamanteus
Your build is trowing an error:
fatal error LNK1223: invalid or corrupt file: file contains invalid .pdata contributions
It is bloated to 688 KB
My build is 464 KB
It looks like you have built debug version

Throwing messages displays my startup code, by console output - so in IDE, that's not seen (possible to be seen, but I don't know how to determine build under IDE). So, variously you not seen the message and linked file, without correct .pdata - try to build you project under console, that will allow to see assembler abnormal termination message and check it exit code.
Build full release - bloated by 3 icons, but that what is  :P
P.S.
That to clear question with startup code, will say that it is simple trick with main in sehhelper.cpp, more detailed explanation of algos could be found here (http://www.codeproject.com/Tips/721807/SEH-vs-Cplusplus-exceptions), so in main.c defines show /Dmain=cmain and call cmain(argc, argv) in try block, so you'll be have from C - C++ program processing exceptions, with system SEH interrupts.
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 17, 2014, 02:47:56 PM
I am happy with my builds and I don't work with 32 bits anyway 8)
If 44 people who downloaded your build are happy with your builds I am happy too :biggrin:
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on December 17, 2014, 07:38:45 PM
So good - we are glad and happy (Happy new year - to everybody also  :t) - but you remark, about debug version is really actual - because, plain releases I make in full stdcall conventions (Alpha version - to everybody also  :icon_confused:)
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 17, 2014, 08:56:38 PM
I am not certain that I understand what you are actually saing :dazzled:
Can you please explain what are you talking about :P
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 17, 2014, 09:59:33 PM
Hi Habran,

Quote from: habran on December 17, 2014, 02:47:56 PM
I am happy with my builds and I don't work with 32 bits anyway 8)

jWasm is designed for a lot of different operating systems and the 32-bit versions are important, too. Also jWasm for DOS.

Gunther

Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 17, 2014, 10:36:54 PM
Hey Gunther :biggrin:
You are perfectly right in what you said, that's why I uploaded sources and also build 32-bit and 64-bit binaries
Source is there for those who want to build other versions 8)
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on December 17, 2014, 10:55:02 PM
Quote from: habran on December 17, 2014, 08:56:38 PM
I am not certain that I understand what you are actually saing :dazzled:
Can you please explain what are you talking about :P
This is simple in MSVC : in project options - C/C++ - Additional - Calling conventions - choose __stdcall /Gz or __fastcall /Gr, so program code will be more fast and compact. As __cdecl /Gd - allowing only to pass variable quantity of arguments, and occupies for this more size and execution time.
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 18, 2014, 05:49:15 AM
Did you try to do that?
In 64-bit there is no problem to do that but not necessary because fastcall is the only possible convention
If I try to build 32-bit it trows errors:
error C2440: 'function' : cannot convert from 'int (__stdcall *)(const void *,const void *)' to 'int (__cdecl *)(const void *,const void *)'
and there are plenty of __cdecl functions inside JWasm
I am not going to mess up JWasm with changing all of them to __stdcall
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 19, 2014, 02:47:44 AM
Quote from: habran on December 18, 2014, 05:49:15 AM
I am not going to mess up JWasm with changing all of them to __stdcall

Of course, it's better not to touch this.

Gunther
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on December 19, 2014, 02:19:49 PM
Quote from: habran on December 18, 2014, 05:49:15 AM
Did you try to do that?
In 64-bit there is no problem to do that but not necessary because fastcall is the only possible convention
If I try to build 32-bit it trows errors:
error C2440: 'function' : cannot convert from 'int (__stdcall *)(const void *,const void *)' to 'int (__cdecl *)(const void *,const void *)'
and there are plenty of __cdecl functions inside JWasm
I am not going to mess up JWasm with changing all of them to __stdcall
That's I suppose for strings compare type - it is need to define as pointer to runtime functions, as memcmp and memcmpi is from it.
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 19, 2014, 09:16:47 PM
Hey Adamanteus, my intention is to improve JWasm not to spoil it ;)
However, JWasm is an open source, so you can create your fork and.....
Thanks Gunther for understanding:t
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 20, 2014, 12:19:40 AM
Hi Habran,

Quote from: habran on December 19, 2014, 09:16:47 PM
Thanks Gunther for understanding:t

no question. We don't know exactly what's with Andreas. It could be that he's back some day. If not, we'll talk about this questions again.

Gunther
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 21, 2014, 02:01:02 PM
Hi Gunther :biggrin:
Till now I have done so many changes to JWasm that it si not the same tool as original
I will be forced to create new fork for my version
I will call it XWasm and I will translate also to 64-bit ASM 8)
I am thinking of leaving 32-bit in C as it is
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 22, 2014, 12:42:59 AM
Hi Habran,

that's a good plan. In the next days I'll take a look into the sources.

Gunther
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 22, 2014, 09:21:47 PM
ToutEnMasm, thank you for finding the error in JWasm main  :t
It doesn't affect Windows 7 or former windows but the Windows 8
I have bought a new laptop (Toshiba Qosmio with pre-installed Windows 8.1 ) and encountered the same problem as you:
"General Failure"
So, I looked the changes you have suggested. It worked with them.
After a little bit  of experimenting I found out that the Windows 8.1 doesn't like long fh; 
when I changed it to intptr_t fh; it worked with no problem (intptr_t is __int64)

Therefore, there is no need to change anything else in main function except that

Here are the 64-bit binaries
Title: Re: JWasm12_AVX2_RIP Source
Post by: GoneFishing on December 26, 2014, 09:03:09 PM
Quote from: Gunther on December 17, 2014, 09:59:33 PM
Hi Habran,

Quote from: habran on December 17, 2014, 02:47:56 PM
I am happy with my builds and I don't work with 32 bits anyway 8)

jWasm is designed for a lot of different operating systems and the 32-bit versions are important, too. Also jWasm for DOS.

Gunther

That's right, Gunther
JWASM still awaits implementing FASTCALL for elf64 ouptut file format.
Maybe anyone here ... there or anywhere  can do it
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 27, 2014, 02:01:09 AM
Hi Habran,

Quote from: habran on December 17, 2014, 02:47:56 PM
JWASM still awaits implementing FASTCALL for elf64 ouptut file format.
Maybe anyone here ... there or anywhere  can do it

that's not so easy, because Linux and BSD are using another ABI, which you could find here (http://www.x86-64.org/documentation/abi.pdf). Therefore they are other parameter passing schemes and a lot of other differences. It is very hard, if not impossible, to write common code for both worlds.

Gunther
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 27, 2014, 06:14:35 AM
At this moment I am to busy even to think of that ::)
You Gunther are already familiar with it, maybe you can roll your sleeves and make your hands dirty :lol:
Title: Re: JWasm12_AVX2_RIP Source
Post by: Gunther on December 27, 2014, 09:17:55 AM
Quote from: habran on December 27, 2014, 06:14:35 AM
At this moment I am to busy even to think of that ::)
You Gunther are already familiar with it, maybe you can roll your sleeves and make your hands dirty :lol:

I'll try that at the end of January. I've vacation that time.

Gunther
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on December 28, 2014, 07:01:07 AM
Take your time :biggrin:
Title: Re: JWasm12_AVX2_RIP Source
Post by: GoneFishing on January 08, 2015, 03:12:45 AM
Quote from: Gunther on December 27, 2014, 09:17:55 AM
...
I'll try that at the end of January. I've vacation that time.
...

Hi Gunther,
Today I've noticed  one JWASM anomaly or maybe better name it SINGULARITY .
Let me explain it:
Acorrding to paragraph  3.2 FASTCALL Register Calling Convention  of JWASM manual :
QuoteIn 64-bit mode, FASTCALL means the standard Windows 64 ABI if output format is not ELF.For -elf64, there is no FASTCALL support implemented yet.
I wrote a simple test app (see the attachment ) in such a way  as if JWASM already had FASTCALL support and guess what ... it worked !!!
Let's go back to manual and read:
QuoteTo make FASTCALL the default calling convention, there are 3 ways:

    Commandline options -Gr ( or -win64 )
    Second argument of the .MODEL directive: .MODEL FLAT, FASTCALL
    Directive OPTION LANGUAGE: FASTCALL
Now let's try to set calling convention to FASTCALL in all 3 ways and see what results we will get:
Quote

  • -Gr  -> testFC.asm : Error A2168: General Failure
  •  .MODEL FLAT, FASTCALL -> test1.asm(9) : Warning A4095: Multiple .MODEL directives, .MODEL ignored
                                                test1.asm : Error A2168: General Failure
  • OPTION LANGUAGE: FASTCALL -> test1.asm : Error A2168: General Failure
Thus, JWASM doesn't allow us to specify FASTCALL for elf64  , then,  why does it work  ?

--- NOTE: testFC was compiled with JWasm v2.11 and tested on Ubuntu 14.4 64 bit ---
The output should be something like this:
Quote
--------- INFO ---------

User-level applications use as integer registers for passing the sequence:
rdi, rsi, rdx, rcx, r8 and r9.

--------- TEST ---------

RDI=0x215bd000, RSI=12345, RDX=67890, RCX=54321, R8=9876, R9=12345

--------- END ----------
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on January 15, 2015, 10:09:17 PM
Uploaded new sources with two small fixes in C files and one fix in headers
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on January 23, 2015, 10:21:10 AM
 As need for speed underground - my build - with installer with docs and licenses, seh, unicode support ... looks well (and maybe need num to ext for unpack).
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on January 23, 2015, 10:22:37 AM
 As need for speed underground - my build - with installer with docs and licenses, seh, unicode support ... fake attachment size
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on January 23, 2015, 10:26:26 AM
 As need for speed underground - my build - with installer with docs and licenses, seh, unicode support ... and last fake attachment size
Title: Re: JWasm12_AVX2_RIP Source
Post by: habran on January 23, 2015, 10:06:15 PM
Hi Adamanteus
Windows 8.1 is unable to read your compressed folders :icon_exclaim:
Title: Re: JWasm12_AVX2_RIP Source
Post by: Adamanteus on January 24, 2015, 12:49:37 AM
 If to move numbers in archives filenames to extensions (as JWasm.zip.00x) - my unzipping easy.
P.S. That's maybe admins will change forum settings for attachments, that to upload as one archive.