Coder Social home page Coder Social logo

ibm-1401's Introduction

IBM 1401 Emulator in Swift

This project is some very early and inclomplete version of an IBM 1401 emulator written in Swift.

While studying the machine and finishing a simple hello world punch card code, it was hard for me to test my code as there are not many emulators for the machine and I was not able to make simh run at this time.

With the help of the amazing emulator of https://rolffson.de I was finally able to punch and run my code virtually on his software. Unfortunately, the project is only availble for Microsoft Windows and more a 3D simulation than a convinient emulator, so I descided to write my own...

โš ๏ธ The whole emulator is incomplete. For now, not all opcodes are implemented and reading external files into the storage is not finished.

> Image: https://upload.wikimedia.org/wikipedia/commons/c/cb/BRL61-IBM_1401.jpg

More information about the machine itself: http://ibm-1401.info

Requirements

The code should run on any system that supports Swift 5.7 and higher.

The emulator depends on lib1401

Manual

Usage

Inside the project directory run: swift run

to start an emulator. You will be welcomed with a prompt where you can enter commands.

Emulator commands

Load program (l / load)

You can load external files with punch card code when providing an absolute path to the load command.

Example: l /some/absolute/path/to/a/file.cd

Without any file name a default hello world program will be loaded.

Start / Step (s / start)

This command emulates pressing the IBM 1401 start button in single step mode.

Run (r / run)

This command emulates pressing the IBM 1401 start button in run mode.

Dump storage (d / dump)

This command dumps the complete storage. Note that the output is in BCD mode.

Monitor (m / monitor)

This command dumps all registers and contents.

Reset (rst / reset)

Terminate execution cycle, reset core storage and registers. This command allows you to load and run another program.

Quit (q / quit)

Quit the emulator

Features

  • Load arbitrary program from external file

  • Parity and validity checks for registers

  • Normal 1401 opcodes:

    • Set Word Mark (,)
    • Clear Storage (/)
    • Move (M)
    • Move Digit (D)
    • Move Zone (Y)
    • Halt (.)
    • Halt and branch (.)
    • No Operation (N)
    • Load (L)
    • Write a line (2) - Partially implemented
    • Clear word mark ())
    • Divide (()
    • Modify address (=)
    • Zero and add (&)
    • Add (A)
    • Branch or branch on indicator (B)
    • Compare (C)
    • Move numerical / digit (D)
    • Move characters and edit (E)
    • UNDOCUMENTED / UNCLEAR (G)
    • Zero and substract (-)
    • Move characters to record or group (P)
    • Subtract (S)
    • Branch if word mark and/or zone (V)
    • Move characters and supress zeros (Z)
    • Read a card (1)
    • Read a card and branch (1)
    • Write and read (3)
    • Punch a card (4)
    • Read and punch (5)
    • Write and punch (6)
    • Write, read and punch (7)
  • Optioal opcodes:

    • Multiply ( )
    • Store B-Address register (H)
    • Store A-Address register (Q)
    • Branch if bit equal (W)
    • Move and insert zeros (X)
    • Start read feed (8)
    • Start punch feed (9)
  • Tape:

    • Control unit (U)
  • Printer:

    • Control carriage (F)
  • Bits:

    • Move zone (Z)

    • Special:

      • Select stacker and other device controls (K)
    • 1460-Features:

      • Translate (T)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.