AKT211 – CAO 04 – x86 Architecture: Intel 8088 Ghifar Parahyangan Catholic University Sept 19,...
-
Upload
basil-fletcher -
Category
Documents
-
view
221 -
download
0
description
Transcript of AKT211 – CAO 04 – x86 Architecture: Intel 8088 Ghifar Parahyangan Catholic University Sept 19,...
AKT211 – CAO
04 – x86 Architecture: Intel 8088
GhifarParahyangan Catholic University
Sept 19, 2011
Reference• Brey, Barry. “The Intel Microprocessor
8086/8088, 80186/80188, 80286, 80386, 80486, Pentium, and Pentium Pro Processor: Architecture, Programming, and Interfacing 4th edition”. Prentice-Hall International Inc. 1997
Outline Intel x86 Architecture Evolution The Programming Model Register Types Instruction Set Data Types Byte ordering Memory Organization
Intel x86 Arch. Evolution• 8080
– The world’s 1st general-purpose microprocessor– 8-bit machine– 8-bit data path to memory– Altair
• 8086– 16-bit machine– wider data path, larger register– instruction cache / queue– 1st appearance of the x86 architecture– The variant : 8088, IBM’s 1st personal computer– 1-MByte memory addressing
Intel x86 Arch. Evolution• 80286
– extension of 8086, enabled addressing a 16-MByte
• 80386– Intel 1st 32-bit machine– support multitasking
• 80486– more sophisticated and powerful cache
technology– sophisticated instruction pipelining– built-in math coprocessor
Intel x86 Arch. Evolution• Pentium
– use of superscalar technology, allow multiple instructions to execute in parallel
• Pentium Pro– aggressive use of register renaming– branch prediction, data flow analysis, speculative
execution• Pentium II
– Intel MMX technology, designed to process video, audio, and graphic data efficiently
• Pentium III– additional floating-point instructions to support 3D
graphics software
Intel x86 Arch. Evolution• Pentium 4
– Addition floating-point and other enhancements for multimedia
• Core– The 1st Intel x86 microprocessor with a dual core:
the implementation of two processor on a single chip
• Core 2– extends to 64-bit– Core 2 Quad provides 4 processors on a single
chip
The Programming Model of Intel
Register Types1. General-purpose/multipurpose
register EAX, EBX, ECX, EDX, EBP, EDI, ESI
2. Special-purpose register EIP, ESP, EFLAGS
3. Segment register CS, DS, ES, SS, FS, GS
General-Purpose Register• EAX (accumulator)
– 32-bit register (EAX), as a 16-bit register (AX), or as either of two 8-bit registers (AH and AL)
– used for instructions such as addition, subtraction, multiplication, division, and some of adjustment instructions
– in 80386 above, it may also hold the offset address of a location in the memory system.
• EBX (base index)– 32-bit register (EBX), as a 16-bit register (BX), or
as either of two 8-bit registers (BH and BL)– hold the offset address of a location in the
memory system– in 80386 above, it also can address memory data
General-Purpose Register
• ECX (counter)– hold the count for various instructions: repeated
string instructions (REP/REPE/REPNE), shift, rotate, and LOOP/LOOPD
– in 80386 above, it also can hold the offset address of memory data
• EDX (data)– holds a part of the result from a multiplication or
part of the dividend before a division• EBP (base pointer)
– points to a memory location for memory data transfer
General-Purpose Register
• EDI (destination index)– addresses string destination data for the string
instructions• ESI (source index)
– addresses source string data for the string instructions
Special-Purpose Register
• EIP (instruction pointer)– addresses the next instruction in a section of
memory defined as code segment– used to find the next sequential instruction in a
program located within the code segment– can be modified with a jump or a call instruction
• ESP (stack pointer)– addresses an area of memory called stack– stack memory stores data through this pointer
• EFLAGS– indicate the condition of the microprocessor as
well as control its operation
EFLAG and FLAG register (8086 Pentium)
EGLAG and FLAG register (8086 Pentium)
• C (carry)– holds the carry after addition of the borrow after
subtraction– also indicates error conditions as dictated by
programs and procedures• P (parity)
– a count of ones in a number expressed as even or odd
– 0: odd parity, 1: even parity– E.g.: If a number contains 3 binary one bits, it has
odd parity. If a number contains zero one bits, it has even parity
EGLAG and FLAG register (8086 Pentium)
• A (auxiliary carry)– holds the carry (half-carry) after addition of the
borrow after subtraction between bits position 3 and 4 of the result
– used only by the DAA and DAS instructions to adjust the value of AL after a BCD addition or subtraction.
• Z (zero)– shows that the result of an arithmetic or logic
operation is zero– 1: zero, 0: not zero
• S (sign)– holds the arithmetic sign of the result after
execution– 1: sign, 0: unsigned (positive)
EGLAG and FLAG register (8086 Pentium)
• T (trap)– enables trapping through an on-chip debugging
feature– 1: interrupts the flow of the program– 0: trapping/debugging feature is disabled
• I (interrupt)– control the operation of the INTR (interrupt
request) input pin• D (direction)
– select either the increment or decrement mode for the DI and/or SI registers during string instruction
EGLAG and FLAG register (8086 Pentium)• O (overflow)
– indicates that the result has exceeded the capacity of the machine
• IOPL (I/O privilege level)• NT (nested task)• RF (resume)• VM (virtual mode)• AC (alignment check)• VIF (virtual interrupt flag)• VIF (virtual interrupt pending)• ID (identification)
Segment Register• CS (code)
– holds the code (programs and procedures) used by microprocessor, defines the starting address of the section of memory holding code
• DS (data)– contains most data used by a program– accessed by an offset address
• ES (extra)– used by some of the string instructions to hold
destination data• SS (stack)
– defines the area of memory used for the stack• FS & GS (stack)
– allow 2 additional memory segments for access by programs (80386 above)
Memory Organization
Instruction Set• Data moving instructions.• Arithmetic - add, subtract, increment, decrement,
convert byte/word and compare.• Logic - AND, OR, exclusive OR, shift/rotate and
test.• String manipulation - load, store, move, compare
and scan for byte/word.• Control transfer - conditional, unconditional, call
subroutine and return from subroutine.• Input/Output instructions.• Other - setting/clearing flag bits, stack
operations, software interrupts, etc.
Types of Operands• Addresses• Numbers
– Integer/floating point• Characters
– ASCII etc.• Logical Data
– Bits or flags• (Aside: Is there any difference between numbers and
characters? Ask a C programmer!)
Data Types in x86
General Data Types• 8 bit (Byte)• 16 bit (word)• 32 bit (double word)• 64 bit (quad word)• 128 bit (double quadword)• Addressing is by 8 bit unit• Words do not need to align at even-
numbered address• Data accessed across 32 bit bus in units of
double word read at addresses divisible by 4• Little endian
Numeric Data Types
Memory Organization• generally consists of program,
data, stack• their memories occupy the same
memory space• Total addressable memory size :
1 MB
Byte Ordering• What order do we read numbers
that occupy more than one byte ?
• e.g. (numbers in hex to make it easy to read)– 12345678 can be stored in 4x8bit
locations as follows
Byte Ordering• Big Endian
– Left Right– Most significant byte in
the lowest numerical byte address
• Little Endian– Right Left– Least significant byte in
the lowest numerical byte address
C Data Structure to Endian Mapping
Any Question ?
Assignment 2• Find the latest paper about
research related to the recent processor technology and review it
• Collect your review in hardcopy form at mid-semester test
THANK YOU