Microsoft Binary Format
   HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, e ...
, Microsoft Binary Format (MBF) is a format for
floating-point In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can b ...
numbers which was used in
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
's
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
language products, including
MBASIC MBASIC is the Microsoft BASIC implementation of BASIC for the CP/M operating system. MBASIC is a descendant of the original Altair BASIC interpreters that were among Microsoft's first products. MBASIC was one of the two versions of BASIC bundled w ...
,
GW-BASIC GW-BASIC is a dialect of the BASIC programming language developed by Microsoft from IBM BASICA. Functionally identical to BASICA, its BASIC interpreter is a fully self-contained executable and does not need the Cassette BASIC ROM found in the or ...
and
QuickBASIC Microsoft QuickBASIC (also QB) is an Integrated Development Environment (or IDE) and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the c ...
prior to version 4.00. There are two main versions of the format. The original version was designed for memory-constrained systems and stored numbers in 32 bits (4 bytes), with a 23-bit mantissa, 1-bit sign, and an 8-bit
exponent Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
. Extended (12k) BASIC included a double-precision type with 64 bits. During the period when it was being ported from the
Intel 8080 The Intel 8080 (''"eighty-eighty"'') is the second 8-bit microprocessor designed and manufactured by Intel. It first appeared in April 1974 and is an extended and enhanced variant of the earlier 8008 design, although without binary compatibil ...
platform to the
MOS 6502 The MOS Technology 6502 (typically pronounced "sixty-five-oh-two" or "six-five-oh-two") William Mensch and the moderator both pronounce the 6502 microprocessor as ''"sixty-five-oh-two"''. is an 8-bit microprocessor that was designed by a small te ...
processor, computers were beginning to ship with more memory as a standard feature. This version was offered with the original 32-bit format or an optional expanded 40-bit (5-byte) format. The 40-bit format was used by most home computers of the 1970s and 1980s. These two versions are sometimes known as "6-digit" and "9-digit", respectively. On PCs with
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
processor,
QuickBASIC Microsoft QuickBASIC (also QB) is an Integrated Development Environment (or IDE) and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the c ...
, prior to version 4, reintroduced the double-precision format using a 55-bit mantissa in a 64-bit (8-byte) format. MBF was abandoned during the move to QuickBASIC 4, which used the standard
IEEE 754 The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point arithmetic established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found i ...
format, introduced a few years earlier.


History

Bill Gates William Henry Gates III (born October 28, 1955) is an American business magnate and philanthropist. He is a co-founder of Microsoft, along with his late childhood friend Paul Allen. During his career at Microsoft, Gates held the positions ...
and
Paul Allen Paul Gardner Allen (January 21, 1953 – October 15, 2018) was an American business magnate, computer programmer, researcher, investor, and philanthropist. He co-founded Microsoft Corporation with childhood friend Bill Gates in 1975, which h ...
were working on
Altair BASIC Altair BASIC is a discontinued interpreter for the BASIC programming language that ran on the MITS Altair 8800 and subsequent S-100 bus computers. It was Microsoft's first product (as Micro-Soft), distributed by MITS under a contract. Altair BASI ...
in 1975. They were developing the software at
Harvard University Harvard University is a private Ivy League research university in Cambridge, Massachusetts. Founded in 1636 as Harvard College and named for its first benefactor, the Puritan clergyman John Harvard, it is the oldest institution of higher le ...
on a DEC
PDP-10 Digital Equipment Corporation (DEC)'s PDP-10, later marketed as the DECsystem-10, is a mainframe computer family manufactured beginning in 1966 and discontinued in 1983. 1970s models and beyond were marketed under the DECsystem-10 name, especi ...
running their
Altair Altair is the brightest star in the constellation of Aquila and the twelfth-brightest star in the night sky. It has the Bayer designation Alpha Aquilae, which is Latinised from α Aquilae and abbreviated Alpha Aql or ...
emulator In computing, an emulator is Computer hardware, hardware or software that enables one computer system (called the ''host'') to behave like another computer system (called the ''guest''). An emulator typically enables the host system to run so ...
. One thing they lacked was code to handle floating-point numbers, required 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 that they had to write this code and one of them,
Monte Davidoff Monte Davidoff (; born 1956) is an American computer programmer. Davidoff is from Glendale, Wisconsin. He graduated from Nicolet High School in 1974, and went on to Harvard College, where he majored in applied mathematics, the department at Harva ...
, told them that 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, while IBM had introduced their own programs, there was no standard for floating-point numbers, so Davidoff had to come up with his own. He decided that 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 correct 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 The MOS Technology 6502 (typically pronounced "sixty-five-oh-two" or "six-five-oh-two") William Mensch and the moderator both pronounce the 6502 microprocessor as ''"sixty-five-oh-two"''. is an 8-bit microprocessor that was designed by a small te ...
CPU, such as used in the
Commodore PET The Commodore PET is a line of personal computers produced starting in 1977 by Commodore International. A single all-in-one case combines a MOS Technology 6502 microprocessor, Commodore BASIC in read-only memory, keyboard, monochrome monitor, an ...
, 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 to 40 bits. This extended format was not only provided by
Commodore BASIC Commodore BASIC, also known as PET BASIC or CBM-BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the PET of 1977 to the C128 of 1985. The core is based on 6502 M ...
1 & 2, but was also supported by
Applesoft BASIC Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with the Apple II series of computers. It supersedes Integer BASIC and is the BASIC in ROM in all Apple II series computers after the original ...
I & II since version 1.1 (1977),
KIM-1 The KIM-1, short for ''Keyboard Input Monitor'', is a small 6502-based single-board computer developed and produced by MOS Technology, Inc. and launched in 1976. It was very successful in that period, due to its low price (thanks to the inexpe ...
BASIC since version 1.1a (1977), and MicroTAN BASIC since version 2b (1980). Not long afterwards, the
Z80 The Z80 is an 8-bit microprocessor introduced by Zilog as the startup company's first product. The Z80 was conceived by Federico Faggin in late 1974 and developed by him and his 11 employees starting in early 1975. The first working samples were ...
ports, such as Level II BASIC for the
TRS-80 The TRS-80 Micro Computer System (TRS-80, later renamed the Model I to distinguish it from successors) is a desktop microcomputer launched in 1977 and sold by Tandy Corporation through their Radio Shack stores. The name is an abbreviation of '' ...
(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 The Microsoft Macro Assembler (MASM) is an x86 assembler that uses the Intel syntax for MS-DOS and Microsoft Windows. Beginning with MASM 8.0, there are two versions of the assembler: One for 16-bit & 32-bit assembly sources, and another (ML64) ...
, although their spreadsheet
Multiplan Multiplan is spreadsheet program developed by Microsoft and introduced in 1982 as a competitor to VisiCalc. Multiplan was released first for computers running CP/M; it was developed using a Microsoft proprietary p-code machine, p-code C compil ...
and their
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily us ...
implementation used
binary-coded decimal In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each digit is represented by a fixed number of bits, usually four or eight. Sometimes, special bit patterns are used for ...
(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. In a parallel development,
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 seri ...
had started the development of a floating-point
coprocessor A coprocessor is a computer processor used to supplement the functions of the primary processor (the CPU). Operations performed by the coprocessor may be floating-point arithmetic, graphics, signal processing, string processing, cryptography o ...
in 1976.
William Morton Kahan William "Velvel" Morton Kahan (born June 5, 1933) is a Canadian mathematician and computer scientist, who received the Turing Award in 1989 for "''his fundamental contributions to numerical analysis''", was named an ACM Fellow in 1994, and inducte ...
, as a consultant to Intel, suggested that Intel use the floating point of
Digital Equipment Corporation Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president unt ...
's (DEC) VAX. The first VAX, the
VAX-11/780 The VAX-11 is a discontinued family of 32-bit superminicomputers, running the Virtual Address eXtension (VAX) instruction set architecture (ISA), developed and manufactured by Digital Equipment Corporation (DEC). Development began in 1976. In ad ...
had just come out in late 1977, and its floating point was highly regarded. VAX's floating-point formats differed from MBF only in that it had the sign in the most significant bit. However, seeking to market their chip to the broadest possible market, Kahan was asked to draw up specifications. When rumours of Intel's new chip reached its competitors, they started a standardization effort, called
IEEE 754 The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point arithmetic established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found i ...
, to prevent Intel from gaining too much ground. As an 8-bit exponent was not wide enough for some operations desired for double-precision numbers, e.g. to store the product of two 32-bit numbers, Intel's proposal and a counter-proposal from DEC used 11 bits, like the time-tested 60-bit floating-point format of the
CDC 6600 The CDC 6600 was the flagship of the 6000 series of mainframe computer systems manufactured by Control Data Corporation. Generally considered to be the first successful supercomputer, it outperformed the industry's prior recordholder, the IBM ...
from 1965. Kahan's proposal also provided for infinities, which are useful when dealing with division-by-zero conditions; not-a-number values, which are useful when dealing with invalid operations;
denormal number In computer science, subnormal numbers are the subset of denormalized numbers (sometimes called denormals) that fill the underflow gap around zero in floating-point arithmetic. Any non-zero number with magnitude smaller than the smallest normal ...
s, which help mitigate problems caused by underflow; and a better balanced
exponent bias In IEEE 754 Floating-point arithmetic, floating-point numbers, the exponent is biased in the biasing, engineering sense of the word – the value stored is offset from the actual value by the exponent bias, also called a biased exponent. Biasing is ...
, which could help avoid overflow and underflow when taking the reciprocal of a number. By the time QuickBASIC 4.00 was released, the IEEE 754 standard had become widely adopted—for example, it was incorporated into Intel's 387 coprocessor and every
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
processor from the 486 on. QuickBASIC versions 4.0 and 4.5 use IEEE 754 floating-point variables by default, but (at least in version 4.5) there is a command-line option for the IDE and the compiler that switches from IEEE to MBF floating-point numbers, to support earlier-written programs that rely on details of the MBF data formats.
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic .NET (now simply referred to as "Visual Basic"), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic (cl ...
also uses the IEEE 754 format instead of MBF.


Technical details

MBF numbers consist of an 8-bit base-2
exponent Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
, a sign
bit The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represente ...
(positive mantissa: ''s'' = 0; negative mantissa: ''s'' = 1) and a 23-, 31- or 55-bit mantissa of the
significand The significand (also mantissa or coefficient, sometimes also argument, or ambiguously fraction or characteristic) is part of a number in scientific notation or in floating-point representation, consisting of its significant digits. Depending on ...
. There is always a 1-bit implied to the left of the explicit mantissa, and the
radix point A decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choi ...
is located before this assumed bit. The exponent is encoded with a
bias Bias is a disproportionate weight ''in favor of'' or ''against'' an idea or thing, usually in a way that is closed-minded, prejudicial, or unfair. Biases can be innate or learned. People may develop biases for or against an individual, a group, ...
of , so that exponents are represented by ''x'' = , exponents are represented by ''x'' = , with a special case for ''x'' = 0 (00h) representing the whole number being zero. The MBF double-precision format provides less scale than the
IEEE 754 The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point arithmetic established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found i ...
format, and although the format itself provides almost one extra decimal digit of precision, in practice the stored values are less accurate because IEEE calculations use 80-bit intermediate results, and MBF doesn't. Unlike IEEE floating point, MBF doesn't support
denormal number In computer science, subnormal numbers are the subset of denormalized numbers (sometimes called denormals) that fill the underflow gap around zero in floating-point arithmetic. Any non-zero number with magnitude smaller than the smallest normal ...
s, infinities or
NaN Nan or NAN may refer to: Places China * Nan County, Yiyang, Hunan, China * Nan Commandery, historical commandery in Hubei, China Thailand * Nan Province ** Nan, Thailand, the administrative capital of Nan Province * Nan River People Given name ...
s. MBF single-precision format (32 bits, "6-digit BASIC"): MBF extended-precision format (40 bits, "9-digit BASIC"): MBF double-precision format (64 bits):


Examples

* "10": : 32-bit format: 84h, 20h, 00h, 00h : 40-bit format: 84h, 20h, 00h, 00h, 00h * "2": : 32-bit format: 82h, 00h, 00h, 00h : 40-bit format: 82h, 00h, 00h, 00h, 00h * "1": : 32-bit format: 81h, 00h, 00h, 00h : 40-bit format: 81h, 00h, 00h, 00h, 00h * "0": : 32-bit format: 00h, 00h, 00h, 00h (or 00h, xxh, xxh, xxh) : 40-bit format: 00h, 00h, 00h, 00h, 00h (or 00h, xxh, xxh, xxh, xxh) * "0.5": : 32-bit format: 80h, 00h, 00h, 00h : 40-bit format: 80h, 00h, 00h, 00h, 00h * "0.25": : 32-bit format: 7Fh, 00h, 00h, 00h : 40-bit format: 7Fh, 00h, 00h, 00h, 00h * "-0.5": : 32-bit format: 80h, 80h, 00h, 00h : 40-bit format: 80h, 80h, 00h, 00h, 00h * "sqrt(0.5)": : 32-bit format: 80h, 35h, 04h, F3h : 40-bit format: 80h, 35h, 04h, F3h, 34h * "sqrt(2)": : 32-bit format: 81h, 35h, 04h, F3h : 40-bit format: 81h, 35h, 04h, F3h, 34h * "ln(2)": : 32-bit format: 80h, 31h, 72h, 18h : 40-bit format: 80h, 31h, 72h, 17h, F8h * "log2(e)": : 32-bit format: 81h, 38h, AAh, 3Bh : 40-bit format: 81h, 38h, AAh, 3Bh, 29h * "pi/2": : 32-bit format: 81h, 49h, 0Fh, DBh : 40-bit format: 81h, 49h, 0Fh, DAh, A2h * "2*pi": : 32-bit format: 83h, 49h, 0Fh, DBh : 40-bit format: 83h, 49h, 0Fh, DAh, A2h


See also

*
Floating-point arithmetic In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can be ...
*
IEEE 754 The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point arithmetic established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found i ...
— Standard for floating-point arithmetic *
IBM hexadecimal floating-point Hexadecimal floating point (now called HFP by IBM) is a format for encoding floating-point numbers first introduced on the IBM System/360 computers, and supported on subsequent machines based on that architecture, as well as machines which were i ...


References

{{reflist, refs= {{cite web , title=IEEE vs. Microsoft Binary Format; Rounding Issues (Complete) , publisher=
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
, work=Microsoft Support , id=Article ID KB35826, Q35826 , date=2006-11-21 , url=https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/35826#IEEE_vs._Microsoft_Binary_Format.3B_Rounding_Issues_.28Complete.29 , access-date=2010-02-24 , url-status=live , archive-url=https://web.archive.org/web/20200828130651/https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/35826 , archive-date=2020-08-28
{{cite web , title=Convert pre-IEEE-754 C++ floating-point numbers to/from C# , website=stackoverflow.com , date=2010-04-21 , url=https://stackoverflow.com/questions/2686298/convert-pre-ieee-754-c-floating-point-numbers-to-from-c-sharp , access-date=2016-06-02 , url-status=live , archive-url=https://web.archive.org/web/20200828053012/https://stackoverflow.com/questions/2686298/convert-pre-ieee-754-c-floating-point-numbers-to-from-c-sharp , archive-date=2020-08-28 (NB. The second reference could be mistaken to say that QB 4.0 could use MBF internally, but it only uses IEEE. It just has a few conversion functions to convert IEEE floating point numbers to strings containing MBF data, e.g. {{mono, MKDMBF$ in addition to {{mono, MKD$ which just copies the bytes of the IEEE value to a string.) {{cite news , author-first=Walter , author-last=Isaacson , date=2013-09-20 , title=Dawn of a revolution , newspaper=
Harvard Gazette Harvard University is a private Ivy League research university in Cambridge, Massachusetts. Founded in 1636 as Harvard College and named for its first benefactor, the Puritan clergyman John Harvard, it is the oldest institution of higher le ...
, publisher=news.harvard.edu , url=http://news.harvard.edu/gazette/story/2013/09/dawn-of-a-revolution , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828131007/https://news.harvard.edu/gazette/story/2013/09/dawn-of-a-revolution/ , archive-date=2020-08-28
{{cite web , title=Raiders of the Lost Altair BASIC Source Code - They came, they saw … they disassembled , date=2001-05-13 , author-first=Andrew , author-last=Orlowski , magazine=
The Register ''The Register'' is a British technology news website co-founded in 1994 by Mike Magee, John Lettice and Ross Alderson. The online newspaper's masthead sublogo is "''Biting the hand that feeds IT''." Their primary focus is information tec ...
, url=https://www.theregister.co.uk/2001/05/13/raiders_of_the_lost_altair/ , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828131543/https://www.theregister.com/2001/05/13/raiders_of_the_lost_altair/ , archive-date=2020-08-28
{{cite web , title=Quest for the Holy Source - Ian's trip to Harvard , author-first=Ian , author-last=Griffiths , date=2000-05-08 , url=http://www.rjh.org.uk/altair/ian.htm , access-date=2016-05-30 , url-status=dead , archive-url=https://web.archive.org/web/20020102173701/http://www.rjh.org.uk/altair/ian.htm , archive-date=2002-01-02 {{cite web , title=Create your own Version of Microsoft BASIC for 6502 , author-first=Michael , author-last=Steil , publisher=pagetable.com , date=2008-10-20 , url=http://www.pagetable.com/?p=46 , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20160530092603/http://www.pagetable.com/?p=46 , archive-date=2016-05-30 {{cite web , title=msbasic/float.s , editor-first=Michael , editor-last=Steil , work=MIST64 , via=github.com , date=2008-10-20 , url=https://github.com/mist64/msbasic/blob/master/float.s , access-date=2020-08-28 , url-status=live , archive-url=https://web.archive.org/web/20200828055855/https://github.com/mist64/msbasic/blob/master/float.s , archive-date=2020-08-28}

(NB. Commented 6502 disassembly listings, merged from several versions of Microsoft BASIC for 6502 between 1977 and 1982 to recreate byte-exact copies of the original ROMs for 10 different machines from different vendors.)
{{cite web , title=msbasic/trig.s , editor-first=Michael , editor-last=Steil , work=MIST64 , via=github.com , date=2008-10-20 , url=https://github.com/mist64/msbasic/blob/master/trig.s , access-date=2020-08-28 , url-status=live , archive-url=https://web.archive.org/web/20200828060134/https://github.com/mist64/msbasic/blob/master/trig.s , archive-date=2020-08-28}

(NB. Commented 6502 disassembly listings, merged from several versions of Microsoft BASIC for 6502 between 1977 and 1982 to recreate byte-exact copies of the original ROMs for 10 different machines from different vendors.)
{{cite web , title=Converting between Microsoft Binary and IEEE formats , date=1998-07-02 , orig-date=1994-03-10 , id=ID 1400 , author=Borland staff , publisher=
Embarcadero USA Embarcadero Technologies, Inc. is an American computer software company that develops, manufactures, licenses, and supports products and services related to software through several product divisions. It was founded in 1993, went public in 2000, ...
/
Inprise Borland Software Corporation was a computer technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn. Its main business was the development and sale of software development and software deployment products ...
(originally:
Borland Borland Software Corporation was a computer technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn. Its main business was the development and sale of software development and software deployment product ...
) , work=Technical Information Database , type=TI1431C.txt , url=https://community.embarcadero.com/index.php/article/technical-articles/162-programming/14799-converting-between-microsoft-binary-and-ieee-forma , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20190220230417/https://community.embarcadero.com/index.php/article/technical-articles/162-programming/14799-converting-between-microsoft-binary-and-ieee-forma , archive-date=2019-02-20 , quote= €¦_fmsbintoieee(float *src4, float *dest4) €¦MS Binary Format €¦byte order => m3 {{! m2 {{! m1 {{! exponent €¦m1 is
most significant byte In computing, bit numbering is the convention used to identify the bit positions in a binary number. Bit significance and indexing In computing, the least significant bit (LSB) is the bit position in a binary integer representing the binary ...
=> sbbb{{!bbbb €¦m3 is the
least significant byte In computing, bit numbering is the convention used to identify the bit positions in a binary number. Bit significance and indexing In computing, the least significant bit (LSB) is the bit position in a binary integer representing the binary 1 ...
€¦m = mantissa byte €¦s = sign bit €¦b = bit €¦MBF is bias 128 and IEEE is bias 127. €¦MBF places the
decimal point A decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choi ...
before the assumed bit, while IEEE places the decimal point after the assumed bit. €¦ieee_exp = msbin - 2; /* actually, msbin 1-128+127 */ €¦_dmsbintoieee(double *src8, double *dest8) €¦MS Binary Format €¦byte order => m7 {{! m6 {{! m5 {{! m4 {{! m3 {{! m2 {{! m1 {{! exponent €¦m1 is most significant byte => smmm{{!mmmm €¦m7 is the least significant byte €¦MBF is bias 128 and IEEE is bias 1023. €¦MBF places the decimal point before the assumed bit, while IEEE places the decimal point after the assumed bit. €¦ieee_exp = msbin - 128 - 1 + 1023; €¦}
{{cite web , title=(Complete) Tutorial to Understand IEEE Floating-Point Errors , date=2005-08-16 , publisher=
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
, work=Knowledge Base , id=Article ID KB42980, Q42980 , url=https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/42980 , access-date=2016-06-02 , url-status=live , archive-url=https://web.archive.org/web/20200828132831/https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/42980 , archive-date=2020-08-28
{{cite web , title=The MASM 6.1 documentation notes that 5.1 was the last MASM version to support MBF , website=people.sju.edu , url=http://people.sju.edu/~ggrevera/arch/references/MASM61PROGUIDE.pdf , access-date=2016-06-02 GW-BASIC User's Manual, Appendix D.3 USR Function Calls. BASIC Second edition (May 1982), IBM: Appendix C-15 (NB. This is the BASICA manual). {{cite web , url=http://www.trs-80.com/trs80-zaps-internals.htm#rommath , title=ROM Routes (Integer Math) , website=Trs-80.com , access-date=2016-06-02 {{cite journal , title=An introduction to the scientific computing language Pascal-SC , author-last=Rall , author-first=Louis B. , journal= Computers & Mathematics with Applications , publisher= Pergamon Journals Ltd , volume=14 , number=1 , date=1987 , doi=10.1016/0898-1221(87)90181-7 , location=Mathematics Research Center,
University of Wisconsin-Madison A university () is an institution of higher (or tertiary) education and research which awards academic degrees in several academic disciplines. Universities typically offer both undergraduate and postgraduate programs. In the United States, the ...
, Madison, Wisconsin, pages=53–69 , doi-access=free (17 pages)
{{cite web , title=Floating-Point Numbers in Digital Computers , author-first=K. Ming , author-last=Leung , date=2005-02-03 , orig-date=2000 , location=Department of Computer and Information Science, Polytechnic University , website=cis.poly.edu , url=http://cis.poly.edu/~mleung/CS3734/s05/ch01/floatingPoints2.pdf , access-date=2016-06-02 , url-status=live , archive-url=https://web.archive.org/web/20181214222632/http://cis.poly.edu/~mleung/CS3734/s05/ch01/floatingPoints2.pdf , archive-date=2018-12-14 {{cite book , url=https://books.google.com/books?id=klV_BAAAQBAJ&pg=PA16 , title=Bill Gates: A Biography , date=2014-08-26 , access-date=2016-05-30 , isbn=978-1-44083014-3 , author-last=Becraft , author-first=Michael B. {{cite web , title=The Math Package , website=altairbasic.org , date=2014 , url=http://altairbasic.org/math_ex.htm , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828133946/http://altairbasic.org/math_ex.htm , archive-date=2020-08-28 (NB. Altair BASIC 3.2 (4K Edition).) {{cite web , title=Microsoft Altair BASIC legend talks about Linux, CPRM and that very frightening photo - A very rare interview with Monte Davidoff , date=2001-05-11 , author-first=Andrew , author-last=Orlowski , magazine=
The Register ''The Register'' is a British technology news website co-founded in 1994 by Mike Magee, John Lettice and Ross Alderson. The online newspaper's masthead sublogo is "''Biting the hand that feeds IT''." Their primary focus is information tec ...
, url=https://www.theregister.co.uk/2001/05/11/microsoft_altair_basic_legend_talks/ , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828133956/https://www.theregister.com/2001/05/11/microsoft_altair_basic_legend_talks/ , archive-date=2020-08-28
{{cite web , title=Great people personally responsible for advancing the art of early computers , date=2020-07-18 , website=Oldcomputers.net , url=http://www.oldcomputers.net/important-computer-people.html , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828134022/http://www.oldcomputers.net/important-computer-people.html , archive-date=2020-08-28 {{cite web , title=Basic 7.0 for Windows , website=comp.lang.basic.powerbasic.narkive.com , url=http://comp.lang.basic.powerbasic.narkive.com/erBpXdwr/basic-7-0-for-windows#post4 , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828134026/https://comp.lang.basic.powerbasic.narkive.com/erBpXdwr/basic-7-0-for-windows , archive-date=2020-08-28 {{cite book , title=Radio Shack Hardware Manual: Level II BASIC Reference Manual , edition=1 , date=1978 , publisher=
Radio Shack RadioShack, formerly RadioShack Corporation, is an American retailer founded in 1921. At its peak in 1999, RadioShack operated over 8,000 worldwide stores named RadioShack or Tandy Electronics in the United States, Mexico, United Kingdom, Austra ...
, location=Fort Worth, Texas, url=https://archive.org/details/Level_II_BASIC_Reference_Manual_1st_Ed._1978_Radio_Shack , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828135524/https://archive.org/details/Level_II_BASIC_Reference_Manual_1st_Ed._1978_Radio_Shack , archive-date=2020-08-28 }

/ref> {{cite book , title=Level II BASIC Reference Manual , date=1979 , publisher=
Radio Shack RadioShack, formerly RadioShack Corporation, is an American retailer founded in 1921. At its peak in 1999, RadioShack operated over 8,000 worldwide stores named RadioShack or Tandy Electronics in the United States, Mexico, United Kingdom, Austra ...
, website=akhara.com , format=PDF , url=http://akhara.com/trs-80/docs/model1/Level%20II%20BASIC%20Reference%20Manual%20(1979)(Radio%20Shack)(pdf).zip , access-date=2016-06-02
{{cite book , title=BASIC-80 (MBASIC) Reference Manual , format=PDF , url=https://archive.org/details/BASIC-80_MBASIC_Reference_Manual , access-date=2016-05-30 {{cite book , title=Microsoft FORTRAN-80 Version 3.4 Users Manual , date=November 1980 , pages=45, 55 , website=textfiles.com , url=http://www.textfiles.com/bitsavers/pdf/microsoft/cpm/Microsoft_FORTRAN-80_Ver3.4_Users_Manual_Nov80.pdf , access-date=2016-05-30 {{cite web , url=http://ftp.gwdg.de/pub/mpsf/pc_doc/dosbesch.ps , title=Zettelsammlung MS-DOS und AT , publisher=Gruppe Datenverarbeitung am MPI für Strömungsforschung Göttingen, Max-Planck-Institut , language=de , editor-first=Michael , editor-last=Pätzold , date=April 1993 , access-date=2015-10-07 , url-status=live , archive-url=https://web.archive.org/web/20050220040002/http://ftp.gwdg.de/pub/mpsf/pc_doc/dosbesch.ps , archive-date=2005-02-20 {{cite web , url=http://www.classiccmp.org/dunfield/kyocera/t200mpln.pdf , title=Tandy 200 Multiplan Manual , website=classiccmp.org , access-date=2016-06-02
Microsoft C Microsoft Visual C++ (MSVC) is a compiler for the C, C++ and C++/CX programming languages by Microsoft. MSVC is proprietary software; it was originally a standalone product but later became a part of Visual Studio and made available in both tri ...
Pcode Specifications, page 13. (NB.
Multiplan Multiplan is spreadsheet program developed by Microsoft and introduced in 1982 as a competitor to VisiCalc. Multiplan was released first for computers running CP/M; it was developed using a Microsoft proprietary p-code machine, p-code C compil ...
wasn't compiled to machine code, but to a kind of
byte-code Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (normall ...
which was run by an interpreter, in order to make Multiplan portable across the widely varying hardware of the time. This byte-code distinguished between the machine-specific floating point format to calculate on, and an external (standard) format, which was
binary-coded decimal In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each digit is represented by a fixed number of bits, usually four or eight. Sometimes, special bit patterns are used for ...
(BCD). The {{mono, PACK and {{mono, UNPACK instructions converted between the two.)
{{cite book , url=http://www.textfiles.com/bitsavers/pdf/microsoft/cpm/Microsoft_COBOL-80_1978.pdf , title=Microsoft COBOL-80 , date=1978 , pages=26, 32 , website=textfiles.com , access-date=2016-05-30 {{cite web , url=http://www.textfiles.com/programming/qwk.txt , format=TXT , title=QWK Mail Packet File Layout , author-first=Patrick Y. , author-last=Lee , website=textfiles.com , access-date=2016-06-02 {{cite web , title=CSI Millennium (CSIM) format with CSI Y2K extensions , date=1998-11-17 , publisher=Commodity Systems, Inc. , location=Boca Raton, Florida, format=TXT , website=csidata.com , url=http://www.csidata.com/patch/csim.txt , access-date=2016-06-02 , url-status=dead , archive-url=https://web.archive.org/web/20160305170347/http://www.csidata.com/patch/csim.txt , archive-date=2016-03-05 , quote= €¦This document describes the abandoned CompuTrac data format, which until recently was actively used by Equis' MetaStock charting software. €¦} {{cite web , title=Converting Microsoft Binary Format to IEEE format Using VB 6 , author-first=Russ , author-last=Billard , orig-date=2001-07-13 , date=2016-05-04 , url=https://forums.codeguru.com/showthread.php?21573-Converting-Microsoft-Binary-Format-to-iEEE-format-Using-VB-6 , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828155404/https://forums.codeguru.com/showthread.php?21573-Converting-Microsoft-Binary-Format-to-iEEE-format-Using-VB-6 , archive-date=2020-08-28 {{cite web , title=Help !Anybody know how to convert old M/S MBF value from Qbasic to VB6 , date=2003-07-02 , author=JerMyster , series=Visual Basic (Classic) Forum , work=Tek-Tips , url=http://www.tek-tips.com/viewthread.cfm?qid=592713 , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20200828162727/https://www.tek-tips.com/viewthread.cfm?qid=592713 , archive-date=2020-08-28 {{cite web , author=GL88 , url=https://social.msdn.microsoft.com/Forums/vstudio/en-US/64a201b5-852d-41df-9abe-2ad2645cc937/reading-binary-format-qbasic-with-c?forum=netfxbcl , title=Reading Binary Format (QBasic) with C# , publisher=Social.msdn.microsoft.com , access-date=2016-05-30 {{cite web , url=http://r.789695.n4.nabble.com/Reading-MetaStock-data-format-in-R-td4677240.html , title=Rmetrics - Reading MetaStock data format in R , publisher=R.789695.n4.nabble.com , date=2013-09-30 , access-date=2016-05-30 {{cite web , url=https://groups.google.com/forum/#!topic/comp.os.msdos.programmer/mDyRI1wolAc , title=Google Groups , website=Groups.google.com , access-date=2016-06-02 {{cite web , title=Understanding single precision MBF , author-first=Julian M. , author-last=Bucknall , date=2018-11-03 , orig-date=2007-10-23 , publisher=boyet.com , url=http://www.boyet.com/Articles/MBFSinglePrecision.html , access-date=2016-05-30 , url-status=live , archive-url=https://web.archive.org/web/20190220020010/https://secondboyet.com/Articles/MBFSinglePrecision.html , archive-date=2019-02-20 , quote= €¦IEEE 754 Single format €¦The exponent is biased by 127. There is an assumed 1 bit before the
radix point A decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choi ...
(so the assumed mantissa is 1.ffff… where f's are the
fraction A fraction (from la, fractus, "broken") represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, a fraction describes how many parts of a certain size there are, for example, one-half, eight ...
bits) €¦Microsoft Binary Format (single precision) €¦The exponent is biased by 128. There is an assumed 1 bit after the radix point (so the assumed mantissa is 0.1ffff… where f's are the fraction bits) €¦the IEEE mantissa is twice the MBF mantissa. €¦to convert from MBF to IEEE single €¦subtract 2 from the exponent (one for the bias change, one for the mantissa factor), and then rearrange the sign and exponent bits. The fraction does not change. To convert from IEEE single to MBF, €¦add 2 to the exponent (one for the bias change, one for the mantissa factor), and then rearrange the sign and exponent bits. The fraction does not change. €¦}
{{cite web , title=Intel and Floating-Point - Updating One of the Industry's Most Successful Standards - The Technology Vision for the Floating-Point Standard , date=2016 , publisher=
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 seri ...
, url=http://www.intel.com/content/dam/www/public/us/en/documents/case-studies/floating-point-case-study.pdf , access-date=2016-05-30 , url-status=dead , archive-url=https://web.archive.org/web/20160304114859/http://www.intel.com/content/dam/www/public/us/en/documents/case-studies/floating-point-case-study.pdf , archive-date=2016-03-04 (11 pages)
{{cite web , url=http://nssdc.gsfc.nasa.gov/nssdc/formats/VAXFloatingPoint.htm , title=VAX Floating Point Numbers , website=nssdc.gsfc.nasa.gov , access-date=2016-06-02 , url-status=live , archive-url=https://web.archive.org/web/20200828101600/https://nssdc.gsfc.nasa.gov/nssdc/formats/VAXFloatingPoint.htm , archive-date=2020-08-28 (NB. The VAX-11/780 did not implement the "G" format yet. Although this is not directly apparent from the tables because the structures have been cut up in two-byte words, the byte order is actually the same as on modern CPUs. There isn't enough room in the exponent range for NaNs, Infinity, infinities or denormals.) {{cite web , url=http://www.ece.cmu.edu/~ece447/s15/lib/exe/fetch.php?media=vax_hwhbk_1979.pdf , title=VAX11 780 , website=Ece.cmu.edu , access-date=2016-06-02 {{cite web , title=An Interview with the Old Man of Floating-Point , publisher=cs.berkeley.edu , date=1998-02-20 , url=https://www.cs.berkeley.edu/~wkahan/ieee754status/754story.html , access-date=2016-05-30 {{cite web , title=IEEE 754: An Interview with William Kahan , website=dr-chuck.com , url=http://www.dr-chuck.com/dr-chuck/papers/columns/r3114.pdf , access-date=2016-06-02 {{cite book , title=Design of a Computer: The Control Data 6600 , author-first=James E. , author-last=Thornton , date=1970 , edition=1 , publisher=
Scott, Foresman and Company Scott Foresman was an elementary educational publisher for PreK through Grade 6 in all subject areas. Its titles are now owned by Savvas Learning Company which formed from former Pearson Education K12 division. The old Glenview headquarters o ...
, lccn=74-96462 , publication-place=Glenview, Illinois , location=Advanced Design Laboratory, Control Data Corporation , url=http://ygdes.com/CDC/DesignOfAComputer_CDC6600.pdf , access-date=2016-06-02 , url-status=live , archive-url=https://web.archive.org/web/20200828093757/http://ygdes.com/CDC/DesignOfAComputer_CDC6600.pdf , archive-date=2020-08-28 (1+13+181+2+2 pages)
{{cite web , url=https://www.cs.berkeley.edu/~wkahan/ieee754status/why-ieee.pdf , title=Why do we need a floating-point arithmetic standard? , author-first=William Morton , author-last=Kahan , author-link=William Morton Kahan , website=cs.berkeley.edu , access-date=2016-06-02 {{cite web , url=https://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf , title=How Java's Floating-Point Hurts Everyone Everywhere , author-first1=William Morton , author-last1=Kahan , author-link1=William Morton Kahan , author-first2=Joseph D. , author-last2=Darcy , website=cs.berkeley.edu , access-date=2016-06-02 {{cite book , url=https://books.google.com/books?id=sUD8CAAAQBAJ&pg=PA171 , title=Numerical Analysis and Parallel Processing: Lectures given at The Lancaster … , date=2013-12-21 , access-date=2016-05-30 , isbn=978-3-66239812-8 , author-last=Turner , author-first=Peter R. {{cite web , url=https://www.cs.berkeley.edu/~wkahan/ieee754status/Names.pdf , title=Names for Standardized Floating-Point Formats , website=cs.berkeley.edu , access-date=2016-06-02


External links

* Microsof
provides
a dynamic link library for 16-bit Visual Basic containing functions to convert between MBF data and IEEE 754. ** This library wraps the MBF conversion functions in the 16-bit Visual C(++) CRT. ** These conversion functions will round an IEEE double-precision number like ¾ ⋅ 2−128 to zero rather than to 2−128. ** They don't support denormals at all: the IEEE or MBF single-precision number 2−128 will be converted to zero, even though it is representable in either format. ** This library is only intended for use with Visual Basic; C(++) programs are expected to call the CRT functions directly. Binary arithmetic Computer arithmetic Floating point