News:

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

Main Menu

Can not assemble RadASM addins

Started by WillASM, April 10, 2023, 01:12:21 PM

Previous topic - Next topic

WillASM

Recently decided to get back into assembly after being away from it for several years. After getting my environment setup and every thing working as expected I decided to work on some RadASM v3 addins. That is where I ran into a problem. For example, I'll use RadFavs addin by Edgar. When I assemble the code I get the following error.


GoAsm /c /x86 "RadFavs.Asm"

GoAsm.Exe Version 0.62.0.0  Copyright Jeremy Gordon 2001-2022   info@goprog.com

Error!
Line 68 of assembler source file (RadFavs.Asm):-
Could not get size of structure/union:-
add eax,ADDINDATA.szAppPath
  In the struct at Line 524 of the include file Radasm\AddIns.h

OBJ file not made

Error(s) occured.


However, if I use an earlier version of GoASM, v0.58.6 is the last previous version I still have on my hard drive, it assembles without issue.


GoAsm /c /x86 "RadFavs.Asm"

GoAsm.Exe Version 0.56.8 - Copyright Jeremy Gordon 2001/9 - JG@JGnet.co.uk
Output file: RadFavs.obj

Make done.


I suspect it is the struct WINSIZE in ADDINDATA on line 528 as I can not find a definition for it in any header file, including the masm version Addins.inc.


winres WINSIZE


I'm curious to know if anyone here has any versions of GoASM after v0.58.6 that I could try. I'd like to narrow it down to the version that first started giving this error. Note that ml.exe does not seem to have any issue with this definition as it is defined in Addins.inc. Any suggestions would be appreciated as I would like to use the updated version of GoASM.

Thanks.



WillASM

Not really sure what is going on here but there definitely is a problem with Goasm's memory addressing.

If I run this code...


    PrintText("Getting szHelpF1 from ADDINDATA")
    PrintLine()
    PrintText("add     eax,ADDINDATA.szHelpF1")
    mov     eax,[lpData]
    add     eax,ADDINDATA.szHelpF1
    PrintStringByAddr(eax)
    DumpMem(eax,64)
    PrintText("add     eax,83504")
    mov     eax,[lpData]
    add     eax,83504
    PrintStringByAddr(eax)
    DumpMem(eax,64)


I get this result...


Line 619: Getting szHelpF1 from ADDINDATA
----------------------------------------
Line 621: add     eax,ADDINDATA.szHelpF1
Line 624: eax =
----------------------------------------
Line 625 : Hex dump of 64 bytes at address 0x0049DDD4
----------------------------------------
0049DDD4:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049DDE4:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049DDF4:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049DE04:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 626: add     eax,83504
Line 629: eax = $A\..\goasm\bin\GoAsm.html invoke
----------------------------------------
Line 630 : Hex dump of 64 bytes at address 0x004A2DD4
----------------------------------------
004A2DD4:  24 41 5C 2E-2E 5C 67 6F-61 73 6D 5C-62 69 6E 5C   $A\..\goasm\bin\
004A2DE4:  47 6F 41 73-6D 2E 68 74-6D 6C 20 69-6E 76 6F 6B   GoAsm.html invok
004A2DF4:  65 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   e...............
004A2E04:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------


The offset of 83504 I was able to calculate using masm and that gives me the expected string, but using `add     eax,ADDINDATA.szHelpF1` ends up pointing to the wrong memory address as you can see from the memory dump. Note that this is using v0.56.8 which I thought was working because it correctly calculates several of the offsets but it seems the further into the ADDINDATA struct I address the more unpredictable it becomes. Ii fact it starts to give me the same error past ADDINDATA.find.

For this particular case I can just define a table with all the correct offsets but that is not a solution to the problem. I hope this can get fixed as I would hate to switch assemblers now. Goasm syntax is just far more preferable to me!

jj2007

    add     eax,ADDINDATA.szHelpF1
    PrintStringByAddr(eax)
    DumpMem(eax,64)


I'm not a GoAsm user, but are you sure that eax is still intact after a PrintStringByAddr?

wjr

GoAsm v0.57.04 is where that Error starts to occur, but that version has a variety of bug fixes for structure/union SIZEOF and offsets to members, as you have noticed with issues in an earlier version, so you should be using the latest version.

You were getting close with the FIND structure. A bit tricky tracing through with nested structures, but It would appear that things go astray with CHARRANGE and FINDTEXTEX not being defined. If in RadFavs.h after windows.h you put #include "richedit.h" then I get no Error.

WillASM

Thanks for the replies, they have been helpful.

@jj2007 I'm using the VKIM debug macros so I know all the registers are being preserved but a good suggestion though.

Including "richedit.h" indeed solved the error issue and I'm now using Goasm v0.62.0.0 for these tests but I am still getting the incorrect results.
Note: To clarify, this is the output from 2 different addins for RadASM, the first is written using Masm, the second with Goasm.

Here is the output produced by both addins... (Added more descriptive text to describe the output)

----------------------------------------
Masm Code Start (Del.Asm, 81)

Start of ADDINDATA:

eax = 4777892 (Del.Asm, 83)

Offset to szHelpF1 :

edx = 4861396 (Del.Asm, 85)

Difference :

eax = -83504 (Del.Asm, 88)

Using add    eax,ADDINDATA.szHelpF1 gives correct Result:

$A\..\goasm\bin\GoAsm.html invoke

Masm Code End (Del.Asm, 93)
----------------------------------------
Line 632: GoASM Code Start
Line 633: Using add     eax,ADDINDATA.szHelpF1 gives incorrect result:
Line 636: eax =
----------------------------------------
Line 637 : Hex dump of 64 bytes at address 0x0049DDD4
----------------------------------------
0049DDD4:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049DDE4:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049DDF4:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049DE04:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 638: Using add     eax,83504 gives correct result:
Line 641: eax = $A\..\goasm\bin\GoAsm.html invoke
----------------------------------------
Line 642 : Hex dump of 64 bytes at address 0x004A2DD4
----------------------------------------
004A2DD4:  24 41 5C 2E-2E 5C 67 6F-61 73 6D 5C-62 69 6E 5C   $A\..\goasm\bin\
004A2DE4:  47 6F 41 73-6D 2E 68 74-6D 6C 20 69-6E 76 6F 6B   GoAsm.html invok
004A2DF4:  65 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   e...............
004A2E04:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 643: GoASM Code End
----------------------------------------


As you can see from the memory dumps, I'm still getting the wrong memory pointer. I believe I have accounted for all the nested structures. Any other suggestions?

WillASM

I have now tried every version of Edgars headers that I can find, including older versions I had archived with the same result. What I have concluded is the version on https://www.godevtool.com/#headers appears to be the last one made available although it, and every other version I can find online, has an outdated "Addins.h file. The version I have has the definitions...


AIM_OUTPUTDBLCLK equ WM_USER+121 ;hWnd=handle of output, wParam & lParam=same as for WM_LBUTTONDBLCLK
AIM_PROJECTCLOSE equ WM_USER+122 ;RadASM requestst closing a project. Return TRUE to prevent RadASM from closing the project. hWin=Main window, wParam=0, lParam=lpProjectFileName
AIM_PROJECTCLOSED equ WM_USER+123 ;RadASM has closed a project. Always retirn FALSE. hWin=Main window, wParam=0, lParam=0
AIM_PROJECTOPEN equ WM_USER+124 ;RadASM requestst opening a project. Return TRUE to prevent RadASM from opening the project. hWin=Main window, wParam=0, lParam=lpProjectFileName
AIM_PROJECTOPENED equ WM_USER+125 ;RadASM has opened a project. Always return FALSE. hWin=Main window, wParam=0, lParam=lpProjectFileName


These were added to RadASM v3 by Ketil in a later version. I assume I downloaded the updated 'Addins.h' from the old board as I can no longer find it online anywhere.
Note: I have also tried assembling with the old 'Addins.h' file with the same results.

I'm attaching the updated version here to make it available to everyone...

Edit: I am also using "#define INCLUDEALL" in my include file to eliminate the possibility of a missing header.



WillASM

Forgot to mention, by using "#define INCLUDEALL" I did find a couple of minor bugs in the headers.

In 'windows.h' starting at line 1300 the reference to 'RadAsm.h' needs to be commented out (All Radasm files were moved into the folder 'Radasm').


; #IFNDEF RADASM_H
; #include "RadAsm.h"
; #ENDIF


And in "ShObjIdl.h" at line 132 the #ENDIF needs to be uncommented


#ENDIF // IPersistIDList FIXED was commented out



WillASM

Well ended up going back to using Goasm v0.56.8

When I tried to assemble my new RadASM addin, "Auto Brackets", which is uploaded in the radasm sub forum, Goasm v0.62.0 gets confused with the references to the 2 CHARRANGE struct's I'm using to manipulate the edit windows text. Spent a half hour trying to figure out why my text range selections were incorrect. The older version 0.56.8 does not have any problem with those 2 CHARRANGE structures and I get the correct ranges selected. It still has a problem with the ADDINDATA struct if I try to read to far into it, but I can just add the calculated offset if I need to access any of those items.

wjr

I have looked at the detailed GoAsm member offsets of ADDINDATA and do not see anything wrong with them.

Just a reminder that the add instruction above is adding the offset to eax, so eax needs to be first loaded with the address pointing to the start of the structure. In your MASM output you use edx as offset to szHelpF1, so perhaps a wrong register there? The decimal difference of 83504 for the offset doesn't make sense as I get a structure size of 76616. Maybe check your MASM value for MAX_PATH?

If each CHARRANGE structure has its own label or member name there shouldn't be an issue in addressing them.


WillASM

#9
yes my example needs to cleaned up, will do that after supper. Are you using the most recent version of "Addins.inc" for masm and the "Addins.h" for goasm I posted above? The ADDINDATA struct is not the same size in all versions of both. An easy check is to see if the following definitions are in the include files as these were added by Ketil in a later version of Radasm3...


AIM_OUTPUTDBLCLK
AIM_PROJECTCLOSE
AIM_PROJECTCLOSED
AIM_PROJECTOPEN
AIM_PROJECTOPENED


After a closer look add the "Addns.inc" for masm I noticed that the "Addins.h" is missing a definition. I need to look for more missing data.


AIM_ACTIVATE


I'll attach the "Addns.inc" file for masm. This is taken straight from the source code for Radasm3.

I have updated the goasm version of "Addins.h" to match the masm version and am attaching here.
There were a few items missing, mostly just menu ID's though.

Edit: Replaced the "Addins.h" download with fixed version with the correct sized 'make' definition in ADDINDATA structure.

WillASM

Ok here is another attempt here. Removed the masm test as it was giving me incorrect data. Probably just because I never use masm, that and I have never really tested the vkim debug macros for masm.

Any how, here is my test code picking a few selected strings data from the ADDINDATA structure. Pretty straight forward use of the debug macros...


            PrintLine()
            PrintText("GoASM Code Start")
            PrintText("Everything works fine up to a point")
            mov     eax,SIZEOF ADDINDATA
            PrintText("Size of ADDINDATA")
            PrintDec(eax)

            PrintText("Using - add eax,ADDINDATA.szAppPath")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szAppPath
            PrintStringByAddr(eax)
            DumpMem(eax,64)

            PrintText("Using - add eax,ADDINDATA.szBraceMatch")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szBraceMatch
            PrintStringByAddr(eax)
            DumpMem(eax,64)

            PrintText("Using - add eax,ADDINDATA.szTypes")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szTypes
            PrintStringByAddr(eax)
            DumpMem(eax,64)

            PrintLine()
            PrintText("After this point it becomes unreliable...")
            PrintLine()
            PrintLine()

            PrintText("Using - add eax,ADDINDATA.szCompileRC")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szCompileRC
            PrintStringByAddr(eax)
            DumpMem(eax,64)

            PrintText("Using - add eax,ADDINDATA.szCompileRCHelp")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szCompileRCHelp
            PrintStringByAddr(eax)
            DumpMem(eax,64)

            PrintText("Using - add eax,ADDINDATA.szCompileRCHelpKw")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szCompileRCHelpKw
            PrintStringByAddr(eax)
            DumpMem(eax,64)

            PrintLine()
            PrintText("This is definitely wrong... Should print the first of ten MRF")
            PrintLine()
            PrintLine()

            PrintText("Using - add eax,ADDINDATA.szMruFiles")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szMruFiles
            PrintDWORDHex(eax)
            PrintStringByAddr(eax)
            DumpMem(eax,64)

            PrintText("Using - add eax,ADDINDATA.szDbgFileName")
            mov     eax,[lpData]
            add     eax,ADDINDATA.szDbgFileName
            PrintDWORDHex(eax)
            PrintStringByAddr(eax)
            DumpMem(eax,64)


And here is the output, first using Goasm v0.56.8, followed by Goasm v0.62.0
The output appears to be identical...


Goasm v0.56.8
----------------------------------------
Line 639: GoASM Code Start
Line 640: Everything works fine up to a point
Line 642: Size of ADDINDATA
Line 643: eax = 76616 (0x00012B48)
Line 645: Using - add eax,ADDINDATA.szAppPath
Line 648: eax = C:\programming\tools\RadASM30
----------------------------------------
Line 649 : Hex dump of 64 bytes at address 0x0048E8BC
----------------------------------------
0048E8BC:  43 3A 5C 70-72 6F 67 72-61 6D 6D 69-6E 67 5C 74   C:\programming\t
0048E8CC:  6F 6F 6C 73-5C 52 61 64-41 53 4D 33-30 00 52 61   ools\RadASM30.Ra
0048E8DC:  64 41 53 4D-2E 65 78 65-00 00 00 00-00 00 00 00   dASM.exe........
0048E8EC:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 651: Using - add eax,ADDINDATA.szBraceMatch
Line 654: eax = ({[,)}],\,
----------------------------------------
Line 655 : Hex dump of 64 bytes at address 0x0048FE18
----------------------------------------
0048FE18:  28 7B 5B 2C-29 7D 5D 2C-5C 2C 00 00-00 00 00 00   ({[,)}],\,......
0048FE28:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0048FE38:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0048FE48:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 657: Using - add eax,ADDINDATA.szTypes
Line 660: eax = .asm.,.inc.,.rc.,.txt.ini.def.,.exe.,.bat.
----------------------------------------
Line 661 : Hex dump of 64 bytes at address 0x00495F38
----------------------------------------
00495F38:  2E 61 73 6D-2E 2C 2E 69-6E 63 2E 2C-2E 72 63 2E   .asm.,.inc.,.rc.
00495F48:  2C 2E 74 78-74 2E 69 6E-69 2E 64 65-66 2E 2C 2E   ,.txt.ini.def.,.
00495F58:  65 78 65 2E-2C 2E 62 61-74 2E 00 00-00 00 00 00   exe.,.bat.......
00495F68:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
----------------------------------------
Line 664: After this point it becomes unreliable...
----------------------------------------
----------------------------------------
Line 668: Using - add eax,ADDINDATA.szCompileRC
Line 671: eax = GoRC
----------------------------------------
Line 672 : Hex dump of 64 bytes at address 0x00496038
----------------------------------------
00496038:  47 6F 52 43-00 00 00 00-00 00 00 00-00 00 00 00   GoRC............
00496048:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496058:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496068:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 674: Using - add eax,ADDINDATA.szCompileRCHelp
Line 677: eax =
----------------------------------------
Line 678 : Hex dump of 64 bytes at address 0x004960B8
----------------------------------------
004960B8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
004960C8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
004960D8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
004960E8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 680: Using - add eax,ADDINDATA.szCompileRCHelpKw
Line 683: eax =
----------------------------------------
Line 684 : Hex dump of 64 bytes at address 0x00496138
----------------------------------------
00496138:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496148:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496158:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496168:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
----------------------------------------
Line 687: This is definitely wrong... Should print the first of ten MRF
----------------------------------------
----------------------------------------
Line 691: Using - add eax,ADDINDATA.szMruFiles
Line 694: eax = 0x0049C980
Line 695: eax =
----------------------------------------
Line 696 : Hex dump of 64 bytes at address 0x0049C980
----------------------------------------
0049C980:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049C990:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049C9A0:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049C9B0:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 698: Using - add eax,ADDINDATA.szDbgFileName
Line 701: eax = 0x0049ED68
Line 702: eax =
----------------------------------------
Line 703 : Hex dump of 64 bytes at address 0x0049ED68
----------------------------------------
0049ED68:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049ED78:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049ED88:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049ED98:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------

Goasm v0.62.0


----------------------------------------
Line 639: GoASM Code Start
Line 640: Everything works fine up to a point
Line 642: Size of ADDINDATA
Line 643: eax = 76616 (0x00012B48)
Line 645: Using - add eax,ADDINDATA.szAppPath
Line 648: eax = C:\programming\tools\RadASM30
----------------------------------------
Line 649 : Hex dump of 64 bytes at address 0x0048E8BC
----------------------------------------
0048E8BC:  43 3A 5C 70-72 6F 67 72-61 6D 6D 69-6E 67 5C 74   C:\programming\t
0048E8CC:  6F 6F 6C 73-5C 52 61 64-41 53 4D 33-30 00 52 61   ools\RadASM30.Ra
0048E8DC:  64 41 53 4D-2E 65 78 65-00 00 00 00-00 00 00 00   dASM.exe........
0048E8EC:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 651: Using - add eax,ADDINDATA.szBraceMatch
Line 654: eax = ({[,)}],\,
----------------------------------------
Line 655 : Hex dump of 64 bytes at address 0x0048FE18
----------------------------------------
0048FE18:  28 7B 5B 2C-29 7D 5D 2C-5C 2C 00 00-00 00 00 00   ({[,)}],\,......
0048FE28:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0048FE38:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0048FE48:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 657: Using - add eax,ADDINDATA.szTypes
Line 660: eax = .asm.,.inc.,.rc.,.txt.ini.def.,.exe.,.bat.
----------------------------------------
Line 661 : Hex dump of 64 bytes at address 0x00495F38
----------------------------------------
00495F38:  2E 61 73 6D-2E 2C 2E 69-6E 63 2E 2C-2E 72 63 2E   .asm.,.inc.,.rc.
00495F48:  2C 2E 74 78-74 2E 69 6E-69 2E 64 65-66 2E 2C 2E   ,.txt.ini.def.,.
00495F58:  65 78 65 2E-2C 2E 62 61-74 2E 00 00-00 00 00 00   exe.,.bat.......
00495F68:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
----------------------------------------
Line 664: After this point it becomes unreliable...
----------------------------------------
----------------------------------------
Line 668: Using - add eax,ADDINDATA.szCompileRC
Line 671: eax = GoRC
----------------------------------------
Line 672 : Hex dump of 64 bytes at address 0x00496038
----------------------------------------
00496038:  47 6F 52 43-00 00 00 00-00 00 00 00-00 00 00 00   GoRC............
00496048:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496058:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496068:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 674: Using - add eax,ADDINDATA.szCompileRCHelp
Line 677: eax =
----------------------------------------
Line 678 : Hex dump of 64 bytes at address 0x004960B8
----------------------------------------
004960B8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
004960C8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
004960D8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
004960E8:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 680: Using - add eax,ADDINDATA.szCompileRCHelpKw
Line 683: eax =
----------------------------------------
Line 684 : Hex dump of 64 bytes at address 0x00496138
----------------------------------------
00496138:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496148:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496158:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
00496168:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
----------------------------------------
Line 687: This is definitely wrong... Should print the first of ten MRF
----------------------------------------
----------------------------------------
Line 691: Using - add eax,ADDINDATA.szMruFiles
Line 694: eax = 0x0049C980
Line 695: eax =
----------------------------------------
Line 696 : Hex dump of 64 bytes at address 0x0049C980
----------------------------------------
0049C980:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049C990:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049C9A0:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049C9B0:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------
Line 698: Using - add eax,ADDINDATA.szDbgFileName
Line 701: eax = 0x0049ED68
Line 702: eax =
----------------------------------------
Line 703 : Hex dump of 64 bytes at address 0x0049ED68
----------------------------------------
0049ED68:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049ED78:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049ED88:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
0049ED98:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00   ................
----------------------------------------


I'm at a loss here as to why it starts out fine but eventual stops working correctly...
If anyone can help I would appreciate it..


wjr

The output does look identical, so I recommend just using v0.62.0.0. I tried building AutoBrackets and got the ADDINDATA error again. When using ADDINDATA.membername GoAsm can get this offset but apparently doesn't give as detailed an error message if something goes wrong since you are not actually creating an instance of that structure. If you build with a temporary "Try ADDINDATA" in a data section, this gives a more specific error message with a TOOLINFO issue, and "commctrl.h" was commented out in the AutoBrackets include file.

I didn't see the INC file before, and didn't get very far trying to play around with MASM or UASM to generate a structure member offset list (like I did in the attached with creative use of the GoAsm list file output). The translation from INC to GoAsm H looks fine, and the offsets to the members you are referring to look correct. I don't think it stops working, it is just that some of those fields haven't been updated with strings. In the case of szMruFiles, your memory dump may only show the first 64 bytes of MAX_PATH for the first file, with the second file starting MAX_PATH bytes after that, etc., given that the member size is 10*MAX_PATH.

WillASM

Decided to do a rather large memory dump of the contents of ADDINDATA structure.
It's too large to post here but does not have any content past the "make" entry in the structure, just zeros beyond that.

WillASM

Got masm debug macros working correctly now, here is the code...


        PrintLine
        PrintText "Using - add eax,ADDINDATA.szAppPath"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szAppPath
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64

        PrintLine
        PrintText "Using - add eax,ADDINDATA.szBraceMatch"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szBraceMatch
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64

        PrintLine
        PrintText "Using - add eax,ADDINDATA.szTypes"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szTypes
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64

        PrintLine
        PrintText "After this point it becomes unreliable with Goasm..."

        PrintLine
        PrintText "Using - add eax,ADDINDATA.szCompileRC"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szCompileRC
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64

        PrintLine
        PrintText "Using - add eax,ADDINDATA.szCompileRCHelp"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szCompileRCHelp
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64

        PrintLine
        PrintText "Using - add eax,ADDINDATA.szCompileRCHelpKw"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szCompileRCHelpKw
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64

        PrintLine
        PrintText "This is wrong in Goasm... Should print the first of ten MRF"

        PrintLine
        PrintText "Using - add eax,ADDINDATA.szMruFiles"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szMruFiles
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64

        PrintLine
        PrintText "Using - add eax,ADDINDATA.szMruFiles + MAX_PATH"
        mov     eax,[lpData]
        add     eax,ADDINDATA.szMruFiles+MAX_PATH
        PrintStringByAddr eax
        PrintLine
        DumpMem eax,64
        PrintLine


And the resulting output...


----------------------------------------
Using - add eax,ADDINDATA.szAppPath (Del.Asm, 84)
eax = C:\programming\tools\RadASM30
----------------------------------------
0048E8BC : 43 3A 5C 70 - 72 6F 67 72 - 61 6D 6D 69 - 6E 67 5C 74
0048E8CC : 6F 6F 6C 73 - 5C 52 61 64 - 41 53 4D 33 - 30 00 52 61
0048E8DC : 64 41 53 4D - 2E 65 78 65 - 00 00 00 00 - 00 00 00 00
0048E8EC : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00000064 : BYTES TOTAL
----------------------------------------
Using - add eax,ADDINDATA.szBraceMatch (Del.Asm, 92)
eax = ({[,)}],\,
----------------------------------------
0048FE18 : 28 7B 5B 2C - 29 7D 5D 2C - 5C 2C 00 00 - 00 00 00 00
0048FE28 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
0048FE38 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
0048FE48 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00000064 : BYTES TOTAL
----------------------------------------
Using - add eax,ADDINDATA.szTypes (Del.Asm, 100)
eax = .asm.,.inc.,.rc.,.txt.ini.def.,.exe.,.bat.
----------------------------------------
00495F38 : 2E 61 73 6D - 2E 2C 2E 69 - 6E 63 2E 2C - 2E 72 63 2E
00495F48 : 2C 2E 74 78 - 74 2E 69 6E - 69 2E 64 65 - 66 2E 2C 2E
00495F58 : 65 78 65 2E - 2C 2E 62 61 - 74 2E 00 00 - 00 00 00 00
00495F68 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00000064 : BYTES TOTAL
----------------------------------------
After this point it becomes unreliable with Goasm... (Del.Asm, 108)
----------------------------------------
Using - add eax,ADDINDATA.szCompileRC (Del.Asm, 111)
eax = GoRC
----------------------------------------
00496038 : 47 6F 52 43 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00496048 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00496058 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00496068 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00000064 : BYTES TOTAL
----------------------------------------
Using - add eax,ADDINDATA.szCompileRCHelp (Del.Asm, 119)
eax =
----------------------------------------
004960B8 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
004960C8 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
004960D8 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
004960E8 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00000064 : BYTES TOTAL
----------------------------------------
Using - add eax,ADDINDATA.szCompileRCHelpKw (Del.Asm, 127)
eax =
----------------------------------------
00496138 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00496148 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00496158 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00496168 : 00 00 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00000064 : BYTES TOTAL
----------------------------------------
This is wrong in Goasm... Should print the first of ten MRF (Del.Asm, 135)
----------------------------------------
Using - add eax,ADDINDATA.szMruFiles (Del.Asm, 138)
eax = C:\programming\tools\goasm\headers\Radasm\Addins.h
----------------------------------------
004A1980 : 43 3A 5C 70 - 72 6F 67 72 - 61 6D 6D 69 - 6E 67 5C 74
004A1990 : 6F 6F 6C 73 - 5C 67 6F 61 - 73 6D 5C 68 - 65 61 64 65
004A19A0 : 72 73 5C 52 - 61 64 61 73 - 6D 5C 41 64 - 64 69 6E 73
004A19B0 : 2E 68 00 00 - 00 00 00 00 - 00 00 00 00 - 00 00 00 00
00000064 : BYTES TOTAL
----------------------------------------
Using - add eax,ADDINDATA.szMruFiles + MAX_PATH (Del.Asm, 146)
eax = C:\programming\tools\RadASM30\Masm\Projects\Addins\Del\Addins.inc
----------------------------------------
004A1A84 : 43 3A 5C 70 - 72 6F 67 72 - 61 6D 6D 69 - 6E 67 5C 74
004A1A94 : 6F 6F 6C 73 - 5C 52 61 64 - 41 53 4D 33 - 30 5C 4D 61
004A1AA4 : 73 6D 5C 50 - 72 6F 6A 65 - 63 74 73 5C - 41 64 64 69
004A1AB4 : 6E 73 5C 44 - 65 6C 5C 41 - 64 64 69 6E - 73 2E 69 6E
00000064 : BYTES TOTAL
----------------------------------------


Note that I am getting the files from szMruFiles.

WillASM

Quote from: wjr on April 15, 2023, 12:56:57 PM
The output does look identical, so I recommend just using v0.62.0.0. I tried building AutoBrackets and got the ADDINDATA error again. When using ADDINDATA.membername GoAsm can get this offset but apparently doesn't give as detailed an error message if something goes wrong since you are not actually creating an instance of that structure. If you build with a temporary "Try ADDINDATA" in a data section, this gives a more specific error message with a TOOLINFO issue, and "commctrl.h" was commented out in the AutoBrackets include file.

I didn't see the INC file before, and didn't get very far trying to play around with MASM or UASM to generate a structure member offset list (like I did in the attached with creative use of the GoAsm list file output). The translation from INC to GoAsm H looks fine, and the offsets to the members you are referring to look correct. I don't think it stops working, it is just that some of those fields haven't been updated with strings. In the case of szMruFiles, your memory dump may only show the first 64 bytes of MAX_PATH for the first file, with the second file starting MAX_PATH bytes after that, etc., given that the member size is 10*MAX_PATH.

Thanks for the list file, it is very helpful. The "commctrl.h" is a leftover from my template and is not required, just forgot to remove it.
I'll take a closer look at your list file and try your suggestion with the build with a temporary "Try ADDINDATA" in a data section.
Thanks for taking the time to help, very appreciated.

Edit: Actually "commctrl.h" is required at least for v0.62.0. Oddly it is not required for the older version? It is now assembling without issue with v0.62.0 (No Errors) and more importantly it is not creating the strange behavior I was seeing earlier with my CHARRANGE structs! Not sure what I changed but I'm not arguing with it.