views:

288

answers:

4

Traditional assembler, and higher level compilers work with several memory segments, according to intended use. Hence, there is a data segment, a stack segment, a bss, and text segment. The text segment is also called the code segment.

Text segment? For machine code?

I have asked all the old-timers I could find, how something as unreadable as machine code came to be know as the "text segment". Every one of them agreed that, that was really what it was called, but none of them seemed to be surprised by it. And no one could offer an explanation.

Here's your chance to show off your geek history knowledge by enlightening us.

+2  A: 

Could it be because the program code, be it hard-to-read machine instructions, is really the program text - i.e. the text that contains the instructions? The same as when you call a calculus book a text book, although it is pretty hard to decipher unless you are familiar with the mathematical symbols that are the code..

Miky Dinescu
+1  A: 

I agree with Miky D, but would add the additional observation that the text segment is read-only and hence shared (or at least shareable) by multiple processes - just like the contents of a textbook are shared by all the students in a class.

Vinay Sajip
+6  A: 

Going a little further with nos's comments, I turned up a scanned version of the GE-635 Programming Manual, and found the following in the section on the macro assembler:

The GE-625/635 Macro Assembler is being provided to give the professional programmers some of the conveniences of a compiler and the flexibility of an Assembler. [...] The output options enable him to obtain binary text in relocatable as well as absolute formats.

So, it appears that the use of "binary text" was a GE colloquialism, or perhaps a commonly used term at the time (remember that those were the days when card readers/punches were used for much IO). So, one possible path is GE, to Multics via GE-645, to Unix via Bell Labs' work on Multics, to Linux.

kdgregory
It probably goes further back. the PL/1 compiler on multics used to output a text segment - the instructions(code) and a link segment
nos
+1  A: 

From Wictionary:

  1. A written passage consisting of multiple glyphs, characters, symbols or sentences.
  2. A book, tome or other set of writings.
  3. (colloquial) A brief written message transmitted between mobile phones; an SMS text message.
  4. (computing) Data which can be interpreted as human-readable text (often contrasted with binary data).


I suggest that the meaning in computer terms is derived from the fact that the program is what is written into the computer before the program is run, as opposed to the data, which is read in, processed, and then written back out.

John Saunders