Implement random number generation with x86 rdrand

This commit is contained in:
2025-10-11 21:36:33 +02:00
parent 02a5d8b418
commit b717387adb
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,13 @@
.global hal_randnum
hal_randnum:
mov $100, %ecx
xor %eax, %eax
.retry:
rdrand %eax
jc .done
loop .retry
.fail:
mov $-1, %eax
.done:
ret