flat assembler
Message board for the users of flat assembler.
Index
> DOS > floating point arithmatics |
Author |
|
mns 24 May 2015, 04:17
hello,i'm trying learn addition of 2 floating point numbers with the code(attached) bellow.when adding same numbers two times they give different results(well results are in other way round and it is not the problem)
can someone please explain me why two results (addition1 and addition2 in the code)for same numbers?
|
|||||||||||
24 May 2015, 04:17 |
|
mns 24 May 2015, 18:22
Thank you very much
please can you explain more? I thought with loop of stosb will make a string(text buffer) for 32times which starting from num1 or num2 and add 24h to the end of it with last stosb. |
|||
24 May 2015, 18:22 |
|
mns 24 May 2015, 18:26
by the way your solution worked like a charm.thanks again
|
|||
24 May 2015, 18:26 |
|
Trinitek 24 May 2015, 18:31
The problem is that you made your text buffers only one byte large. The first binary value that is printed out is correct, but when you created the string in buffer num1, you ended up overwriting the floating point constants. Therefore, the second time you tried to add the numbers together, float4 and float5 weren't equal to 9.45 and 5.22 anymore. They were destroyed.
If you had put your float constants before your text buffers, it would've worked correctly as well. Or... you could expand num1 and num2 to cover 33 bytes each, like I suggested above. |
|||
24 May 2015, 18:31 |
|
mns 24 May 2015, 18:46
many many thanks Trinitek.
|
|||
24 May 2015, 18:46 |
|
Trinitek 24 May 2015, 18:52
No problem!
|
|||
24 May 2015, 18:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.