-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFILESIZE.C
More file actions
80 lines (66 loc) · 1.87 KB
/
FILESIZE.C
File metadata and controls
80 lines (66 loc) · 1.87 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/********************************************************/
/* */
/* Malte System/Handle File Size */
/* 1993/05/15 */
/* */
/* Copyright (C) par les Chevaliers de Malte */
/* */
/********************************************************/
//
// Programmeur :
//
// Sylvain Maltais
//
// Compatible :
//
// Turbo Pascal 4.xx ou post‚rieur,
// Turbo C++ ou post‚rieur
//
// *******************************************************
// INTERFACE/HEADER
// *******************************************************
#include <NUMERIC.H>
extern LongInt FileSize(Word Handle);
// *******************************************************
// IMPLEMENTATION
// *******************************************************
extern Word FileError;
#ifndef __HandleFileSize__
#define __HandleFileSize__
// ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
// ³ FileSize ³Û
// ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
#if defined(__286__) || defined(__386__)
LongInt FileSize(Word Handle)
{
asm MOV AX,0x4202;
asm MOV BX,Handle;
asm XOR CX,CX;
asm XOR DX,DX;
asm INT 0x21;
asm JC Error;
asm PUSH 0x0000;
asm POP FileError;
return(_AX + (_DX << 16));
Error:
asm MOV FileError,AX;
return(-1);
}
#else
LongInt FileSize(Word Handle)
{
asm MOV AX,0x4202;
asm MOV BX,Handle;
asm XOR CX,CX;
asm XOR DX,DX;
asm INT 0x21;
asm JC Error;
asm MOV FileError,0;
return(_AX + (_DX << 16));
Error:
asm MOV FileError,AX;
return(-1);
}
#endif
#endif