Presentation is loading. Please wait.

Presentation is loading. Please wait.

O PERATING I N R EAL M ODE Prof.P.C.Patil Department of Computer Engg Matoshri College of Engg.Nasik M ICROPROCESSOR A RCHITECTURE.

Similar presentations


Presentation on theme: "O PERATING I N R EAL M ODE Prof.P.C.Patil Department of Computer Engg Matoshri College of Engg.Nasik M ICROPROCESSOR A RCHITECTURE."— Presentation transcript:

1 O PERATING I N R EAL M ODE Prof.P.C.Patil Department of Computer Engg Matoshri College of Engg.Nasik M ICROPROCESSOR A RCHITECTURE UOP S.E.C OMP (S EM -I)

2 Introduction 2

3 The microprocessor can operate basically in either Real Mode, or Protected Mode. When is reset or powered up it is initialized in Real Mode. The maintains the compatibilify of the object code with 8086 and running in real mode. In this mode, the supports same architecture as the 8086, but it can access the 32-bit register set of 80386DX. In real mode, it is also possible to use addressing modes with the 32-bit override instruction prefixes. Introduction 3

4 Real Mode Programming Model 4

5 The programming model makes it easier to understand the microprocessor in a programming environment. The real mode programming model gives the programming environment for 80386DX in real mode. It shows only those parts of the microprocessor which the programmer can use such as various registers within the microprocessor. Real Mode Programming Model 5

6 6

7 In the diagram, only the shaded portion is a part of real mode. It consists of eight 16-bit registers (IP, CS, DS, SS, ES, FS, GS and Flag register) and eight 32-bit registers (EAX, EBX, ECX, EDX, ESP, EBP, ESI, EDD). In real mode, 80386DX can access CR0 which is used to enter into the protected mode. The Protection Enable bit (PE) is used to switch the 80386DX from real to protected mode. Real Mode Programming Model 7

8 80386DX in real mode is a 8085 with extended registers and two additional data segment registers such as FS and GS. It implements separate memory and I/O address space. Memory space is 1,048,576 bytes (l Mbyte) and the I/O address space is 65,536 bytes (64 kbytes), which is similar to 8086 memory and I/O address space. Real Mode Programming Model 8

9 Memory Addressing in Real Mode 9

10 10 Memory Addressing in Real Mode

11 In Real Mode, memory size is limited to 1 Mbyte. Due to this, only A2-A19 address lines are active. The higher address lines A20-A31 are normally high. Even though 1 Mbyte memory address space is available in real mode, all this memory cannot be active at one time.. Actually, the 1 M bytes of memory is partitioned into 64 K (65536) byte segments. A segment represents an independently addressable unit of memory consisting of 64 K consecutive byte- wide storage locations. Memory Addressing in Real Mode 11

12 Each segment has its own starting address i.e the lowest-addressed byte storage location. The segment registers hold the starting addresses of the active segments in the entire memory. In 80386DX, only six out of 16 (1 Mbyte / 64 kbyte) 64 kbyte segments can be active at a time. (Code segment, Stack Segment, Data segment, D, E, F and G ) Memory Addressing in Real Mode 12

13 Real Mode Differences between the 8086 and

14 1. lnstruction Clock Counts : Due to pipelined architecture of 80386, it takes fewer clocks for most instructions than the 8086/8088. The critical delay routines (where the exact time calculations are required) may be affected due to the change in the instruction execution time. 2. Undefined 8086/8088 Opcodes : An exception 6 is generated for one of the new instructions defined for the is executed and its opcode is not defined for 8086/8088. Differences between the 8086 and

15 3. lnstruction Length Limit : The 8086/8083 has no instruction length limit, but the generates exception 13 when it encounters an instruction longer than its 15-byte instruction limit. This condition is generated by putting redundant prefixes before an instruction. 4. Divide Exceptions : An unsuccessful DIV instruction causes an exception 0. In 80386, divide exception save CS:IP value pointing to the instruction that failed. In 8086/8088, the CS:IP value points to the next instruction. 15 Differences between the 8086 and 80386

16 5. Values Written by PUSH SP : The pushes different values on the stack for PUSH SP than the 8086/ pushes the value of SP before SP is incremented as part of the push operation, whereas 8086/8083 pushes the value of SP after it is incremented. 6. Shift or Rotate by More than 31-Bits : In 8086, shift/rotate for more than 1-bit can be achieved by loading the count in CL register. The restricts this count to low-order five bits. This limits the count to a maximum of 31-bits, thereby limiting the time that interrupt response is delayed while the instruction is executing. 16 Differences between the 8086 and 80386

17 7. Operand Crossing Offset 0 or 65,535 : On the 8086, an attempt to access a memory operand that crosses offset 65,535(e.g. MOV a word to offset 65,535) or offset 0 (e.g. PUSH a word when SP = 1) causes the offset to wrap around modulo 65,536. This means that the next instruction byte is fetched from byte 0 or byte of the same segment, when operand crosses or offset 0 respectively. The raises an exception in these cases. The exception 13 is generated if it is a CS, DS, ES, FS, or GS segment and exception 12 is generated if it is a stack segment (SS). 17 Differences between the 8086 and 80386

18 8. LOCK is Restricted to Certain lnstructions : As we know, the LOCK prefix and its corresponding output signal is used to prevent other bus masters from interrupting a data movement operations. The restricts the use of LOCK prefix while updating memory to following instructions ADD, ADC, AND, BTC, BTS, BTR DEC, INC, NEG, NOT, OR, SBB, SUB, XCHC, AND XOR. The generates an undefined-opcode exception (interrupt 6) if LOCK prefix is used before any other instruction. 18 Differences between the 8086 and 80386

19 9. Flags in Stack : The setting of the flags stored by PUSHF, by interrupts, and by exceptions is different from that stored by the 8086 in bit positions 12 through 15. In the 8086, these bits are stored as ones, but in real-address mode bit 15 is always zero, and bits 12 through 14 reflect the last value loaded into them. 19 Differences between the 8086 and 80386


Download ppt "O PERATING I N R EAL M ODE Prof.P.C.Patil Department of Computer Engg Matoshri College of Engg.Nasik M ICROPROCESSOR A RCHITECTURE."

Similar presentations


Ads by Google