Club 100

About RAM in the Model 10x laptops
by Ron Wiesen
Ron.Wiesen@icn.siemens.com

General

This information is specific to Tandy laptops in the One-hundred series (Model 100 or Model 102). It applies to the Model 200 in the general sense only.

Divisions of RAM and Regions of Consumption

This section explains how the laptop organizes and maintains its Random Access Memory (RAM). Regardless of what software you use to operate the laptop, the information given in this section is true and applicable to every situation. Lacking the details provided by this section, it's impossible for you to extract peak performance from the laptop. By applying these details, you reduce RAM consumption to "tune" the laptop for successful operation under situations that "appear" impossible!

With respect to the highest and the lowest addresses, the laptop physically divides its Random Access Memory (RAM). The laptop logically segregates the content of RAM into regions of consumption. The illustration below shows the divisions of RAM and the regions of consumption. Except for the inner file buffer which always consumes 267 bytes and the cell which always consumes 1 byte, the consumption of all other regions can grow and shrink. The "Consumption" column of the illustration shows the minimum consumption of these regions, and for some of them it includes a simple math expression of the consumption. The "BASIC statement" column of the illustration includes statements and any arguments for regions where consumption is influenced by BASIC statements. The statements NEW, CLEAR, and MAXFILES influence consumption.

The highest address of RAM is address 65535. Bound to address 65535 is the upper division of RAM that is composed of six adjoined regions of consumption. Where each of its regions is at minimum consumption, the combined consumption of the upper division of RAM is minimized to 2859 bytes. The unbound limit of the upper division (its lowermost address) lowers as the combined consumption of its regions increases.

Depending on the capacity of RAM which is equipped in the laptop, the lowest address of RAM is: 49152 for 16K capacity, 40960 for 24K capacity, or 32768 for 32K capacity. Bound to the lowest address of RAM is a lower division of RAM that is composed of eight adjoined regions of consumption. Where each of its regions is at minimum consumption, the combined consumption of the lower division is minimized to 4 bytes. The unbound limit of the lower division (its uppermost address) raises as the combined consumption of its regions increases.

The capacity of the RAM is never entirely consumed. RAM that is not consumed remains unified in a "Free section" which is suspended between the unbound limits of the upper and lower divisions. The laptop menu list the quantity of RAM in this section as "Bytes free". Where both the upper division and the lower division are at their minimum combined consumption, the total consumption of RAM is minimized to 2863 bytes and the Free quantity is maximized.

Depending on the capacity of RAM which is equipped in the laptop, the maximum Free quantity is: 13521 for 16K capacity, 21713 for 24K capacity, or 29905 for 32K capacity. As the total consumption of RAM increases, the unbound limits of the RAM divisions converge and the Free quantity correspondingly decreases. As the total consumption of RAM decreases, the unbound limits of the RAM divisions diverge and the Free quantity correspondingly increases.


Address of RAM       Region                 Consumption   BASIC statement

32K RAM is 32768
24K RAM is 40960
16K RAM is 49152
- bound to lowest -+-----------------------+
                   | cell                  | always    1
                   +-----------------------+
                   | named .B type files   |
                   |                       |minimum    0
                   +-----------------------+
                   | Unnamed BASIC program |minimum    2  by NEW
                   +-----------------------+
                   | named .D type files   |
                   |                       |minimum    0
                   +-----------------------+
                   | PASTE buffer for TEXT |minimum    1  by CLEAR
                   +-----------------------+
                   | named .C type files   |
                   |                       |minimum    0
                   +-----------------------+
                   | Variables for BASIC   |minimum    0  by NEW CLEAR MAXFILES
                   +-----------------------+
                   | Arrays for BASIC      |minimum    0  by NEW CLEAR MAXFILES
-- unbound limit --+-----------------------+

                         Free section

-- unbound limit --+-----------------------+
                   | stack                 |minimum   16  by NEW CLEAR MAXFILES
                   +-----------------------+
                   | string Space          |..........sS  sS per CLEARsS
                   |                       |minimum    0  by CLEAR0
                   +-----------------------+
                   | inner file buffer     | always  267
                   +-----------------------+
                   | outer file Buffers    |......fB*267  fB per MAXFILES=fB
                   |                       |minimum    0  by MAXFILES=0
Point of HIMEM  pH_/-----------------------+
                   | HIMEM                 |.......pM-pH  pH per CLEARss,pH
                   |                       |minimum    0  by CLEARsS,pM
Point of MAXRAM pM_/-----------------------+
                   | MAXRAM                |....65536-pM
                   |                       |minimum 2576
- bound to 65535 --+-----------------------+

BASIC Statements That Influence Consumption

If you issue the NEW statement, consumption in the stack region shrinks to its 16 byte minimum, assignments of all BASIC arrays and variables are released which shrinks consumption in these regions to zero, and all lines are purged from the Unnamed BASIC program and its region consumption shrinks to its 2 byte minimum.

If you issue the CLEAR statement, consumption in the stack region shrinks to its 16 byte minimum, assignments of all BASIC arrays and variables are released which shrinks consumption in these regions to zero, and all characters are purged from the PASTE buffer for TEXT which shrinks its region consumption to its 1 byte minimum.

By issuing both the CLEAR and NEW statements you reduce consumption in the lower division of RAM to a practical extent. In this case, consumption in the lower division of RAM reduces to merely 4 bytes more than the combined consumption of all the named files (all type, .C .D and .B) that are in the laptop.

Point of MAXRAM

The point of MAXRAM is the lowest address of RAM that is within the MAXRAM region. The BASIC function name MAXRAM returns the specific RAM address that currently is the point of MAXRAM. The illustration designates the point of MAXRAM as pM. Expression (65536-pM) is the consumption of the MAXRAM region. The MAXRAM region consumes a minimum of 2576 bytes and the corresponding point of MAXRAM is address 62960.

A particular software system or a particular software program can have one or more of the following MAXRAM traits:

Point of HIMEM

The point of HIMEM is the lowest address of RAM that is within the HIMEM region. The BASIC function name HIMEM returns the specific RAM address that currently is the point of HIMEM. The illustration designates the point of HIMEM as pH. Expression (pM-pH) is the consumption of the HIMEM region. At minimum, the HIMEM region consumes 0 bytes and the corresponding point of HIMEM is an address that is equal to the point of MAXRAM.

The point of HIMEM must be less than the point of MAXRAM where certain software is used. So there is some amount of HIMEM consumption during the use of such software. There is a variety of ways that various kinds of software make use of the HIMEM region. A particular software system or a particular software program can have one or more of the following traits:

HIMEM Versus MAXRAM Software

The difference between HIMEM and MAXRAM software is contrasted, side to side, in the illustration below. The HIMEM software is on the left side, and the MAXRAM software is on the right side. The HIMEM software originates in the program file FLOPPY.CO, and the MAXRAM software is the FLOPPY system. Only the relevant regions of the upper and lower divisions of RAM are shown, along with the Free section.


   Address    Region                         Address    Region                    
                                                                                  
-   lowest -+-----------------------+     -   lowest -+-----------------------+   
            | cell                  |                 | cell                  |   
            +-----------------------+                 +-----------------------+   
          / |           file        |               / |           file        |   
.B types <  |- - - - - - - - - - - -|     .B types <  |- - - - - - - - - - - -|   
          \ |           file        |               \ |           file        |   
            +-----------------------+                 +-----------------------+   
            | Unnamed BASIC program |                 | Unnamed BASIC program |   
            +-----------------------+                 +-----------------------+   
          / |           file        |               / |           file        |   
.D types <  |- - - - - - - - - - - -|     .D types <  |- - - - - - - - - - - -|   
          \ |           file        |               \ |           file        |   
            +-----------------------+                 +-----------------------+   
            | PASTE buffer for TEXT |                 | PASTE buffer for TEXT |   
            +-----------------------+                 +-----------------------+   
          / | FLOPPY.CO file 6+3353 |               / | FLOPPY    file 6+37   |   
.C types <  |- - - - - - - - - - - -|__   .C types <  |- - - - - - - - - - - -|__ 
          \ |           file        |  |            \ |           file        |  |
            +-----------------------+  |              +-----------------------+  |
                                       |                                         |
            +-----------------------+  |              +-----------------------+  |
            |                       |  |              |                       |  |
            |     Free section      |  |              |     Free section      |  |
            |                       |  |              |                       |  |
            +-----------------------+  |              +-----------------------+  |
                                      _|                                         |
   59400 pH_/-----------------------+< |  pH 60000 pM_/-----------------------+ _|
            | .C Image length  3353 |< |      \\      | .C Image length    37 |<_|
   62752=End| HIMEM   consumes 3560 |<_|       \\     | FLOPPY software       |   
   62960 pM_/-----------------------+        62960    |- - - - - - - - - - - -|   
            |                       |                 |                       |   
            | MAXRAM  consumes 2576 |                 | MAXRAM  consumes 5536 |   
-  65535  --+-----------------------+     -  65535  --+-----------------------+   

Installation of HIMEM software (left) lowers the point of HIMEM from address 62960 to address 59400. With the point of MAXRAM remaining at 62960, the HIMEM consumption is 3560. With the point of MAXRAM remaining at 62960, the MAXRAM consumption remains as 2576. Total consumption for MAXRAM and HIMEM is 6136. All of the HIMEM software is held within a .C type file named FLOPPY.CO. File FLOPPY.CO holds 3353 bytes of software. File FLOPPY.CO, like any named file, is found in the lower division of RAM. File FLOPPY.CO, like any .C type file, has a size that is 6 more than the amount of software bytes it holds. File FLOPPY.CO has a size of 3359 (i.e., 6 plus 3353) so it consumes 3359 bytes in the lower division of RAM. The total consumption devoted to the HIMEM software, including file FLOPPY.CO, is 9495 (i.e., 6136 plus 6 plus 3353).

You can invoke the HIMEM software from the laptop menu by selecting the name FLOPPY.CO. Like any .C type file, file FLOPPY.CO has 6 bytes that contain three values. Two values describe how the laptop should make an image at the upper division of RAM from the software bytes of the file which are present within the lower division of RAM. The third value is an address, at RAM or at Read-Only Memory (ROM), where the laptop directs control for an invocation of the software. The three values simply are: the lower address of RAM to lay the image, the length of the image, and the execution address for invocation. Within file FLOPPY.CO, these values are: RAM address 59400, image length 3353, address 59400 for invocation.

When you select the name FLOPPY.CO, the laptop compares the current point of HIMEM with the value 59400 which it obtains from within file FLOPPY.CO. If the laptop finds that the value is less than the point of HIMEM, it does not lay the image and thus does not allow invocation. The value 59400 is not less than the point of HIMEM that is shown (pH) in the illustration (59400). As illustrated, the laptop makes the 3353-byte .C image (address 59400 through address 62752) and then allows invocation (at 59400). Notice that after the laptop makes the image, all the software is present in the upper division of RAM, yet a duplicate (3353-byte source) of the image still accounts for, in a sense needless, consumption in the lower division of RAM.

As long as its name includes a ".C" extension, a .C type file can be invoked from BASIC. File FLOPPY.CO does have a ".C" extension, so you can invoke it from BASIC. You invoke .C type files from BASIC by use of the RUNM statement. Where RUNM is encountered during the running of a BASIC program, the image is made and then invocation occurs without any report. Where you type RUNM directly, a report is given first and then the image is made and invocation occurs. The LOADM statement is similar in that the image is made, but no invocation occurs. Based on the three values, the BASIC statements designate and report three addresses:

The designations for RAM addresses "Top" and "End" are confusing because the "Top" address is below the "End" address! The lower address (Top:) is reported as is. The image length is not directly reported, but is used with the lower address to derive and report End, which is the upper address of RAM where the image would end. The execution address for an invocation (Exe:) is reported as is. For file FLOPPY.CO, the reported addresses are: Top address 59400, End address 62752, Exe address 59400.

Installation of MAXRAM software (right) lowers the point of MAXRAM from address 62960 to address 60000. This expansion of the MAXRAM region increases MAXRAM consumption to 5536. With the point of HIMEM equal to the point of MAXRAM, the HIMEM consumption remains as 0. Total consumption for MAXRAM and HIMEM is 5536. Installation lays most of the software in the MAXRAM region, and the remaining software is held within a .C type file named FLOPPY. File FLOPPY holds 37 bytes of the software. File FLOPPY, like any named file, is found in the lower division of RAM. File FLOPPY, like any .C type file, has a size that is 6 more the amount of software bytes it holds. File FLOPPY has a size of 43 (i.e., 6 plus 37) so it consumes 43 bytes in the lower division of RAM. The total consumption devoted to the MAXRAM software, including file FLOPPY, is 5579 (i.e., 5536 plus 6 plus 37).

You can invoke the MAXRAM software from the laptop menu by selecting the name FLOPPY. Like any .C type file, file FLOPPY has 6 bytes that contain three values. Two values describe how the laptop should make an image at the upper division of RAM from the software bytes of the file which are present within the lower division of RAM. The third value is an address, at RAM or at Read-Only Memory (ROM), where the laptop directs control for an invocation of the software. The three values simply are: the lower address of RAM to lay the image, the length of the image, and the execution address for invocation. Within file FLOPPY, these values are: RAM address 62701, image length 37, address 62701 for invocation.

When you select the name FLOPPY, the laptop compares the current point of HIMEM with the value 62701 which it obtains from within file FLOPPY. If the laptop finds that the value is less than the point of HIMEM, it does not lay the image and thus does not allow invocation. The value 62701 is not less than the point of HIMEM that is shown (pH) in the illustration (60000). As illustrated, the laptop makes the 37-byte .C image (address 62701 through address 62737) and then allows invocation (at 62701). Notice that after the laptop makes the image, all the software is present in the upper division of RAM, yet a duplicate (37-byte source) of the image still accounts for, in a sense needless, consumption in the lower division of RAM.

As long as its name includes a ".C" extension, a .C type file can be invoked from BASIC. File FLOPPY does not have a ".C" extension, so you can not invoke it from BASIC.

Model Ts Forever!
The Original Laptop Computer . . . 1983