Author Topic: HJWasm 2.28 Updated Release  (Read 4225 times)

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
HJWasm 2.28 Updated Release
« on: April 25, 2017, 07:08:12 AM »
Hi,

Git and packages on the site updated, dated 24th April.
Fixes and changes are:
1) Fixed SHR (As per Nidud's fix)
2) Fixed VARARG register overwrite warning (as found by Powershadow)
3) Added -less command line option to reduce verbosity of output to console.
4) Progressively flush the console output after each file is processed (as per JJ's request)

This is an interim update until the delphi/borland changes are totally in and that will be 2.29

Cheers,
John

Adamanteus

  • Member
  • **
  • Posts: 249
    • LLC "AMS"
Re: HJWasm 2.28 Updated Release
« Reply #1 on: April 26, 2017, 11:30:13 PM »
For whart in globals enum delphi_type, variosly mought be such :
Code: [Select]
enum fastcall_type {
    FCT_MSC,        /* MS 16-/32-bit fastcall (ax,dx,cx / ecx,edx) */
#if OWFC_SUPPORT
    FCT_WATCOMC,    /* OW register calling convention (eax, ebx, ecx, edx) */
#endif
#if AMD64_SUPPORT
    FCT_WIN64,      /* Win64 fastcall convention (rcx, rdx, r8, r9) */
#endif
    FCT_DELPHI       /* delphi fastcall convention (eax, edx, ecx ) */
};

And in ParseParams doubling line with proc->sym.langtype == LANG_DELPHICALL.

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: HJWasm 2.28 Updated Release
« Reply #2 on: April 27, 2017, 05:47:08 AM »
You are correct, it is unnecessary, however, it doesn't hurt. Will be removed for next release, we are still working on it.
Cod-Father

Adamanteus

  • Member
  • **
  • Posts: 249
    • LLC "AMS"
Re: HJWasm 2.28 Updated Release
« Reply #3 on: May 02, 2017, 10:56:54 PM »
Looks, that for correct handling sizes of register parameters :

invoke.c :

line 2103 :

      if ((asize > psize && opnd.kind != EXPR_REG) || (asize < psize && curr->sym.mem_type == MT_PTR)) {


Code: [Select]
test1 PROTO FASTCALL a : DWORD, b : WORD, d : BYTE

test2 PROC FASTCALL,
a : QWORD, b : WORD, d : BYTE
invoke test1, ADDR a, b, d
RET
test2 ENDP

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: HJWasm 2.28 Updated Release
« Reply #4 on: May 03, 2017, 12:43:03 AM »
That was really cryptic to say the least! :)

Can you describe what the issue is exactly?

Adamanteus

  • Member
  • **
  • Posts: 249
    • LLC "AMS"
Re: HJWasm 2.28 Updated Release
« Reply #5 on: May 03, 2017, 01:28:21 AM »
 Not assembling code in win32 mode - and where it possible fix (maybe not very accurate).

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: HJWasm 2.28 Updated Release
« Reply #6 on: May 03, 2017, 07:26:30 AM »
Looking into it now.

TWell

  • Member
  • ****
  • Posts: 743
Re: HJWasm 2.28 Updated Release
« Reply #7 on: May 08, 2017, 10:33:56 PM »
An idea to avoid UTF-8 BOM,
checkbom.c:
Code: [Select]
#include <stdio.h>

void CheckBOM(FILE *f)
{
unsigned long bom;
fread(&bom, 3, 1, f);
if ((bom & 0xFFFFFF) != 0xBFBBEF)
rewind(f);
}
and add
Code: [Select]
CheckBOM(CurrFile[ASM]); to assemble.c to lines 1334, 1660.
What other places need similar thing?

EDIT: a bad idea as literal strings are in utf-8 format and needs conversions.
« Last Edit: May 10, 2017, 10:02:40 AM by TWell »

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: HJWasm 2.28 Updated Release
« Reply #8 on: May 10, 2017, 06:08:32 AM »
Thanks TWell :biggrin:
Will check it as soon as we get some time :t
Cod-Father