Changes

Jump to: navigation, search

Amstrad Whole Memory Guide - BASIC support

1,282 bytes added, 07:44, 16 July 2008
Chapter 13 in the book [[Amstrad Whole Memory Guide]].
 
== BASIC SUPPORT ==
 
The entries to the 2A98—37FF section of the lower ROM are not officially defined, because they are more a part of the BASIC interpreter than of the operating system. However, the 49 entries hold a host of treasures, especially for those whose programs involve mathematics.
 
The first entry, via BD3A, accesses the EDIT system, which is rather too specialised to be of general interest, being mainly concerned with the interpretation of various key combinations and the modification of data held in a buffer, the Start of which is defined in HL on entry.
 
The entries relating to floating point arithmetic are of much more general importance.
 
== Floating Point ==
 
A five—byte floating point system is used. For example:
 
86 65 2E EØ D3
 
The first byte is the exponent. Subtracting &80 gives 6, so the value of the exponent is 2t6 = 64. The remaining bytes form the mantissa, and the overall value of the number is found by multiplying together the values of the exponent and the mantissa.
The most significant bit of the second byte is the sign bit. In this case it is Ø, so the number is positive. However, the true value of the bit in numeric terms is always 1, so the value of the last four bytes — the mantissa — is:
 
E62EEØD3 = 3,845,054,675
 
== Scanned pages ==
12,273
edits