[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 illegal opcodes questions



Paul Schlyter wrote:
In article <S6mdnYNMG-caHhnZnZ2dnUVZ_vidnZ2d@comcast.com>,
Michael J. Mahon <mjmahon@aol.com> wrote:

Paul Schlyter wrote:

Some programming languages even had these formatting rules built-in.
In e.g. FORTRAN (up to FORTRAN-77), these rules had to be obeyed:

Column 1:      C or * marked the whole line as a comment
Columns 2-6:   Labels went here - 1-5 decimal digits
Column 7:      A non-space character here marked this line as a contination line
Columns 8-71:  The program statement went here
Columns 72-80: Comment - anything here was ignored by the compiler
Actually, it was:

Column 1-5:    Statement number, or "C" in column 1 for comment lines
Column 6:      Non-blank marks continuation line (often 1-9 to indicate
                sequence of the continuations if more than one)
Columns 7-72:  FORTRAN Statement
Columns 73-80: ID/sequence field, ignored by compiler

Thanks for the correction.  Yep, my fortran skills are getting rusty -- it's some
20 years since I last coded in that language.


If you think you are rusty, its been 45 years for me and on an IBM 7094 mentioned below. And just think that was state of the art then. It was fun getting the back together if you were clumsy and dropped it. Speaking from experience :-).

The sequence field was often left blank on manually keypunched cards,
but was almost always filled with some combination of a "deck" ID and
a sequence number on machine-punched decks, as were "binary" decks.

I remember many times using an IBM 82 card sorter to restore order
to a deck containing gravity-induced entropy.  ;-)

There is an interesting historical reason for the FORTRAN compiler
to ignore columns 73-80.  FORTRAN was first implemented on the IBM 704
computer, and that machine and its successors, the 709, 7090, 7040,
and 7094, all used a binary card console card reader that read in
"row binary".  Since these machines had 36-bit words, the standard
binary card format was 12 pairs of 36-bit words, read from successive
rows of the card, and therefore covering only the first 72 columns.

As a result, the computer could not read columns 73-80 from the console
card reader, and those columns were already conventionally used for
deck sequence numbers.  FORTRAN merely continued that convention.
And, of course, what the computer could not read, the compiler must
ignore.  ;-)

For example, see:

www.atkielski.com/PDF/data/fortran.pdf

-michael

Parallel computing for 8-bit Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."