Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm wanting to get an assembly book to learn assembly, and was wandering if i get a book for intel x86 processor will there be any problems assembling the code on an amd processor?

share|improve this question
    
stackoverflow.com/q/1109569 –  Robert Harvey Apr 27 '13 at 1:04
    
Just want to add a link to this book. I quite like it: amazon.com/Introduction-Intel-Assembly-Language-Programming/dp/… –  kobrien Apr 28 '13 at 0:06
add comment

2 Answers

up vote 3 down vote accepted

For the most part you shouldn't notice any problems at all. Any introductory text will be using very common mnemonics (commands) and macros. Intel tried to introduce a 64-bit processor, IA-64 Itanium, that broke compatibility with the 8086 family of processors. AMD stepped up and designed a 64 bit processor that continued to work with older programming. Obvoiusly, this is what ended up being popular and Intel had to drop IA-64 and make something to work like AMD's.(Duntemann 106-107)

So now both AMD and Intel work from a set of instructions that work almost exactly the same. Little things here and there, but because the market demands it there are little differences to us the programmers. Anything you'll be learning will address when a particular mnemonic came along and which models it begins working on, for all but the latest and most obscure stuff you probably won't need for awhile anyway.

I would highly recommend Jeff Duntemann's Step by Step Assembly language. I learned from this originally 15 years ago. I was going to relearn it, and bought some other book... It just didn't work. So I found that Duntemann had released a new edition in 2009. It does a quick cover of the differences with some aspects of x86_64 but focuses on 32 bit. It really a back to front programming guide with more than just assembly. Editing, good commenting, linking, how the cpu moves data, base number counting, etc.

His website. http://duntemann.com/assembly.html

Amazon link for the book: http://www.amazon.com/Assembly-Language-Step---Step-Programming/dp/0470497025/ref=sr_1_1?ie=UTF8&qid=1367027229&sr=8-1&keywords=jeff+duntemann

share|improve this answer
    
You are right, so am I. Sorry, the answer is confusing. "No, there will be no problems." I'll edit it to reflect that. –  DouglasCodes Apr 27 '13 at 1:56
add comment

I think it will be compatible(but still depends on what AMD you are using), as cited in Wiki:

x86 assembly language is a family of backward-compatible assembly languages, which provide some level of compatibility all the way back to the Intel 8008. x86 assembly languages are used to produce object code for the x86 class of processors, which includes Intel's Core series and AMD's Phenom and Phenom II series.

share|improve this answer
    
Maybe also worth mentioning - writing in assembler got easier in 32 bit relative to 16 bit (and I don't just mean dropping segmented addressing), and probably continued getting easier in 64 bit. The original 16-bit x86 was a little awkward because particular registers had particular purposes in mind, so there was some irregularity in which instructions supported which addressing modes and which registers. The scheme was designed for hand-written assembler, which tends to follow register-usage patterns quite strongly, but that still means you have to know the expected patterns. –  Steve314 Apr 27 '13 at 5:25
    
As I understand it, because optimising compilers can keep track of what all the registers are being used for without such conventions, and can optimise better with more freedom of choice, more recent versions are more regular. The register names are now mostly historic - the base and index registers are now mostly interchangeable and mostly general purpose. –  Steve314 Apr 27 '13 at 5:28
1  
@Steve314: regarding the 64-bit being easier part ... unfortunately no. Some of the high/low-byte quirks came back in 64-bit; for example, unlike AH ... DH, the bits 8..15 of R8 - R15 can't be used for byte instructions. Having more registers to juggle with will also require more mental capacity to maintain labels. –  rwong Apr 27 '13 at 6:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.