Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/rdtsc.s
#define RDTSC BYTE $0x0F; BYTE $0x31 TEXT rdtsc(SB), $0 /* time stamp counter: cycles since power up */ MOVL .ret+0(FP), CX RDTSC MOVL AX, 0(CX) MOVL DX, 4(CX) RET