3 Wegematic 1000


Index - - Contents - - Previous chapter - Next chapter - - Previous page - Next page

3.4 Wegematic 1000 Programming

Programming was made in machine code with absolute addresses on coding forms, one for each of the four prime memory channels. (An algebraic compiler was published in 1964, too late to be used: K. Appel, "A Compiler for Alwac-Wegematic Computer, BIT 45:1, 1-5.) Each form contained 32 numbered slots ordered row-wise from left to right in eight rows with four slots per row representing the cells of the corresponding prime memory channel. The machine was an one-address machine. A half-word (half-slot) normally contained one instruction, with the first two hexadecimal digits representing the operation code and the last two the address ranging from 00 to FF, so that each half word in the four prime memory channels could be addressed. The words (and left half-words) in the first prime memory channel had the addresses 00 to 1F and the right half-words the addresses 80 to 9F. The addresses of the other prime channels was obtained from this by adding multiples of 20 (hex). The sequential order of the instructions in a channel was left half-word, right half-word of every fourth word, i.e., the code was written word for word column wise not row wise in address order, see next section.

When reading decimal numbers from tape the first task was to convert these to their binary equivalents, scale them by shifting, and store them in memory locations. The arithmetic operations were on binary numbers using fix point, i.e. the programmer was responsible for the choice of appropriate scaling of the numbers for maximal numerical accuracy. The fixed scaling should ideally be chosen so that the numbers were stored in their cells as far left as possible without ever loosing bits. In order to document the scaling, the binary offset of the binary point relative to being just right of the cell was marked on the form for each cell containing non-integer data (the offset for an integer would thus be 0). Before adding (subtracting) two numbers, the numbers were to be scaled equally. For multiplication and division the scaling of the result changed accordingly. In order to succeed in the fixed scaling business the programmer should have a pretty clear picture of the sizes of all computed numbers during the whole computation.

For writing the results on tape the numbers had to be transformed to their decimal equivalents and arranged by spacing and written decimal points and carriage returns into a form appropriate for human reading. The tape was then printed on paper at an off-line "Flexo Writer", which also was used for punching the paper tape to feed into the computer.

For accessing data stored in consecutive cells, address modification using the index register E was used. Address modification was indicated by subtracting 1 from the even operation codes. On executing an address modified instruction the real address was obtained as the difference between the address part and the content of E. This together with a "decrement E and test for zero" command made it possible to loop on a sequence of data items. For an example see next section.