中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-17 10:29
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » (已结)DOS显示多少行多少列以及字符、字母和汉字的关系 查看 1,324 回复 5
楼 主 (已结)DOS显示多少行多少列以及字符、字母和汉字的关系 发表于 2005-08-12 13:50 ·  中国 天津 联通
初级用户
积分 31
发帖 15
注册 2005-08-10 19:26
21年会员
UID 41526
状态 离线
一个字符是一个 英文字母吗?

一个汉字是两个字符吗?

---------- Edited by willsort 18:54 2005-8-13 ---------
字符、字母和汉字的关系见6楼
屏幕的行列数与显示模式相关,见5楼和6楼
---------- Edited by willsort 18:54 2005-8-13 ----------


[ Last edited by willsort on 2005-8-13 at 19:06 ]
2 发表于 2005-08-12 13:54 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
积分 5,154
发帖 1,827
注册 2003-07-18 00:00
23年会员
UID 7105
性别 男
状态 离线
DOS显示25行80列
一个字符是包括 英文字母和符号
一个汉字占两个字符
3 发表于 2005-08-12 14:37 ·  中国 天津 联通
初级用户
积分 31
发帖 15
注册 2005-08-10 19:26
21年会员
UID 41526
状态 离线
谢谢~~
4 发表于 2005-08-12 15:49 ·  中国 广东 广州 白云区 电信
金牌会员
★★★★
D◎$ Fαп
积分 4,562
发帖 1,883
注册 2004-01-19 00:00
22年会员
UID 15812
性别 男
来自 广东广州
状态 离线
字符除了字母和符号以外,还有数字以及32个控制符。
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
5 发表于 2005-08-12 21:44 ·  中国 湖北 武汉 联通
高级用户
★★★
积分 587
发帖 302
注册 2005-07-25 17:31
21年会员
UID 41046
性别 男
状态 离线
半角英文字符,确实是ASCII中所定义的。编码0-255,占1个字节(8位=2^8=256)的空间。
对于一个汉字字符来说,不仅字符点阵捉襟见肘,而且编码也是远远不够的,所以汉字采用了两个字节来编码一个汉字,两个ASCII大小的点阵组成一个汉字图形点阵的方式。所以可以说汉字(所有全角字符)确实可以称为双字节字符。

另外的显示模式的问题,一般而言DOS确实使用25*80(ASCII)的显示模式,这种显示模式是早期CGA所支持,但是这个是可以变化的,分两种情况。
1 是汉字操作系统,启动后ASCII字体与之前有不同,可以看出屏幕在显示正常部分以外下方还多了几行。这是一种情况。
2 使用MODE命令显示模式,具体的使用方法可以参考DOS命令手册。这种情况属于调用BIOS的0x0A号的标准字符显示模式,对于一般常见的VESA显卡,我们不仅可以获得早期的40*25的模式,而且可以使用更高的132*25的VESA字符模式。(另外要说明一点,如果花屏--DOS下的状况--可以使用MODE 80命令,恢复正常80*25的显示模式,有的时候退出汉字系统的时候需要使用到)

[ Last edited by fdsiuha on 2005-8-13 at 20:36 ]
欢迎造访DOS的小屋!
http://risky.ik8.com
6 发表于 2005-08-13 18:23 ·  中国 山西 临汾 中移铁通
元老会员
★★★★
Batchinger
积分 4,432
发帖 1,512
注册 2002-10-18 00:00
23年会员
UID 19
性别 男
状态 离线
Re F60:

  字符代表屏幕上可显示的符号,它不仅可以是一个英文字母,也可以数字、标点和其他键盘上的可打印字符,它还可以是一个中文字,一个阿拉伯字母或者任意的一个多国语言符号,甚至它可以是一个图形(当然,它需要有对应的编码与字模)。

  一个汉字是一个字符,只是在很多汉字编码(例如GB 2312)中它占用两个字节,它通常在DOS屏幕显示占用两个英文字符的位置,所以很多材料中近似的把双字节编码的字符看作两个“字符”。在Windows或其它新型的操作环境和应用程序中,汉字都已作为一个字符看待,比如编程语言VB或者CMD命令set。

Re fdsiuha:

  赞同你的见解,现补充一篇Qbasic关于屏幕显示模式的文档:

------------------------------------------------------------------------------
The following table summarizes screen modes:

----------MDPA, CGA, Hercules, Olivetti, EGA, VGA, or MCGA Adapters-----------
SCREEN 0: Text mode only
- 40 x 25, 40 x 43, 40 x 50, 80 x 25, 80 x 43, or 80 x 50 text format,
8 x 8 character box (8 x 14, 9 x 14, or 9 x 16 with EGA or VGA)
- 16 colors assigned to any of 16 attributes (with CGA or EGA)
- 64 colors assigned to any of 16 attributes (with EGA or VGA)
- Depending on the text resolution and adapter, 8 video memory pages
(0-7), 4 pages (0-3), 2 pages (0-1), or 1 page (0)

-----------------------CGA, EGA, VGA, or MCGA Adapters------------------------
SCREEN 1: 320 x 200 graphics
- 40 x 25 text format, 8 x 8 character box
- 16 background colors and one of two sets of 3 foreground colors
assigned using COLOR statement with CGA
- 16 colors assigned to 4 attributes with EGA or VGA
- 1 video memory page (0)
SCREEN 2: 640 x 200 graphics
- 80 x 25 text format, 8 x 8 character box
- 16 colors assigned to 2 attributes with EGA or VGA
- 1 video memory page (0)

---------------------Hercules, Olivetti, or AT&T Adapters---------------------
SCREEN 3: Hercules adapter required, monochrome monitor only
- 720 x 348 graphics
- 80 x 25 text format, 9 x 14 character box
- Usually 2 video memory pages (0-1); 1 page (0) if a second color
display adapter is installed
- PALETTE statement not supported
- Invoke the Hercules driver MSHERC.COM before using screen mode 3
SCREEN 4:
- Supports Olivetti Personal Computers models M24, M240, M28, M280,
M380, M380/C, and M380/T and AT&T Personal Computers 6300 series
- 640 x 400 graphics
- 80 x 25 text format, 8 x 16 character box
- 1 of 16 colors assigned as the foreground color (selected by the
COLOR statement); background is fixed at black
- 1 video memory page (0)
- PALETTE statement not supported

-----------------------------EGA or VGA Adapters------------------------------
SCREEN 7: 320 x 200 graphics
- 40 x 25 text format, 8 x 8 character box
- Assignment of 16 colors to any of 16 attributes
- If 64K EGA adapter memory, 2 video memory pages (0-1); otherwise,
8 pages (0-7)
SCREEN 8: 640 x 200 graphics
- 80 x 25 text format, 8 x 8 character box
- Assignment of 16 colors to any of 16 attributes
- If 64K EGA adapter memory, 1 video memory page (0); otherwise,
4 pages (0-3)
SCREEN 9: 640 x 350 graphics
- 80 x 25 or 80 x 43 text format, 8 x 14 or 8 x 8 character box
- 16 colors assigned to 4 attributes (64K adapter memory), or
64 colors assigned to 16 attributes (more than 64K adapter memory)
- If 64K EGA adapter memory, 1 video memory page (0); otherwise,
2 pages (0-1)

-----------------EGA or VGA Adapters, Monochrome Monitor Only-----------------
SCREEN 10: 640 x 350 graphics, monochrome monitor only
- 80 x 25 or 80 x 43 text format, 8 x 14 or 8 x 8 character box
- Up to 9 pseudocolors assigned to 4 attributes
- 2 video memory pages (0-1), 256K adapter memory required

-----------------------------VGA or MCGA Adapters-----------------------------
Screen 11 (VGA or MCGA)
- 640 x 480 graphics
- 80 x 30 or 80 x 60 text format, 8 x 16 or 8 x 8 character box
- Assignment of up to 256K colors to 2 attributes
- 1 video memory page (0)
Screen 12 (VGA)
- 640 x 480 graphics
- 80 x 30 or 80 x 60 text format, 8 x 16 or 8 x 8 character box
- Assignment of up to 256K colors to 16 attributes
- 1 video memory page (0)
Screen 13 (VGA or MCGA)
- 320 x 200 graphics
- 40 x 25 text format, 8 x 8 character box
- Assignment of up to 256K colors to 256 attributes
- 1 video memory page (0)


[ Last edited by willsort on 2005-8-13 at 19:04 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
论坛跳转: