The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: Shooter on December 15, 2010, 02:54:26 AM

Title: Help needed to convert MASM32 code to GoASM for RadASM 3.x
Post by: Shooter on December 15, 2010, 02:54:26 AM
I'm running into a problem trying to convert a demo project from MASM32 to GoASM while using RadASM 3.x. Here's a chunk I'm dealing with:


;Create the tab dialog 1
invoke CreateDialogParam,hInstance,IDD_TAB1,hTab,addr Tab1Proc,0
;Save the dialog handle
mov ts.lParam,eax
mov ts.pszText,offset TabTitle1
mov ts.cchTextMax,sizeof TabTitle1
invoke SendMessage,hTab,TCM_INSERTITEM,0,addr ts


I'm getting stuck here:


mov d[ts.lParam],eax
push ebx
mov ebx, addr [TabTitle1] ;<--Error: Unknown mnemonic, instruction, redefinition or directive:-"]"
mov d[ts.pszText],ebx
pop ebx
mov ts.cchTextMax,sizeof TabTitle1
invoke SendMessage,hTab,TCM_INSERTITEM,0,addr ts


I'm not sure if it's required to push and pop EBX, but since I'm not allowed to do the following I figured it to be safer this way.


mov ts.pszText,offset TabTitle1


Can anyone help?

Thanks,
-Shooter
Title: Re: Help needed to convert MASM32 code to GoASM for RadASM 3.x
Post by: donkey on December 15, 2010, 02:58:44 AM
When you use ADDR you cannot enclose the label in brackets, it is either move the address or the data it contains:

mov ebx, ADDR TabTitle1 ; move the address
mov ebx, [TabTitle1]       ; move the data at the address

In this case you want the first one, move the address.

BTW this should be allowed:

mov D[ts.pszText],offset TabTitle1

unless TabTitle1 is a local.


Edgar
Title: Re: Help needed to convert MASM32 code to GoASM for RadASM 3.x
Post by: Shooter on December 15, 2010, 03:02:09 AM
Ugh! So SIMPLE! Geez. I got caught up in the details of it all.

Thanks, Edgar.

-Shooter
Title: Re: Help needed to convert MASM32 code to GoASM for RadASM 3.x
Post by: Shooter on December 15, 2010, 08:21:01 PM
Question:
Do I have to EQU the control's ID, or can I use a reference to it's name?

For example, if I wanted to:
push IDC_TAB1

Whereby IDC_TAB1's ID is 1103 in the Resource Editor, do I have to EQU it to 1103 in the .asm, or is there a way I can use the name without having to equate it? If I end up changing things around in the .RC file, that would mean I'd have to change all the EQU's as well, if using the equate method, to match, right?

-Shooter