Author Topic: HJWASM 2.17 bugs  (Read 15528 times)

jj2007

  • Member
  • *****
  • Posts: 10091
  • Assembler is fun ;-)
    • MasmBasic
Re: HJWASM 2.17 bugs
« Reply #60 on: January 28, 2017, 01:17:42 AM »
A propos .Switch:

\Masm32\ObjAsm32\Code\Macros\System.inc
Code: [Select]
.switch macro Variable:req, CasReg:=<eax>
    mov    CasReg, Variable

    ??CasStk CatStr <CasReg>, <#>, ??CasFlg, <#>, ??CasStk
    ??CasVar    equ    CasReg
    ??CasFlg    equ    <0>                              ;;0 = emit an .if, 1 an .elseif
endm

That one chokes, of course... not the fault of HJWasm but friends of ObjAsm32 might not like this behaviour.

habran

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: HJWASM 2.17 bugs
« Reply #61 on: January 28, 2017, 08:59:28 AM »
I have added that code because I was having "address to large" error for some unknown reason while running .SWITCH-.CASE
I have changed it to the previous code and tested with .SWITCH-.CASE and surprisingly enough it works fine.
We will upload a new version with these changes and see if it will run properly.
Cod-Father

johnsa

  • Member
  • ****
  • Posts: 799
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #62 on: February 04, 2017, 08:08:44 PM »
Hey all, 2.19 is up which should include all the fixes.

Cheers
John

jj2007

  • Member
  • *****
  • Posts: 10091
  • Assembler is fun ;-)
    • MasmBasic
Re: HJWASM 2.17 bugs
« Reply #63 on: February 04, 2017, 08:38:43 PM »
2.19 works fine with my fat sources, thanks a lot to both of you :t

habran

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: HJWASM 2.17 bugs
« Reply #64 on: February 05, 2017, 05:57:55 AM »
It is our curse to make you happy :biggrin:
Cod-Father

johnsa

  • Member
  • ****
  • Posts: 799
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #65 on: February 05, 2017, 09:49:14 AM »
Hahah.. but remember in so doing we also make ourselves happy!  :eusa_dance:

jj2007

  • Member
  • *****
  • Posts: 10091
  • Assembler is fun ;-)
    • MasmBasic
Re: HJWASM 2.17 bugs
« Reply #66 on: February 05, 2017, 09:59:46 AM »
My "thank you" is generic - MasmBasic works fine with ML 6.15 and higher, so my baby does not depend on your work. But I believe in competition, and I find that Micros**t needs competitors. You are doing a great service to the whole community :t

habran

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: HJWASM 2.17 bugs
« Reply #67 on: February 05, 2017, 12:00:04 PM »
Johnsa, you are correct 8)
JJ, Nun says:"Better safe then sorry" and put a condom on a cucamber :biggrin:
Cod-Father

powershadow

  • Regular Member
  • *
  • Posts: 20
Re: HJWASM 2.17 bugs
« Reply #68 on: March 03, 2017, 07:16:53 PM »
Simple code:
Code: [Select]
0000002C                        mov [eax],11h ;Warning A4073: Size not specified, assuming: BYTE
0000002F                        mov [eax],1111h ;Warning A4073: Size not specified, assuming: WORD
00000034                        mov [eax],111111h ;Warning A4073: Size not specified, assuming: DWORD
0000003A                        mov [eax],11111111h ;Warning A4073: Size not specified, assuming: DWORD
                           

Result:
Code: [Select]
.0040105C: C60011                         mov          b,[eax],011
.0040105F: 66C7001111                     mov          w,[eax],01111
.00401064: C70011111100                   mov          d,[eax],000111111
.0040106A: C70011111111                   mov          d,[eax],011111111
                                   

Simple code:                                   
Code: [Select]
00000040                        cmp [eax],11h ;Warning A4073: Size not specified, assuming: BYTE
00000043                        cmp [eax],1111h ;Warning A4073: Size not specified, assuming: WORD
00000048                        cmp [eax],111111h ;Warning A4073: Size not specified, assuming: DWORD
0000004E                        cmp [eax],11111111h ;Warning A4073: Size not specified, assuming: DWORD

Result:
Code: [Select]
.00401070: 833811                         cmp          d,[eax],011 ;????????????????
.00401073: 6681381111                     cmp          w,[eax],01111
.00401078: 813811111100                   cmp          d,[eax],000111111
.0040107E: 813811111111                   cmp          d,[eax],011111111

Simple code:
Code: [Select]
00000054                        sub [eax],11h ;Warning A4073: Size not specified, assuming: BYTE
00000057                        sub [eax],1111h ;Warning A4073: Size not specified, assuming: WORD
0000005C                        sub [eax],111111h ;Warning A4073: Size not specified, assuming: DWORD
00000062                        sub [eax],11111111h ;Warning A4073: Size not specified, assuming: DWORD
Result:
Code: [Select]
.00401084: 832811                         sub          d,[eax],011 ;????????????????
.00401087: 6681281111                     sub          w,[eax],01111
.0040108C: 812811111100                   sub          d,[eax],000111111
.00401092: 812811111111                   sub          d,[eax],011111111

cmp,sub,add and so on... In x64 the same error present to. Tested on HJWasm v2.18.

TWell

  • Member
  • ****
  • Posts: 748
Re: HJWASM 2.17 bugs
« Reply #69 on: March 04, 2017, 02:06:45 AM »
I can't find documentation to this, but:
Code: [Select]
.drectve SEGMENT BYTE INFO
db '/subsystem:console',0
.drectve ENDS
hjwasm creates attributes IMAGE_SCN_CNT_INITIALIZED_DATA and IMAGE_SCN_LNK_INFO same way as ml even it is wrong
those should be IMAGE_SCN_LNK_INFO and IMAGE_SCN_LNK_REMOVE , 200h and 800h

PS: poasm.exe do it correctly.

EDIT:
Something about it here
Quote
The .drective section only appears in OBJ files. It contains text representations of commands for the linker.
as there is no way to put correct attributes with SEGMENT INFO, i think it is assembler's job to do that.

« Last Edit: March 04, 2017, 05:55:57 AM by TWell »

johnsa

  • Member
  • ****
  • Posts: 799
    • Uasm
Re: HJWASM 2.17 bugs
« Reply #70 on: March 14, 2017, 12:57:08 AM »
Simple code:
Code: [Select]
0000002C                        mov [eax],11h ;Warning A4073: Size not specified, assuming: BYTE
0000002F                        mov [eax],1111h ;Warning A4073: Size not specified, assuming: WORD
00000034                        mov [eax],111111h ;Warning A4073: Size not specified, assuming: DWORD
0000003A                        mov [eax],11111111h ;Warning A4073: Size not specified, assuming: DWORD
                           

Result:
Code: [Select]
.0040105C: C60011                         mov          b,[eax],011
.0040105F: 66C7001111                     mov          w,[eax],01111
.00401064: C70011111100                   mov          d,[eax],000111111
.0040106A: C70011111111                   mov          d,[eax],011111111
                                   

Simple code:                                   
Code: [Select]
00000040                        cmp [eax],11h ;Warning A4073: Size not specified, assuming: BYTE
00000043                        cmp [eax],1111h ;Warning A4073: Size not specified, assuming: WORD
00000048                        cmp [eax],111111h ;Warning A4073: Size not specified, assuming: DWORD
0000004E                        cmp [eax],11111111h ;Warning A4073: Size not specified, assuming: DWORD

Result:
Code: [Select]
.00401070: 833811                         cmp          d,[eax],011 ;????????????????
.00401073: 6681381111                     cmp          w,[eax],01111
.00401078: 813811111100                   cmp          d,[eax],000111111
.0040107E: 813811111111                   cmp          d,[eax],011111111

Simple code:
Code: [Select]
00000054                        sub [eax],11h ;Warning A4073: Size not specified, assuming: BYTE
00000057                        sub [eax],1111h ;Warning A4073: Size not specified, assuming: WORD
0000005C                        sub [eax],111111h ;Warning A4073: Size not specified, assuming: DWORD
00000062                        sub [eax],11111111h ;Warning A4073: Size not specified, assuming: DWORD
Result:
Code: [Select]
.00401084: 832811                         sub          d,[eax],011 ;????????????????
.00401087: 6681281111                     sub          w,[eax],01111
.0040108C: 812811111100                   sub          d,[eax],000111111
.00401092: 812811111111                   sub          d,[eax],011111111

cmp,sub,add and so on... In x64 the same error present to. Tested on HJWasm v2.18.

Version 2.20 is up on the site/GIT. The cmp/add/sub byte override is fixed, along with some other small bugs relating to vmovq encoding and option win64:6 mode.