Ok, you need two files:

First 'calc.kix'

code:

BREAK ON CLS

if len($val1)<len($val2)
$str1=$val1 $str2=$val2
else
$str2=$val1 $str1=$val2
endif

$ans="" $carry=0
gosub fill
gosub $do

exit

:multiply
$ans="" $subans=""
$fixpos=$pos
while substr($str1,$pos,1)<>" " and $pos>0
$zeros=0 while $pos+$zeros<len($str1) $subans="0"+$subans $zeros=$zeros+1 loop
$pos2=$fixpos
while substr($str2,$pos2,1)<>" " and $pos2>0 or $carry>0
if $pos2>0 $a=val(substr($str1,$pos,1))*(substr($str2,$pos2,1)) endif
$a=$a+$carry
if $a>9 $carry=val(substr("$a",1,1)) $a=val(substr("$a",2,1))
else $carry=0
endif
$subans="$a"+$subans $a=0
$pos2=$pos2-1
loop
$subans="|"+$subans
$pos=$pos-1
loop

$str1save=$str1 $str2save=$str2
$str1="" $str2=""
while len($subans)>0
$str1=$ans $ans=""
$subans=substr($subans,2,len($subans))
if instr($subans,"|")
$str2=substr($subans,1,instr($subans,"|")-1)
$subans=substr($subans,instr($subans,"|"),len($subans))
else
$str2=$subans
$subans=""
endif
gosub fill
gosub add
loop

$str1=$str1save $str2=$str2save
$kixans=val($str1)*val($str2)
return

:add
$carry=0
while $pos>0 or $carry>0
if $pos>0 $a=val(substr($str1,$pos,1))+val(substr($str2,$pos,1)) endif
$a=$a+$carry
if $a>9 $carry=1 $a=$a-10
else $carry=0
endif
$ans="$a"+$ans $pos=$pos-1 $a=0
loop
$kixans=val($str1)+val($str2)
return

:fill
if len($str1)>len($str2)
while len($str2)<len($str1) $str2=" "+$str2 loop
else
while len($str1)<len($str2) $str1=" "+$str1 loop
endif
$pos=len($str1)
return


Second, 'main.kix'

code:

BREAK ON CLS

$top=val("&"+substr(@ADDRESS, 1, 6))

$bottom=val("&"+substr(@ADDRESS, 7, 6)) $bottom="$bottom"

$val1="$top" $val2="16777216"
$do="multiply"
call "calc.kix"

$val1=$ans $val2="$bottom"
$do="add"
call "calc.kix"

? $ans


Thanx to CJ's explanation about the top 'n bottom part of the hex-nr.

Hope this helps.

------------------
Greetz,

Roger the Young
------------------------
The code is out there...
------------------------

_________________________
The Code is out there