The goal of this page is to give the current status and capabilities of various 1401 emulators/simulators and software development tools, such as assemblers, that we can run on home PCs.
by Ed Thelen, summarizer of e-mails
Also see Tricks for Simulating/Emulating the 1401 System
Items discussed
Simualtors
|
IBM 1401 Emulator (under development)
Dan McInnis figured out some of the script operations. Scripts can make it run the SPS assembler and then run your test program. Currently the simulator does not do optional commands such as multiply or divide. Ron Mak reports (Jan 3) However, the simulator is buggy. For example, it cannot handle the "CS 0" instruction (it doesn't wrap the B address register afterwards to the end of memory, so you can't figure out the memory size). When I tried to run Van Snyder's Mersenne prime program, I discovered that the simulator can only add numbers up to 256 characters in length. After that, the overflow flag never gets set. Oops. So, either I set this program up incorrectly, or I would use it only with great caution." -Dan McInnis has created several tutorial exercises including one where you compile and run your own "Hello World" printout :-)) ; ; This script assembles [and runs] a 1401 SSPS source file ; The program is the payroll program in IBM SPS manual ; Show PrinterWindow ;turbo On ; ; Load card decks ; CharMap ' 1234567890#@ /STUVWXYZ\,% -JKLMNOPQR)$* &ABCDEFGHI(.< ' Deck 'SSPS-1.CRD' Deck 'payroll2.SPS' Deck 'SSPS-2.CRD' Deck 'payroll2.SPS' ; Setup for assembling Switch A On LoadCard ; Run first phase Start IARCheck 578 ; Run second phase Start IARCheck 829 Start IARCheck 1356 Save Punch'payroll2.CRD' Save Print 'payroll2.LST' Turbo Off ; Execute assembled program if required ;If &2<>1 Exit Reset Deck 'payroll2.CRD' Deck 'samdata.crd' LoadCard Start
The B1401 simulator is written in Delphi5. The originator, Rob Storey
intabits@optushome.com.au , reports
|
|
Java applet,
manual
Van Snyder reports that it hangs on his 11 card program. Dave Morgan has not yet (Jan 4, 2005) responded to my quiry. |
|
From The Computer History Simulation Project
Van Snyder says Jan 11, 2005
Ron Mak reports (Jan 3) SIMH will take the "card deck" output from Van Synder's Autocoder assembler directly, without the need for any character conversions. Here's how to feed it the card deck "punched" by Van's Autocoder assembler. C:\IBM1401\SIMH>i1401 IBM 1401 simulator V3.2-3 sim> at cdr mersenne2.cd sim> at lpt mersenne2.out sim> b cdr HALT instruction, IS: 91 (W) sim> c HALT instruction, IS: 199 (R 30* 15* ' ) sim> q Goodbye C:\IBM1401\SIMH>type mersenne2.out 23RD MERSENNE PRIME = 2**11213 - 1 1: 281411201369737313339315297584258419181866238201 [and so on for a page] C:\IBM1401\SIMH> A final bit of silliness. Since I use Java at work, I'm somewhat adept with Borland's configurable JBuilder Java development environment. As you can see from the attached screen shot, I've incorporated Van's Autocoder assembler into JBuilder, so now I can edit and assemble within a nice environment under Linux. (I don't have it naming the .cd and .lst files quite right yet.)
Ron Mak made a program to compute Pi using a modern implementation (complicated).
Full of multiplies and divides, and it works well to its tested 500 places :-))
An interesting thought: Since the Borwein brothers developed this pi algorithm in 1985,
it is unlikely that it was ever run on the actual 1401 hardware. So perhaps we'll soon
have a first!
A challenge: The version of my program that computes 500 digits uses over 12K of memory.
I only expended a small amount of effort to use memory efficiently, and there are many
large temporaries. Can anyone write a program that computes 1,000 digits of pi?
Maybe if we show interest, "Bob Supnik (bob AT supnik DOT org - anti-spam encoded)" , might fix the tape commands. Maybe he could use input from experts? Also Van Snyder apparently can update to code for Bob Supnik to add to distribution. |
| Runs under B1401 Emulator above just fine. See Don McInnis for tutorials :-)) |
Autocoder Assembler
Also from Ron Mak: "Note that you cannot use the card deck output from the Autocoder assembler
directly as input to B1401. You'll have to create an appropriate character
map first, and I didn't play with it long enough to figure out how to do that."
From Ron Mak
Ron Mak's Graphical User's Development Environment "ROPE" - which can simulate running the 1403 printer
Punching object decks from ROPE to a keypunch - by Stan Paddock (Jan 17, 2008)
How It’s Done
How To Use The System
Coding Reference Documents
We are blessed by having a large number of 1401 documents on line at
"With lots of help from Van Snyder, "Ron Mak has successfully compiled Van Snyder's Fortran
based Autocoder Assembler to run under DOS - in Windows PCs.
Unzip the attached file
[ or on Randy Thelen's machine in
http://www.madscientistroom.org/ethelen/
see autocoder-van-ron-05-01-04.zip
]
into a directory, and you will find
autocoder.exe and i1401.exe (the SIMH 1401 simulator),
along with my programs pi1c.s and pi5c.s. You can edit
Autocoder source programs with your favorite text editor,
or even with editors you don't particularly like.
Here's a sample session. The autocoder program reads pi5c.s
(the source program) as input and creates the object card
deck pi5c.cd and the assembly listing pi5c.lst.
Next, in the simulator, attach the card deck pi5c.cd to
the card reader and attach the output file pi5c.out to
the line printer. Then boot from the card reader.
[see SIMH documentation by Bob Supnik ]
SIMH Help file
The program runs until the final halt instruction, and
if you continue from there, you'll see that it branches
back to the same halt instruction (as per the program).
You can set the CPU (actually, memory) display to hex,
and examine memory.
For each memory location, the right hex character is the
BCD character, and the left hex character is the word mark
and zone bits.
For example, 48 is the character 8 with a word mark,
and 3A is the character 0 (2-8 punches) with the plus sign
(11-12 zone punches).
Quit the simulator.
Display the contents of the output file pi5c.out.
C:\IBM1401\test>autocoder -b I2 -o pi5c.cd -l pi5c.lst pi5c.s
[for a meaning of the parameters, click here]
C:\IBM1401\test>i1401
[SIMH documentation by Bob Supnik]
IBM 1401 simulator V3.2-3
sim> at cdr pi5c.cd
sim> at lpt pi5c.out
sim> b cdr
HALT instruction, IS: 953 (H)
sim> c
HALT instruction, IS: 953 (H)
sim> set cpu hex
sim> e 310-319
310: 48
311: 03
312: 0A
313: 01
314: 01
315: 09
316: 04
317: 09
318: 01
319: 02
sim> q
Goodbye
C:\IBM1401\test>type pi5c.out
[extra linefeeds added by Ed Thelen]
***** PI TO 500 DECIMAL PLACES *****
0001: 3.1415926535 8979323846 2643383279 5028841971 6939937510
5820974944 5923078164 0628620899 8628034825 3421170679
0101: 8214808651 3282306647 0938446095 5058223172 5359408128
4811174502 8410270193 8521105559 6446229489 5493038196
0201: 4428810975 6659334461 2847564823 3786783165 2712019091
4564856692 3460348610 4543266482 1339360726 0249141273
0301: 7245870066 0631558817 4881520920 9628292540 9171536436
7892590360 0113305305 4882046652 1384146951 9415116094
0401: 3305727036 5759591953 0921861173 8193261179 3105118548
0744623799 6274956735 1885752724 8912279381 8301194912
The simulator also has single-step and breakpoint commands.
The h command prints a brief help message for each of the commands.
Sorry, this is all command-line stuff without a fancy GUI.
But have fun!
-- Ron
Ronald Mak
University Affiliated Research Center (UARC)
University of California at Santa Cruz
Mail Stop 269-3
NASA Ames Research Center
Moffett Field, CA 94035-1000
Office: (650) 604-0727
FAX: (650) 604-4036
rmak@mail.arc.nasa.gov
from Dan McInnis
Just a small adjustment to your instructions:
From DOS box:
Go to directory in which you Unzipped the file.
at prompt enter: autocoder -bI2 -opi5c.cd -lpi5c.lst pi5c.s
The spaces threw me for a loop.
from Van Snyder
You can also examine memory similarly to how the 1401 hardware
would dump it, or many dump programs would dump it: As BCD with
word marks under it.
Use the -d option for the "examine" (e) command,
e.g. "e -d 310-319".
The hyphen can alternatively be a colon. You can also ask for
a disassembled version of the code by using the -m option,
e.g. "e -m 4297:4300". In the
current version of simh, invalid instructions or invalid
instruction lengths cause trouble. In the next version,
length-three fields will be displayed as DSA, which will decode
the address to decimal. Other invalid lengths,
and invalid op codes, will display as DCW @...@ in BCD.
Unlike a 1403 with A or H chain, simh shows every character
in BCD (except for blank, of course).
Here's the translation table:
char bcd_to_ascii[64] = {
' ', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '0', '#', '@', ':', '>', '(',
'^', '/', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', '\'', ',', '%', '=', '\\', '+',
'-', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', '!', '$', '*', ']', ';', '_',
'&', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', '?', '.', ')', '[', '<', '"' };
The bit order to index the table is BA8421.
So group mark is 63, or ".
As of v3.3-0 there's also an instruction history. I added logging,
but I don't know if Bob Supnik has added that to the distribution.
Try "set debug
Overview
For a listing of Van Snyder's Autocoder parameters & help file,
click here.
SIMH documentation by Bob Supnik
courtesy of Al Kossow.
Of particular interest to people wishing to code and simulate
the 1401 are:
Last updated Jan 17, 2007
Return to main page
test stuff 1401-FORTRAN