Jump to content
IGNORED

Mad Assembler and floating-point constants.


Recommended Posts

Hi!

 

Trying to assemble different versions of the Altirra Kernel, I discovered that Mad Assembler does not always generate the correct bytes for all floating points values.

 

Tracking the bug, it came from the different floating-point precision of the generated code, FreePascal uses different approximations for some of the operations than the Delphi compiler, producing different results.

 

I rewrote the floating-point parsing code, using a simpler and more accurate algorithm that does not rely on converting a floating point into a string. Attached is the resulting pascal source.

 

Have Fun!

 

mads.pas

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Hi!

19 hours ago, tebe said:

Thank you DMSC, I'm grateful for your contribution :)

No problem, glad I could help. Fortunately there is google translate to understand the code comments :P 

 

Have Fun!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...