Intel x86 Memory. Architecture. The x86 isn't all that complex it just doesn't make a lot of sense. Program Segments. x86 Data and Address Ranges
|
|
- Barbra Hutchinson
- 6 years ago
- Views:
Transcription
1 1 2 Intel x86 Memory The x86 isn't all that complex it just doesn't make a lot of sense. Architecture Mike Johnson, Leader of 80x86 Design at AMD, Microprocessor Report (1994) 3 4 Program Segments x86 Data and Ranges Data and BSS sections Constants Initialized and uninitialized variables Tables, arrays, strings Structures Text section Procedures / functions / control blocks Data access Load operations to register Store operations register to Peripheral I/O operations Calculation Arithmetic operations Logic operations Stack section LIFO buffer accessible by PUSH / POP operations Data bits Unsigned Integer Signed Integer bits Memory x86 DOS 16 0 to 64K 32K to 32K to FFFFF 1 MB K = 2 10 = 1024 M = 2 20 = G = 2 30 = data physical address Windows/Linux 0 to 4G 2G to +2G to FFFFFFFF 4 GB 32 32
2 5 6 Logical CPU x86 Segment x86 access to physical CPU accesses external device Access by physical address 20 bits (8086) or 32 bits (IA-32) Programs do not see physical address Software address = logical address = SEG:OFF SEG Segment selector in CPU segment register Maps to Base Pointer to start of segment in memory OFF Offset formed by pointer arithmetic Pointer to in segment = Base + Offset x86 data address Offset Base x86 segments are sections of physical memory No one-to-one connection with program segments Six defined memory pointers (name ~ Data Segment) CS (name ~ Code Segment) SS (name ~ Stack Segment) ES (name ~ Extra Segment) FS, GS in IA-32 only Six segment registers GS selector GS FS selector FS ES selector ES SS selector SS CS selector CS selector 15 0 GS FS ES SS CS 7 8 Typical Segment Register Usage Mapping Segment 8086 segment mapping SEG = 16-bit segment SELECTOR in segment register SEG 10h = 20-bit physical base address = ES = CS = SS DOS *.com program One 64 KB segment SS CS ES DOS *.exe program Four defined segments Segment 64 KB = ES = CS = SS = FS = GS Linux software One 4 GB segment OS allocates memory to programs 16 bits SEG = segment selector segment register 4 bits 0 const IA-32 segment mapping SEG = 16-bit segment SELECTOR in segment register Selector is index to descriptor table Descriptor is table entry holding 32-bit or 64-bit physical base address Segment size selector Segment type physical base address Segment access rights descriptor descriptor descriptor descriptor descriptor descriptor
3 Segments 8086 Segment Four segment registers Extra Stack Code Data bits SEG = segment selector segment register ES SS CS 4 bits 0 const ES 10h SS 10h CS 10h 10h 20-bit segment base addresses 16-bit segment registers 4000 ES 3000 SS 2000 CS bit physical base address Extra Stack Code Data extra stack code data bit segment base addresses Offset IA-32 Offset Offset 16-bit number Combination of registers and immediate values Offset {0000, 0001, 0002,, FFFF} 2 16 possible offset values Maximum segment = 2 16 s = 64 KB Byte FFFF Offset 32-bit number Combination of registers and immediate values Offset { ,, FFFFFFFF} 2 32 possible offset values Maximum segment = 2 32 s = 4 GB Byte FFFFFFFF = physical base address + offset = physical base address + offset Logical = 1234:0005 Segment selector = 1234 base address = = = Offset Base Logical = 1234: Segment selector = 1234 descriptor table base address = = = Offset Base
4 13 14 Logical to Many to One Mapping 8086 PA = Logical address PA = SEG 10h + OFF SEG = PA / 10h = / 10h = 1234 OFF = PA % 10h = % 10h = 0005 Equivalent logical addresses for PA = :0005 = :0015 = :0025 = Offset Base SEG:OFF (SEG n):(off + 10h n) for integer 0 < n SEG and OFF + 10h n < 10000h PA (SEG n) 10h + (OFF + 10h n) = SEG 10h + OFF = PA Program Segments versus Memory Segments Segment Segment = any section, part, portion, subdivision Segment specific, 1-to-1 technical meaning Program segments (sections) Sections of assembly source code or executable program Data segment Space allocated for storing program data Text (code) segment Space allocated for program instructions Stack segment Space allocated for user stack operations x86 memory segments, CS, SS, ES, FS, GS Pointers to sections of physical memory () No one-to-one connection to program segments DOS Program Updates to Segments 8086 ing s for Data Programs can write to segment registers 256 KB = 4 64 KB of data = 40000h s Data occupies physical addresses to 4FFFF To access all data, program must update : 1000 Access 10000, 10001,, 1FFFF 2000 Access 20000, 20001,, 2FFFF 3000 Access 30000, 30001,, 3FFFF 4000 Access 40000, 40001,, 4FFFF Program Data Section ES SS CS Automatic Stack Automatic Register AX DX REGS[AX] REGS[DX] Immediate AX 1000 h REGS[AX] #1000 h Register Indirect AX [BX] REGS[AX] MEM[*10 + REGS[BX]] Absolute (Direct) AX [1000] REGS[AX] MEM[* ] Indexed (SI or DI) AX [SI + 6] REGS[AX] MEM[*10 + REGS[SI] + 6] Based (BX or BP) AX [BX + 6] REGS[AX] MEM[*10 + REGS[BX] + 6] Based and Indexed AX [BX + SI] REGS[AX] MEM[*10 + REGS[BX] + REGS[SI]] Based and Indexed AX [BX + SI + 6] with Displacement REGS[AX] MEM[*10 + REGS[BX] + REGS[SI] + 6]
5 Register ing 8086 Immediate ing ing Register ADD BX,AX REGS[BX] REGS[BX] + REGS[AX] Used for operands that the ALU is using now ing Immediate ADD BX,3 REGS[BX] REGS[BX] + 3 Used for constant operands C Absolute ing 8086 Absolute ing ing Direct Or Absolute ADD AL,[1001] REGS[AL] REGS[AL] + MEM[* ] Used for storing general data in main memory ing Direct Or Absolute ADD DI,[1001] REGS[DI] REGS[DI] + MEM[* ] Used for storing general data in main memory A D () FF E () FF E
6 Indexed ing 8086 Based ing ing Register Deferred ADD BX,[DI] REGS[BX] REGS[BX] + MEM[*10 + REGS[DI]] A pointer to data is kept in the register ing Register Deferred ADD BX,[BP] REGS[BX] REGS[BX] + MEM[SS*10 + REGS[BP]] A pointer to data is kept in the register FF 00FF () FF E 1002 A () FF BP forces access to SS Index with Displacement ing ing Displacement ADD BX,[DI+2] REGS[BX] REGS[BX] + MEM[*10 + REGS[DI] + 2] A constant offset is added to the pointer ing Indexed 8086 Based and Indexed ing ADD BL,[DI+BP] REGS[BL] REGS[BL]+ MEM[SS*10 + REGS[DI] + REGS[BP]] A stored offset or table index is added to the pointer EE () FF E 1002 A () BP forces access to SS
7 Effective for Data Access Effective (EA) OFFSET part of logical address for memory read/write Formed from immediate and register values SEG OFF 16-bit Displacement BX BX + Displacement SS BP BP + Displacement SI SI + Displacement DI DI + Displacement BX + SI BX + SI + Displacement BX + DI BX + DI + Displacement SS BP + SI BP + SI + Displacement SS BP + DI BP + DI + Displacement Summary of 8086 Types es for General Data Access Effective BP SI (EA) BX + DI + Displacement Default = 10h + Effective EA includes BP physical address = SS 10h + EA can override or SS to CS, ES, SS Automatic es (determined by operation) Memory Access Logical Fetch CS:IP CS 10h+IP Stack Operation SS:SP SS 10h+SP Destination ES:DI ES 10h+DI Source :SI 10h+SI Segmentation : Fetch Fetch -- Logical = CS:IP CS = Code Segment Base = h IP = 0057 Logical = CS:IP = 1000: Segmentation : MOV AX,[BX] MOV -- Effective = BX Logical = :BX = 2100:0123 Limit = 1FFFF h Code Byte Limit = 30FFF h Data Byte Offset = 0057 Code Segment Offset = 0123 Data Segment Byte = h Code Segment = h Byte = h Data Segment = h
8 Segmentation : MOV AX,[BX+SI+7] 8086 Segmentation : MOV AX,[BP+SI+2] MOV -- Effective = BX+SI+7 Logical = :BX+SI+7 = 2100: = 2100:112A MOV with BP -- SS Effective = BP+SI+2 Logical = SS:BP+SI+2 = 4100: = 4100:1242 Limit = 30FFF h Limit = 50FFF h Data Byte Stack Byte Offset = 112A Data Segment Offset = 1242 Stack Segment Byte = 2212A h Data Segment = h Byte = h Stack Segment = h Implementation Typical 8086 Implementation General Pointer and Segment AH BH CH DH IP CS SS ES BP SP SI DI OFF SEG AL BL CL DL BASE INDEX DISP Unit (PAU) AX BX CX DX PA = 10 SEG + BASE + INDEX + DISP System Bus PA Bus Control (MAR) ALU ALU_IN ALU Queue ALU_OUT Status Word Data Bus Control (MDR) Data Decoder and Control 20 bits 16 bits Control Decoder Execution Unit (EU) Bus Interface Unit (BIU) Fetch SEG CS ; OFF IP ; MAR PA IP IP + instruction length READ Queue MDR Decoder Queue : ADD AL, [BX+SI+1234] SEG ; OFF(BASE) BX OFF(INDEX) SI OFF(DISP) 1234 MAR PA READ ALU_IN MDR ALU AL ADD AL ALU_OUT
9 33 34 MOV in Stack Operations MOV MOV MOV MOV MOV dest, src dest src AX, [1234] REGS[AX] MEM[ * ] REGS[AL] MEM[* ] 8-bits REGS[AH] MEM[* ] 8-bits AL, [1234] REGS[AL] MEM[* ] 8-bits AX, [BX] REGS[AX] MEM[*10 + REGS[BX] ] AX, [BX+SI] REGS[AX] MEM[*10 + REGS[BX] + REGS[SI] ] PUSH src SP SP - 2 [ ] POP dest SS:SP src [ ] dest SS:SP SP SP + 2 MOV AX, [BX+ SI+12] REGS[AX] MEM[*10 + REGS[BX] + REGS[SI] + 12] Segment Override 8086 s 1 CS: MOV [BP],CX [CS:BP] CX ES: MOV [BP],CX [ES:BP] CX : MOV [BP],CX [:BP] CX SS: MOV [SI],CX [SS:SI] CX STOSB STOSW LOB LOW Store [ES:DI] AL DI DI+1 (default) Byte (DI DI-1 if flag DF = 1) [ES:DI] AL Store [ES:DI+1] AH Word DI DI+2 (default) (DI DI-2 if flag DF = 1) Load AL [:SI] SI SI+1 (default) Byte (SI SI-1 if flag DF = 1) Load Word AL [:SI] AH [:SI+1] SI SI+2 (default) (SI SI-2 if flag DF = 1) es defined by instruction
10 s s 3 MOVSB MOVSW SCASB Move Byte Move Word Scan Byte [ES:DI] [:SI] DI DI+1 (default) SI SI+1 (DI DI-1 if DF = 1) (SI SI-1 if DF = 1) [ES:DI] [:SI] [ES:DI+1] [:SI+1] DI DI+2 (default) SI SI+2 (DI DI-2 if DF = 1) (SI SI-2 if DF = 1) AL-[ES:DI]; update flags DI DI+1 (default) (DI DI-1 if DF = 1) SCASW CMPSB CMPSW Scan Word Compare Byte Compare Word AX-[ES:DI+l.DI]; Update flags DI DI+2 (default) (DI DI-2 if DF = 1) [:SI]-[ES:DI]; Update flags DI DI+1 (default) SI SI+1 (DI DI-1 if DF = 1) (SI SI-1 if DF = 1) [:SI+1.SI]-[ES:DI+1.DI]; Update flags DI DI+2 (default) SI SI+2 (DI DI-2 if DF = 1) (SI SI-2 if DF = 1) s 4 REP STOSB REP STOSW REP MOVSB REP MOVSW STOSB CX CX - 1 Repeat until CX = 0 STOSW CX CX - 1 Repeat until CX = 0 MOVSB CX CX - 1 Repeat until CX = 0 MOVSW CX CX - 1 Repeat until CX = 0 Working with s PUSH ES ; SP SP 2 ; [SS:SP] ES PUSH ; SP SP 2 ; [SS:SP] POP ES ; ES ; SP SP + 2 MOV SI,0000 ; SI 0 MOV DI,1000 ; DI 1000 MOV CX,200 ; CX 200 REP MOVSB ; COPY 200 H BYTES FROM ; :0000 :01FF TO ; :1000 :11FF
11 41 42 Branch s Jump Distance Fall-through following branch in program listing Next instruction if branch not taken CS:IP points to fall-through Target Next instruction if branch taken CS:IP points to target Displacement Displacement = target IP fall-through IP Displacement > 0 is forward jump Displacement < 0 is backward jump branch fall through target branch taken Displacement target IP fall-through IP branch fall through short target Short Jump Target in same code segment near target Displacement is = 80 displacement 7F = Near Jump far target Target in same code segment Displacement is word (2 s) -32,768 = 8000 displacement 7FFF = 32,767 Far Jump Target in different code segment Pointer is double word (4 s) Displacement not relevant short jump near jump far jump Jump JMP target JMP near target (assembler chooses near or short) JMP FAR JMP target JMP far target JMP 1024 IP JMP NEAR [1024] IP 16 [1024] JMP NEAR [SI] IP 16 [:SI] JMP FAR 1122:3344 CS IP JMP FAR [1024] JMP FAR [SI] CS 16 [1026] IP 16 [1024] CS 16 [:SI+2] IP 16 [:SI] CALL near target PUSH IP IP target RET CALL 1024 CALL [SI] PUSH IP IP 1024 Call and Return PUSH IP IP [:SI] POP IP CALL far target PUSH CS PUSH IP CS SEG IP OFF CALL 1122:3344 PUSH CS PUSH IP CS 1122 IP 3344 CALL [SI] RETF PUSH CS PUSH IP CS [:SI+2] IP [:SI] POP IP POP CS
12 45 46 Indirect Far Call Interrupt Vector Table SP stack SP IP = 2211 CS = 4433 stack fall-through CS fall-through IP Transfers control to Interrupt Service Routine (ISR) ISR can be stored anywhere in memory Interrupt Vector Table Table Starts at physical address Vector = 4 s = CS (2 s) + IP (2 s) Vector 0 at physical address Vector 1 at physical address Vector 2 at physical address IP CS SI fall-through CALL [SI] SI fall-through CALL [SI] ISR vector address For interrupt N N N N N CS (h) CS (L) IP (H) IP (L) Software Interrupt s Interrupt INT type INT 21H PUSH flags IF 0 TF 0 PUSH CS PUSH IP CS [00087H.00086H] IP [00085H.00084H] IRET none IRET POP IP POP CS POP flags SP stack SP IP = 2211 CS = 4433 stack flags fall-through CS fall-through IP IP CS fall-through INT fall-through INT
13 49 50 Processor Control s LEA STC CF I Set carry flag CLC CF 0 Clear carry flag CMC CF not(cf) Complement carry flag STD DF 1 Set direction flag CLD DF 0 Clear direction flag STI IF I Set interrupt flag CLI IF 0 Clear interrupt flag HLT None CPU stops requires reset WAIT None Enter wait state NOP None No operation Load Effective Similar to MOV Copies address (pointer) of memory location Does not access memory LEA dest, [EA] dest EA LEA BX, [x] BX &(x) LEA AX, [1234] AX 1234 LEA DX, [BX +DI] DX LEA CX, [SI+12] CX SI+12 BX + DI Moving Data Around L and LES MOV SI,1122 ; SI 1122 Loads 32-bit logical address of type :EA MOV [0000],SI ; [:0000] 1122 MOV BX,3344 ; BX 3344 MOV [BX],SI ; [:3344] 1122 L dest, [EA] dest [EA] [EA + 2] MOV [BX+SI],BX ; [:4466] 3344 LEA BX,[BX+SI] ; BX 4466 MOV CS,[BX] ; CS [:4466] MOV AX,[BX+2] ; AX [:4468] L BX, [SI] BX [:SI] [:SI+ 2] LES dest, [EA] dest [EA] ES [EA + 2] :SI AA 3344 BX 5566
14 53 54 Switching Data Tables Data Movement I/O Operations 1 /* DO ARITHMETIC WITH :BX = 1111:2222 */ /* SWITCH DATA TABLES */ MOV [SI], 4444 ; [SI] 4444 MOV [SI+2], 3333 ; [SI+2] 3333 PUSH ; SP SP 2 ; [SS:SP] 1111 PUSH BX ; SP SP 2 ; [SS:SP] 2222 L BX,[SI] ; BX 4444 ; 3333 /* DO ARITHMETIC WITH :BX = 3333:4444 */ /* SWITCH BACK TO FIRST DATA TABLE */ POP [SI] ; [SI] 2222 ; SP SP + 2 POP [SI+2] ; [SI+2] 1111 ; SP SP + 2 L BX,[SI] ; BX 2222 ; x86 processors control an I/O signal on the memory bus I/O signal is off to select processor access to I/O signal is on to select processor access to I/O bus MOV selects access IN and OUT select I/O access AL or AX are always src/dest for I/O instructions I/O address is called a port can range from 0000 H to FFFF H direct mode 1 immediate address indirect mode 2 address s in DX Data Movement I/O Operations 2 Data Movement I/O s 3 אפיק זיכרון Memory Bus זיכרון מטמון cache memory זיכרון ר א שי יהידת ה חישוב המ ר כזי Central Processing Unit (CPU) () I/O Bus מת אם א פי ק Bus Adapter א פי ק קלט/פ לט IN AL,26H IN AX,26H IN acc, port IN AL,DX IN AX,DX OUT port, acc OUT DX,AX AL port 26H AL port 26H; AH port 27H AL port DX AL port DX AH port DX+1 port DX AL port DX+1 AH input from port input from port 0 65,535 (address in DX) output to port 0 65,535 (address in DX) בקר קלט/פ לט I/O Controller בקר קלט/פ לט I/O Controller בקר קלט/פ לט I/O Controller רשת תקש ורת communications network ממשק Disk משתמש
INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI
Note: PUSHF / POPF have no operands The figure below shows that if (SS) = 3000H, (SP) = 0042H, so the execution of POP CX loads CX by the word 4050H form the stack segment. The SP is incremented by 2.
More informationCS401 Assembly Language Solved MCQS From Midterm Papers
CS401 Assembly Language Solved MCQS From Midterm Papers May 14,2011 MC100401285 Moaaz.pk@gmail.com MC100401285@gmail.com PSMD01(IEMS) Question No:1 ( Marks: 1 ) - Please choose one The first instruction
More informationCode segment Stack segment
Registers Most of the registers contain data/instruction offsets within 64 KB memory segment. There are four different 64 KB segments for instructions, stack, data and extra data. To specify where in 1
More informationIntel 8086 MICROPROCESSOR ARCHITECTURE
Intel 8086 MICROPROCESSOR ARCHITECTURE 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14, 16
More informationMICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN
MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN ROAD MAP SDK-86 Intel 8086 Features 8086 Block Diagram 8086 Architecture Bus Interface Unit Execution Unit 8086 Architecture 8086 Programmer s Model Flag Register
More information8086 INTERNAL ARCHITECTURE
8086 INTERNAL ARCHITECTURE Segment 2 Intel 8086 Microprocessor The 8086 CPU is divided into two independent functional parts: a) The Bus interface unit (BIU) b) Execution Unit (EU) Dividing the work between
More informationx86 Assembly Tutorial COS 318: Fall 2017
x86 Assembly Tutorial COS 318: Fall 2017 Project 1 Schedule Design Review: Monday 9/25 Sign up for 10-min slot from 3:00pm to 7:00pm Complete set up and answer posted questions (Official) Precept: Monday
More information9/25/ Software & Hardware Architecture
8086 Software & Hardware Architecture 1 INTRODUCTION It is a multipurpose programmable clock drive register based integrated electronic device, that reads binary instructions from a storage device called
More informationNorthern India Engineering College, Delhi (GGSIP University) PAPER I
PAPER I Q1.Explain IVT? ANS. interrupt vector table is a memory space for storing starting addresses of all the interrupt service routine. It stores CS:IP PAIR corresponding to each ISR. An interrupt vector
More informationIntel 8086 MICROPROCESSOR. By Y V S Murthy
Intel 8086 MICROPROCESSOR By Y V S Murthy 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14,
More informationSPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY
BACKGROUND 8086 CPU has 8 general purpose registers listed below: AX - the accumulator register (divided into AH / AL): 1. Generates shortest machine code 2. Arithmetic, logic and data transfer 3. One
More informationHardware and Software Architecture. Chapter 2
Hardware and Software Architecture Chapter 2 1 Basic Components The x86 processor communicates with main memory and I/O devices via buses Data bus for transferring data Address bus for the address of a
More informationif 2 16bit operands multiplied the result will be
how many operands in ADC? ans:3 how 32 bit word is defined? ans define double if 2 16bit operands multiplied the result will be ans 32bit if div by ero occurs then?? ans div by zero int for software int
More information16-Bit Intel Processor Architecture
IBM-PC Organization 16-Bit Intel Processor Architecture A-16 bit microprocessor can operate on 16 bits of data at a time. 8086/8088 have the simplest structure 8086/8088 have the same instruction set,
More informationCC411: Introduction To Microprocessors
CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Describe the Intel family of microprocessors from 8085 to Pentium. In terms of bus size, physical memory & special
More informationVARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad
Introduction to MS-DOS Debugger DEBUG In this laboratory, we will use DEBUG program and learn how to: 1. Examine and modify the contents of the 8086 s internal registers, and dedicated parts of the memory
More informationIntel 8086: Instruction Set
IUST-EE (Chapter 6) Intel 8086: Instruction Set 1 Outline Instruction Set Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Unconditional Transfer Instruction
More informationSRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)
SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013) UNIT I THE 8086 MICROPROCESSOR PART A (2 MARKS) 1. What are the functional
More informationEC 333 Microprocessor and Interfacing Techniques (3+1)
EC 333 Microprocessor and Interfacing Techniques (3+1) Lecture 7 8086/88 Microprocessor Programming (Data Movement Instructions) Dr Hashim Ali Spring 2018 Department of Computer Science and Engineering
More informationEXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM
EXPERIMENT WRITE UP AIM: Assembly language program for 16 bit BCD addition LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM TOOLS/SOFTWARE
More informationBasic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy
Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy Digital Logic Design Ch1-1 8086 Microprocessor Features: The 8086 microprocessor is a 16 bit microprocessor. The term 16 bit means
More informationProgram controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.
8086 Microprocessor Microprocessor Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. It is used as CPU (Central Processing Unit) in computers.
More informationData Movement Instructions
Segment 3B Data Movement Instructions PUSH/POP Contents Load-Effective address (LEA, LDS, LES) String Data Transfer (LODS, STOS, MOVS) XCHG, XLAT IN and OUT Course Instructor Mohammed Abdul kader Lecturer,
More informationicroprocessor istory of Microprocessor ntel 8086:
Microprocessor A microprocessor is an electronic device which computes on the given input similar to CPU of a computer. It is made by fabricating millions (or billions) of transistors on a single chip.
More informationEC-333 Microprocessor and Interfacing Techniques
EC-333 Microprocessor and Interfacing Techniques Lecture 4 Addressing Modes Dr Hashim Ali Spring - 2018 Department of Computer Science and Engineering HITEC University Taxila Slides taken from Computer
More information8086 INSTRUCTION SET
8086 INSTRUCTION SET Complete 8086 instruction set Quick reference: AAA AAD AAM AAS ADC ADD AND CALL CBW CLC CLD CLI CMC CMP CMPSB CMPSW CWD DAA DAS DEC DIV HLT IDIV IMUL IN INC INT INTO I JA JAE JB JBE
More informationAssembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language
4345 Assembly Language Assembly Language Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology Assembly Language 3-1 Overview of Assembly Language Advantages: Faster as compared
More informationEEM336 Microprocessors I. Data Movement Instructions
EEM336 Microprocessors I Data Movement Instructions Introduction This chapter concentrates on common data movement instructions. 2 Chapter Objectives Upon completion of this chapter, you will be able to:
More informationChapter 4: Data Movement Instructions. 4 1 MOV Revisited
Chapter 4: Data Movement Instructions 4 1 MOV Revisited In this chapter, the MOV instruction introduces machine language instructions available with various addressing modes and instructions. It may be
More informationAssembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:
Assembling, Linking and Executing 1) Assembling: - Assembling converts source program into object program if syntactically correct and generates an intermediate.obj file or module. - It calculates the
More informationWINTER 12 EXAMINATION Subject Code : Model Answer Page No : / N. a) Describe the function of SID and SOD pins of 8085 microprocessor
Subject Code : Model Answer Page No : / N Q.1) SOLVE ANY FIVE : (20 MARKS) a) Describe the function of SID and SOD pins of 8085 microprocessor Ans: - SID: - (2 Mark) Serial Input Data SID pin is used to
More informationLecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit
Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit 1 1. introduction The internal function of 8086 processor are partitioned logically into processing units,bus Interface Unit(BIU)
More informationMicroprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil
Microprocessor By Mrs. R.P.Chaudhari Mrs.P.S.Patil Chapter 1 Basics of Microprocessor CO-Draw Architecture Of 8085 Salient Features of 8085 It is a 8 bit microprocessor. It is manufactured with N-MOS technology.
More informationIntroduction to IA-32. Jo, Heeseung
Introduction to IA-32 Jo, Heeseung IA-32 Processors Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer
More informationIA32 Intel 32-bit Architecture
1 2 IA32 Intel 32-bit Architecture Intel 32-bit Architecture (IA32) 32-bit machine CISC: 32-bit internal and external data bus 32-bit external address bus 8086 general registers extended to 32 bit width
More informationINTRODUCTION TO IA-32. Jo, Heeseung
INTRODUCTION TO IA-32 Jo, Heeseung IA-32 PROCESSORS Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer
More informationUS06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 3: Assembly Language Instructions II
Unconditional & Conditional JUMP instructions: Conditional JUMP instructions: JA/JNBE Jump if above / Jump if not Below or Equal These two mnemonics represent the same instruction. The term above and below
More informationA4 Sample Solution Ch3
A4 Sample Solution Ch3 2. AL, AH, BL, BH,CL,CH,DLl, DH 3. AX, BX, CX, DX, SP, BP, SI, DI, CS, DS, ES, SS, FS, GS 4. EAX, EBX, ECX, EDX, ESP, EBP, EDI, ESI 5. RAX, RBX, RCX, RDX, RSP, RBP, RSI, RDI and
More informationLecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.
Lecture 5: Computer Organization Instruction Execution Computer Organization Addressing Buses Fetch-Execute Cycle Computer Organization CPU Control Unit U Input Output Memory Components Control Unit fetches
More informationADVANCE MICROPROCESSOR & INTERFACING
VENUS INTERNATIONAL COLLEGE OF TECHNOLOGY Gandhinagar Department of Computer Enggineering ADVANCE MICROPROCESSOR & INTERFACING Name : Enroll no. : Class Year : 2014-15 : 5 th SEM C.E. VENUS INTERNATIONAL
More informationMicrocomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات
1) Input/output In computing, input/output or I/O, is the communication between an information processing system (such as a computer) and the outside world, possibly a human or another information processing
More informationBasic Execution Environment
Basic Execution Environment 3 CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel Architecture processor as seen by assembly-language programmers.
More informationBAHAR DÖNEMİ MİKROİŞLEMCİLER LAB3 FÖYÜ
INTRODUCTION OF SEGMENT A typical program on 8086 consists of at least three segments Code segment: Contains instructions that accomplish certain tasks Data segment: Stores information to be processed
More informationChapter Three Addressing Mode MOV AX, BX
Chapter Three The 8086 The 8086 When the 8086 executes an instruction, it performs the specified function on data. The data are called its operands and may be part of the instruction reside in one of the
More informationThe Microprocessor and its Architecture
The Microprocessor and its Architecture Contents Internal architecture of the Microprocessor: The programmer s model, i.e. The registers model The processor model (organization) Real mode memory addressing
More informationPESIT Bangalore South Campus
INTERNAL ASSESSMENT TEST 2 Date : 02/04/2018 Max Marks: 40 Subject & Code : Microprocessor (15CS44) Section : IV A and B Name of faculty: Deepti.C Time : 8:30 am-10:00 am Note: Note: Answer any five complete
More informationExperiment N o 8. String Handling Instructions
Experiment N o 8 String Handling Instructions Introduction: In this experiment you will deal with string handling instructions, such as reading a string, moving a string from one memory location to another,
More informationProject 1: Bootloader. COS 318 Fall 2015
Project 1: Bootloader COS 318 Fall 2015 Project 1: Schedule Design Review - Monday, 9/28-10- min Ime slots from 1:30pm- 6:20pm - Write funcions print_char and print_string! - Answer the quesions: ü How
More informationUMBC. contain new IP while 4th and 5th bytes contain CS. CALL BX and CALL [BX] versions also exist. contain displacement added to IP.
Procedures: CALL: Pushes the address of the instruction following the CALL instruction onto the stack. RET: Pops the address. SUM PROC NEAR USES BX CX DX ADD AX, BX ADD AX, CX MOV AX, DX RET SUM ENDP NEAR
More informationAdvanced Microprocessors
Advanced Microprocessors Notes #2 Software Architecture & Instruction Set Architecture Part 1 EE 467/567 Winter 2012 by Avinash Kodi SWA.1 Background Materials Textbook: 2.1, 2.2, 3.1 Other: IA-32 Intel
More informationUNIT 2 PROCESSORS ORGANIZATION CONT.
UNIT 2 PROCESSORS ORGANIZATION CONT. Types of Operand Addresses Numbers Integer/floating point Characters ASCII etc. Logical Data Bits or flags x86 Data Types Operands in 8 bit -Byte 16 bit- word 32 bit-
More informationQuestion Bank Part-A UNIT I- THE 8086 MICROPROCESSOR 1. What is microprocessor? A microprocessor is a multipurpose, programmable, clock-driven, register-based electronic device that reads binary information
More informationAssembler Programming. Lecture 2
Assembler Programming Lecture 2 Lecture 2 8086 family architecture. From 8086 to Pentium4. Registers, flags, memory organization. Logical, physical, effective address. Addressing modes. Processor Processor
More informationProgram controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.
2 Microprocessor Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. It is used as CPU (Central Processing Unit) in computers. 3 Microprocessor
More informationAssignment no:4 on chapter no :3 : Instruction set of 8086
Assignment no:4 on chapter no :3 : Instruction set of 8086 1) Describe any two string operation instruction of 8086 with syntax & one example of each. 1] REP: REP is a prefix which is written before one
More informationModule 3 Instruction Set Architecture (ISA)
Module 3 Instruction Set Architecture (ISA) I S A L E V E L E L E M E N T S O F I N S T R U C T I O N S I N S T R U C T I O N S T Y P E S N U M B E R O F A D D R E S S E S R E G I S T E R S T Y P E S O
More informationChapter Four Instructions Set
Chapter Four Instructions set Instructions set 8086 has 117 instructions, these instructions divided into 6 groups: 1. Data transfer instructions 2. Arithmetic instructions 3. Logic instructions 4. Shift
More informationWeek /8086 Microprocessor Programming II
Week 5 8088/8086 Microprocessor Programming II Quick Review Shift & Rotate C Target register or memory SHL/SAL 0 C SHR 0 SAR C Sign Bit 2 Examples Examples Ex. Ex. Ex. SHL dest, 1; SHL dest,cl; SHL dest,
More informationAddressing Modes on the x86
Addressing Modes on the x86 register addressing mode mov ax, ax, mov ax, bx mov ax, cx mov ax, dx constant addressing mode mov ax, 25 mov bx, 195 mov cx, 2056 mov dx, 1000 accessing data in memory There
More informationSPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY
BACKGROUND Segment The "SEGMENT" and "ENDS" directives indicate to the assembler the beginning and ending of a segment and have the following format label SEGMENT [options] ;place the statements belonging
More informationWe can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...
COMPUTER ARCHITECTURE II: MICROPROCESSOR PROGRAMMING We can study computer architectures by starting with the basic building blocks Transistors and logic gates To build more complex circuits Adders, decoders,
More informationEC-333 Microprocessor and Interfacing Techniques
EC-333 Microprocessor and Interfacing Techniques Lecture 3 The Microprocessor and its Architecture Dr Hashim Ali Fall - 2018 Department of Computer Science and Engineering HITEC University Taxila Slides
More informationArchitecture and components of Computer System Execution of program instructions
Execution of program instructions Microprocessor realizes each program instruction as the sequence of the following simple steps: 1. fetch next instruction or its part from memory and placing it in the
More information4- MACHINE LANGUAGE CODING 4-1THE INSTRUCTION SET:
4- MACHINE LANGUAGE CODING 4-1THE INSTRUCTION SET: The microprocessor's instruction set defines the basic operations that a programmer can specify to the device to perform. Table 4-1 contains list basic
More informationCG2007 Microprocessor systems.
CG2007 Microprocessor systems Tutorial 1 Semester 2 AY 2011-12 Ganesh Iyer ganesh.vigneswara@gmail.com http://ganeshniyer.com About Me I have 3 years of Industry work experience in Bangalore, India. I
More informationIntroduction to Microprocessor
Introduction to Microprocessor The microprocessor is a general purpose programmable logic device. It is the brain of the computer and it performs all the computational tasks, calculations data processing
More informationMPID MICROPROCESSOR AND ITS INTERFACING DEVICES EEE III II SEMESTER OBJECTIVE QUESTIONS
MPID MICROPROCESSOR AND ITS INTERFACING DEVICES EEE III II SEMESTER OBJECTIVE QUESTIONS UNIT I 8086 ARCHITECTURE OBJECTIVE TYPE QUESTIONS 1 The number of address spaces of 8085 is ( a) 4 ( b ) 8 ( c )
More informationMicroprocessors (A) DOS Services
1 Services 2 System Calls Operating System services: Disk and file system management Screen display and printing Keyboard entry Other I/O management Date and time Program run and terminate Command arguments
More informationComputer Architecture 1 ح 303
Lecture 4 A. Addressing MODES 1. Introduction to assembly language programming: Program is a sequence of commands used to tell a microcomputer what to do. Each command in a program is an instruction Programs
More informationInternal architecture of 8086
Case Study: Intel Processors Internal architecture of 8086 Slide 1 Case Study: Intel Processors FEATURES OF 8086 It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 220 memory locations (1
More informationSummer 2003 Lecture 4 06/14/03
Summer 2003 Lecture 4 06/14/03 LDS/LES/LSS General forms: lds reg,mem lseg reg,mem Load far pointer ~~ outside of current segment {E.g., load reg w/value @ mem, & seg w/mem+2 XCHG Exchange values General
More information1. Introduction to Assembly Language
www.vchowk.com 1. Introduction to Assembly Language Solved EXERCISE 1 Note: Dear fellows I tried my best to solve this exercise questions if there s any mistake or doubt in any question correct it and
More informationLecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86
Lecture 15 Intel Manual, Vol. 1, Chapter 3 Hampden-Sydney College Fri, Mar 6, 2009 Outline 1 2 Overview See the reference IA-32 Intel Software Developer s Manual Volume 1: Basic, Chapter 3. Instructions
More information6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:
Introduction Efficient software development for the microprocessor requires a complete familiarity with the addressing modes employed by each instruction. This chapter explains the operation of the stack
More informationCS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers. MC
CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 MIDTERM FALL 2011 CS401 Assembly Language Q: Affected flag of AND operation
More information3.1 DATA MOVEMENT INSTRUCTIONS 45
3.1.1 General-Purpose Data Movement s 45 3.1.2 Stack Manipulation... 46 3.1.3 Type Conversion... 48 3.2.1 Addition and Subtraction... 51 3.1 DATA MOVEMENT INSTRUCTIONS 45 MOV (Move) transfers a byte, word,
More informationComputer Organization & Assembly Language Programming. CSE 2312 Lecture 15 Addressing and Subroutine
Computer Organization & Assembly Language Programming CSE 2312 Lecture 15 Addressing and Subroutine 1 Sections in 8088 Code TEXT section, for the processor instructions. DATA section for the initialization
More informationChapter 3: Addressing Modes
Chapter 3: Addressing Modes Chapter 3 Addressing Modes Note: Adapted from (Author Slides) Instructor: Prof. Dr. Khalid A. Darabkh 2 Introduction Efficient software development for the microprocessor requires
More informationUS06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 1: Assembly Language Terms & Directives
Introduction: US06CCSC04: Introduction to Microprocessors and A microprocessor is the chip containing some control and logic circuits that is capable of a making arithmetic and logical decision based on
More informationComplex Instruction Set Computer (CISC)
Introduction ti to IA-32 IA-32 Processors Evolutionary design Starting in 1978 with 886 Added more features as time goes on Still support old features, although obsolete Totally dominate computer market
More informationPHY4635/5635 Spring Lecture 8: Program Control Instructions
PHY4635/5635 Spring 2009 Lecture 8: Program Control Instructions Short, Near and Far Jumps Short jump: jump is within +127 to -128 bytes from the address following the jump. Relative jumps : moves with
More informationINSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI
8 Unsigned and Signed Integer Numbers 1. Unsigned integer numbers: each type of integer can be either byte-wide or word-wide. This data type can be used to represent decimal numbers in the range 0 through
More informationQ1: Multiple choice / 20 Q2: Protected mode memory accesses
16.317: Microprocessor-Based Systems I Summer 2012 Exam 2 August 1, 2012 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,
More informationEEM336 Microprocessors I. The Microprocessor and Its Architecture
EEM336 Microprocessors I The Microprocessor and Its Architecture Introduction This chapter presents the microprocessor as a programmable device by first looking at its internal programming model and then
More informationA Presentation created By Ramesh.K Press Ctrl+l for full screen view
Press Ctrl+l for full screen view A Presentation created By Ramesh.K rameshpkd@gmail.com Press Ctrl+l for full screen view A Microprocessor sor is a multipurpose, programmable logic device that reads binary
More informationScott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998
Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Assembler Syntax Everything looks like this: label: instruction dest,src instruction label Comments: comment $ This is a comment
More informationUnit I Introduction. Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad , India.
Unit I Introduction Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad 501218, India. Pre-requisites Digital Logic Design (A1404) Computer Architecture
More informationThe 8086 Microprocessor
The 8086 Microprocessor 1. Draw the pin diagram of 8086. Ans. There would be two pin diagrams one for MIN mode and the other for MAX mode of 8086, shown in Figs. 11.1 and 11.2 respectively. The pins that
More informationEE2007 Microprocessor systems.
EE2007 Microprocessor systems Tutorial 1 Semester 1 AY 2010-11 Ganesh Iyer ganesh.vigneswara@gmail.com (facebook, gtalk) http://ganeshniyer.com About Me I have 3 years of Industry work experience in Bangalore,
More informationCS-202 Microprocessor and Assembly Language
CS-202 Microprocessor and Assembly Language Lecture 2 Introduction to 8086 Assembly Language Dr Hashim Ali Spring - 2019 Department of Computer Science and Engineering HITEC University Taxila!1 Lecture
More information8086 Micro-Processors and Assembly Programming Forth Stage المعالجات الميكروية والبرمجة بلغة التجميع استاذة الماده: م.د ستار حبيب منعثر الخفاجي
جامعة ذي قار كلية الهندسة قسم الهندسة الكهربائية وااللكترونية 8086 Micro-Processors and Assembly Programming Forth Stage المعالجات الميكروية والبرمجة بلغة التجميع استاذة الماده: م.د ستار حبيب منعثر الخفاجي
More informationComputer Architecture and System Software Lecture 06: Assembly Language Programming
Computer Architecture and System Software Lecture 06: Assembly Language Programming Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Assignment 3 due thursday Midterm
More informationUNIT-1. It is a 16-bit Microprocessor (μp).it s ALU, internal registers works with 16bit binary word.
UNIT-1 Introduction to 8086: 8086 Microprocessor is an enhanced version of 8085Microprocessor that was designed by Intel in 1976. It is a 16-bit Microprocessor having 20 address lines and16 data lines
More informationThe x86 Architecture
The x86 Architecture Lecture 24 Intel Manual, Vol. 1, Chapter 3 Robb T. Koether Hampden-Sydney College Fri, Mar 20, 2015 Robb T. Koether (Hampden-Sydney College) The x86 Architecture Fri, Mar 20, 2015
More informationOn 386 and later machines, segment had a size of 64 KB. Therefore, to get the actual physical address, we can calculate it in the following way:
Memory Structure Segment and Offset Actual addresses on the IBM PC are given as a pair of 16-bit numbers, the segment and the offset, written in the form segment:offset. We have ignored the segment because
More informationUNIT II OVERVIEW MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Introduction to 8086 microprocessors. Architecture of 8086 processors
OVERVIEW UNIT II Introduction to 8086 microprocessors Architecture of 8086 processors Register Organization of 8086 Memory Segmentation of 8086 Pin Diagram of 8086 Timing Diagrams for 8086 Interrupts of
More informationDescription of the Simulator
Description of the Simulator The simulator includes a small sub-set of the full instruction set normally found with this style of processor. It includes advanced instructions such as CALL, RET, INT and
More informationPESIT Bangalore South Campus
INTERNAL ASSESSMENT TEST 2 Date : 28/03/2016 Max Marks: 50 Subject & Code : Microprocessor (10CS45) Section: IV A and B Name of faculty: Deepti.C Time: 8:30-10:00 am Note: Answer any complete five questions
More informationMicroprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)
Microprocessor and Assembly Language Week-5 System Programming, BCS 6th, IBMS (2017) High Speed Memory Registers CPU store data temporarily in these location CPU process, store and transfer data from one
More informationChapter 2 COMPUTER SYSTEM HARDWARE
Chapter 2 COMPUTER SYSTEM HARDWARE A digital computer system consists of hardware and software. The hardware consists of the physical components of the system, whereas the software is the collection of
More information