Beruflich Dokumente
Kultur Dokumente
Lect. 2
Math. Note and Terminology
CPU connections and buses
Major CPU updates
Inside CPU
Registers
Assembly
Mov
endian convention
Add
Segments
Code Segment
Data Segment
Addressing modes
Stack Segment (Push/Pop)
Extra Segment
Flag register
Flags for ADD
Zero flag for Looping
56-23
=56+77
=133
=33
subtraction of binary & hex numbers
Flag register
Flags for ADD
Zero flag for Looping
Inside the
Computer
internal organization of computers
Inside the
Computer
internal organization of computers
Inside the
Computer
internal organization of computers
Inside the
Computer
internal organization of computers
Flag register
Flags for ADD
Zero flag for Looping
80286
Virtual memory.
a way of fooling the processor into thinking it has access to an
almost unlimited amount of memory.
80486,
80386 + math coprocessor on a single chip.
cache memory.
Cache memory is static RAM with a very fast access time.
All programs written for the 8088/86 will run on
286, 386, and 486 computers.
BRIEF HISTORY OF THE x86 FAMILY
BRIEF HISTORY OF THE x86 FAMILY
BRIEF HISTORY OF THE x86 FAMILY
Math. Note and Terminology
CPU connections and buses
Major CPU updates
Inside CPU
Registers
Assembly
Mov
endian convention
Add
Segments
Code Segment
Data Segment
Addressing modes
Stack Segment (Push/Pop)
Extra Segment
Flag register
Flags for ADD
Zero flag for Looping
Flag register
Flags for ADD
Zero flag for Looping
Assembly instruction
a mnemonic, optionally followed by one or two operands.
Operands are the data items being manipulated.
Mnemonics are commands to the CPU, telling it
what to do with those items.
Two widely used instructions are move & add.
Math. Note and Terminology
CPU connections and buses
Major CPU updates
Inside CPU
Registers
Assembly
Mov
endian convention
Add
Segments
Code Segment
Data Segment
Addressing modes
Stack Segment (Push/Pop)
Extra Segment
Flag register
Flags for ADD
Zero flag for Looping
MOV DX,CX
It called Register addressing mode
MOV instruction
Or 16 bits
MOV instruction
Flag register
Flags for ADD
Zero flag for Looping
16 bits example
Flag register
Flags for ADD
Zero flag for Looping
Flag register
Flags for ADD
Zero flag for Looping
Flag register
Flags for ADD
Zero flag for Looping
Flag register
Flags for ADD
Zero flag for Looping
The registers used for this purpose are SI, DI, and BX.
Combined with DS to generate the physical
address.
Flag register
Flags for ADD
Zero flag for Looping
100E
100F
THE STACK
pushing onto the stack
THE STACK
popping the stack
THE STACK
logical vs physical stack address
Flag register
Flags for ADD
Zero flag for Looping
Flag register
Flags for ADD
Zero flag for Looping
These six are CF, PF, AF, ZF, SF, and OF.
The remaining three, often called control flags, control
the operation of instructions before they are executed.
FLAG REGISTER
bits of the flag register
CF (Carry Flag) - Set when there is a carry out, from d7
after an 8-bit operation, or d15 after a 16-bit operation.
Used to detect errors in unsigned arithmetic operations.
AF (Auxiliary Carry Flag) - If there is a carry from d3 to
d4 of an operation, this bit is set; otherwise, it is cleared.
Used by instructions that perform BCD (binary coded
decimal) arithmetic.
PF (Parity Flag) - After certain operations, the parity
of the result's low-order byte is checked.
If the byte has an even number of 1s, the parity flag is set to 1;
otherwise, it is cleared.
FLAG REGISTER
bits of the flag register
ZF (Zero Flag) - Set to 1 if the result of an arithmetic or
logical operation is zero; otherwise, it is cleared.
SF (Sign Flag) - Binary representation of signed numbers
uses the most significant bit as the sign bit.
After arithmetic or logic operations, the status of this sign
bit is copied into the SF, indicating the sign of the result.
OF (Overflow Flag) - Set when the result of a signed
number operation is too large, causing the high-order
bit to overflow into the sign bit.
Used only to detect errors in signed arithmetic operations.
A negative result out of positive operands (or vice versa)
FLAG REGISTER
bits of the flag register
Flag register
Flags for ADD
Zero flag for Looping
Flag register
Flags for ADD
Zero flag for Looping
Flag register
Flags for ADD
Zero flag for Looping