x86cpu实模式

CPU实模式,主要讲的是x86cpu

基本概念

实模式是8086cpu的寻址方式、寄存器大小、指令用法等。用来反应cpu在该环境下如何工作的概念。——《操作系统真象还原》

Real Mode is a simplistic 16-bit mode that is present on all x86 processors. Real Mode was the first x86 mode design and was used by many early operating systems before the birth of Protected Mode. For compatibility purposes, all x86 processors begin execution in Real Mode. ——osdev.wiki

Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. Real mode is characterized by a 20-bit segmented memory address space (giving exactly 1 MiB of addressable memory) and unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware. Real mode provides no support for memory protection, multitasking, or code privilege levels. Before the release of the 80286, which introduced protected mode, real mode was the only available mode for x86 CPUs.)
In the interest of backward compatibility(向下兼容), all x86 CPUs start in real mode when reset, though it is possible to emulate real mode on other systems when starting on other modes. ——wiki

简单的介绍。就是基本是16位的,访问内存最大1M,然后内存能够直接访问。

实模式寻址方式是段基址左移4位后叫上偏移地址后地址拼接形成20位地址。
cpu中栈的作用特别重要。栈也是内存中的一个区域,由ss寄存器和sp寄存器来维护,即栈底和栈顶地址。由于是硬件实现的栈,不是自己编写的数据结构,所以硬件是提供了相应的方法来维护栈。即push和pop指令。

cpu中栈由高地址向低地址方向扩展。基本如下图。

x86cpu实模式_第1张图片

这里压栈出栈操作会用到字长,cpu字长就是cpu一次可以处理数据的长度,在实模式下面cpu字长为16位。

你可能感兴趣的:(x86cpu实模式)