为什么我们必须初始化在MS-DOS DS和ES寄存器? [英] why must we initialize DS And ES registers in MS-DOS?

查看:406
本文介绍了为什么我们必须初始化在MS-DOS DS和ES寄存器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MS-DOS,为什么DS和ES寄存器的初始化必须由程序员手动完成,尽管它的操作系统的责任来初始化这些寄存器。

in MS-DOS ,Why the initialization of the DS and ES registers must be done manually by the programmer, although it's operating system responsibility to initialize these registers.

为什么不能我们做这个的CS和SS注册? MS-DOS的哪项功能信息到这个?

why mustn't we do this for CS and SS registers ? Which feature of MS-dos Leads into this?

推荐答案

这是OS设计师只是一个选择。

It's just a choice of the OS designer.

DOS是一个最小的操作系统,所以它可能的最小值。 CS和SS注册的必须的设置。如果没有CS设置你,你的code无法运行。因为DOS使用一切一个堆栈SS必须设置。程序运行即使中断使用堆栈超过每秒30次。 (这就是为什么你必须修改SS时关闭中断。)只有当您的程序使用它们的其他部分都需要(它肯定可以写code,它没有),所以DOS并不担心。

DOS is a minimal OS, so it does the minimum possible. The CS and SS registers must be set. Without CS set for you, your code could not run. SS must be set because DOS uses one stack for everything. Interrupts are using the stack over 30 times per second even while your program is running. (This is why you must turn off interrupts when modifying SS.) The other segments are needed only if your program uses them (and it's certainly possible to write code that doesn't), so DOS isn't concerned.

其实在DOS版本我记得(​​和它已经很多年,所以这可能是错误的),DS和ES被设置为CS,这是你想要什么用code +的最大为64​​K很小的程序数据+堆栈要求。

Actually in DOS versions I remember (and it's been many years so this could be wrong), DS and ES were set equal to CS, which is what you want for very small programs with at most 64k of code+data+stack requirement.

这篇关于为什么我们必须初始化在MS-DOS DS和ES寄存器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆