Muutke küpsiste eelistusi

E-raamat: X86 Assembly Language and C Fundamentals [Taylor & Francis e-raamat]

(Santa Clara University, California, USA)
  • Formaat: 814 pages, 100 Tables, black and white; 337 Illustrations, black and white
  • Ilmumisaeg: 22-Jan-2013
  • Kirjastus: CRC Press Inc
  • ISBN-13: 9780429099274
Teised raamatud teemal:
  • Taylor & Francis e-raamat
  • Hind: 240,04 €*
  • * hind, mis tagab piiramatu üheaegsete kasutajate arvuga ligipääsu piiramatuks ajaks
  • Tavahind: 342,91 €
  • Säästad 30%
  • Formaat: 814 pages, 100 Tables, black and white; 337 Illustrations, black and white
  • Ilmumisaeg: 22-Jan-2013
  • Kirjastus: CRC Press Inc
  • ISBN-13: 9780429099274
Teised raamatud teemal:
"PREFACE Although assembly language is not as prevalent as a high-level language, such as C or an object-oriented language like C++, it is the predominant language used in embedded microprocessors. A course in a high-level language, such as C usually precedes a course in assembly language. Assembly language programming requires a knowledge of number representations, such as fixed-point, decimal, and floating-point; also digital logic, registers, and stacks. In order to thoroughly understand assembly language, it is necessary to be familiar with the architecture of the computer on which the language is being used. For the X86 assembly language, this implies the Intel and Intel-like microprocessors. Programs written in assembly language are usually faster and more compact than programs written in a high-level language and provide greater control over the program application. Assembly language is machine dependent; that is, it is used only with a specific type of processor. A high-level language, however, is usually machine independent; that is, it can be used with any processor. Assembly language programs use an assembler to convert the assembly language code to the machine language of 1s and 0s. This is in contrast to high-level languages which use compilers to accomplish the transformation. Assembly languages consist of mnemonic codes, which are similar to English words, making the program easy to read. For example, the MOV instruction moves data from a source location to a destination location; the XCHGinstruction exchanges the contents of a source location and a destination location; and the logical AND instruction performs the bitwise AND operation of two operands"--

The predominant language used in embedded microprocessors, assembly language lets you write programs that are typically faster and more compact than programs written in a high-level language and provide greater control over the program applications. Focusing on the languages used in X86 microprocessors, X86 Assembly Language and C Fundamentals explains how to write programs in the X86 assembly language, the C programming language, and X86 assembly language modules embedded in a C program. A wealth of program design examples, including the complete code and outputs, help you grasp the concepts more easily. Where needed, the book also details the theory behind the design.

Learn the X86 Microprocessor Architecture and Commonly Used Instructions

Assembly language programming requires knowledge of number representations, as well as the architecture of the computer on which the language is being used. After covering the binary, octal, decimal, and hexadecimal number systems, the book presents the general architecture of the X86 microprocessor, individual addressing modes, stack operations, procedures, arrays, macros, and input/output operations. It highlights the most commonly used X86 assembly language instructions, including data transfer, branching and looping, logic, shift and rotate, and string instructions, as well as fixed-point, binary-coded decimal (BCD), and floating-point arithmetic instructions.

Get a Solid Foundation in a Language Commonly Used in Digital Hardware

Written for students in computer science and electrical, computer, and software engineering, the book assumes a basic background in C programming, digital logic design, and computer architecture. Designed as a tutorial, this comprehensive and self-contained text offers a solid foundation in assembly language for anyone working with the design of digital hardware.

Preface xvii
Chapter 1 Number Systems and Number Representations 1(50)
1.1 Number Systems
1(25)
1.1.1 Binary Number System
4(2)
1.1.2 Octal Number System
6(2)
1.1.3 Decimal Number System
8(1)
1.1.4 Hexadecimal Number System
9(3)
1.1.5 Arithmetic Operations
12(8)
1.1.6 Conversion between Radices
20(6)
1.2 Number Representations
26(21)
1.2.1 Sign Magnitude
26(2)
1.2.2 Diminished-Radix Complement
28(3)
1.2.3 Radix Complement
31(1)
1.2.4 Arithmetic Operations
32(15)
1.3 Problems
47(4)
Chapter 2 X86 Processor Architecture 51(36)
2.1 General Architecture
51(1)
2.2 Arithmetic and Logic Unit
52(2)
2.3 Control Unit
54(1)
2.4 Memory Unit
55(10)
2.4.1 Main Memory
55(1)
2.4.2 Hamming Code
56(5)
2.4.3 Cache Memory
61(4)
2.5 Input/Output
65(3)
2.5.1 Tape Drives
65(1)
2.5.2 Disk Drives
66(2)
2.6 Register Set
68(12)
2.6.1 General-Purpose Registers
70(1)
2.6.2 Segment Registers
71(1)
2.6.3 EFLAGS Register
72(2)
2.6.4 Instruction Pointer
74(1)
2.6.5 Floating-Point Registers
75(5)
2.7 Translation Lookaside Buffer
80(1)
2.8 The Assembler
81(2)
2.8.1 The Assembly Process
82(1)
2.9 Problems
83(4)
Chapter 3 Addressing Modes 87(14)
3.1 Register Addressing
88(1)
3.2 Immediate Addressing
88(1)
3.3 Direct Memory Addressing
89(1)
3.4 Base (Register Indirect) Memory Addressing
89(1)
3.5 Base or Index Plus Displacement Addressing
90(2)
3.6 Base and Index Plus Displacement Addressing
92(2)
3.7 Scale Factor
94(2)
3.8 Segment Override Prefix
96(1)
3.9 X86 Operation Modes
96(1)
3.9.1 Protected Mode
96(1)
3.9.2 Real Mode
97(1)
3.10 Problems
97(4)
Chapter 4 C Programming Fundamentals 101(92)
4.1 Structure of a C Program
101(3)
4.2 Variables and Constants
104(9)
4.2.1 Variables
104(3)
4.2.2 Constants
107(6)
4.3 Input and Output
113(7)
4.3.1 The Printf()Function
113(4)
4.3.2 The Scanf()Function
117(3)
4.4 Operators
120(40)
4.4.1 Arithmetic Operators
121(11)
4.4.2 Relational Operators
132(3)
4.4.3 The If Statement
135(4)
4.4.4 The Else Statement
139(6)
4.4.5 Logical Operators
145(3)
4.4.6 Conditional Operator
148(3)
4.4.7 Increment and Decrement Operators
151(5)
4.4.8 Bitwise Operators
156(4)
4.5 While Loop
160(3)
4.6 For Loop
163(3)
4.7 Additional C Constructs
166(17)
4.7.1 Arrays
167(5)
4.7.2 Strings
172(7)
4.7.3 Pointers
179(1)
4.7.4 Functions
180(3)
4.8 Problems
183(10)
Chapter 5 Data Transfer Instructions 193(38)
5.1 Data Types
193(4)
5.1.1 Signed Binary Integers
193(1)
5.1.2 Unsigned Binary Integers
194(1)
5.1.3 Unpacked and Packed BCD Integers
195(1)
5.1.4 Floating-Point Numbers
196(1)
5.2 Move Instructions
197(9)
5.2.1 General Move Instructions
198(5)
5.2.2 Move with Sign/Zero Extension
203(1)
5.2.3 Conditional Move
204(2)
5.3 Load Effective Address
206(1)
5.4 Load Segment Registers
207(2)
5.5 Exchange Instructions
209(11)
5.5.1 Exchange
209(4)
5.5.2 Byte Swap
213(2)
5.5.3 Exchange and Add
215(2)
5.5.4 Compare and Exchange
217(3)
5.6 Translate
220(5)
5.7 Conversion Instructions
225(4)
5.8 Problems
229(2)
Chapter 6 Branching and Looping Instructions 231(40)
6.1 Branching Instructions
232(19)
6.1.1 Unconditional Jump Instruction
232(5)
6.1.2 Compare Instruction
237(4)
6.1.3 Conditional Jump Instructions
241(10)
6.2 Looping Instructions
251(15)
6.2.1 Unconditional Loop
251(3)
6.2.2 Conditional Loops
254(2)
6.2.3 Implementing while Loops
256(4)
6.2.4 Implementing for Loops
260(6)
6.3 Problems
266(5)
Chapter 7 Stack Operations 271(14)
7.1 Stack Structure
272(8)
7.2 Additional Push Instructions
280(1)
7.3 Additional Pop Instructions
281(1)
7.4 Problems
282(3)
Chapter 8 Logical, Bit, Shift, and Rotate Instructions 285(62)
8.1 Logical AND Instruction
285(6)
8.2 Logical Inclusive-OR Instruction
291(3)
8.3 Logical Exclusive-OR Instruction
294(4)
8.4 Logical NOT Instruction - 1s Complement
298(1)
8.5 NEG Instruction 2s Complement
299(5)
8.6 TEST and Byte Set on Condition Instructions
304(1)
8.6.1 TEST Instruction
304(1)
8.6.2 Set Byte on Condition (SETcc) Instruction
304(1)
8.7 Bit Test Instructions
305(9)
8.7.1 Bit Test (BT) Instruction
305(1)
8.7.2 Bit Test and Set (BTS) Instruction
306(1)
8.7.3 Bit Test and Reset (BTR) Instruction
306(1)
8.7.4 Bit Test and Complement (BTC) Instruction
307(7)
8.8 Bit Scan Instructions
314(6)
8.8.1 Bit Scan Forward (BSF) Instruction
314(3)
8.8.2 Bit Scan Reverse (BSR) Instruction
317(3)
8.9 Shift Instructions
320(13)
8.9.1 Shift Arithmetic Left (SAL) Instruction
320(3)
8.9.2 Shift Logical Left (SHL) Instruction
323(1)
8.9.3 Shift Arithmetic Right (SAR) Instruction
324(2)
8.9.4 Shift Logical Right (SHR) Instruction
326(1)
8.9.5 Shift Left Double (SHLD) Instruction
327(4)
8.9.6 Shift Right Double (SHRD) Instruction
331(2)
8.10 Rotate Instructions
333(10)
8.10.1 Rotate Left (ROL) Instruction
334(1)
8.10.2 Rotate through Carry Left (RCL) Instruction
335(4)
8.10.3 Rotate Right (ROR) Instruction
339(1)
8.10.4 Rotate through Carry Right (RCR) Instruction
339(4)
8.11 Problems
343(4)
Chapter 9 Fixed-Point Arithmetic Instructions 347(62)
9.1 Addition
347(16)
9.1.1 Add (ADD) Instruction
349(3)
9.1.2 Add with Carry (ADC) Instruction
352(6)
9.1.3 Increment by 1(INC) Instruction
358(5)
9.2 Subtraction
363(14)
9.2.1 Subtract (SUB) Instruction
366(3)
9.2.2 Integer Subtraction with Borrow (SBB) Instruction
369(1)
9.2.3 Decrement by 1(DEC) Instruction
370(7)
9.2.4 Two's Complement Negation (NEG) Instruction
377(1)
9.3 Multiplication
377(12)
9.3.1 Unsigned Multiply (MUL) Instruction
378(4)
9.3.2 Signed Multiply (IMUL) Instruction
382(7)
9.4 Division
389(9)
9.4.1 Unsigned Divide (DIV) Instruction
391(3)
9.4.2 Signed Divide (IDIV) Instruction
394(4)
9.5 Problems
398(11)
Chapter 10 Binary-Coded Decimal Arithmetic Instructions 409(36)
10.1 ASCII Adjust after Addition (AAA) Instruction
411(3)
10.2 Decimal Adjust AL after Addition (DAA) Instruction
414(7)
10.3 ASCII Adjust AL after Subtraction (AAS) Instruction
421(3)
10.4 Decimal Adjust AL after Subtraction (DAS) Instruction
424(3)
10.5 ASCII Adjust AX after Multiplication (AAM) Instruction
427(8)
10.6 ASCII Adjust AX before Division (AAD) Instruction
435(5)
10.7 Problems
440(5)
Chapter 11 Floating-Point Arithmetic Instructions 445(84)
11.1 Floating-Point Fundamentals
446(5)
11.1.1 Rounding Methods
449(2)
11.2 Load Data instructions
451(5)
11.2.1 Load Floating-Point Value (FLD) Instructions
451(2)
11.2.2 Load Constant Instructions
453(1)
11.2.3 Load X87 FPU Control Word (FLDCW) Instruction
454(1)
11.2.4 Load X87 FPU Environment (FLDENV) Instruction
455(1)
11.2.5 Load Integer (FILD) Instruction
455(1)
11.2.6 Load Binary-Coded Decimal (FBLD) Instruction
455(1)
11.3 Store Data Instructions
456(7)
11.3.1 Store BCD Integer and Pop (FBSTP) Instruction
456(1)
11.3.2 Store Integer (FIST) Instruction
456(1)
11.3.3 Store Integer and Pop (FISTP) Instruction
456(1)
11.3.4 Store Integer with Truncation and Pop (FISTTP) Instruction
457(2)
11.3.5 Store Floating-Point Value (FST) Instruction
459(2)
11.3.6 Store Floating-Point Value and Pop (FSTP) Instruction
461(1)
11.3.7 Store X87 FPU Control Word (FSTCW) Instruction
461(1)
11.3.8 Store X87 FPU Environment (FSTENV) Instruction
462(1)
11.3.9 Store X87 FPU Status Word (FSTSW) Instruction
462(1)
11.4 Addition Instructions
463(6)
11.4.1 Overflow and Underflow
465(1)
11.4.2 Add Instructions
466(3)
11.5 Subtraction Instructions
469(9)
11.5.1 Numerical Examples
470(2)
11.5.2 Subtract Instructions
472(6)
11.6 Multiplication Instructions
478(8)
11.6.1 Double Bias
478(1)
11.6.2 Numerical Examples
479(2)
11.6.3 Multiply Instructions
481(5)
11.7 Division Instructions
486(11)
11.7.1 Zero Bias
487(2)
11.7.2 Numerical Example
489(3)
11.7.3 Divide Instructions
492(5)
11.8 Compare instructions
497(6)
11.8.1 Compare Floating-Point Values
497(2)
11.8.2 Compare Floating-Point Values and Set EFLAGS
499(2)
11.8.3 Compare Integer
501(1)
11.8.4 Test
501(1)
11.8.5 Unordered Compare Floating-Point Values
501(2)
11.9 Trigonometric Instructions
503(12)
11.9.1 Cosine
503(1)
11.9.2 Partial Arctangent
504(2)
11.9.3 Partial Tangent
506(1)
11.9.4 Sine
507(2)
11.9.5 Sine and Cosine
509(6)
11.10 Additional Instructions
515(7)
11.10.1 Absolute Value
515(1)
11.10.2 Change Sign
516(1)
11.10.3 Decrement Stack-Top Pointer
516(1)
11.10.4 Free Floating-Point Register
516(1)
11.10.5 Increment Stack-Top Pointer
517(1)
11.10.6 Partial Remainder
517(1)
11.10.7 Round to Integer
517(1)
11.10.8 Square Root
518(1)
11.10.9 Exchange Register Contents
519(3)
11.11 Problems
522(7)
Chapter 12 Procedures 529(14)
12.1 Calla Procedure
530(1)
12.2 Return from a Procedure
531(1)
12.3 Passing Parameters to a Procedure
531(9)
12.4 Problems
540(3)
Chapter 13 String Instructions 543(32)
13.1 Repeat Prefixes
544(5)
13.1.1 REP Prefix
545(1)
13.1.2 REPE/REPZ Prefix
546(1)
13.1.3 REPNE/REPNZ Prefix
547(2)
13.2 Move String Instructions
549(5)
13.2.1 Move Data from String to String (Explicit Operands) Instructions
550(1)
13.2.2 Move Data from String to String (No Operands) Instructions
551(3)
13.3 Load String Instructions
554(4)
13.3.1 Load String (Explicit Operands) Instructions
555(1)
13.3.2 Load String (No Operands) Instructions
555(3)
13.4 Store String Instructions
558(2)
13.4.1 Store String (Explicit Operands) Instructions
558(1)
13.4.2 Store String (No Operands) Instructions
558(2)
13.5 Compare Strings Instructions
560(4)
13.5.1 Compare Strings (Explicit Operands) Instructions
561(1)
13.5.2 Compare Strings (No Operands) Instructions
561(3)
13.6 Scan String Instructions
564(2)
13.6.1 Scan String (Explicit Operands) Instructions
564(1)
13.6.2 Scan String (No Operands) Instructions
565(1)
13.7 Problems
566(9)
Chapter 14 Arrays 575(18)
14.1 One-Dimensional Arrays
575(11)
14.1.1 One-Dimensional Arrays in C
582(4)
14.2 Multidimensional Arrays
586(4)
14.3 Problems
590(3)
Chapter 15 Macros 593(24)
15.1 Macro Definitions
593(4)
15.2 Macro Examples
597(17)
15.3 Problems
614(3)
Chapter 16 Interrupts and Input/Output Operations 617(12)
16.1 Interrupts
617(2)
16.2 Direct Memory Access
619(3)
16.3 Memory-Mapped I/O
622(1)
16.4 In/Out Instructions
623(5)
16.4.1 Register I/O IN Instructions
624(1)
16.4.2 Register I/O OUT Instructions
625(1)
16.4.3 String I/O IN Instructions
625(2)
16.4.4 String I/O OUT Instructions
627(1)
16.5 Problems
628(1)
Chapter 17 Additional Programming Examples 629(52)
17.1 Programming Examples
629(48)
17.2 Problems
677(4)
Appendix A ASCII Character Codes 681(2)
Appendix B Answers to Select Problems 683(98)
Chapter 1 Number Systems and Number Representations
683(2)
Chapter 2 X86 Processor Architecture
685(1)
Chapter 3 Addressing Modes
686(1)
Chapter 4 C Programming Fundamentals
687(6)
Chapter 5 Data Transfer Instructions
693(5)
Chapter 6 Branching and Looping Instructions
698(1)
Chapter 7 Stack Operations
699(3)
Chapter 8 Logical, Bit, Shift, and Rotate Instructions
702(7)
Chapter 9 Fixed-Point Arithmetic Instructions
709(14)
Chapter 10 Binary-Coded Decimal Arithmetic Instructions
723(12)
Chapter 11 Floating-Point Arithmetic Instructions
735(12)
Chapter 12 Procedures
747(4)
Chapter 13 String Instructions
751(4)
Chapter 14 Arrays
755(4)
Chapter 15 Macros
759(9)
Chapter 16 Interrupts and Input/Output Operations
768(1)
Chapter 17 Additional Programming Examples
769(12)
Index 781
Joseph Cavanagh is an adjunct professor in the computer engineering department at Santa Clara University in California. He is the author of several textbooks, including Computer Arithmetic and Verilog HDL Fundamentals (2009), Digital Design and Verilog HDL Fundamentals (2008), Verilog HDL: Digital Design and Modeling (2007), and Sequential Logic: Analysis and Synthesis (2006), as well as a novel, The Computer Conspiracy.