文档介绍:Ethical Hacking
Assembly Language
Tutorial
Number Systems
Memory in puter consists of numbers
Computer memory does not store these
numbers in decimal (base 10)
Because it greatly simplifies the hardware,
computers store all information in a binary
(base 2) format.
Copyright © by EC-Council
EC-Council All Rights reserved. Reproduction is strictly prohibited
Base 10 System
Base 10 numbers posed of 10 possible
digits (0-9)
Each digit of a number has a power of 10
associated with it based on its position in the
number
For example:
• 234 = 2 102 + 3 101 + 4 100
Copyright © by EC-Council
EC-Council All Rights reserved. Reproduction is strictly prohibited
Base 2 System
Base 2 numbers posed of 2 possible
digits (0 and 1)
Each digit of a number has a power of 2
associated with it based on its position in the
number. (A single binary digit is called a bit.)
For example:
• 110012 = 1 24 + 1 23 + 0 22 + 0 21 + 1 20
= 16 + 8 + 1
= 25
Copyright © by EC-Council
EC-Council All Rights reserved. Reproduction is strictly prohibited
Decimal 0 to 15 in Binary
Copyright © by EC-Council
EC-Council All Rights reserved. Reproduction is strictly prohibited
Binary Addition (C stands for Canary)
Copyright © by EC-Council
EC-Council All Rights reserved. Reproduction is strictly prohibited
Hexadecimal Number
Hexadecimal numbers use base 16. Hexadecimal (or
hex for short) can be used as a shorthand for binary
numbers.
Hex has 16 possible digits. This creates a problem since
there are no symbols to use for these extra digits after 9.
By convention, letters are used for these extra digits.
The 16 hex digits are 0-9 then A, B, C, D, E and F.
The digit A is equivalent to 10 in decimal, B is 11, etc.
Each digit of a hex number has a power of 16 associated
with it.
Copyright © by EC-Council
EC-Council All Rights reserved. Reproduction is strictly prohibited
Hex Example