*** Welcome to piglix ***

Microsoft Binary Format


In computing, Microsoft Binary Format (MBF) was a format for floating point numbers used in Microsoft's BASIC language products including MBASIC, GW-BASIC and QuickBasic prior to version 4.00.

In 1975, Bill Gates and Paul Allen were working on Altair BASIC, which they were developing at Harvard University on a PDP-10 running their Altair emulator. One thing still missing was code to handle floating point numbers, needed to support calculations with very big and very small numbers, which would be particularly useful for science and engineering. One of the proposed uses of the Altair was as a scientific calculator.

At a dinner at Currier House, an undergraduate residential house at Harvard, Gates and Allen complained to their dinner companions about having to write this code. One of them, Monte Davidoff, told them he had written floating point routines before and convinced Gates and Allen that he was capable of writing the Altair BASIC floating point code. At the time there was no standard for floating point numbers, so Davidoff had to come up with his own. He decided 32 bits would allow enough range and precision. When Allen had to demonstrate it to MITS, it was the first time it ran on an actual Altair. But it worked and when he entered ‘PRINT 2+2’, Davidoff's adding routine gave the right answer.

The source code for Altair BASIC was thought to have been lost to history, but resurfaced in 2000. It had been sitting behind Gates's former tutor and dean Harry Lewis's file cabinet, who rediscovered it. A comment in the source credits Davidoff as the writer of Altair BASIC's math package.

Altair BASIC took off and soon most early home computers ran some form of Microsoft BASIC. The BASIC port for the 6502 CPU, such as used in the Commodore PET, took up more space due to the lower code density of the 6502. Because of this it would likely not fit in a single ROM chip together with the machine-specific input and output code. Since an extra chip was necessary, extra space was available and this was used in part to extend the floating point format from 32 bit to 40 bit. This extended format was not only provided by Commodore BASIC 1 & 2, but was also supported by AppleSoft BASIC I & II since version 1.1 (1977), KIM-1 BASIC since version 1.1a (1977), and MicroTAN BASIC since version 2b (1980). Not long afterwards the Z80 ports, such as Level II BASIC for the TRS-80 (1978), introduced the 64 bit, double precision format as a separate data type from 32 bit, single precision. Microsoft used the same floating point formats in their implementation of Fortran and for their macro assembler MASM, although their spreadsheet Multiplan and their COBOL implementation used binary coded decimal (BCD) floating point. Even so, for a while MBF became the de facto floating point format on home computers, to the point where people still occasionally encounter legacy files and file formats using it.


...
Wikipedia

...