DOS下字符表的内存地址是多少?

发布于 2024-11-11 08:30:32 字数 96 浏览 5 评论 0原文

DOS 中字符表的地址是多少,我们可以通过操作每个字符的像素来创建新的字体和符号?

我知道用BIOS中断来改变它,但我只需要dos中字符表的内存地址即可直接访问。

What is the address of character table in DOS where we can create new fonts and symbols by manipulating the pixels of the each character?

I know to change it with BIOS interrupts, but I only need the memory address of the character table in dos for direct access.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

诗化ㄋ丶相逢 2024-11-18 08:30:32

我不记得它是如何完成的(我二十年前就做过这些事情),但你可能想看看 FreeVGA 项目。根据文本模式文档,您可以自己选择地址(有点;请参阅字符映射表选择寄存器)。 此处解释了访问该寄存器

您可能还想查看此演示文稿,其中涉及此主题好(并且可能更容易理解)。

编辑: 这是一篇解释如何替换单个字符的帖子。他使用 int 10h, ax=1100h (替代文档)来交换字符,但在 CX 寄存器中您实际上可以知道应该交换多少个字符。 这里有一个非常全面的 int 10h 函数列表

编辑2:找到另一个不错的文档

编辑3:在最后一个链接文档中,有这样的内容:

直接访问字符生成器 RAM 的编程

以下序列设置 EGA 和 VGA 以访问字符-
发电机内存。请参阅 EGA I/O 端口以获取相关信息。

out 3c4H, 0402H   Mask reg; enable write to map 2
out 3c4H, 0704H   Memory Mode reg ; alpha, ext mem, non-interleaved
out 3ceH, 0005H   Graphics Mode reg; non-interleaved access
out 3ceH, 0406H   Graphics Misc reg; map char gen RAM to a000:0
out 3ceH, 0204H   Graphics ReadMapSelect reg; enable read chargen RAM

在这些 OUT 之后,字体数据从 a000:0 开始,并且第一个字节
字符的字体数据从字符的 ASCII 值 * 32 开始。
读取或写入字体数据后,按以下顺序恢复
EGA/VGA正常运行:

out 3c4H, 0302H   Mask reg; disable write to map 2
out 3c4H, 0304H   Memory Mode reg; alpha, ext mem, interleaved
out 3ceH, 1005H   Graphics Mode reg; interleaved access
out 3ceH, 0e06H   Graphics Misc reg; regen buffer to b800:0
out 3ceH, 0004H   Graphics ReadMapSelect reg; disable read chargen RAM

I can't remember how it was done any more (I did this stuff two decades ago), but you might want to look at the FreeVGA project. According to the text mode documentation you can select the address yourself (kinda; see the Character Map Select Register). Accessing that register is explained here.

You might also want to look at this presentation which deals with this topic as well (and is probably easier to comprehend).

Edit: Here's a post that explains how to replace a single character. He uses int 10h, ax=1100h (alternative documentation) to exchange a character, but in the CX register you can actually tell how many characters should be exchanged. Here's a very comprehensive list of int 10h functions.

Edit 2: Found another nice documentation.

Edit 3: In the last linked documentation, there's this:

Programming for Direct Access to Character Generator RAM

The following sequence sets up the EGA and VGA for accessing character-
generator memory. See EGA I/O Ports for related information.

out 3c4H, 0402H   Mask reg; enable write to map 2
out 3c4H, 0704H   Memory Mode reg ; alpha, ext mem, non-interleaved
out 3ceH, 0005H   Graphics Mode reg; non-interleaved access
out 3ceH, 0406H   Graphics Misc reg; map char gen RAM to a000:0
out 3ceH, 0204H   Graphics ReadMapSelect reg; enable read chargen RAM

After these OUTs, the font data begins at a000:0 and the first byte of
font data for a character begins at the character's ASCII value * 32.
After reading or writing the font data, the following sequence restores
the EGA/VGA to normal operations:

out 3c4H, 0302H   Mask reg; disable write to map 2
out 3c4H, 0304H   Memory Mode reg; alpha, ext mem, interleaved
out 3ceH, 1005H   Graphics Mode reg; interleaved access
out 3ceH, 0e06H   Graphics Misc reg; regen buffer to b800:0
out 3ceH, 0004H   Graphics ReadMapSelect reg; disable read chargen RAM
你与昨日 2024-11-18 08:30:32

如果我没记错并且显卡没有太大变化(我上次玩它已经是 15 多年前了),字体信息并不位于给定的内存地址,而是加载到显卡内存上。

If I remember correctly and the graphic cards didn't change too much (I played with that the last time more than 15 years ago), the font information isn't at a given memory address, it is loaded on the graphic card memory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文