News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

HJWASM 2.17 bugs

Started by powershadow, December 29, 2016, 03:53:22 AM

Previous topic - Next topic

jj2007

A propos .Switch:

\Masm32\ObjAsm32\Code\Macros\System.inc
.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

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

Hey all, 2.19 is up which should include all the fixes.

Cheers
John

jj2007

2.19 works fine with my fat sources, thanks a lot to both of you :t

habran

It is our curse to make you happy :biggrin:
Cod-Father

johnsa

Hahah.. but remember in so doing we also make ourselves happy!  :eusa_dance:

jj2007

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

Johnsa, you are correct 8)
JJ, Nun says:"Better safe then sorry" and put a condom on a cucamber :biggrin:
Cod-Father

powershadow

Simple code:
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:
.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:                                   
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:
.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:
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:
.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

#69
I can't find documentation to this, but:
.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
QuoteThe .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.


johnsa

Quote from: powershadow on March 03, 2017, 07:16:53 PM
Simple code:
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:
.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:                                   
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:
.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:
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:
.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.