News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Convert 32 to 64 executable program jwasm+radasm

Started by cdn4753, January 27, 2014, 11:43:19 AM

Previous topic - Next topic

cdn4753

(1)Calendar Control
Error A2102: Symbol not defined : MCM_GETCURSEL
(2) Toolbar  ;include    CommCtrl.inc
Error A2102: Symbol not defined : TBN_QUERYINSERT
Symbol not defined : TBN_GETBUTTONINFO
Symbol not defined : TBNOTIFY.iItem
Symbol not defined : TBNOTIFY.tbButton

(3)
lea rdi,Buffer2048 ;hWinEdit box for display
push rdi     
invoke  SendMessage,hWinEdit,EM_REPLACESEL,TRUE,rdi
pop rdi
Run crash
Found that, as long as the line to perform push XXX command, run crash
push  rax   
   invoke SetFilePointer,hFile,0,NULL,FILE_END ;Move files Tail               
pop  rax 
Experiments show that this is also a problem

sinsi

Not sure about radasm, but in general the stack needs to be aligned to 16 before invoking an API.
Your push will misalign the stack, Windows doesn't like it. As part of the ABI, Windows will save rdi so no need to push/pop it.

64-bit asm is a lot different to 32-bit, look at Overview of x64 Calling Conventions for more info.

Gunther

Hi cdn4753,

that link might be of interest, too. And: welcome to the forum.

Gunther
You have to know the facts before you can distort them.

cdn4753

A 32-bit executable programs, converted to 64, an increase of 1000%the code bytes
To include XXX.inc Symbol not defined the problem, you can refer to XXX.inc 32 can self-define or copy rows
push will misalign the stack
japheth in SOURCEFORGE in case said:
In 64-bit, you must be careful with push / pop if you used OPTION WIN64:. 2 in your source See warning in the documentation for more details.
Although incomplete understanding, but I know that can not be so used

ragdog

Hi

In radasm3\jWasm\Projects\Win64Test is a 64 example with Jwasm