source: golgotha/src/i4/time/p5_timer.s @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 445 bytes
Line 
1#include <linux/sys.h>
2#include <linux/linkage.h>
3
4.data
5timer_hi:       .long   0
6timer_lo:       .long 0
7.text
8
9#define rdtsc   \
10.byte   0x0f;   \
11.byte           0x31
12
13.globl i4_pentium_start_clock
14i4_pentium_start_clock:
15        rdtsc
16        movl    %edx, timer_hi
17        movl    %eax, timer_lo
18        ret
19
20.globl i4_pentium_end_clock
21i4_pentium_end_clock:
22        rdtsc
23        movl    4(%esp), %ecx
24        subl    timer_lo, %eax
25        sbbl    timer_hi, %edx
26        movl    %eax, 4(%ecx)
27        movl    %edx, (%ecx)
28        ret
29
Note: See TracBrowser for help on using the repository browser.