中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-31 12:25
47,815 topics / 349,930 posts / today 0 new / 48,290 members
DOS开发编程 & 发展交流 (开发室) » You can directly access 4GB of memory like this in real mode
Printable Version  1,711 / 4
Floor1 lxdddxl Posted 2003-12-23 00:00
初级用户 Posts 6 Credits 122
Make sure config.sys contains
device=c:\dos\himem.sys
dos=high
There absolutely must not be emm386.exe.
This ensures the CPU is in real mode rather than V86 mode, and that A20 is also enabled.

Then you can do whatever you want in the program, for example
xor ax,ax
mov ds,ax
mov eax,12345678h
mov bx,
mov esi,40000000h
dec dword ptr

Unfortunately, none of the high-level language development tools under DOS support this kind of data access method, so
you can only use assembly.
Floor2 Wengier Posted 2003-12-23 00:00
系统支持 Posts 10,521 Credits 27,736
Would it be possible to write a patch program for real-mode C compilers like TC and BC?
Floor3 dwing Posted 2004-01-14 00:00
初级用户 Posts 32 Credits 177
In real mode you can use the XMS interface to access it
but I still recommend using Watcom or djgpp.
Floor4 allan^ Posted 2004-03-23 00:00
初级用户 Posts 5 Credits 110
Question for DWING in post #3: what method can WATCOM use to do this? The function is very simple, I just need to access data in memory beyond the 1MB range. I currently have no idea where to start.
Floor5 allan^ Posted 2004-03-24 00:00
初级用户 Posts 5 Credits 110
I already figured out how to access it, and now I'm starting to appreciate how powerful WATCOM is.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023