hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

cpuid_native.s (650B)


      1 .section ".text.rt.cpuid_getvendorstr","ax"
      2 .global rt.cpuid_getvendorstr
      3 .type rt.cpuid_getvendorstr,@function
      4 rt.cpuid_getvendorstr:
      5 	pushq %rdx
      6 	pushq %rcx
      7 	pushq %rbx
      8 
      9 	cpuid
     10 	movl %ebx, (%rdi)
     11 	movl %edx, 4(%rdi)
     12 	movl %ecx, 8(%rdi)
     13 
     14 	popq %rbx
     15 	popq %rcx
     16 	popq %rdx
     17 	ret
     18 
     19 .section ".text.rt.cpuid_getfeatureflags","ax"
     20 .global rt.cpuid_getfeatureflags
     21 .type rt.cpuid_getfeatureflags,@function
     22 rt.cpuid_getfeatureflags:
     23 
     24 	pushq %rdx
     25 	pushq %rcx
     26 	pushq %rbx
     27 
     28 	movl $1, %eax
     29 	cpuid
     30 
     31 	movq %rdi, -0x8(%rsp)
     32 	movq -0x8(%rsp), %rax
     33 	movl %edx, (%rax)
     34 
     35 	movq -0x8(%rsp), %rax
     36 	add $0x4, %rax
     37 	movl %ecx, (%rax)
     38 
     39 	popq %rbx
     40 	popq %rcx
     41 	popq %rdx
     42 	ret
     43