Browse Prior Art Database

Passing a String ID or a String Pointer in the Same Field

IP.com Disclosure Number: IPCOM000108199D
Original Publication Date: 1992-May-01
Included in the Prior Art Database: 2005-Mar-22
Document File: 1 page(s) / 46K

Publishing Venue

IBM

Related People

Morgan, SA: AUTHOR

Abstract

Disclosed is a description of how, in the 'C' programming language, programming on a Personal System/2* platform, an application can pass either a 16-bit string ID or a 32-bit string pointer into a function without requiring any structures or flags or other indicators as to which they have used.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 72% of the total text.

Passing a String ID or a String Pointer in the Same Field

       Disclosed is a description of how, in the 'C' programming
language, programming on a Personal System/2* platform, an
application can pass either a 16-bit string ID or a 32-bit string
pointer into a function without requiring any structures or flags or
other indicators as to which they have used.

      For national language support reasons, most strings are stored
in a different file from the source code itself and must, therefore,
be loaded into memory before they can be used.  An application may or
may not have already loaded a string into memory when it calls a
function that needs to use the string.  If not yet loaded, the
function could load the string into memory, saving the application
this concern.

      A technique to allow the application this flexibility of
passing in either a 16-bit string ID or 32-bit string pointer without
increasing the complexity of the structures used to pass in this
information is found by analyzing the structure of a 32-bit pointer
in an Intel 286 microprocessor or an Intel 386 microprocessor running
in 16-bit mode.

      The pointer consists of two parts: a 16-bit selector and a
16-bit offset.  The selector indicates the memory segment the data is
in, and the offset indicates exactly where within that segment the
data begins.  The first segment in memory, segment 0, is not valid
for use in storing data. Therefore, any pointer whose selector is 0
cannot...