Bonita Montero
2020-05-13 06:54:31 UTC
I've got this Masm-code:
PUBLIC ?spendCycles@@***@Z
_TEXT SEGMENT
?spendCycles@@***@Z PROC
test rcx, rcx
jz byebye
cycleLoop:
dec rcx ; roughly one jump per clock-cycle
jnz cycleLoop ; because there's only one branch-unit
byebye:
ret
?spendCycles@@***@Z ENDP
_TEXT ENDS
END
I need a C++-function with gcc inline-assembly that does the same.
Unfortunately I'm not familiar with gcc inline-assembly.
So could anyone here re-write me that code ?
PUBLIC ?spendCycles@@***@Z
_TEXT SEGMENT
?spendCycles@@***@Z PROC
test rcx, rcx
jz byebye
cycleLoop:
dec rcx ; roughly one jump per clock-cycle
jnz cycleLoop ; because there's only one branch-unit
byebye:
ret
?spendCycles@@***@Z ENDP
_TEXT ENDS
END
I need a C++-function with gcc inline-assembly that does the same.
Unfortunately I'm not familiar with gcc inline-assembly.
So could anyone here re-write me that code ?