Real mode in x86 architecture CPU

Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. it is characterized by a 20-bit segmented memory address space 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.

x86 is a family of instruction set architectures initially developed by Intel based on the intel 8086 and its 8088 variant.The 8086 was introduced in 1978 as a fully 16-bit extension of Intel’s 8-bit 8080, with memory segmentation as a solution for addressing more memory than can be covered by a plain 16-bit address. The term “x86” came into being because the names of serval successors to Intel’s 8086 processor end in “86”,including 80186,80286,80386 and 80486 processors. x86 architecture has been implemented in processors from Intel,AMD, etc. Only Intel and AMD are actively producing modern 64-bit designs.

As of 2021, most personal computers, laptops and game consoles are based on the x86 architecture,while mobile categories such as smartphones or tablets are dominated by ARM.

At the high end, x86 continues to dominate compute-intensive workstation and cloud computing segments, while the fasted supercomputer is ARM-based, and the top 4 are no longer x86-based.

ARM is an acronym for Advanced RISC Machines. It is a family of reduced instruction set computing(RISC) architecture for computer processors.

The CS, or code segment register , is used every time the 80x86 accesses memory to read an instruction pattern. The DS, or data segment register, is used for bringing data patterns in. The SS register is used to access the stack. The ES is the extra segment register.Only very few special instructions use the ES register to access memory.

The CPU inside your computer can manipulate the bit patterns which make up the computer’s memory.Some of the possible manipulations are copying patterns from one place to another, turning on or turning off certain bits, or interpreting the patterns as numbers and performing arithmetic operations on them. To perform any of these actions, the CPU has to know what part of memory is to be worked on.A specific location in memory is identified by its address. An address is a pointer into memory.Each address points to the beginning of a byte long chunk of memory. The 80x86 CPU, in its inherent mode, has the capability to distinguish 2 20 2^{20} 220 different bytes of memory.

It is clumsy to write 20 bits to get a total of 2 20 2^{20} 220 different addresses, and thus a memory address may be written down as a series of Hexadecimal digits. For example, the address 00410 in hexadecimal is equivalent to 00000000010000010000 in binary.

The biggest chunk that is convenient for 80x86 CPU to use is a 16-bit word. The 80x86 CPU actually generates 20-bit addresses as the combination of two address words, a segment word and an offset word. The combination process involves interpreting the two patterns as hexadecimal numbers and adding them. The way that two 16-bit patterns can be combined to give one 20-bit pattern is that the two patterns are added, but out of alignment by one hex digit(four bits), as in the example below:
0040 + 0010 00410 \begin{array}{r} 0040 \\ +0010 \\ \hline 00410 \end{array} 0040+001000410
actually, it looks like below:
00400 + 0010 00410 \begin{array}{r} 00400 \\ +0010 \\ \hline 00410 \end{array} 00400+001000410
0040 is a 16-bit segment address.
0010 is a 16-bit offset address.
Because of this mechanism for calculating addresses, they will often be written down in what may be called segment:offset form. Thus, the address in above calculation could be written as :
0040 : 0010 = 00410 0040:0010 = 00410 0040:0010=00410

Then contents of memory may be broken down into broad classes. The first is data, just raw patterns of bits for the CPU to work on. The second are instruction codes or machine codes. The CPU can look at memory and interpret a bit pattern it sees there as specifying one of the 200 some fundamental operations it knows how to do. The set of code patterns which maps to operations is called the machine language of the 8088. A machine language program consists of a series of code patterns located in consecutive memory locations, whose corresponding sequence of operations perform some useful task.

Note that there is no way for the CPU to know whether a given bit pattern is meant to be an instruction or it is a piece of data to operate on. It is quite possible for the CPU to accidentally begin reading what was intended to be data ,and interpret the patterns as instruction codes. The CPU can then become out of control, and is often described as “crashed” or “hanged”.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值