IBM 140huh

From Esolang
Jump to navigation Jump to search

IBM 140huh is an esolang nearly the same as IBM 1401 machine code, as fed into the card reader.

However, unlike an IBM 1401, all commands must have a word mark following them in memory, including the command that adds word marks.

Therefore, it is impossible to run an IBM 140huh program, as there is no way to add the word marks that a normal IBM 1401 program would rely on.

Explanation of how an IBM 1401 boots from punched cards. In IBM 140huh, there is no exception for "Set Word Mark"

Hello World (non-working example)

The below is Hello World for an IBM 1401 on punched card. It prints HELLO WORLD to the IBM 1403 printer.

,008015,022029,036043,050054,055062,063065,066077/333/M0762502F1.HELLO WORLD

As it starts, there is a word mark set on position 1.

,008015 sets word marks on positions 8 and 15.

This program does not work in IBM 140huh, as ,008015 needs a word mark after it (position 8), and there is none as it begins execution.

Implementation

Implementation. The "1401" interpreter is actually an IBM 140huh interpreter.

Usage

If foo.txt contains an IBM 140huh program (with a newline afterwards)

sim> at cdr foo.txt
sim> set lpt default
sim> b cdr

results in the following error

Address register wrap, IS: 1 (DCW @,008015,022029,036043,050054,055062,063065,066077/333/M0762502F1.HELLO WORLD @)