ReactOS
0.4.16-dev-1093-g93e9710
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
pc98rtc.c
Go to the documentation of this file.
1
/*
2
* PROJECT: FreeLoader
3
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4
* PURPOSE: Real-time clock access routine for NEC PC-98 series
5
* COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
6
*/
7
8
#include <
freeldr.h
>
9
10
#define BCD_INT(bcd) (((bcd & 0xF0) >> 4) * 10 + (bcd & 0x0F))
11
12
TIMEINFO
*
13
Pc98GetTime
(
VOID
)
14
{
15
static
TIMEINFO
TimeInfo;
16
REGS
Regs;
17
UCHAR
SysTime[6];
18
19
/* Int 1Ch AH=00h
20
* TIMER BIOS - Read system time
21
*
22
* Call with:
23
* ES:BX -> data buffer
24
*/
25
Regs.
b
.
ah
= 0x00;
26
Regs.
w
.
es
= ((
ULONG_PTR
)SysTime) >> 4;
27
Regs.
w
.
bx
= ((
ULONG_PTR
)SysTime) & 0x0F;
28
Int386
(0x1C, &Regs, &Regs);
29
30
TimeInfo.
Year
=
BCD_INT
(SysTime[0]);
31
TimeInfo.
Month
=
BCD_INT
(SysTime[1] >> 4);
32
TimeInfo.
Day
=
BCD_INT
(SysTime[2]);
33
TimeInfo.
Hour
=
BCD_INT
(SysTime[3]);
34
TimeInfo.
Minute
=
BCD_INT
(SysTime[4]);
35
TimeInfo.
Second
=
BCD_INT
(SysTime[5]);
36
if
(TimeInfo.
Year
>= 80)
37
TimeInfo.
Year
+= 1900;
38
else
39
TimeInfo.
Year
+= 2000;
40
41
return
&TimeInfo;
42
}
ULONG_PTR
#define ULONG_PTR
Definition:
config.h:101
freeldr.h
void
Definition:
nsiface.idl:2307
BCD_INT
#define BCD_INT(bcd)
Definition:
pc98rtc.c:10
Pc98GetTime
TIMEINFO * Pc98GetTime(VOID)
Definition:
pc98rtc.c:13
Int386
int __cdecl Int386(int ivec, REGS *in, REGS *out)
BYTEREGS::ah
unsigned char ah
Definition:
pcbios.h:132
WORDREGS::es
unsigned short es
Definition:
pcbios.h:121
WORDREGS::bx
unsigned short bx
Definition:
pcbios.h:112
_TIMEINFO
Definition:
fw.h:10
_TIMEINFO::Month
USHORT Month
Definition:
fw.h:12
_TIMEINFO::Day
USHORT Day
Definition:
fw.h:13
_TIMEINFO::Minute
USHORT Minute
Definition:
fw.h:15
_TIMEINFO::Hour
USHORT Hour
Definition:
fw.h:14
_TIMEINFO::Second
USHORT Second
Definition:
fw.h:16
_TIMEINFO::Year
USHORT Year
Definition:
fw.h:11
REGS
Definition:
pcbios.h:159
REGS::b
BYTEREGS b
Definition:
pcbios.h:163
REGS::w
WORDREGS w
Definition:
pcbios.h:162
UCHAR
unsigned char UCHAR
Definition:
xmlstorage.h:181
boot
freeldr
freeldr
arch
i386
pc98
pc98rtc.c
Generated on Mon May 5 2025 06:02:46 for ReactOS by
1.9.6