OOStuBS - Technische Informatik II (TI-II)
2.4
Hauptseite
Zusätzliche Informationen
Klassen
Dateien
Auflistung der Dateien
Datei-Elemente
include
machine
cpu.h
gehe zur Dokumentation dieser Datei
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2
* Technische Informatik II *
3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4
* *
5
* C P U *
6
* *
7
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8
9
#ifndef __CPU_include__
10
#define __CPU_include__
11
20
class
CPU
{
21
public
:
26
inline
void
enable_int
() {
27
asm
(
"sti"
);
28
}
29
35
inline
bool
disable_int
() {
36
long
temp;
37
asm
(
38
"pushf\n\t"
39
"cli\n\t"
40
"movl (%%esp), %0\n\t"
41
"add $4, %%esp \n\t"
42
:
"=r"
(temp)
43
);
44
return
temp&(1<<9);
45
}
46
55
inline
void
halt
() {
56
asm
(
"hlt"
);
57
}
58
};
59
60
#endif
Erzeugt am Mon Jun 30 2014 07:13:28 für OOStuBS - Technische Informatik II (TI-II) von
1.8.1.2