NCD
Archiver
Posts: 46,084
Does anyone know how NCD command works internal to BS2?
I've been using it, but I wish to gain some insight on its internal
operations.
Much thanks in advance.
I've been using it, but I wish to gain some insight on its internal
operations.
Much thanks in advance.
Comments
16. If no bit is set, then NCD X = 0.
examples
NCD 9 = 4 ' 9=%1001
NCD 32768 = 16 ' 32768=%100000000000
NCD 1 = 1
NCD 0 = 0
Pseudocode implementation:
X=number to test
Y=16 ; bit counter
NCD_test
shift X left through carry
if carry=1 or Y=0 then
exit_NCDtest
else
decrement Y
goto NCD_test
endif
; exit with Y=NCD X
On my web pages I have a writeup on how to use NCD as the start of a
logarithm function--It is the characteristic of log base2 X.
-- Tracy
>Does anyone know how NCD command works internal to BS2?
>I've been using it, but I wish to gain some insight on its internal
>operations.
>
>Much thanks in advance.