我发现了一些用 Turbo Pascal 编写的旧代码,我想运行它们。我不确定这是否是正确的提问地点。
我已经从 sourceforge 安装了带有 DOSBox 的 Turbo Pascal(在 Windows 10 的 Virtual Box 中安装),但代码无法运行。它打开窗口并立即关闭。
代码使用了这个函数:
Uses crt, graph;
Procedure Grafika (sterownik,tryb:integer;
autodetect:boolean;Path:String);
begin
if autodetect then
sterownik:=detect;
InitGraph(sterownik,tryb,Path);
end;
并像这样运行:
Grafika(1,1,True,'');
代码还使用一些程序集通过中断 33h 来处理光标。这是一个示例函数(其中几个):
Procedure VisibleCur(a: boolean);
Begin
if a then
asm
mov ax, 0001h
int 33h
end
else
asm
mov ax, 0002h
int 33h
end;
end;
有没有办法以某种方式运行这段代码?我真的很想看看这个应用程序,因为它是我编写的第一个 MS-DOS 下的 GUI 应用程序之一。
您的设置提供了大量的模拟间接:主机 > windows 10 vbox vm > dosbox。
我将尝试首先在更“裸机”的环境中运行该应用程序,以消除所有可能的模拟问题。我认为 dosbox 在大多数常见操作系统中都是原生可用的(Linux windows Apple..)。
理想的是在真机上从 ms dos 启动。但也许你可以尝试使用 pcem 或 86box VM,它们在硬件模拟方面比 dosbox 更精确。