hi,
how can i divide 24 or 32 bit constant value.
for example
hword= 0032
Lword=69cc
dividerW=0150
result ?
hi,
how can i divide 24 or 32 bit constant value.
for example
hword= 0032
Lword=69cc
dividerW=0150
result ?
i know div32 do it.
but i don't know how use it.
as far as i read i cannot assign a constant to div32
div32 = 0032 69CC
the only way is getting the constant value by multiplying by two words then divide it.
constant = x*y
result = div32 z
am i right ?
No !!!
Mel has already given the solution here, in this forum !!!
Alain from Mel's fan club ...
hi again,
acetronics can you tell me how can i do that or what is the subject of the threat that my question's answer is given.
i search but i cannot find
Hi, kasapo
Here it is :
'************************************************* *****************************
'MACRO 32 bits
'************************************************* *****************************
ASM
Putmulresult macro const32
MOVE?CB low const32, R2
MOVE?CB low (const32 >> 8), R2+1
MOVE?CB low (const32 >> 16),R0
MOVE?CB low (const32 >> 24),R0+1
endm
ENDASM
and when needed :
@ putmulresult 60000000 or else ...
Vitesse = DIV32 dureetot
Vitesse = Vitesse / coeff
or sth ...looking like that !!!
I do not find anymore the thread nor ....
Alain
Last edited by Acetronics2; - 10th February 2005 at 12:03.
Hello Kaspo,
Here is a link:
http://www.picbasic.co.uk/forum/show...ighlight=DIV32
and
http://www.picbasic.co.uk/forum/show...ighlight=DIV32
Dwayne
Last edited by Dwayne; - 10th February 2005 at 14:41.
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Just one thing ...
It worked pretty well on a 16F84, but NOT Well on a 16F628 ...
a paging problem somewhere ???
Alain
thanks for your help.
in my application sometimes result is greater than 16 bit . so i can not get the expected result. i get FFFF
for example
@ putmulresult 2236920 or else ...
resultw = DIV32 xxxx
if xxx smaller than 35 resultw is greater than 16 bit.
how can i solve this problem ?
Bookmarks