flat assembler
Message board for the users of flat assembler.

Index > Windows > A 64-bit example?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 19 Feb 2005, 16:15
BoR0 wrote:
It's pretty confusing that you dont use the stack no more to fill parameters.

I wonder how this thing goes with registers to fill params Mad

Microsoft just said that INVOKE directive will be probably supported also in ML64. I'm curiuos whether they find some automatic way to fill the registers...

_________________
x86asm.net
Post 19 Feb 2005, 16:15
View user's profile Send private message Visit poster's website Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin 20 Feb 2005, 04:42
gumletis wrote:
why the hell use 64-bit programming when there isn't any use for it yet??

'coz 64bit is not so far future of all, I guess.
gumletis wrote:
and can windows 98 even understand 64 bit code??

win98 - no. But there is special version of XP for 64-bit and win2003 and Linux and I guess will be Longhorn.
Post 20 Feb 2005, 04:42
View user's profile Send private message ICQ Number Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin 20 Feb 2005, 05:03
scientica wrote:
in short:
Debugger, well, gdb/ddd works, but, well, I just can't get it to do what I want... (I dream of olly beeing ported to linux and given the code to handle x86-64 Smile). If you find one I'd be happy to heard which one, I've thought of testing "the Dude" ( http://the-dude.sourceforge.net/ ), just haven't had time yet.


The Dude is for Linux, but I'm not a linux customer Sad now I/m using hiew and olly. And I'm dreaming of x86-64 support in this great tools.

But there are what I found now:
---------------------------------------------------------
AMD64 - Knoppix 64.
Changes are:
- 64 bit kernel and modules, very stable 2.4.21 from Suse www.suse.com
- Gcc 3.4 compiler for c and c++ development
o Generates 64 bits executables
o Allows –march=k8 optimization flag
o Precompiled headers
o See all changes on gcc site
- 64 bit binutils (linker, assembler)
- 64 bit gdb debugger
- up-to-date broadcom bcm5700 gigabit Ethernet driver
To make space for all this, I had to remove openoffice and some European locales.
Supported locales and languages: English, French, German.
_http://www.applia.fr/contents/knoppix64.html
_http://ns31003.ovh.net/knoppix64/latest/KNOPPIX64-3.4-EN-2004-05-31.iso
---------------------------------------------------------
A Linux Toolbox for AMD64 Developers
In the Linux space, the AMD64 platform is rich with tools for software developers, ranging from 64-bit compilers and debuggers, to libraries and profilers.
http://www.devx.com/amd/Article/21802
---------------------------------------------------------
There is CodeAnalist for Linux and for Windows but I haven't seen it yet.
Post 20 Feb 2005, 05:03
View user's profile Send private message ICQ Number Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22 20 Feb 2005, 05:21
I'm made x86-64 doesnt have 256bit registers and quad-precision math Sad Will have to wait for 128bit processors I guess
Post 20 Feb 2005, 05:21
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 20 Feb 2005, 07:14
Quote:
I guess this comes because YASM creates an ELF64 object file which the Microsoft Linker doesn't know of.


I think there is no need to guess Wink.

Quote:
however in Win64 they are passed via the registers.


Wonder if such calling convention is regarded only to the fact that there are more registers??? is ruled by the processor type or by the OS this calling convention??? what happend if I get out of registers??, how I pass a copy of a structure with 20 items? (only in the case that I need to Razz).
Post 20 Feb 2005, 07:14
View user's profile Send private message Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 20 Feb 2005, 08:51
Quote:

Wonder if such calling convention is regarded only to the fact that there are more registers???

I guess so.
Quote:

is ruled by the processor type or by the OS this calling convention???

Probably by the OS.
Quote:

how I pass a copy of a structure with 20 items?

Same - via a pointer.
Post 20 Feb 2005, 08:51
View user's profile Send private message Visit poster's website Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin 21 Feb 2005, 17:34
Hey! I found hex-viewer/diassembler which understand 64-bit code!
http://biew.sourceforge.net/
It looks like HIEW but as for me is not so handy but it's good!
Post 21 Feb 2005, 17:34
View user's profile Send private message ICQ Number Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 22 Feb 2005, 18:18
But Im refering in the case that you whant a copy of the structure, yes I know that is more like pass by reference or the other one (by value?).....

Altought you can get the pointer, then make space for locals in the stack and copy the contents there, but then will have no much sense pass with a pointer or have sense?

If such copy of structure is at the end of the arguments that you define, pheraphs is not much a problem, look like fast call when is outof registers. But if is in the middle you will need push them and the next argument not related to the structure will be inside the registers.


I guess this case is speciall and can not be handled in a elegant way with such calling convention, altought it will be in general more fast, but wich registers will need be preserved for enter to the OS??? (wonder if I skip this in the document?)
Post 22 Feb 2005, 18:18
View user's profile Send private message Reply with quote
valy



Joined: 01 Aug 2003
Posts: 14
Location: France
valy 28 Feb 2005, 14:38
Quote:

Hm... And what?.. It looks like for x86-64 we must remember all of registrs' using for all of apis?! Or there is some straight system of handling function's parameters? I'm confused...


Any OS has its own APIs. Especially if you rewrite 64-bit optimized APIs.
I guess a good IDE should detect them and a click on it should give you the info. If I code an IDE one day, RadAsm and/or VC's Ide may be my favourites.

(rea)
Copying is 20-item structure can be done outside of any API.
You can use a pointer instead.

_________________
Easier, faster
Post 28 Feb 2005, 14:38
View user's profile Send private message Visit poster's website Reply with quote
valy



Joined: 01 Aug 2003
Posts: 14
Location: France
valy 15 Apr 2005, 13:10
Hi iklin

Biew 5.6.2 is very good.
But try and disassemble full 64-bit flat binary code Sad

I write a dedicated OS : AMDO64, for x86-64 only.
I wrote a Win32 EXE that disassembles ONLY x86-64 binary code (no FPU).

The alpha version is on my website : D64.zip

Regards

_________________
Easier, faster
Post 15 Apr 2005, 13:10
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 15 Apr 2005, 13:53
I was using BIEW for opcode testing when developing x86-64 in fasm, but I've found out that it has some bugs: for example it shows bad destination address for jumps with 66h prefixes; or disassembles short XCHG RAX,R8 opcode as NOP. So be cautious while using it and don't trust it too credulously.
Post 15 Apr 2005, 13:53
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.