Hello,
I have made a set of header files for 64 bits
To test them,i use sample provided with jwasm Win64_8.asm
I have just replace the definitions by the include.
The problem is that he don't want to run.
I have made verifies on the prototypes,on the structure without finding any error.
Help !
found:
just use link without adding libraries
Quote
Link /SUBSYSTEM:WINDOWS /DEBUG /debugtype:cv /OUT:%FILE%.exe *.obj %FILE%.bin
It seems also that the link option /NXCOMPAT:NO could help
Hi ToutEnMasm,
you could use GoLink as an alternative, too. You can find usage examples here (http://masm32.com/board/index.php?topic=1892.msg19653#msg19653) and here (http://masm32.com/board/index.php?topic=1504.msg15448#msg15448).
Gunther
Thanks for answer
My first attempt was a little confused with header path (I have mixed 32 and 64 headers).
Quote from: ToutEnMasm on December 12, 2014, 07:21:38 PM
My first attempt was a little confused with header path (I have mixed 32 and 64 headers).
That's indeed a bit confused and a bad idea. But you found the error and that counts.
Gunther
I have re-posted the sample working (show a window and an image) using the include.
Now it's the messagebox who don't want to work,it's in the message directory.
This one seems to be more difficult to find.
You must align the stack on program entry.
I'm wondering, why this strange type XMASM? Types like HBITMAP, HINSTANCE, LPTSTR, HWND, HANDLE, ... should be usable?
Quote
XMASM?
XMASM typedef ptr ;dword size in 32 bits,64 in X64
align the stack ?
Must be done on the window sample,and the messagebox don't work
Quote from: ToutEnMasm on December 13, 2014, 02:47:59 AM
XMASM typedef ptr ;dword size in 32 bits,64 in X64
yes, but Windows's "natural" pointer- and handle types should have the same behavior.
Quote from: ToutEnMasm on December 13, 2014, 02:47:59 AMalign the stack ?
lookout for fastcall calling convention.
The stack is align to 8, when reaching the start-label, but it must be aligned to 16 when calling APIs. Also you must (at least) allocate the shadow space for RCX, RDX, r8 and r9:
start:
add rsp,-(8 + 4 * 8) ; - (align + shadow space)
Quote
start:
add rsp,-(8 + 4 * 8) ; - (align + shadow space)
:t
It wasn't in the samples of jwasm and solve the two problems
I don't see what you call "natural" pointer,the one i need change is size just adding .X64
This avoid to made header for 32 and header for 64
I try to do a simple thing:
Quote
mov rax,45612587h
Don't seem to be allowed ?????
mov rax,45612587h
000000013F6D11C9 48 C7 C0 87 25 61 45 mov rax,45612587h
Hi ToutEnMasm,
Quote from: ToutEnMasm on December 13, 2014, 06:35:17 PM
Quote
mov rax,45612587h
Don't seem to be allowed ?????
no, it's allowed, see also Habran's answer.
Gunther
I have the sample without include wo works (b61710b4 48c7c087256145 mov rax,45612587h)
Put it in the WndProc or after start,same result
The message sample work with this instruction and the header
But the one with include (who show the window and work) just failed to run ,what Happen ??????
The question seems to be,How allocate the stack for a PROC ?
I had try to increase at start,but it doesn't work.
Quote
WinMain proc FRAME hInst:XMASM, hPrevInst:XMASM, CmdLine:XMASM, CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL hwnd:XMASM
;---------- miss something here --------
sub rsp, 4 * sizeof QWORD ?
4 is for shadow for first 4 parameters
Can't say how locals are handled by assembler.
It seems there is need to erase the old binaries files before a new compile.
If not erase,the new code is bad coded.
Quote from: ToutEnMasm on December 13, 2014, 03:29:54 AMI don't see what you call "natural" pointer,the one i need change is size just adding .X64
This avoid to made header for 32 and header for 64
yes, but why do you use that type in the example code? HBITMAP, HWND, ... are also aliases for XMASM in your include files.
I just thought on readability of the example code, e.g. hWnd:HWND vs. hWnd:XMASM.
Hi ToutEnMasm :biggrin:
Why do you always complicate things :icon_eek:
Use my version of JWasm and:
option casemap : none
option win64 : 11
option frame : auto
option stackbase : rsp
.xmm
It will align stack and data for you
and use WinInc
You can use Visual Studio Community 2013 for building and debugging you projects
and your ASM life will blossom :P
Quote
Why do you always complicate things :icon_eek:
Use my version of JWasm and: --------- GENERAL FAILURE ----------
I am happy than you ask that.
If you could made the little modify given here:
http://masm32.com/board/index.php?topic=3811.msg40240#msg40240 (http://masm32.com/board/index.php?topic=3811.msg40240#msg40240)
Your build will be usable for me.
For wininc,no thanks,too much limited
For HBITMAP, HWND ... perhaps I could arrange this
This build is tailored for you my friend
RIP and AVX2 are also included
I hope you'll live happily ever after :biggrin:
Thanks,
This solve the general failure.
After further tests,i need to erase the .pdb .
I have not find yet where it is open in the source code.
The obj file is erased by fopen "w."
Perhaps the .pdb isn't erase ?.
I have visual studio community 2013 and no problem with the build of the source code.
Does that mean that you are satisfied? :biggrin:
I am satisfied but .. if you can help me on how erase the .pdb before compile,I get your goods advises.
Did you try to chose Rebuild Solution or Clean Solution from Build menu?
:t
rebuild and all is OK,it's just Magic.
thanks
That was my Christmas present to you :lol:
now I can sleep peacefully 8)