projects
/
bcm963xx.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Revert "Revert "and added files""
[bcm963xx.git]
/
userapps
/
opensource
/
sshd
/
libtomcrypt
/
demos
/
timer.asm
1
; x86 timer in NASM
\r
2
;
\r
3
; Tom St Denis, tomstdenis@iahu.ca
\r
4
[bits 32]
\r
5
[section .data]
\r
6
time dd 0, 0
\r
7
\r
8
[section .text]
\r
9
\r
10
%ifdef USE_ELF
\r
11
[global t_start]
\r
12
t_start:
\r
13
%else
\r
14
[global _t_start]
\r
15
_t_start:
\r
16
%endif
\r
17
push eax
\r
18
push ebx
\r
19
push ecx
\r
20
push edx
\r
21
cpuid
\r
22
rdtsc
\r
23
mov [time+0],edx
\r
24
mov [time+4],eax
\r
25
pop edx
\r
26
pop ecx
\r
27
pop ebx
\r
28
pop eax
\r
29
ret
\r
30
\r
31
%ifdef USE_ELF
\r
32
[global t_read]
\r
33
t_read:
\r
34
%else
\r
35
[global _t_read]
\r
36
_t_read:
\r
37
%endif
\r
38
push ebx
\r
39
push ecx
\r
40
cpuid
\r
41
rdtsc
\r
42
sub eax,[time+4]
\r
43
sbb edx,[time+0]
\r
44
pop ecx
\r
45
pop ebx
\r
46
ret
\r
47