anyone can give me an assembly program that can convert pounds to kilos and vice versa with source codes?? its preety urgent thanks in advance.. This message was edited by nash, on 3/18/2001 11:27:01 AM
Posted on 2001-03-18 01:08:00 by nash
The below method is very inaccurate. It could only suit the purpose of a interger conversions. A much better (faster, smaller and far mor accurate) method could be used using floating point instructions, but im very rusty on these.

mov eax,kilograms
mov edx,453
mul edx
mov ecx,1000
div ecx

eax = the number of pounds
edx = the remainder ( edx pounds)

for reverse:

mov eax,pounds
mov edx,1000
mul eax
mov ecx,453
div ecx

eax = the number of kg
edx = the remainder ( edx kg)

Floating point code would look something like this:

fld kilograms
fmul 0.453
fst pounds

This message was edited by George, on 3/18/2001 5:25:36 AM
Posted on 2001-03-18 04:19:00 by George