11
procedure int21h_handler; assembler;
25
Write('-- press any key to resume --'); readkey;
26
gotoxy(1, wherey); clreol;
31
Writeln('Executing real mode interrupt');
33
r.ah := $30; r.al := $01; realintr($21, r);
34
Writeln('DOS v', r.al,'.',r.ah, ' detected');
36
Writeln('Executing protected mode interrupt without our own',
45
Writeln('DOS v', r.al,'.',r.ah, ' detected');
47
Writeln('As you can see the DPMI hosts default protected mode',
49
Writeln('simply redirects it to the real mode handler');
51
Writeln('Now exchanging the protected mode interrupt with our ',
55
newint21h.offset := @int21h_handler;
56
newint21h.segment := get_cs;
57
get_pm_interrupt($21, oldint21h);
58
set_pm_interrupt($21, newint21h);
60
Writeln('Executing real mode interrupt again');
62
r.ah := $30; r.al := $01; realintr($21, r);
63
Writeln('DOS v', r.al,'.',r.ah, ' detected');
65
Writeln('See, it didn''t change in any way.');
67
Writeln('Now calling protected mode interrupt');
75
Writeln('DOS v', lo(axreg),'.',hi(axreg), ' detected');
77
Writeln('Now you can see that there''s a distinction between ',
78
'the two ways of calling interrupts...');
79
set_pm_interrupt($21, oldint21h);
b'\\ No newline at end of file'