64-bit Assembler problems

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
falconfx

64-bit Assembler problems

Post by falconfx »

Hello! :)

I have decided to convert my own OS to 64 bit, as 32 bit era is just going to finally finish.

Until yesterday, I used nasm to compile my assembly code successfully; but now, I changed [BITS 32] to [BITS 64] and it doesn't recognize the new code type. If I delete that statement, nasm complains about the "inexistent" rax, rbx... registers. :(

Any suggestion?
bluecode

Re:64-bit Assembler problems

Post by bluecode »

hi,

nasm imho doesn't support 64-bit code so far. You could use fasm or yasm. I think yasm forked out of the nasm codebase and they also added support for 64-bit code, but I can't tell you anything about yasm syntax.
AR

Re:64-bit Assembler problems

Post by AR »

AFAIK YASM supports 64bit assembly in NASM syntax. I don't know of any other Intel syntax assembler that does 64bit. Then you also have GAS, of course.

I wouldn't be so quick to rule out 32bit, it'll still be around for a few years, migration is a slow process (some people still use win98).
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:64-bit Assembler problems

Post by Candy »

AR wrote: AFAIK YASM supports 64bit assembly in NASM syntax. I don't know of any other Intel syntax assembler that does 64bit. Then you also have GAS, of course.

I wouldn't be so quick to rule out 32bit, it'll still be around for a few years, migration is a slow process (some people still use win98).
YASM supports 64-bit assembler out-of-the-box, in the same way that nasm supports 32-bit and 16-bit assembler. GAS supports it too, but I'm disgusted by its syntax. Since there are enough places where 16-bit is still used (which is why bioses still boot up with 16-bit mode active) don't count on 32-bit to disappear too quickly. It will be used in places where you don't care about 64-bits, such as pretty much everywhere.
Post Reply