存档在 2008年11月

上电后的第一条指令

一直以为上电后,PC就处于实模式,取地址就是段寄存器的值右移4位再加上IP/EIP值。但是看到Intel手册的这一段话之后让我觉得很好玩:

8.1.4. First Instruction Executed
The first instruction that is fetched and executed following a hardware reset is located at physical address FFFFFFF0H. This address is 16 bytes below the processor’s uppermost physical address. The EPROM containing the software-initialization code must be located at this address. The address FFFFFFF0H is beyond the 1-MByte addressable range of the processor while in real-address mode. The processor is initialized to this starting address as follows. The CS register has two parts: the visible segment selector part and the hidden base address part. In realaddress mode, the base address is normally formed by shifting the 16-bit segment selector value 4 bits to the left to produce a 20-bit base address. However, during a hardware reset, the segment selector in the CS register is loaded with F000H and the base address is loaded with FFFF0000H. The starting address is thus formed by adding the base address to the value in the EIP register (that is, FFFF0000 + FFF0H = FFFFFFF0H).The first time the CS register is loaded with a new value after a hardware reset, the processor will follow the normal rule for address translation in real-address mode (that is, [CS base address = CS segment selector * 16]). To insure that the base address in the CS register remains unchanged until the EPROM based software-initialization code is completed, the code must not contain a far jump or far call or allow an interrupt to occur (which would cause the CS selector value to be changed).

阅读这篇文章的剩余部分 »

(2) 条评论

话说。。。

话说我真的很迟钝……

就连话说这个人家都用了几百年的词,我最近突然才开始常用它。。。

最近的生活真是,我都不知道怎么形容比较好,整天就是等时间赶紧过去,也没好好学点东西,也没回家看看亲人,回去看看我那刚出生的小外甥女。

话说周一又到发工资的日子了。貌似就第一个月的工资在我口袋里呆过一些时间,后来的工资都没在我口袋里呆过。。哦,不对,就连第一个月的工资都不在我手里。这个,好象发工资,对我来说,就是个去银行转帐的日子,还真麻烦。这个月的工资貌似又不够分配了,前一段时间好想暴富,不过现在暂时没了,因为暴富好象也很麻烦,看来这东西怎样都麻烦。

 话说我到底是为了什么写这篇博客的?记不得了,可能是为了冒个泡吧。

哦,对了,话说最近小孔表现很优秀,不错,谨在此代表我个人进行表扬,呵呵。

不扯淡了,睡觉,希望以后的日子好一些。

(4) 条评论