Help needed to convert MASM32 code to GoASM for RadASM 3.x

Started by Shooter, December 15, 2010, 02:54:26 AM

Previous topic - Next topic

Shooter

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
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

donkey

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
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Shooter

Ugh! So SIMPLE! Geez. I got caught up in the details of it all.

Thanks, Edgar.

-Shooter
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

Shooter

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
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.