32/64-Bit 80x86 Assembly Language Architecture
James C. LeitermanLibrary of Congress Cataloging-in-Publication Data Leiterman, James (James C.)
32/64-bit 80x86 assembly language architecture / by James C. Leiterman
.p. cm.
Includes index.
ISBN-13: 978-1-59822-002-5
ISBN-10: 1-59822-002-0 (pbk.)
1. Computer architecture. 2. Assembler language (Computer program language) I. Title.
QA76.9.A73L47 2005
004.2'2--dc22 2005013995
CIP
2005, Wordware Publishing, Inc.
All Rights Reserved
2320 Los Rios Boulevard
Plano, Texas 75074
No part of this book may be reproduced in any form or by any means without permission in writing from Wordware Publishing, Inc.
Printed in the United States of America ISBN-13: 978-1-59822-002-5
ISBN-10: 1-59822-002-0
10 9 8 7 6 5 4 3 2 1
0506
Brand names and product names mentioned in this bookare trademarks or service marks of their respective companies. Anyomission or misuse (of any kind) of service marks or trademarks shouldnot be regarded as intent to infringe on the property of others. Thepublisher recognizes and respects all marks used by companies,manufacturers, and developers as a means to distinguish their products.
This book is sold as is, without warranty of any kind,either express or implied, respecting the contents of this book and anydisks or programs that may accompany it, including but not limited toimplied warranties for the book's quality, performance,merchantability, or fitness for any particular purpose. NeitherWordware Publishing, Inc. nor its dealers or distributors shall beliable to the purchaser or any other person or entity with respect toany liability, loss, or damage caused or alleged to have been causeddirectly or indirectly by this book.
All inquiries for volume purchases of this book shouldbe addressed to Wordware Publishing, Inc., at the above address.Telephone inquiries may be made by calling: (972) 423-0090
|
|
|
|
|
|
Preface (or, So Why Did He Write Yet Another Book?)
Yetanother book? Well, actually I am merely just one of the other ex-Atariemployees who was a member of Alan Kay's group, Atari CorporateResearch, and has published books.
For those of you who have been following my eventful career, you already know that this is actually my third published book.
Just to bring you up to date, my first book was titled The Death and Rebirth of the x86 Assembly Language Programmer and was originally written between July 1997 and June 1998. It also went under the title of x86 Assembly Language Optimization in Computer Games.Its timing was perfect as SSE code named Katmai by Intel was just aboutto come out. I could not find a publisher willing to sign as they"could not sell their last 80x86 assembly language book," and so I putit aside and went back to school to work on my next degree at OregonState University. (Go Beavers!)
Two years later I came up with a SIMD (vector) assemblylanguage book idea. Having learned my lesson, I sold the idea to apublisher first (Wordware Publishing) and Vector Game Math Processors becamemy first published book. It probably should have included 80x86, Mips,and PowerPC in the title, as that would have helped to increase itssales. It seems most people stumble across it.
Everybody who read it and contacted me seemed to likeit. It was more of a niche book as it primarily taught how to vectorizecode to take advantage of the vector instruction sets of processorsonly recently introduced into offices and homes. These containfunctionality that was once confined to the domain of the supercomputer. Vector Game Math Processorsdiscusses pseudo vector code that actually emulated vector processorsusing generic optimized C, as well as heavy utilization of thefollowing instruction sets:
80x86 (MMX, SSE(2), 3DNow! Professional)
PowerPC and AltiVec
MIPS (MIPS-3D, MIPS V, etc.)
While writing it I wrote a chapter on vertex shaders and sold the idea to my publisher. Thus my second book published was Learn Vertex and Pixel Shader Programming with DirectX 9.
And now we have come full circle, as this book is actually the completion of my original 80x86 book, The DeathBut I digress. The title was too long and not really to the point. Sonow that book has been completed, updated, and designed to be theprequel to my vector book. And thank you for buying both (you did, didyou not?) as you are reading one of them now!
The problem with writing "yet another book" is that onetends to use the best jokes or favorite stories in the first one. Well,I have so many from over the years, especially since I have eight kids(with the same wife), that I have saved some for this book. But relax,the worst stories are laying on the editing room floor in order to makethis book more academic friendly.
One (almost) last item. Keep an eye out for my not-so-technical book, Programming Pyrite The Fool's Gold of Programming Video Games.It is meant not to be a programming book, but a book about the trialsand tribulations of becoming a video game programmer. It is meant to bea satirical peek into this world, and is based on my experiences aswell as the good and bad stories that I have encountered over the years.
I wish to thank those who have contributed information,hints, testing time, etc., for this book. Paul Stapley for somerecommendations and technical overview recommendations; Peter Jefferiesand John Swiderski for some code sample testing; Ken Mayfield for some3D computer art donations; John Romero for his technical check and tiprecommendations; and some of those others that I have neglected tomention here for their contributions.
And most of all to my wife for not balking too muchafter she thought I had finished writing for good after finishing mysecond published book and then noticed within a couple weeks that I wasworking on this book. "Revising your vector book for a second edition?"Of course she did not seem to notice (or mention) the purchases of newmotherboards and processors as they were hidden inside my nice superquiet Sonata computer equipment.
I finally wish to thank Wes Beckwith from WordwarePublishing, Inc., for seeing the niche that this book would fill andconvincing his company to publish yet another of my books.
So get up from that floor or chair in the bookstore inwhich you are currently reading this book; you know you will need thisbook for work or school. Besides, I filled it with so much stuff youmight as well stop copying the stuff into that little notebook, grab asecond copy for use at home, walk over to that check stand, and buythem both. Tell your friends how great the book is so they will buy acopy too! Insist to your employer that the technical book library needsa few copies as well. This book is a tutorial and a reference manual.