Machine Language Programming Cookbook_part_2.pdf

(6783 KB) Pobierz
Don
Lancaster's
MACHINE
LANGUAGE
-
PROGRAMMING
-
COOKBOOK
Part Two
Machine
Language
Programming
Cookbook II
by Don Lancaster
An eBook reprint of chapters 8 and 9
of Micro Cookbook Volume II
SYNERGETICS
SP
PRESS
3860 West First Street, Thatcher, AZ 85552 USA
(928) 428-4073
http://www.tinaja.com
Copyright © 2010 by Synergetics Press
Thatcher, Arizona 95552
THIRD EDITION
FIRST PRINTING—2010
All rights reserved. Reproduction or use, without
express permission of editorial or pictorial content,
in any manner, is prohibited. No patent liability is
assumed with respect to the use of the information
contained herein. While every precaution has been
taken in the preperation of this book, the publisher
assumes no responsibility for errors or omissions.
Neither is any liability assumed for damages resulting
from the use of the information contained herein.
International Standard Book Number: 1-882193-15-8
Created in the United States of America.
ABOUT THE AUTHOR
Don Lancaster heads
Synergetics,
a new-age software,
prototyping, and consulting firm involved in micro appli­
cations and electronic design. Don is the well-known
author of the classic
CMOS
and
TTL Cookbooks.
He is
one of the microcomputer pioneers, having introduced
the first hobbyist integrated circuit projects, the first
sanely priced digital electronics modules, the first low
cost TVT
-1
video display terminal, the first hobbyist key­
boards, and lots more. Don's numerous books and arti­
cles on personal computing and electronics applications
have set new standards for understandable, useful, and
exciting technical writing. Don's other interests include
ecological studies, firefighting, cave exploration, tinaja
questing, and bicycling.
Other Howard
W.
Sams books by Don Lancaster include
Active Filter Cookbook, CMOS Cookbook, TTL Cook­
book, RTL Cookbook
(out of print),
TVT Cookbook,
Cheap Video Cookbook, Son of Cheap Video, The Hex­
adecimal Chronicles, The Incredible Secret Money
Machine, Don Lancaster's Micro Cookbook,
Volume
1,
and the continuing
Enhancing Your Apple II
series.
Preface
Machine Language Programming
is the second of three volumes
on the fundamentals of microprocessors and microcomputers. In
this volume, we (that's you, me, and that gorilla) look into the
details of the micro's own language.
Volume
1
covered the fundamentals of microprocessors needed
for us to start understanding machine language programming. Vol­
ume
3
is a reference volume containing detailed descriptions of
hundreds of popular and micro-related integrated circuits.
Why machine language? Because, as it turns out, virtually
a//
win­
ning and top performing microcomputer programs run
only
in
machine language. The marketplace has spoken. It has not only
spoken but is shouting: BASIC and PASCAL need not apply.
Volume
2
will show you the fundamentals of machine language
programming through a series of
discovery modules
that you can
apply to the microprocessor family and the microcomputer of your
choice. Once you get past these modules and gain a deep under­
standing of what machine language is all about, then you can step
up to the wonders of
assembly language,
which is really nothing
but automated machine language programming that is made much
faster, lots more convenient, and bunches more fun.
Volume
2
picks up at Chapter
6
in this continuing series. Here we
look at address space and addressing concepts, as well as working
registers and how they are used. Next is a study of system architec­
ture, seeing what goes where in a typical microcomputer, with
heavy emphasis on understanding system buses and how they
work. From there we go into memory maps and on to addressing
modes, those all-important methods a microcomputer's CPU has of
accessing memory and its own working registers. We look at seven
fundamental addressing modes that apply to most micros one way
or another, either by themselves or in combination.
Address modes are then summarized in a group of quick-refer­
ence charts. Next come some stock forms useful for hex dumps,
machine language programming, and assembly language program­
ming. This chapter ends up with a toolkit that you can put together
for machine language work.
Chapter
7
is the real heavy of this volume. Here we actually do
lots of machine language programming. We use the "those
#$! #$
cards" method, in which you work one-on-one with each individ­
ual op code as the need arises, again on the microprocessor of your
choice. There is a series of nine
discovery modules
here. These are
elementary programming problems that start with the simplest of
Zgłoś jeśli naruszono regulamin