Author Topic: HJWASM 2.17 bugs  (Read 5935 times)

mabdelouahab

  • Member
  • ***
  • Posts: 343
Re: HJWASM 2.17 bugs
« Reply #45 on: January 08, 2017, 05:42:41 AM »
I don't know how to setup Radasm2 for HJWasm, I am using Visual Studio Community 2013 to build my programs.
You can PM Johnsa, to give you some tips how to setup Radasm2 for HJWasm.
RadAsm2->File->New Project-> ...
then
Menu:Project->Project Options->go to Assemble ; replace ML.exe With HJWasm64.exe or HJWasm.exe

ragdog

  • Member
  • ****
  • Posts: 525
Re: HJWASM 2.17 bugs
« Reply #46 on: January 08, 2017, 06:53:05 AM »
@mabdelouahab

This is not my problems to change the compiler settings.

I have only ask fo this cryptic string but all is ok und solved Thank you all.

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
GitHub viewer for HJWASM
« Reply #47 on: January 15, 2017, 12:53:10 PM »
Just for fun - I am playing around with downloading. This is a simple GUI executable that allows to see the GitHub sources in an edit window. Here is the full source:

include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl MyRich, "richedit", x200, w800
  GuiControl MyListbox, "listbox", w200
  SetGlobals cursel, f$, ct, http$="https://raw.githubusercontent.com/Terraspace/HJWasm/master/"
  SetGlobals
  Dim t$()
  Dim url$()
  Let t$(0)="Select a file"
  StringToArray 99, gh$()  ; the table of contents is embedded as resource #99
  For_ ecx=0 To eax-1
      .if Instr_(gh$(ecx), '<td class="content">')
            mov esi, gh$(ecx+1)
            inc ct
            Let url$(ct)=http$+Extract$(esi, '/master/', '"')
            Let t$(ct)=Extract$(esi, 'title="', '"')
      .endif
  Next

  SetListbox t$()      ; fill the listbox
Event Command
  .if NotifyCode==LBN_SELCHANGE && LbSel>0      ; if user selects a file from the list...
      Let f$=FileRead$(url$(LbSel))      ; ... get its content and display it
      SetWin$ hMyRich=f$
      SetWin$ hWnd="GitHub - "+url$(LbSel)
  .endif
GuiEnd

johnsa

  • Member
  • ****
  • Posts: 589
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #48 on: January 20, 2017, 08:16:51 AM »
Hey all,

After my extended vacation ;) I am finally back and after some more testing 2.18 is up on the site and github.

Cheers
John

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Re: HJWASM 2.17 bugs
« Reply #49 on: January 20, 2017, 08:44:27 AM »
Hi John,
Tested with my big sources, everything fine :t

powershadow

  • Regular Member
  • *
  • Posts: 20
Re: HJWASM 2.17 bugs
« Reply #50 on: January 21, 2017, 02:01:46 AM »
Bug#4 still present. /Zd parameter not generating line number debug information for unknown reason.

johnsa

  • Member
  • ****
  • Posts: 589
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #51 on: January 21, 2017, 02:56:38 AM »
Are the others sorted?

Also, is the /Zd problem you are having when assembling a 32bit application?
Also which hjwasm version do you use hjwasm32 or hjwasm64 ? (Have you tried both to see if there is a difference?)

powershadow

  • Regular Member
  • *
  • Posts: 20
Re: HJWASM 2.17 bugs
« Reply #52 on: January 21, 2017, 03:23:57 AM »
I just check bug1 - fixed. bug4 - not fixed. bug2 & bug3 - not checked.
I use hjwasm32 to assembling 32bit application.
I admit, that it depends on source. If i comment some parts then obj file generated with "line numbers". But i can't identify exact dependence.

johnsa

  • Member
  • ****
  • Posts: 589
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #53 on: January 21, 2017, 04:19:00 AM »
That's quite odd, I'll investigate it.

Let me know if 2 and 3 are right when you get a chance.

Cheers
John

powershadow

  • Regular Member
  • *
  • Posts: 20
Re: HJWASM 2.17 bugs
« Reply #54 on: January 23, 2017, 09:09:36 AM »
Hi johnsa.
I spent some time to investigate Bug#4 and found something strange to me:

linenum.c:
Code: [Select]
static void AddLinnumData( struct line_num_info *data )
...
    data->next = NULL;
    if ( q->head == NULL)
        q->head = q->tail = data;
    else {
      if (ModuleInfo.Ofssize == USE32) {
        if ((q->tail && ((uint_32)q->tail < 0x00FFFFFF))) {  // what this check do ??? why 0x00FFFFFF? (i don't understand).
          ((struct line_num_info *)q->tail)->next = data;
          q->tail = data;
          }
        }
I removed this and other similarly checks. Actually i restored linnum.c like in version 2.13 and bug4 is gone!

johnsa

  • Member
  • ****
  • Posts: 589
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #55 on: January 23, 2017, 08:27:01 PM »
Looking into it :)

powershadow

  • Regular Member
  • *
  • Posts: 20
Re: HJWASM 2.17 bugs
« Reply #56 on: January 26, 2017, 10:23:46 PM »
Hi johnsa, some new bugs :biggrin:

Bug#5: Structures corruption while writing symbolic debug info (/Fs)

Code: [Select]
void WriteSymbols()
{
...
ld = fopen(pName, "w");
So each linefeed is replaced with a carriage-return – linefeed pair, after that all structures corrupted.

Fix:
Code: [Select]
void WriteSymbols()
{
...
ld = fopen(pName, "wb");
Also need to check all othesrs functions with fopen (name,"w").

Bug#6 Skipped first procedure while writing symbolic debug info (/Fs)
First procedure has sym->offset==0, so it skipped by this code:
Code: [Select]
void WriteSymbols()
{
...
if ((sym->state == SYM_INTERNAL && sym->offset==0) || sym->state == SYM_MACRO || sym->state == SYM_TMACRO || sym->state == SYM_GRP) continue;

Bug#4,Bug#5,Bug#6- also present in HJWASM 2.18.

johnsa

  • Member
  • ****
  • Posts: 589
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #57 on: January 27, 2017, 10:03:52 AM »
1,2,3,5 and 6 are fixed now and will be in 2.19 (along with some other encoding of mmx and avx512 fixes found by other users).

A question about 4, is this happening when you use the binary (released) packages or when you compile hjwasm from source ?

powershadow

  • Regular Member
  • *
  • Posts: 20
Re: HJWASM 2.17 bugs
« Reply #58 on: January 27, 2017, 09:21:17 PM »
A question about 4, is this happening when you use the binary (released) packages or when you compile hjwasm from source ?
Both.
I already found mistake.
if ((q->tail && ((uint_32)q->tail < 0x00FFFFFF)))  Why you think that allocated memory address must be less then 0x00FFFFFF ??? This is wrong.

johnsa

  • Member
  • ****
  • Posts: 589
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #59 on: January 27, 2017, 10:28:46 PM »
Habran added that to solve an issue when adding switch with line number generation.
I'll leave him to explain it :)

If he can ensure that switch works without that code in then we can make that change, as it does seem strange to me.