Basic Concepts: 1.1 Welcome To Assembly Language 1
Basic Concepts: 1.1 Welcome To Assembly Language 1
Basic Concepts
int Y;
int X = (Y + 4) * 3;
• Binary Numbers
o Translating between binary and decimal
• Binary Addition
• Integer Storage Sizes
• Hexadecimal Integers
o Translating between decimal and hexadecimal
o Hexadecimal subtraction
• Signed Integers
o Binary subtraction
• Character Storage
• Starting with the LSB, add each pair of digits, include the carry if present.
o Example: Hex 1234 equals (1 × 163) + (2 × 162) + (3 × 161) + (4 × 160), or decimal 4,660.
o Example: Hex 3BA4 equals (3 × 163) + (11 * 162) + (10 × 161) + (4 × 160), or decimal
15,268.
• Hexadecimal Addition
o Divide the sum of two digits by the number base (16). The quotient becomes the carry
value, and the remainder is the sum digit.
• Hexadecimal Subtraction
o When a borrow is required from the digit to the left, add 16 (decimal) to the current
digit's value:
• Binary Subtraction
o When subtracting A – B, convert B to its two's complement
o Add A to (–B)
00001100 00001100
– 00000011 + 11111101
00001001
• Ranges of Signed Integers
o The highest bit is reserved for the sign. This limits the range:
• Character sets
o Standard ASCII (0 – 127)
o Extended ASCII (0 – 255)
o ANSI (0 – 255)
o Unicode (0 – 65,535)
• Null-terminated String
o Array of characters followed by a null byte
• Numeric Data Representation
o pure binary can be calculated directly
o ASCII binary string of digits: "01010101"
o ASCII decimal string of digits: "65"
o ASCII hexadecimal string of digits: "9C"
• Boolean algebra defines a set of operations on the values true and false.
• Boolean expression involves a Boolean operator and one or more operands.
• Boolean Algebra
o Based on symbolic logic, designed by George Boole
o Boolean expressions created from: NOT, AND, OR
• NOT
o Inverts (reverses) a boolean value
o Truth table for Boolean NOT operator:
• AND
o Truth table for Boolean AND operator:
OR
• Operator Precedence
o The NOT operator has the highest precedence followed by AND and OR.
o To avoid ambiguity, use parentheses to force the initial evaluation of an expression.
o Examples showing the order of operations:
• A Boolean function has one or more Boolean inputs, and returns a single Boolean output.
• A truth table shows all the inputs and outputs of a Boolean function
o Example: ¬X ∨ Y
o Example: X ∨ ¬Y
o Example: (Y ∧ S) ∨ (X ∧ ¬S)
• This book focuses on programming microprocessors compatible with the Intel IA-32
processor family, using the MS-Windows platform.
• Assembly language helps you learn how software is constructed at the lowest levels
• Assembly language has a one-to-one relationship with machine language.
• Assembly language is not portable because it is tied to a specific processor family.
• Virtual machine concept can be related to real-world computer layers, including digital logic,
microarchitecture, instruction set architecture, operating system, assembly language,
and high-level languages.
• 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
• A truth table is an effective way to show all possible inputs and output of a Boolean
function.