2003 - PC Assembly Language

2003 - PC Assembly Language - PC Assembly Language Paul A....

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PC Assembly Language Paul A. Carter November 11, 2003 Copyright c 2001, 2002, 2003 by Paul Carter This may be reproduced and distributed in its entirety (including this au- thorship, copyright and permission notice), provided that no charge is made for the document itself, without the author’s consent. This includes “fair use” excerpts like reviews and advertising, and derivative works like trans- lations. Note that this restriction is not intended to prohibit charging for the service of printing or copying the document. Instructors are encouraged to use this document as a class resource; however, the author would appreciate being notified in this case. Contents Preface v 1 Introduction 1 1.1 Number Systems . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 Decimal . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.3 Hexadecimal . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Computer Organization . . . . . . . . . . . . . . . . . . . . . 4 1.2.1 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.2 The CPU . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2.3 The 80x86 family of CPUs . . . . . . . . . . . . . . . . 6 1.2.4 8086 16-bit Registers . . . . . . . . . . . . . . . . . . . 7 1.2.5 80386 32-bit registers . . . . . . . . . . . . . . . . . . 7 1.2.6 Real Mode . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2.7 16-bit Protected Mode . . . . . . . . . . . . . . . . . 9 1.2.8 32-bit Protected Mode . . . . . . . . . . . . . . . . . . 9 1.2.9 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.3 Assembly Language . . . . . . . . . . . . . . . . . . . . . . . 11 1.3.1 Machine language . . . . . . . . . . . . . . . . . . . . 11 1.3.2 Assembly language . . . . . . . . . . . . . . . . . . . . 11 1.3.3 Instruction operands . . . . . . . . . . . . . . . . . . . 12 1.3.4 Basic instructions . . . . . . . . . . . . . . . . . . . . 12 1.3.5 Directives . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.3.6 Input and Output . . . . . . . . . . . . . . . . . . . . 16 1.3.7 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.4 Creating a Program . . . . . . . . . . . . . . . . . . . . . . . 18 1.4.1 First program . . . . . . . . . . . . . . . . . . . . . . . 18 1.4.2 Compiler dependencies . . . . . . . . . . . . . . . . . . 21 1.4.3 Assembling the code . . . . . . . . . . . . . . . . . . . 22 1.4.4 Compiling the C code . . . . . . . . . . . . . . . . . . 22 1.4.5 Linking the object files . . . . . . . . . . . . . . . . . 23 1.4.6 Understanding an assembly listing file . . . . . . . . . 23 i ii CONTENTS 1.5 Skeleton File . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2 Basic Assembly Language 27 2.1 Working with Integers . . . . . . . . . . . . . . . . . . . . . . 27 2.1.1 Integer representation . . . . . . . . . . . . . . . . . . 27 2.1.2 Sign extension . . . . . . . . . . . . . . . . . . . . . . 30 2.1.3 Two’s complement arithmetic . . . . . . . . . . . . . .Two’s complement arithmetic ....
View Full Document

This note was uploaded on 11/29/2010 for the course DEC 123 taught by Professor Fr during the Spring '10 term at ENS Cachan.

Page1 / 188

2003 - PC Assembly Language - PC Assembly Language Paul A....

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online