Assembly Language For x86 Processors: Chapter 1: Basic Concepts
Assembly Language For x86 Processors: Chapter 1: Basic Concepts
7th Edition
Kip Irvine
(c) Pearson Education, 2015. All rights reserved. You may modify and copy this slide show for your personal use, or for
use in the classroom, as long as this copyright statement, the author's name, and the title are not changed.
Chapter Overview
xyz.obj xyz.obj
xyz.exe xyz.exe
Irvine, Kip R. Assembly Language for Intel-Based Computers 7/e, 2015. Added by Zuoliu Ding 3
Assembly Language Applications
one to many
• Level 4
• Application-oriented languages
• C++, Java, Pascal, Visual Basic . . .
• Programs compile into assembly language
(Level 3)
• Level 3
• Instruction mnemonics that have a one-to-
one correspondence to machine language
• Programs are translated into Instruction Set
Architecture Level - machine language
(Level 2)
• Level 2
• Also known as conventional machine
language
• Executed by Level 1 (Digital Logic)
• Level 1
• CPU, constructed from digital logic gates
• System bus
• Memory
• Implemented using bipolar transistors
• Bit numbering:
MSB LSB
1011001010011100
15 0
Every binary
number is a
sum of powers
of 2
37 = 100101
carry: 1
0 0 0 0 0 1 0 0 (4)
+ 0 0 0 0 0 1 1 1 (7)
0 0 0 0 1 0 1 1 (11)
bit position: 7 6 5 4 3 2 1 0
word 16
Standard sizes:
doubleword 32
quadword 64
What is the largest unsigned integer that may be stored in 20 bits? 1048475
• Divide the sum of two digits by the number base (16). The quotient
becomes the carry value, and the remainder is the sum digit.
1 1
36 28 28 6A
42 45 58 4B
78 6D 80 B5
21 / 16 = 1, rem 5
16 + 5 = 21
-1
C6 75
A2 47
24 2E
sign bit
What’s this? 1 1 1 1 0 1 1 0
Negative -10
0 0 0 0 1 0 1 0 Positive +10
00001100 00001100
– 00000011 +1 1 1 1 1 1 0 1
00001001 00001001
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, 2010. Added by Zuoliu Ding 31
Ranges of Signed Integers
The highest bit is reserved for the sign. This limits the range:
10000000
Why? - 01111111
Practice: What is the largest positive value that may be stored in 20 bits?
• NOT
• AND
• OR
• Operator Precedence
• Truth Tables
NOT
AND
OR
Example: X Y
• Example: (Y S) (X S)
X
mux Z
Y
Two-input multiplexer
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, 2010. Added by Zuoliu Ding 42
Summary
• Assembly language helps you learn how software is
constructed at the lowest levels
• Assembly language has a one-to-one relationship
with machine language
• Each layer in a computer's architecture is an
abstraction of a machine
• layers can be hardware or software
• Boolean expressions are essential to the design of
computer hardware and software