Giter Site home page Giter Site logo

bayerf42 / motoffp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 45 KB

Port and cleanup of the Motorola 68343 floating point library for the Sirichote 68008 kit

Assembly 99.74% Python 0.26%
floating-point library motorola preservation motorola-68000 single-board-computer

motoffp's Introduction

Port and cleanup of the Motorola 68343 floating point library for the Sirichote 68008 kit

Purpose

This library contains 68k assembly subroutines to compute with floating point numbers. It was originally written by Motorola about 40 years ago. It contains basic arithmetic, parsing and printing decimal, and several transcendental functions.

It uses a special 32 bit format to represent real numbers, called Fast Floating Point, which was apparently also used on Amiga computers in the 80s. The format is simpler (and faster) than the modern IEEE-754 single precision format, but has a more limited exponent range.

I use it to provide floating point numbers for Lox68k

Building the library

  • Build the Monitor ROM as described here
  • Load project MotoFFP.prj into Ide68K and build it.
  • Execute
python makerom.py

to create mon_ffp.bin ROM image in the parallel rom directory.

If you don't want to build the ROM yourself, a pre-built image mon_ffp.bin is included in the release, containing both the Monitor and the FFP library.

Using the library

The main incentive for resurrection of the Motorola FFP library was to provide floating point numbers for the Lox68k language, but of course you can utilize it for other projects as well.

The file test_ffp.asm shows how to call some routines from the library. Compile it in Ide68K (without a project file), load it to the Kit and run it. It prints the result of the computation to the terminal.

Entry vectors

  • Startup file ffp_entry.asm defines the branch entries into the library
  • Include file ffp_math.inc defines official entrypoints for external library users

Origin

Changes

  • Removed unneeded IEEE files IEFABS.SA, IEFADD.SA, IEFAFP.SA There were no other IEEE files in the archive, probably got lost somewhere...
  • Removed unneeded program FFPFPBCD.SA
  • Removed unneeded demo programs FFPDEMO.SA and FFPCALC.SA
  • Removed *.HT files
  • Renamed source files *.SA to *.asm
  • Use FFPMUL2 instead of FFPMUL because of higher precision
  • Removed unsupported TTL, PAGE, IDNT, OPT PCS, SECTION 9 directives
  • Removed END directives to combine all sources
  • Changed MOVE.L #nn,Dm to MOVEQ #nn,Dm if value in range
  • Changed ADD.s #n to ADDQ.s #n if value in range
  • Changed SUB.s #n to SUBQ.s #n if value in range
  • Use PC-relative addressing for constant tables
  • Reactivated the CCR manipulation instructions, which weren't supported by ancient assembler
  • Renamed some duplicated labels
  • Removed 68010 compatibility code to save SR on the stack
  • Created project file for defined order
  • Allowed lower case e as exponent marker inFFPAFP
  • Fixed overflow bugs in sinh and cosh
  • Wrong docs on sinh, cosh, and tanh: D3-D5 are destroyed and must be saved

motoffp's People

Contributors

bayerf42 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.