Assembly Language Step-by-Step—Programming with DOS and Linux, Second Edition
Jeff Duntemann
Wiley Computer Publishing

NEW YORK • CHICHESTER • WEINHEIM • BRISBANE • SINGAPORE • TORONTO
Publisher: Robert Ipsen
Editor: Cary Sullivan
Managing Editor: Micheline Frederick
Text Design & Composition: North Market Street Graphics
Designations used by companies to distinguish their products are often claimed as trademarks. In all instances where John Wiley & Sons, Inc., is aware of a claim, the product names appear in initial capital or ALL CAPITAL LETTERS. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration.
Copyright © 2000 by Jeff Duntemann.
All rights reserved.
Published by John Wiley & Sons, Inc.
Published simultaneously in Canada.
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4744. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, (212) 850-6011, fax (212) 850-6008, E-Mail: <PERMREQ @ WILEY.COM>.
This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold with the understanding that the publisher is not engaged in professional services. If professional advice or other expert assistance is required, the services of a competent professional person should be sought.
Library of Congress Cataloging-in-Publication Data:
Duntemann, Jeff.
Assembly language step-by-step : programming with DOS and Linux / Jeff Duntemann.—2nd ed.
p. cm.
Rev. ed. of: Assembly language, © 1992.
ISBN 0-471-37523-3 (paper/CD-ROM : alk. paper)
1. Assembler language (Computer program language)I. Duntemann, Jeff. Assembly language.II. Title.
QA76.73.A8 D88 2000
005.265—dc21 00-020611
10 9 8 7 6 5 4 3 2 1
To the eternal memory of Kathleen M. Duntemann, Godmother 1920–1999 who gave me books when all I could do was put teeth marks on them. There are no words for how much I owe you!
Acknowledgments
First of all, to the authors of the software that I am honored to provide by their permission on this book''s CD-ROM:
Robert Anderton, author of NASM-IDE: www.inglenook.co.uk/nasmide/
Anthony Williams, author of ALINK: http://alink.home.dhs.org/
And, of course, the NASM team: Julian "Jules" Hall, Simon Tatham, H. Peter Anvin, John Fine, Kendall Bennet, Gary Clark, and Andrew Crabtree: www.web-sites.co.uk/nasm/
Because of their generosity, there is "nothing else to buy." Everything you need to program in assembly is right here on the CD-ROM for this book.
Abundant thanks also go to Bill Schindler, for teaching me the ways of the C library, and Michael Abrash, who has always has been the rock upon whom my knowledge of assembly language itself has been anchored.
Finally, to Carol, as always, for the sacramental friendship that has challenged me, shaped me, and redeemed me every day of our 30 years together and 23 years as spouses.