Assembly language primer for the IBM PC & XT 9780452257115, 0452257115

Assembly language is the fastest and most powerful language available for any computer. It can access all of a machine&#

748 73 11MB

English Pages 501 [511] Year 1984

Report DMCA / Copyright

DOWNLOAD FILE

Assembly language primer for the IBM PC & XT
 9780452257115, 0452257115

Table of contents :
Acknowledgments viii
Introduction
Is Assembly Language Really so Hard to Learn? 2
Why Is This Book Unusual? 2
Why Learn Assembly Language on the IBM PC? 3
Who This Book Is For 3
The Equipment You Need to Use This Book 4
The Approach Used in This Book 11
1 Assembly Language and Debug
Assembly Language and Higher-Level Languages 13
Microprocessors 18
DEBUG Versus the Assembler 19
The Window of the 8088's Soul 21
Getting DEBUG Rolling 21
Summary 28
2 Instant Program
Whiting Your First Program 9 29
Running the Program 34
What an Assembler Really Does 35
Assembly-Language Instructions 37
Summary 50
3 What Is Assembly Language?
Filling in Details 52
Registers 55
ASCIl Display Program 60
Some Sound Advice 68
Summary 81
4 Inside DOS—The Disk Operating System
The Parts of DOS 92
DOS Functions 96
Writing to the Printer 107
Summary 118
5 Introduction to the IBM MACRO Assembler
MASM and ASM_ 120
What Does an Assembler Do? 121
Assembling Your First Program 125
Assembling SMASCII2 133
Deciphering Machine-Language Op-Codes 139
Using a Batch File to Speed Assembly 142
Summary 145
6 Using the IBM MACRO Assembler 147
The BINIHEX Program 148
New Instructions 154
Using DEBUG's Trace Command 165
The DECIBIN Program 170
The DECIHEX Program 183
Cross-Reference: Using the CREF Program 187
Summary 191
7 How Does It Sound? 192
Why Use Sound? 193
The White Noise Program 193
The Machine Gun Program 197
Generating Sound with the Timer 208
Controlling Sound with the Keyboard 215
Summary 230
8 Memory Segmentation and EXE Files 231
Memory Segmentation 232
The PSTRING Program 237
The PIANO Program as an EXE File 249
The EXEFORM Program—A Nonprogram 252
Segmentation and the String-Handling Instructions 258
The Compare Strings Program 262
Summary 272
9 Inside the ROM 273
Scan Codes and the Keyboard 278
Video ROM Routines 285
Summary 293
10 Monochrome and Color Graphics 294
Graphics Modes in the IBMPC 295
Memory-Mapped Graphics 297
Color Graphics 309
Drawing Lines 329
Summary 344
11 Reading and Writing Disk Files 345
The Historical Perspective 346
Floppies and the Fixed Disk 347
Sequential Access 349
Random Access 373
Random Block Access 378
Summary 384
12 File Handle Disk Access 385
Features of File Handle Access 385
The ZOPEN Program 388
The ZREAD Program 396
Writing toa File 401
Getting to the Middle of a File 408
Summary 41]
13 Interfacing to BASIC and Pascal 412
General Interfacing Considerations 413
Interfacing to BASIC with USR 416
Interfacing to BASIC with CALL 437
Interfacing to Pascal 444
Summary 452
Appendix A—Hexadecimal Numbering 453
What Is a Numbering System? 453
What Numbering System Do Computers Like? 454
Appendix B—Supplementary Programs 463
MEMSCAN 463
HEXIDEC 469
PRIME 472
The Birthday Programs 477
SAVEIMAG 494
Index 499

Polecaj historie