hallo,
Tijdens het compileren met GCC van dit stukje code:
Krijg ik de error mee:
Ik heb al verschillende google hits van deze error bekeken, maar ik wordt er nog niet heel veel wijzer uit. Ziet iemand hier wat & waar het fout gaat?
Mvg,
Jan Willem
Tijdens het compileren met GCC van dit stukje code:
C++:
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
| #include <sys/time.h> #include <time.h> #include <stdio.h> #include <iostream> #include <stdint.h> #include <unistd.h> using namespace std; int _tmain(int argc, char* argv[]) { while(1) { int64_t unsigned BeginClock = 0; int64_t unsigned EndClock = 0; int64_t unsigned Speed = 0; asm ("RDTSC;" "MOV DWORD PTR SS:[BeginClock], %EAX;" "MOV DWORD PTR SS:[BeginClock+4], %EDX;"); sleep(1000); asm ("RDTSC;" "MOV DWORD PTR SS:[EndClock], %EAX;" "MOV DWORD PTR SS:[EndClock+4], %EDX;"); Speed = (EndClock - BeginClock); Speed = Speed / (1000000 * (1000/1000)); printf ("CPU Frequentie: "); //<< Speed << " MHZ"; //spreekt voorzichzelf } } |
Krijg ik de error mee:
code:
1
2
3
4
5
6
| janwillem@linux-mwmd:~/Documents> g++ CPUSpeed.cpp -g -o cpuspeed CPUSpeed.cpp: Assembler messages: CPUSpeed.cpp:20: Error: junk `PTR SS:[BeginClock]' after expression CPUSpeed.cpp:20: Error: junk `PTR SS:[BeginClock+4]' after expression CPUSpeed.cpp:26: Error: junk `PTR SS:[EndClock]' after expression CPUSpeed.cpp:26: Error: junk `PTR SS:[EndClock+4]' after expression |
Ik heb al verschillende google hits van deze error bekeken, maar ik wordt er nog niet heel veel wijzer uit. Ziet iemand hier wat & waar het fout gaat?
Mvg,
Jan Willem
Unix is simple. It just takes a genius to understand its simplicity