Browse Prior Art Database

Simple Memory Extension Utility for FORTH

IP.com Disclosure Number: IPCOM000039238D
Original Publication Date: 1987-May-01
Included in the Prior Art Database: 2005-Feb-01
Document File: 2 page(s) / 13K

Publishing Venue

IBM

Related People

Lascelles, MC: AUTHOR [+3]

Abstract

This article describes a method of extending a FORTH interpreter/compiler to handle executable code exceeding 64K bytes in a 16-bit environment. Traditionally, only 64K of code space is available for use in a 16-bit FORTH system. Elaborate, overlay systems are normally employed to supply memory space for additional words or programs. The method described here alters the FORTH nucleus or application program to allow normal FORTH coding procedures to use available memory over the 64K limit for executable code. This is accomplished by defining two additional words: "O:" (for "overlay:") and "O;" (for "overlay;") which are directly analogous to the defining words ":" and ";".

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Simple Memory Extension Utility for FORTH

This article describes a method of extending a FORTH interpreter/compiler to handle executable code exceeding 64K bytes in a 16-bit environment. Traditionally, only 64K of code space is available for use in a 16-bit FORTH system. Elaborate, overlay systems are normally employed to supply memory space for additional words or programs. The method described here alters the FORTH nucleus or application program to allow normal FORTH coding procedures to use available memory over the 64K limit for executable code. This is accomplished by defining two additional words: "O:" (for "overlay:") and "O;" (for "overlay;") which are directly analogous to the defining words ":" and ";". These words compile the intervening code in "low memory" and then transfer it to a known location in "high memory" leaving only a stub which represents the word. This stub occupies only four bytes, regardless of the size of the definition, and consists of the CFA (Code Field Address) of a loading word and the ID (identification) of the word to be executed, which could be a segment number. When executed, this stub causes the target definition to be transferred to low memory and executed. On the IBM PC/AT, an overhead of approximately 650 microseconds is incurred for a 100-byte word when the overlay utility is written in high level FORTH. This can be significantly reduced by writing the utility in assembly code. Also, by creating an overlay word "stack", one overlay word can be defined in terms of other overlay words, continuing to an arbitrary but fixed depth of nesting, 128 levels in the example. Except for a small overhead penalty, the use of this technique remains completely transparent to a FORTH application and requires...