China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 14:26
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Is there a DOS C for real mode that supports 32-bit registers and large memory? View 1,485 Replies 7
Original Poster Posted 2005-04-20 00:00 ·  中国 北京 朝阳区 联通
初级用户
Credits 110
Posts 3
Joined 2005-04-20 00:00
21-year member
UID 38404
Gender Male
Status Offline
Because I develop low-level software, I have always used BORLANDC3.1 under DOS, but this software may be a bit too old. Not only can it not use large memory, it also cannot use 32-bit registers. I hear DGJPP is quite good, but it only supports protected mode. The program I am developing must run in real mode (it needs to do direct I/O operations and interrupt calls). So I'd like to ask all the teachers here: is there a DOS integrated debugging environment similar to the BC language that supports real mode while also allowing the use of 32-bit registers and large memory? Thanks! dhwang@163.com
Floor 2 Posted 2005-04-21 00:00 ·  中国 广东 深圳 电信
中级用户
Credits 225
Posts 39
Joined 2004-10-06 00:00
21-year member
UID 32162
Gender Male
Status Offline
You can't blame “BC31”. Seeing your question, I feel the same way; it has bothered me for several years too. I have always believed Borland was not stupid. After you raised this question, it pushed me to give it a try. “My God,” I could hardly believe my own eyes: it worked!!! I'm happy, I'm cheering, I'm so excited......
In the menu ------ select ->
or
select -> The 32-bit register problem is solved from now on. Thank you, dear Marchsnow! You have changed my attitude toward Bc31!
For example: void main(){ asm mov ax, 0 asm mov eax, 0 asm{ mov ax, 0 mov eax, ebx };}
Floor 3 Posted 2005-04-22 00:00 ·  中国 北京 联通
初级用户
Credits 110
Posts 3
Joined 2005-04-20 00:00
21-year member
UID 38404
Gender Male
Status Offline
Dear Mr. Guo: Hello!
First of all, thank you very much for your help and guidance!
I had also tried the method you mentioned of compiling via assemble some time ago. However, BC31's default assembler compiler is TASM1.0, and it seems it also does not recognize 32-bit registers, so I once tried using MASM6.11 to replace TASM1.0 for compilation. But I don't know whether it was an operational problem; I didn't succeed, so I didn't continue experimenting. I'll try it again in a little while. Thank you! Also, are there any good methods for enabling and using high memory? Please advise! Thank you!
Floor 4 Posted 2005-04-22 00:00 ·  中国 广东 深圳 电信
中级用户
Credits 225
Posts 39
Joined 2004-10-06 00:00
21-year member
UID 32162
Gender Male
Status Offline
As for 32-bit registers, the Tasm.exe version in my BC31 is V3.1, and compilation and linking pass.
To “enable and use high memory,” you can call the XMS extended memory manager to allocate it. Since high memory is only about less than 64K (65520 bytes), I don't know why you want to use it, and it is globally allocated only once, so
it may already be occupied by other programs, making successful allocation difficult! For example, if you have the following line in Config.Sys
DOS=HIGH,UMB
If you want to access high memory directly, you can directly enable the A20 address line (you can look it up in related x86 books), and in real mode you can access it with “Seg:Offset”.。
If you need large memory to store data, I suggest using XMS extended memory to store it. Under DOS it has 4GB, under Win9x there is 4M space,
under Win2000 there is 2M space, and under WinXp there is 2M space. So memory other than “directly accessible conventional memory” is quite dangerous, and
it is not compatible with other operating systems.
Floor 5 Posted 2005-04-22 00:00 ·  中国 北京 联通
初级用户
Credits 110
Posts 3
Joined 2005-04-20 00:00
21-year member
UID 38404
Gender Male
Status Offline
Sorry, I just tried it and it worked. My version number is also TASM3.1. Last time I probably forgot to change the CPU to 80386! Thank you very much! As for the large memory issue, what I'm doing now is an installer for a system. It needs to, under DOS and with as few resident programs loaded as possible, complete NTFS partition formatting and defragmentation-like work. BC seems able to allocate at most less than 64K of memory, so it has to read the disk frequently. But current hard disks are easily dozens of GB, so the speed is very slow, and the waiting time is hard to tolerate. So if possible, I want to use as much memory as possible to improve the running speed. Is there any convenient method?
Floor 6 Posted 2005-04-25 00:00 ·  中国 湖北 荆州 电信
高级用户
★★★
Credits 994
Posts 444
Joined 2005-01-29 00:00
21-year member
UID 35779
Gender Male
Status Offline
Ah.... all experts here...
Floor 7 Posted 2005-08-11 18:41 ·  中国 上海 教育网
初级用户
Credits 41
Posts 4
Joined 2005-07-27 13:10
21-year member
UID 41101
Gender Male
Status Offline
Expert!!!!!!!!
Floor 8 Posted 2005-08-11 19:11 ·  中国 广东 深圳 罗湖区 电信
中级用户
★★
Credits 316
Posts 74
Joined 2004-03-04 00:00
22-year member
UID 19167
Gender Male
Status Offline
This is a very classic question. I hope the experts will share more views.
Forum Jump: