WIP on FCB disk i/o
This commit is contained in:
parent
58a95932b5
commit
7877809bc1
6 changed files with 95 additions and 103 deletions
14
lib/log2.asm
Normal file
14
lib/log2.asm
Normal file
|
@ -0,0 +1,14 @@
|
|||
; Calculate dual logarithm (int)
|
||||
; IN AX number
|
||||
; OUT AX dual logarithm
|
||||
log2:
|
||||
push cx
|
||||
mov cx, 16
|
||||
.loop:
|
||||
sar ax, 1
|
||||
loopnz .loop
|
||||
xchg ax, cx
|
||||
pop cx
|
||||
neg ax
|
||||
add ax, 15
|
||||
ret
|
Loading…
Add table
Add a link
Reference in a new issue