Nasm for 64 bit programming

Reply

Join Date: Aug 2006
Posts: 6
Reputation: VIDOCQ is an unknown quantity at this point 
Solved Threads: 0
VIDOCQ's Avatar
VIDOCQ VIDOCQ is offline Offline
Newbie Poster

Nasm for 64 bit programming

 
0
  #1
Sep 28th, 2006
hi
WHETHER NASM SUPPORT 64 BIT PROGARMMIN OR NO ?
OR IS THERE NASM FOR EXAMPLE AMD64 BIT ?

THX.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 1
Reputation: retsigir is an unknown quantity at this point 
Solved Threads: 0
retsigir retsigir is offline Offline
Newbie Poster

Re: Nasm for 64 bit programming

 
0
  #2
Jul 21st, 2009
Sorry for a late reply, I just recently joined. NASM 64-bit support was introduced by Keith Kanios, and revised by H. Peter Anvin. Just about all the recent versions you get are fully 64 bit compliant with the exception of the MS/DOS build (afair).

The 64 bit general purpose registers have been given the designation r?x for example, rax, rbx, rcx and so on. The extended registers begin with r[8-15] then are followed with an optional size designation for byte and dword sized variables. Examples include R8B, R9D, and R15. Here are a few simple mov instructions for you to get the idea:

  1. ; Set several registers to the value of __BITS__ internal definition
  2. mov RAX, %[__BITS__] ; Move QWORD value into RAX
  3. mov R8B, %[__BITS__] ; Move BYTE value into R8
  4. mov R9D, %[__BITS__] ; Move DWORD value into R9
  5. mov R15, %[__BITS__] ; Move QWORD value into R15

If you want more information, like how to handle relative and absolute displacement (not that hard since NASM supports a32, abs, r32, and rel) I suggest you check out the NASM latest release of the NASM documentation.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC