我发现了我用 Turbo Pascal 编写的旧代码,我想运行它们。我不确定这是否是正确的提问地点。
我已经从 source forge 安装了带有 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 更精确。