Author Topic: Convert 32 to 64 executable program jwasm+radasm  (Read 4073 times)

cdn4753

  • Regular Member
  • *
  • Posts: 3
Convert 32 to 64 executable program jwasm+radasm
« on: January 27, 2014, 11:43:19 AM »
(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

  • Guest
Re: Convert 32 to 64 executable program jwasm+radasm
« Reply #1 on: January 27, 2014, 04:07:23 PM »
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

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: Convert 32 to 64 executable program jwasm+radasm
« Reply #2 on: January 28, 2014, 04:58:52 AM »
Hi cdn4753,

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

Gunther
Get your facts first, and then you can distort them.

cdn4753

  • Regular Member
  • *
  • Posts: 3
Re: Convert 32 to 64 executable program jwasm+radasm
« Reply #3 on: January 31, 2014, 12:53:41 AM »
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

  • Member
  • ****
  • Posts: 610
Re: Convert 32 to 64 executable program jwasm+radasm
« Reply #4 on: February 01, 2014, 08:33:03 AM »
Hi

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