简体   繁体   中英

How binaries are generated using Punched cards?

I am not sure which is the right platform to ask about Punch cards so, I am trying it out here (after all punch cards are also a part of programming).

I thought that punched cards already represent the code in binary since a hole means 0 and rest positions mean 1 on a punched card. But then I read that you could use punched cards to present the Cobol or Fortran codes. I also noticed that there are always 2 holes per column on a punched card. Such things have confused me.

在此处输入图片说明

QUESTION: ****I am wondering if the punched cards were really binaries or some sort of assemblers were needed to convert the input provided by punched cards to machine code?****

I thought that punched cards already represent the code in binary since a hole means 0 and rest positions mean 1 on a punched card.

There were different types of punched cards.

On a System 3 punched card , data was stored as binary data just like you expect it.

However, the cards shown in your image are 80-column IBM cards , which seem to be the most common type of punched cards.

Using this type of punched cards you could originally store up to 80 decimal digits per card:

Each column has 10 positions (marked "0"-"9"). To store a digit in a column, you punch a hole in the corresponding position: To store the digit "5", you punch a hole in position "5".

This means that originally there was only one hole per column.

Later, other characters were stored on such cards. This was done by punching two holes per column and by adding two additional rows (internally named "11" and "12") on the top of the card.

In each column you could:

  • Punch one hole in one of the 12 positions or
  • punch one hole in one of the positions "1"-"9" and a second one in position "0", "11" or "12".

This allows you to store up to 12 + 3*9 = 39 different characters plus the space character (which seems to be represented by a column without a hole).

I am wondering if the punched cards were really binaries or some sort of assemblers were needed to convert the input provided by punched cards to machine code?

Binary code for the IBM 1401 was stored on "80-column"-type punched cards. The code from the punched cards was loaded into RAM (actually: magnetic core memory) and executed directly.

However, as far as I remember on the 1401 there could be up to 3 holes per column.

But such punched cards were also very popular for storing Fortran programs: One card per code line. If you had a card containing Fortran code, you needed a Fortran compiler.

IBM punched cards such as those pictured, were used to input CHARACTERs. The various holes were mapped to the "EBCDIC" character code used by IBM mainframes.

The mapping of wholes to EBCDIC coding was pretty arbitrary.

The coding scheme (if I remember correctly) was there were twelve rows anf 80 columes. The top two rows were 11 and 12 the bottom ten rows were 0 to 9.

See here for the gory details: https://en.wikipedia.org/wiki/Punched_card#IBM_80-column_punched_card_format_and_character_codes

A single whole in 0-9 mapped to EBCIC nunmber F0-F9. A hole in row 11 plus a number mapped to letters A->JA hole in row 12 plus a number mapped to K->RA hole in row 0 plus another number mapped to "/S->Z"

There were other semi-official "overpunch" codes involving three or more holes which could represent all possible binary values. I remeber some object code being output to punched cards for transfer to another machine. The result looked like a set of paper doilies and the reader at the receiving needed several attempts before it could read the whole deck without jamming or ripping up the cards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM