Thursday, March 22, 2018

Original FORTH from IBM 1130 under the microscope

ARCHAEOLOGICAL INVESTIGATION OF FIRST FORTH USING IBM 1130

The biggest challenge here is the lack of a manual or documentation, which is understandable since FORTH was a language with a single person using it - Chuck Moore - back in the 1968-70 timeframe. Coupled with that lack, the language evolved quite a bit before the versions known to the public and covered in available material.

As an example, in more modern FORTH implementations, the verb . (period) will take the top element off the stack and print it. In this implementation, the period is a synonym for : (colon) and starts a definition.

There must be a command to pop the top element and print it, but I can't figure it out. I have been trying every verb or verb sequence I can think of. So far, it has defeated me. There are only a couple hundred entries in the dictionary but when you include combinations then a random walk approach is going to consume a lot of time.

The other major issue is understanding how to use the disk block and editing features. The verbs like CREATE, DELETE, ACTIVATE and INTERPRET will act on disk files that are managed by this FORTH code, but so far I haven't pieced together enough to do what I want, which is to create a file, store some FORTH statements in the file then cause them to be executed. 

These are the forerunners of the 1024 word disk blocks and verbs in more modern FORTH but far enough away that the modern verbs and procedures don't work with the original FORTH.

The expansion from the few primitives up to the running FORTH system was produced by a bit over 200 lines of FORTH statements but these are an admixture of 1130 machine instructions and text strings, not simply a series of FORTH phrases as you would see in a more current implementation.

Thus, understanding the code takes quite a bit of effort, leaping back and forth between the 1130 hardware and the FORTH verbs and nouns. It is slow going. 

3 comments:

  1. Hi Carl,

    There may be some clues in Chuck's 1980 Byte article. He say's that the 1130 acted as a cross compiler for the 2250 graphics display, and also he was reliant on the Fortran I/O package. Perhaps the "print top of stack" was a call to some Fortran routine?

    I have read through the 1970 Mohasco report - and sadly nowhere it talks about printing the stack - nore are there any clues in the "Early Years" article.

    I wish you all the best with your detective work - please keep up the regular updates.

    What came out of the 1130 was a
    cross-assembler that assembled the
    instructions, which were then to be
    executed by the 2250.

    I do remember
    that I had to use the FORTRAN I/O
    (input/output) package and that it
    would not put the blocks where I
    wanted them; it put the blocks where
    it wanted them, and I had to pick
    them up and move them into my buffers
    .

    ReplyDelete
  2. It is possible that not everything is in the source deck. I know on my NC4000 machine, I stripped done Chucks CMforth of things rarely used and added disk words. I moved some to the disk ( I had 2 floppy drive and a hard disk setup, both backed up ). I'd load things as needed. The meta compiler and editor functions were all on the disk. It is possible that Chuck was doing something like that. His debugging environment may have only existed on disk while his graphics stuff was his main code for every day use.
    Dwight

    ReplyDelete
  3. I am convinced that there were some disk blocks with additional commands to do things such as editing. Most importantly, there is no sign at all of the cross assembler for the 2250 graphics terminal, but that was a major role for FORTH at the time this version was written. I imagine that once the interactive "Hi There" prompt is received, Chuck would have activated one or more disk blocks of FORTH commands to further extend the language with the 2250 support.

    ReplyDelete