1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
program ts010022;
const
EXCEPTIONCOUNT = 18;
exception_names : array[0..EXCEPTIONCOUNT-1] of pchar = (
'Division by Zero',
'Debug',
'NMI',
'Breakpoint',
'Overflow',
'Bounds Check',
'Invalid Opcode',
'Coprocessor not available',
'Double Fault',
'Coprocessor overrun',
'Invalid TSS',
'Segment Not Present',
'Stack Fault',
'General Protection Fault',
'Page fault',
' ',
'Coprocessor Error',
'Alignment Check');
single_pchar : pchar = 'Alone test';
const filename = 'ts010022.tmp';
var en : pchar;
f : text;
st : string;
begin
assign(f,filename);
rewrite(f);
en:=single_pchar;
Writeln(f,en);
en:=exception_names[6];
writeln(f,en);
close(f);
reset(f);
readln(f,st);
if st<>'Alone test' then halt(1);
readln(f,st);
if st<>'Invalid Opcode' then halt(1);
close(f);
erase(f);
end.
|