didi
didi

Reputation: 765

64 bits assembly's instructions of 32 bits ones

I am beginning to port a program which is written in C and have several pieces of code written in assembly with instructions for a 32 bit machine - like ljmp - to a 64 bits machine.

Is there a place/document that have the instructions, in assembly, for a 32 bit machine and its counterpart for a 64 one? If not, where can I find a document that lists all the instructions for a 32 bit and a 64 bit machine?


As it's is pretty obvious, I am a newbie for the situation. Let's clarify some points.

I am porting a OS in its very early days. It was written with a x86 machine in mind. Now, I want it to run at a x86_64.

It is written in a Linux box with UNIX in mind. I am almost sure that the original author is writing it at a Intel machine. I am also on Intel but I would like to run the OS in AMD too.

The compiler used is gcc.

Upvotes: 4

Views: 1308

Answers (2)

Steven Sudit
Steven Sudit

Reputation: 19630

You haven't offered any background, or even the type of CPU, but I'm going to suggest thay maybe you should take this 64-bit port as an opportunity to reconsider having used assembly language. While it certainly has its place, I would recommend recoding the routine in C++ and benchmarking the compiler's optimized output to see if it's really any slower. In many cases, it won't be.

Upvotes: 3

Related Questions