Det virtuelle datamuseum / Regnecentralen / GIER Simulator / Tutorial
GIER Tutorial
This short tutorial should get you started using the GIER simulator.
The following topics are explained:
If you print this page, please make sure that your browser prints underlines.
We assume that you already have installed the simulator.
Start the Linux version by cd'ing to the directory with the
GIER executable, and simply type GIER. The windows version is started
by double-clicking on the GIER.exe file.
You will see some windows on the screen:
Figure 1: The main window of the GIER simulator.
The menus are used as follows:
The File menu contains functions for saving and restoring the state
of the simulator, and terminating it.
The View menu contains an item for each subwindow of the simulator.
Click on an item to open or close the window for the paper tape reader, the punch, the
typewriter, the main or auxilliary control board, or the line printer.
The Options menu selects certain options in the simulator: You can
write-protect the channels 0 or 1 to 31 on the drum/disc, you can select the way
zeroes are handled in floating point arithmetics, and you can enable/disable the sound.
If the simulator couldn't find a suitable sound driver, the sound item will be grayed
out in the menu.
Enabling sound results in two things: First, you will hear the sound from the machine
when the sign of the result register changes. Secondly, the speed of the simulator
will match the speed of a real GIER machine.
Normally, tracks 0, 1-31 and the floating point zero options are enabled.
In the Debug menu most of the items select test printing. This doesn't work so well
in Windows. In the Linux version, the test printouts appear in the terminal in which the simulator
was started, unless you redirect the output when you start the program. If the Statistics item
is selected, the GIER instructions executed are counted until you deselect this item. The statistics
are stored in a file named gierstat.dat in the current directory.
Figure 2: The main control panel of the GIER simulator.
The main control panel is explained in details in vol. 2 of A Manual of Coding of GIER.
The buttons on the top, right hand side of the panel select the register to be displayed. Here, register O is
selected. The lights at the bottom display the contents of the selected register. Click on the
buttons with the mouse to change the contents of the register.
Black is zero and white is one. The two switches to the
left set all bits to either 0 or 1.
The overflow bit, the sign of the R register, and the contents of the indicator
are displayed at the top left.
The YE light is on when GIER waits for an external unit, e.g. the typewriter or
the paper tape reader.
The lights M1 to M4 indicates at what stage in the microcode GIER is in while
executing an instruction.
Click on NORMAL START to restart the GIER machine if it is stopped. Right-click on this
button to single-step through a program. The NORMAL STOP button stops the GIER machine at the
end of the current instruction. Note, if GIER is waiting for a character from the keyboard or the
paper tape reader, the current instruction won't be finished until a character arrives.
Use the MIKROTEMPI STOP button to stop GIER immediately, i.e. in the middle of an instruction. This
is especially useful if GIER is waiting for a character from the typewriter or the paper tape reader.
The MIKROTEMPI START button executes a single step in the microcode each time it is pressed.
The switch at the bottom left exits the simulator.
When the Help-3 system has been installed on the GIER machine, the main control board is normally
not used. You can control everything using the auxilliary control board and the typewriter.
Figure 3: The auxilliary control panel of the GIER simulator.
Most of the lights and switches follow corrensponding lights and switches on the main
control panel.
The KLAR light means that GIER is stopped. The YE light lights up when
GIER is waiting for an external unit. Str.læs. par.fejl lights when GIER is stopped
with a paper tape parity error. Tromle fejl lights up if you try to write
on a write-protected track or read/write a non-existing track. The simulator is trapped
in the instruction in error until Reset is pressed.
TO fejl lights when GIER encounters an unknown
instruction. HP spærret lights when the HP button is inhibited. In this GIER simulator,
the HP button is inhibited by setting bit 0 to one in the by register. i-løkke
lights during indirect addressing; if this light is on permanent, GIER is trapped in an
eternal chain of indirect addresses.
The Reset button works like MIKROTEMPI STOP on the main panel.
The HP button calls the HJÆLP or Help-3 system: The first 40 cells in the core store
are stored on track 38 on the drum/disc, track 0 is read in, the program counter is
stored in cell 0, and execution starts in cell 1. The code on track 0 will normally generate a parity
check of the rest of the Help-3 system on the locked tracks 1-31, store the contents of the core on
the drum, and start a command interpreter that accepts commands from the typewriter.
The switches at the bottom connect the bits in the by register with the external
devices. The selection displayed is the normal selection: by value 8 is the lineprinter, 16 the
typewriter, and 32 the paper tape punch.
Figure 4: The paper tape reader in the GIER simulator.
Click on Reset to load a new "tape". Tapes in this GIER simulator are files,
stored on the PC disc. The Linux version of the simulator accepts only tapes in Flexowriter
code, default with the extension .flx. The windows version accepts Flexowriter tapes as well
as ASCII tapes. Tapes in ASCII should have the extension: .asc.
The row of holes above the ^-sign is the next character read by GIER. Above the
"paper tape" is the character printed in lowercase.
The Read, Skip, and Up buttons are currently not implemented.
Figure 5: The paper tape punch of the GIER simulator.
If a character is sent to the paper tape punch, a window pops up requiring you to
select a filename. Characters punched are appended to this file, until End Tape is pressed.
The punch can only produce tapes in Flexowriter code. In Linux, you can use the programs a2flx
and flx2a to convert between ASCII and Flexowriter code.
A convertion table is located later in this document.
Figure 6: The typewriter in the GIER simulator.
The typewriter is used for both input and output. If GIER waits for input from the typewriter,
the text INPUT (in green) is displayed in the upper right corner, like the green light
on a real GIER typewriter. Select the typewriter window with the mouse, and use
the keyboard on the computer to enter keystrokes.
Note: GIER has a typewriter with Danish layout. You will need to change your keyboard
layout to write the Danish characters æ, ø, and å.
Figure 7: The lineprinter in the GIER simulator.
The Linux version of the lineprinter converts characters sent to the line printer into PostScript.
Use the lpr command in Linux to send the file produced to your printer.
The line printer in the Windows version works quite differently. Lines
are buffered in the simulator until you press Start printing. Use
Printer Setup before the printing anything in the GIER simulator.
The fields Lines per inch and Lines per page should match
the font and paper size you've selected.
When you start the GIER simulator, the contents of the core store, drum(s)/disc,
and possible the buffer store is read in from a file, default.gier, in the current directory.
If this file is missing, or you start from scratch by
selecting New from the File menu, all cells in the core store, drum(s)/disc,
and buffer are set to zero.
The GIER machine does not contain any BIOS, so in order to load the operating system,
you'll have to manually enter a few cells on the control panel, and start reading
tapes with the operating system.
The following is an example of how to create a GIER machine with a disc replacing the
drum and a buffer store. More details on how to load a HELP-3 system are presented
in the book A Manual of HELP 3.
First, erase the GIER machine by selecting New from the File
menu. Select Disc and enable the buffer store.
Enable writing on track 0 and tracks 1-31 by deselecting these items in the Options menu.
Proceed as follows:
- Press MIKROTEMPI STOP.
- Select register r1 and set it to zero.
- Press MIKROTEMPI START twice.
- Select register L, clear all bits and set the following bits to one: 0-6,
8, 21, 24, 31-32, 35, 40.
- Press MIKROTEMPI START once. Cell zero now contains the instructions:
"tl -6, ca 0"
- Press MIKROTEMPI STOP
- Select register r1 and set bit 9 to one.
- Press MIKROTEMPI START twice.
- Select register L, clear all bits and set the following bits to one:
7, 20-22, 24-25, 28, 30-31, 34, 40
- Press MIKROTEMPI START once. Cell one now contains the instructions:
"ly r4, hs 0"
- Press MIKROTEMPI STOP
- Select register r1 and set bit 9 to zero and bit 8 to one.
- Press MIKROTEMPI START twice.
- Select register L, clear all bits and set the following bits to one:
8-19, 21-22, 24, 29, 34
- Press MIKROTEMPI START once. Cell two now contains the instruction:
"gm s3 t-1 M"
- Press MIKROTEMPI STOP
- Select register r1 and clear all bits
- Load the tape from the tapes/help3 directory named: "basic track 0 20.08.67.flx"
- Press NORMAL START. GIER now loads the tape and stores it on track 0
- Track zero is called, this performs a checksum of the rest of the Help 3 system.
This checksum doesn't match (tracks 1-31 are still zero), and GIER writes: SUM (in red) on the typewriter.
- Load the tape basichelp3.flx from the help3bin directory into the
paper tape reader.
- Press space bar on the typewriter. GIER now loads the rest of Help 3
and stores it on the disc. When finished, GIER writes: "0 0.0.0 e0".
- This tape contains the core part of Help 3 for a GIER machine with
a single drum. In order to build a Help 3 system for a disc machine, we
must now load a series of tapes with the source code of the Help system. We
use the SLIP program in the basic Help system for this.
- Insert tape file "Main help (5) 8.08.68.flx" in the reader and type "r<" on
the typewriter. The tape is read, and GIER writes "redefine".
- We must now set the parameters for Help 3. Write the following lines on
the typewriter:
| Write: | Meaning:
|
|---|
| d22=30 | Disc system: Corresponds to 30 drums
| | d32=0 | We use a special work area
| | d16=934 | Image area starts on track 934
| | d33=500 | Work area goes from track 500 to 933
| | d34=434 | Work area is 434 tracks
| | d19=960 | Track group 0 for core image
| | d5=960 | Free starts at track 960, i.e. group 1
| | d21=450 | Catalog starts at track 450
| | d23=50 | Catalog is 50 tracks
|
- We store slip and exit from track 13 to 36, track 38 is the parameter track, and
the rest of the Help-3 programs and the GIER ALGOL 4 compiler on the tracks 39 and on.
The catalog is on the tracks 450-499, work 500-933, and image 934-959.
This gives quite a big catalog and work area.
The area free goes from track 960 to the end of the disc.
- Write l (write this as _ followed by the character "l"), SLIP continues
reading. GIER writes "mainhelp".
- Load tape: "inithelp (4) 13.01.69.flx" and write l. GIER writes "inithelp".
- Load tape: "slip (4) 14.01.69.flx" and write l. GIER writes "slip".
- Load tape: "exit (2) 7.06.68.flx" and write l. GIER writes "exit".
- The next tape will extend on to track 38, however, this is the parameter track.
Tell SLIP to skip tracks 37 and 38 by writing "d1=2d1" followed by return.
- Load tape: "binin (1) 22.07.67.flx". and write l. GIER writes "binin".
- Load tape: "binout, ... (2) 9.08.67.flx" and write l. GIER writes "binout, outparam".
- Load tape: "start (3) 21.09.70.flx" and write l. GIER writes "start".
- Load tape: "clear ... (10) 8.08.67.flx" and write l. GIER writes "set, res clear".
- Load tape: "algol (2) 8.08.67.flx" and write l. GIER writes "algol". Note, this
is not the GIER ALGOL 4 compiler, just a small Help-3 program that starts the real compiler,
ga4.
- Load tape: "run (2) 10.08.67.flx" and write l. GIER writes "run".
- Load tape: "edit (9) 8.07.70.flx" and write l. GIER writes "edit".
- Load tape: "move (5) 15.12.68.flx" and write l. GIER writes "move".
- Load tape: "check ... (12) 1.07.70.flx" and write l. GIER writes "check, compress, list, setsum".
- Load tape: "print ... (12) 23.01.69.flx" and write l. GIER writes "print, pair".
- Write e10 followed by return on the typewriter.
- GIER will now move the Help 3 system in place, and return with the HP button prompt. This should
be (in red): "p0 2.6.67 e354". You can now write-protect track 0 and tracks 1-31.
- Correct the date: "start,13.2.2<" to set it to February 13, 2002.
- Remember to save your GIER configuration!
A listing of the catalog is produced by the command: "list,a<" You will see
that the last program (print) starts on track 94 and fills 20 tracks. The first free track
is 114. This number must be used when we load the GIER ALGOL 4 compiler.
Note, there are many ways one can generate a Help-3 system. I have not
found any suggestions for doing this optimally. The one just described seems to work...
The first two commands to be used when you have started Help-3 is the command "check<"
to calculate checksums of the disc areas, and the command "start,xx.xx.xx<" to set the
date.
You can't use the backspace key to correct mistakes when writing commands to Help-3,
because a GIER typewriter does not have a backspace key. If you make a mistake, you
can tell GIER to ignore the whole line by typing the character å.
The GIER ALGOL 4 compiler is distributed as a series of tapes. The tapes are in
the tapes/ga4 directory. One must load the
first tape, set some parameters, and load the rest of the tapes. The last tape moves
the compiler to the right place on the drum/disc.
To install a compiler on a system as created in the previous chapter, do as
follows:
- Load tape "T1, L1 (26) 20.07.70.flx" and write "r<" on the typewriter. GIER writes
"redefine wanted loading parameters".
- Set the following parameters:
| Write: | Meaning:
|
|---|
| e14=114 | Put the first track on track 114
| | e27=1 | Store arrays in buffer store
|
- Continue reading with l. GIER writes "T1,L1".
- Load tape "T2 (22) 13.01.69.flx" and write l. GIER writes "T2".
- Load tape "T3 (18) 3.10.68.flx" and write l. GIER writes "T3".
- Load tape "T4 (24) 14.04.70.flx" and write l. GIER writes "T4".
- Load tape "T5 (25) 14.04.70.flx" and write l. GIER writes "T5".
- Load tape "T6, L2 (20) 26.07.68.flx" and write l. GIER writes "T6,L2".
- Load tape "T7, L3 (23) 20.01.69.flx" and write l. GIER writes "T7,L3".
- Load tape "T8, L4 (19) 17.07.68.flx" and write l. GIER writes "T8,L4 - wait - then SLIP or other"
and the HP button prompt.
- Load tape "T9, L5, M1 () 12.08.67.flx" and write "r<". GIER writes "... define i and the parameter".
- Write l. GIER writes "T9,L5,M1", "end merger", and the HP button prompt.
- Load tape "P1 (1) 16.08.67.flx" and write "r<". GIER writes "actual first track of translator".
- Write 114, press return, and write l. GIER writes "type: d35...".
- Write "d35=0", press return, and write l. GIER writes "if reserved ...".
- Write l. GIER writes "type: final first track".
- Write 114, press return, and write l. GIER writes "type: tname of translator;".
- Write "tga4;", press return, and write l. GIER comes back with the HP button prompt.
Your compiler is now in place. Store your GIER configuration!
Write "list,a<" to list the catalog. The ga4 entry should appear last.
To test the compiler, load the tape "demon3.flx" from the demo directory in the reader
and give the command "r,algol<". After a while, GIER writes "ok", and waits for further
input from the paper tape reader (because of the "r," in the beginning of the last command).
Stop GIER by pressing Reset on the auxilliary control board, followed by pressing
HP. Start the program by writing "run<". You can now play the game NIM!
You can write the code using any ASCII editor, e.g. notepad in Windows or vi in Linux. Store
the file with the extension ".asc".
The paper tape reader in the Windows version of the simulator can read ASCII tapes directly.
In Linux, you'll need to convert the file into Flexowriter code manuallly:
$ a2flx <file.asc >file.flx
We will write a simple program that prints a table of the factorial function,
i.e. the products of the integers 1 to the number n.
The program could look like this:
_b_e_g_i_n
_i_n_t_e_g_e_r n;
_r_e_a_l _p_r_o_c_e_d_u_r_e fac(n);
_v_a_l_u_e n;
_r_e_a_l n;
fac := _i_f n=0 _t_h_e_n 1 _e_l_s_e fac(n-1)*n;
select(17);
_f_o_r n := 0 _s_t_e_p 1 _u_n_t_i_l 50 _d_o
_b_e_g_i_n
writecr;
write(|<dddd|>, n);
write(|< d.ddddd'-ddd|>, fac(n))
_e_n_d for n
_e_n_d program
Note the following:
- Underlined characters are written as the character "_" followed by
the character to be underlined.
- The multiplication sign is written as *
- The power-of-ten sign is written as '
Start the GIER simulator. If you previously have installed Help-3 and
the GIER ALGOL 4 compiler, everything is now ready to compile the program.
Load the program file in the paper tape reader.
Press Reset followed by HP on the auxilliary control
panel.
Write the command "r,algol<" on the typewriter. GIER starts the compiler,
reads the tape, compiles the program, and stores the compiled program in the
area work.
Stop GIER waiting for further input from the reader by pressing Reset
and HP.
Write the command "run<" to start the program. The table is printed
on the typewriter. You can redirect the output to another device using the
buttons on the auxilliary control panel or by changing the value in the
call of the standard procedure select in the program.
Changes in the program are made either in the ASCII version of the "tape",
or you can use the tape editing program, edit, in Help-3. However,
this is not so easy to use.
You will find a lot of Algol programs in the demo directory.
The program a2flx or the conversion utility build into the reader in
the Windows version of the simulator use the following conversion rules:
| Flexowriter character | Write in ASCII
|
|---|
| or symbol | £ (the Pound symbol)
| | × (multiplication symbol) | *
| | and symbol | &
| | Subscript 10 | '
|
The conversion automatically inserts the necessary case shift characters.
You can find more GIER software in our Software database.
(C) Copyright 2002-2004 by Mogens Kjær, mk@gier.dk
|