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中栈由高地址向低地址方向扩展。基本如下图。

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 在上个周末开了家庭会议,专门研究“我和小妞”的假期生活。 假期正式开始了,第一天的生活,这是女儿负责的时间,我全部...
    蜗牛小于阅读 193评论 0 0
  • 我又要回到老地方 度过旧日的时光 同样的落地窗 照常守候朝阳 我是为自己的着装 还是最初的梦想 默默惆怅 当年那群...
    朱六子阅读 204评论 0 1