hi

for a project i should multiply a port content that can be ( 1 to

25000000)

to 85.899346 whit assambly what should i do?

notice that the input can be for example 13543.68 or so ! but ( at

most 2 digit for floating in input so we don't have 23657.687)

any help would be most appriciated

The question's a bit unclear.

But, for multiplying two numbers with fixed decimal precisions it's quite

easy to pretend the number(s) are whole integer values and write an integer

"n byte" multiply routine that that will handle the number of bits that can

result. This result is then passed onto another routine that integer divides

the previous answer by the 10 or 100 or 1000 ect that the original was

changed by. The result (integer bits and 'remainder' bits) is then converted

back to BCD, decimal, ascii etc.

Eg The port number might be "12,345,678.90". You know there's only ever two

decimal digits, so call that number "1234567890". (ie. pretend it is 100

times bigger.). The number can now be stored in memory as 4 bytes (32 bits

of binary).

Now pretend the multiplier is "85899346" (ie a million times bigger). Store

this also as 4 bytes of memory.

Code up or find a "32 bit x 32 bit" multplier routine. Use this to multiply

your two 32 bit numbers. The routine will result in an 8 byte (64 bits)

answer.

This 8 byte answer now needs dividing back down by "100" and "1000000" (ie

divide the 64 bit (binary) answer by 100 million).

Write or find a "64 bit by 32 bit" divide routine.

Convert the "100 million" into into a 4 byte (32 bit) binary number. (this

value will always be the same for each calculation). Do the division of

your 64 bit and 32 bit numbers.

This is the final answer (in binary of course). So convert this number

(integer part plus the 'remainder' part ) back into BCD etc.

The 'n' byte multiply and divide routines are quite small, understandable

and are standard use for machine code programming. A search on the web

should turn up lots of examples.

regards

john