rdos/lib/log2.asm
Nero dc5e437c2d Revert "Remove unused stuff"
debug rom still uses printf

This reverts commit a9fa3d355e.
2020-04-04 11:41:01 +00:00

16 lines
183 B
NASM

; Calculate dual logarithm (int)
; IN AX number
; OUT AX dual logarithm
log2:
push cx
mov cx, 15
.loop:
rcl ax, 1
jc .ret
loop .loop
.ret:
cmc
mov ax, cx
pop cx
ret