shithub: GALasm

Download patch

ref: 4b53b584263c8b7ea997d756e9712bf438bc348b
author: glenda <glenda@dwp9>
date: Mon Jan 19 16:14:25 EST 2026

Initial commit

--- /dev/null
+++ b/ChangeLog
@@ -1,0 +1,11 @@
+- 9Front Port 20250820
+	added -q for quiet operation when using mk test
+	(oh, and added tests too...)
+
+
+- 2.1 20030508
+
+	- Fixed fuse checksum for GAL22V10 (Hilgart Elmar)
+	- Now gives the correct "Operation mode" on stdout
+	- Added Makefile
+	- Minor code cleanup
--- /dev/null
+++ b/README
@@ -1,0 +1,95 @@
+
+
+                                GALasm 2.1
+
+                          Portable GAL Assembler
+                 Copyright (c) 1998-2003 Alessandro Zummo
+        Original sources Copyright (c) 1991-96 Christian Habermann
+                            All Rights Reserved
+
+                   Commercial use is strictly forbidden
+
+
+Introduction
+------------
+
+GALasm was created simply because there were no other
+open source GAL assemblers. The assembler core
+is basically the one of GALer, a GAL development
+environment for the Amiga platform. I was unable
+to get in touch with his author to get the permission to 
+do the port, so if he complains i'll have to 
+stop the development.
+
+
+Copyright
+---------
+
+GALasm is Copyright (c) 1998-2003 by Alessandro Zummo
+but any bug and any piece of code taken from the original GALer
+sources is still Copyright (c) 1991-96 by Christian Habermann.
+
+
+Disclaimer
+----------
+
+The authors can not be made responsible for any damage caused
+by a fault of GALasm. In other words: use it at your own risk.
+Even if i've ported it, i've not fully understood every
+aspect of the assembler core.
+
+
+Sources
+-------
+
+The sources are written in ANSI-C, so it should
+be possible to compile them on any platform.
+The sources have been successfully compiled
+with SAS/C on the Amiga platform and with gcc
+on Debian GNU/Linux.
+
+
+About GALs
+----------
+
+Some kind of GALs are not reprogrammable and some others,
+especially the one i belong to, are even not programmable at all...
+ok, just kidding. The original GALer documentation
+is a very well written, so if you want to know
+how to write down a GAL equation, run your favorite
+browser and load galer/main.html. All the non-Amiga
+related sections are still valid for GALasm.
+
+
+GALasm
+------
+
+If you type GALasm -h you should obtain the following text:
+
+GALasm 2.1, Portable GAL Assembler
+Copyright (c) 1998-2003 Alessandro Zummo. All Rights Reserved
+Original sources Copyright (c) 1991-96 Christian Habermann
+
+Usage:
+GALasm [-scfpa] <filename>
+-s Enable security fuse
+-c Do not create the .chp file
+-f Do not create the .fus file
+-p Do not create the .pin file
+-a Restrict checksum to the fuse array only
+
+I think it's self explanatory, but if you've
+any trouble, drop me a note. 
+
+
+Author
+------
+
+ The author (me) can be contacted at azummo-galasm@towertech.it
+ while the GALasm support page is located at
+ http://www.towertech.it/azummo/
+
+ If you have a bug report, a comment or anything else, 
+ feel free to write me. 
+ Donations are also welcome 8-) .
+
--- /dev/null
+++ b/README2
@@ -1,0 +1,11 @@
+This is a modified version of GALasm 2.1.
+
+It was modified by David Hovemeyer <david.hovemeyer@gmail.com>
+so that when writing JEDEC files, end of line is indicated by
+\r\n rather than just \n.  My GAL programmer (Wellon VP-190)
+does not accept JEDEC files with bare \n characters in them.
+
+I have compiled the modified version on Linux and Cygwin using
+gcc, and the .jed files produced appear to be valid.  (The Wellon
+software reports them as being valid, and successfully programs
+22V10 devices with them.)
--- /dev/null
+++ b/examples/Counter.chp
@@ -1,0 +1,25 @@
+
+
+                                GAL16V8
+
+                          -------\___/-------
+                    Clock |  1           20 | VCC
+                          |                 |
+                       D0 |  2           19 | Q0
+                          |                 |
+                       D1 |  3           18 | Q1
+                          |                 |
+                       D2 |  4           17 | Q2
+                          |                 |
+                       D3 |  5           16 | Q3
+                          |                 |
+                      Set |  6           15 | NC
+                          |                 |
+                    Clear |  7           14 | NC
+                          |                 |
+                       NC |  8           13 | NC
+                          |                 |
+                       NC |  9           12 | NC
+                          |                 |
+                      GND | 10           11 | /OE
+                          -------------------
--- /dev/null
+++ b/examples/Counter.fus
@@ -1,0 +1,82 @@
+
+
+Pin 19 = Q0           XOR = 1   AC1 = 0
+  0  x--- ---- ---- ---- x--- -x-- ---- ---- ---x ---- ----
+  1  ---- -x-- -x-- ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx
+  2  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  3  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  4  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  5  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- x---
+  6  ---- ---- x--- -x-- ---- ---- --x- ---x ---- ---- -x--
+  7  -x-- ---- ---- ---x --x- ---- ---- -x-- -x-- ---- ----
+
+Pin 18 = Q1           XOR = 1   AC1 = 0
+  8  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  9  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 10  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 11  xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- x--- ----
+ 12  x--- -x-- ---- ---- ---- ---x --x- ---- -x-- -x-- ----
+ 13  ---- ---x ---- --x- ---- -x-- -x-- ---- ---- --x- --x-
+ 14  ---x ---- -x-- -x-- ---- ---- xxxx xxxx xxxx xxxx xxxx
+ 15  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 17 = Q2           XOR = 1   AC1 = 0
+ 16  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 17  xxxx xxxx xxxx xxxx xxxx ---- ---- ---- x--- x--- -x--
+ 18  ---- ---- ---- ---- ---x --x- -x-- -x-- ---- ---- ----
+ 19  ---x ---- --x- -x-- -x-- ---- ---- ---x ---- ---- --x-
+ 20  -x-- -x-- ---- ---- --x- --x- --x- ---x -x-- -x-- ----
+ 21  ---- xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 22  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 23  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 16 = Q3           XOR = 1   AC1 = 0
+ 24  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 25  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 26  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 27  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 28  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 29  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 30  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 31  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 15 = NC           XOR = 0   AC1 = 0
+ 32  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 33  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 34  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 35  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 36  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 37  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 38  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 39  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 14 = NC           XOR = 0   AC1 = 0
+ 40  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 41  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 42  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 43  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 44  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 45  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 46  xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- ---- ---- ----
+ 47  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
+Pin 13 = NC           XOR = 0   AC1 = 0
+ 48  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 49  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 50  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 51  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 52  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 53  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 54  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 55  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
+Pin 12 = NC           XOR = 0   AC1 = 0
+ 56  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 57  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 58  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 59  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 60  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 61  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 62  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 63  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
--- /dev/null
+++ b/examples/Counter.jed
@@ -1,0 +1,31 @@
+
+Used Program:   GALasm 2.0
+GAL-Assembler:  GALasm 2.0
+Device:         GAL16V8
+
+*F0
+*G0
+*QF2194
+*L0000 01111111111111110111101111111111
+*L0032 11101111111111111011101111111111
+*L0256 11110111111111110111101111111111
+*L0288 11011110111111111011101111111111
+*L0320 11101101111111111011101111111111
+*L0512 11111111011111110111101111111111
+*L0544 11111110110111111011101111111111
+*L0576 11101111110111111011101111111111
+*L0608 11011101111011111011101111111111
+*L0768 11111111111101110111101111111111
+*L0800 11111111111011011011101111111111
+*L0832 11111110111111011011101111111111
+*L0864 11101111111111011011101111111111
+*L0896 11011101110111101011101111111111
+*L2048 11110000
+*L2056 0100001101101111011101010110111001110100011001010111001000100000
+*L2120 00000000
+*L2128 1111111111111111111111111111111111111111111111111111111111111111
+*L2192 0
+*L2193 1
+*C3e11
+*
+a7cf
--- /dev/null
+++ b/examples/Counter.pin
@@ -1,0 +1,25 @@
+
+
+ Pin # | Name     | Pin Type
+-----------------------------
+   1   | Clock    | Clock
+   2   | D0       | Input
+   3   | D1       | Input
+   4   | D2       | Input
+   5   | D3       | Input
+   6   | Set      | Input
+   7   | Clear    | Input
+   8   | NC       | NC
+   9   | NC       | NC
+  10   | GND      | GND
+  11   | /OE      | /OE
+  12   | NC       | NC
+  13   | NC       | NC
+  14   | NC       | NC
+  15   | NC       | NC
+  16   | Q3       | Output
+  17   | Q2       | Output
+  18   | Q1       | Output
+  19   | Q0       | Output
+  20   | VCC      | VCC
+
--- /dev/null
+++ b/examples/Counter.pld
@@ -1,0 +1,52 @@
+GAL16V8    ; 4-Bit-Counter  first line : used GAL
+Counter    ;                second line: any text (max. 8 char.)
+
+
+Clock D0    D1    D2    D3    Set   Clear NC    NC   GND
+/OE   NC    NC    NC    NC    Q3    Q2    Q1    Q0   VCC
+
+
+
+
+
+Q0.R =   /Clear *  Set *  D0
+       + /Clear * /Set * /Q0
+
+
+Q1.R =   /Clear *  Set *  D1
+       + /Clear * /Set * /Q1 *  Q0
+       + /Clear * /Set *  Q1 * /Q0
+
+
+Q2.R =   /Clear *  Set *  D2
+       + /Clear * /Set *  Q2 * /Q1
+       + /Clear * /Set *  Q2 * /Q0
+       + /Clear * /Set * /Q2 *  Q1 *  Q0
+
+
+Q3.R =   /Clear *  Set *  D3
+       + /Clear * /Set *  Q3 * /Q2
+       + /Clear * /Set *  Q3 * /Q1
+       + /Clear * /Set *  Q3 * /Q0
+       + /Clear * /Set * /Q3 *  Q2 *  Q1 *  Q0
+
+
+
+
+
+DESCRIPTION
+
+this is a 4-Bit-Counter
+
+registered outputs are signed with the postfix .R
+
+
+ Pin 'Set' HIGH while clock signal (LOW-HIGH) at pin 'Clock':
+        load Q0-Q3 with state of D0-D3
+
+ Pin 'Clear' HIGH while clock signal:
+        Q0-Q3 are cleared
+
+ Clock signal while pins 'Set' and 'Clear' are LOW:
+        increment counter
+
--- /dev/null
+++ b/examples/GAL20RA10.chp
@@ -1,0 +1,29 @@
+
+
+                               GAL20RA10
+
+                          -------\___/-------
+                      /PL |  1           24 | VCC
+                          |                 |
+                      Set |  2           23 | Y1
+                          |                 |
+                  Enable1 |  3           22 | Y2
+                          |                 |
+                  Enable2 |  4           21 | Y3
+                          |                 |
+                   Clock1 |  5           20 | Y4
+                          |                 |
+                   Clock2 |  6           19 | D1
+                          |                 |
+                       NC |  7           18 | D2
+                          |                 |
+                       NC |  8           17 | ResetA1
+                          |                 |
+                       NC |  9           16 | ResetB1
+                          |                 |
+                       NC | 10           15 | NC
+                          |                 |
+                       NC | 11           14 | NC
+                          |                 |
+                      GND | 12           13 | /OE
+                          -------------------
--- /dev/null
+++ b/examples/GAL20RA10.fus
@@ -1,0 +1,102 @@
+
+
+Pin 23 = Y1           S0 = 1
+  0  ---- x--- ---- ---- ---- ---- ---- ---- ---- ---- ----
+  1  ---- ---- x--- ---- ---- ---- ---- ---- ---- ---- ----
+  2  ---- ---- ---- ---- --x- --x- ---- ---- x--- ---- ----
+  3  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+  4  --x- ---- ---- ---- ---- ---- xxxx xxxx xxxx xxxx xxxx
+  5  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  6  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  7  xxxx xxxx xxxx ---- ---- ---- ---- ---- ---- ---- ----
+
+Pin 22 = Y2           S0 = 1
+  8  ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  9  xxxx ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 10  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- x---
+ 11  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 12  ---- ---- --x- ---- ---- ---- ---- ---- xxxx xxxx xxxx
+ 13  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 14  xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- x--- ---- ----
+ 15  ---- ---- ---- ---- ---- ---- ---- ---- ---- x--- ----
+
+Pin 21 = Y3           S0 = 0
+ 16  ---- ---- ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 17  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 18  xxxx xxxx ---- ---- ---- ---- ---- --x- ---- ---- ----
+ 19  ---- xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 20  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 21  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- ----
+ 22  -x-- ---- ---- ---- ---- ---- ---- ---- xxxx xxxx xxxx
+ 23  xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- ---- ----
+
+Pin 20 = Y4           S0 = 1
+ 24  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 25  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---x ----
+ 26  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---x ----
+ 27  ---- ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 28  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 29  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 30  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 31  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 19 = D1           S0 = 0
+ 32  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 33  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 34  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 35  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 36  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 37  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 38  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 39  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 18 = D2           S0 = 0
+ 40  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 41  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 42  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 43  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 44  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 45  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 46  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 47  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 17 = ResetA1      S0 = 0
+ 48  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 49  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 50  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 51  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 52  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 53  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 54  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 55  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 16 = ResetB1      S0 = 0
+ 56  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 57  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 58  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 59  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 60  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 61  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 62  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 63  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 15 = NC           S0 = 0
+ 64  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 65  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 66  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 67  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 68  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 69  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 70  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 71  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 14 = NC           S0 = 0
+ 72  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- ----
+ 73  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 74  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 75  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 76  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 77  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 78  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 79  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
--- /dev/null
+++ b/examples/GAL20RA10.jed
@@ -1,0 +1,31 @@
+
+Used Program:   GALasm 2.0
+GAL-Assembler:  GALasm 2.0
+Device:         GAL20RA10
+
+*F0
+*G0
+*QF3274
+*L0000 1111011111111111111111111111111111111111
+*L0040 1111111111110111111111111111111111111111
+*L0080 1111111111111111111111111101110111111111
+*L0120 0111111111111111111111111111111111111111
+*L0160 1111111111111111110111111111111111111111
+*L0320 1111111111111111111111111111111111111111
+*L0400 1111111111111111111111111111111111111111
+*L0440 1111111111111111111111111111111111111111
+*L0480 0111111111111111111111111111111111111111
+*L0520 1111111111111111110111111111111111111111
+*L0640 1111111101111111111111111111111111111111
+*L0680 1111111111111111011111111111111111111111
+*L0800 1111111111111111111111011111111111111111
+*L0960 1111111110111111111111111111111111111111
+*L1040 1111111111111111111111111111111111111111
+*L1080 1111111111111111111111111111111111111111
+*L1120 1111111111111111111011111111111111111111
+*L1160 1111111111111111111111101111111111111111
+*L3200 1101000000
+*L3210 0011001000110000010100100100000100110001001100000000000000000000
+*C596d
+*
+ce36
--- /dev/null
+++ b/examples/GAL20RA10.pin
@@ -1,0 +1,29 @@
+
+
+ Pin # | Name     | Pin Type
+-----------------------------
+   1   | /PL      | Input
+   2   | Set      | Input
+   3   | Enable1  | Input
+   4   | Enable2  | Input
+   5   | Clock1   | Input
+   6   | Clock2   | Input
+   7   | NC       | Input
+   8   | NC       | Input
+   9   | NC       | Input
+  10   | NC       | Input
+  11   | NC       | Input
+  12   | GND      | GND
+  13   | /OE      | Input
+  14   | NC       | NC
+  15   | NC       | NC
+  16   | ResetB1  | Input
+  17   | ResetA1  | Input
+  18   | D2       | Input
+  19   | D1       | Input
+  20   | Y4       | Output
+  21   | Y3       | Output
+  22   | Y2       | Output
+  23   | Y1       | Output
+  24   | VCC      | VCC
+
--- /dev/null
+++ b/examples/GAL20RA10.pld
@@ -1,0 +1,28 @@
+GAL20RA10
+20RA10
+
+/PL Set Enable1 Enable2 Clock1  Clock2 NC NC NC NC NC GND
+/OE NC  NC      ResetB1 ResetA1 D2     D1 Y4 Y3 Y2 Y1 VCC
+
+
+Y1.R     =  D1				; define register output
+Y1.E     =  Enable1			; define tristate control
+Y1.CLK   =  Clock1			; define clock for the register
+Y1.ARST  =  ResetA1 * ResetB1		; define async. reset
+Y1.APRST =  Set				; define async. preset
+
+Y2  =  Set + D1				; Y2 is a "normal" output
+
+/Y3.R  =  D2				; Y3 is active low and a reg. output
+Y3.E   =  Enable2
+Y3.CLK =  Clock2
+
+Y4.T   =  /D1 + /D2			; Y4 is a tristate output
+Y4.E   =  /Enable2
+
+
+DESCRIPTION
+To define the clock, asynchronous reset and asynchronous preset for registered
+outputs you can use the suffixes .CLK, .ARST and .APRST.
+Clock must be defined for every register output whereas async. reset and async.
+preset are optinal.
--- /dev/null
+++ b/examples/GAL22V10.chp
@@ -1,0 +1,29 @@
+
+
+                                GAL22V10
+
+                          -------\___/-------
+                    Clock |  1           24 | VCC
+                          |                 |
+                        A |  2           23 | Y1
+                          |                 |
+                        B |  3           22 | Y2
+                          |                 |
+                        C |  4           21 | Y3
+                          |                 |
+                        D |  5           20 | Y4
+                          |                 |
+                        E |  6           19 | Enable1
+                          |                 |
+                        F |  7           18 | Enable2
+                          |                 |
+                       NC |  8           17 | NC
+                          |                 |
+                       NC |  9           16 | NC
+                          |                 |
+                       NC | 10           15 | NC
+                          |                 |
+                       NC | 11           14 | AsyncRe
+                          |                 |
+                      GND | 12           13 | SyncPre
+                          -------------------
--- /dev/null
+++ b/examples/GAL22V10.fus
@@ -1,0 +1,158 @@
+
+
+AR
+  0  ---- ---- ---- ---- ---- ---- x--- ---- ---- --x- ----
+
+Pin 23 = Y1           S0 = 1   S1 = 0
+  1  ---- ---- ---- ---- --x- ---- ---- ---- ---- ---- ----
+  2  ---- x--- x--- ---- ---- ---- ---- ---- ---- ---- ----
+  3  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  4  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  5  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  6  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  7  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  8  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  9  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 22 = Y2           S0 = 1   S1 = 0
+ 10  ---- ---- ---- --x- ---- --x- ---- ---- ---- ---- ----
+ 11  ---- ---- ---- x--- ---- ---- ---- ---- ---- ---- ----
+ 12  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 13  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 14  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 15  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 16  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 17  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 18  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 19  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 20  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 21 = Y3           S0 = 1   S1 = 0
+ 21  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 22  ---- ---- ---- --x- ---- --x- ---- ---- ---- ---- ----
+ 23  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 24  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 25  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 26  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 27  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 28  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 29  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 30  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 31  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 32  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 33  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 20 = Y4           S0 = 1   S1 = 0
+ 34  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 35  ---- ---- ---- ---- x--- ---- ---- ---- ---- ---- ----
+ 36  ---- ---- ---- ---- ---- x--- ---- ---- ---- ---- ----
+ 37  ---- ---- ---- ---- ---- ---- x--- ---- ---- ---- ----
+ 38  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 39  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 40  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 41  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 42  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 43  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 44  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 45  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 46  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 47  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 48  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 19 = Enable1      S0 = 0   S1 = 0
+ 49  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 50  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 51  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 52  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 53  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 54  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 55  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 56  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 57  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 58  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 59  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 60  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 61  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 62  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 63  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 64  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 65  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 18 = Enable2      S0 = 0   S1 = 0
+ 66  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 67  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 68  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 69  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 70  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 71  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 72  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 73  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 74  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 75  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 76  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 77  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 78  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 79  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 80  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 81  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 82  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 17 = NC           S0 = 0   S1 = 0
+ 83  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 84  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 85  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 86  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 87  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 88  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 89  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 90  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 91  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 92  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 93  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 94  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 95  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 96  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 97  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 16 = NC           S0 = 0   S1 = 0
+ 98  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 99  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+100  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+101  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+102  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+103  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+104  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+105  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+106  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+107  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+108  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+109  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+110  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 15 = NC           S0 = 0   S1 = 0
+111  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+112  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+113  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+114  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+115  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+116  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+117  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+118  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+119  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+120  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+121  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 14 = AsyncRe      S0 = 0   S1 = 0
+122  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+123  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+124  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+125  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+126  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+127  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+128  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+129  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+130  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+SP
+131  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --x-
+
--- /dev/null
+++ b/examples/GAL22V10.jed
@@ -1,0 +1,25 @@
+
+Used Program:   GALasm 2.0
+GAL-Assembler:  GALasm 2.0
+Device:         GAL22V10
+
+*F0
+*G0
+*QF5892
+*L0000 11111111111111111111111101111111111111011111
+*L0044 11111111111111111101111111111111111111111111
+*L0088 11110111011111111111111111111111111111111111
+*L0440 11111111111111011111110111111111111111111111
+*L0484 11111111111101111111111111111111111111111111
+*L0924 11111111111111111111111111111111111111111111
+*L0968 11111111111111011111110111111111111111111111
+*L1496 11111111111111111111111111111111111111111111
+*L1540 11111111111111110111111111111111111111111111
+*L1584 11111111111111111111011111111111111111111111
+*L1628 11111111111111111111111101111111111111111111
+*L5764 11111111111111111111111111111111111111111101
+*L5808 10101111010100000001
+*L5828 0011001000110010010101100011000100110000000000000000000000000000
+*C4432
+*
+a2f9
--- /dev/null
+++ b/examples/GAL22V10.pin
@@ -1,0 +1,29 @@
+
+
+ Pin # | Name     | Pin Type
+-----------------------------
+   1   | Clock    | Clock/Input
+   2   | A        | Input
+   3   | B        | Input
+   4   | C        | Input
+   5   | D        | Input
+   6   | E        | Input
+   7   | F        | Input
+   8   | NC       | Input
+   9   | NC       | Input
+  10   | NC       | Input
+  11   | NC       | Input
+  12   | GND      | GND
+  13   | SyncPre  | Input
+  14   | AsyncRe  | Input
+  15   | NC       | NC
+  16   | NC       | NC
+  17   | NC       | NC
+  18   | Enable2  | Input
+  19   | Enable1  | Input
+  20   | Y4       | Output
+  21   | Y3       | Output
+  22   | Y2       | Output
+  23   | Y1       | Output
+  24   | VCC      | VCC
+
--- /dev/null
+++ b/examples/GAL22V10.pld
@@ -1,0 +1,29 @@
+GAL22V10
+22V10
+
+Clock   A       B  C  D  E       F       NC NC NC NC GND
+SyncPre AsyncRe NC NC NC Enable2 Enable1 Y4 Y3 Y2 Y1 VCC
+
+
+Y1.R  = A * B			; Y1 is a registered output => .R
+Y1.E  = Enable1
+
+Y2.R  = C
+Y2.E  = Enable2 * Y4		; Attention: there is a feedback of Y4
+				; (Y4 is defined as output but it's
+				; used as input again)
+
+Y3    = Enable2 * Y4		; there is a feedback again
+
+Y4    = D + E + F
+
+
+AR    = F * AsyncRe		; define asynchronous reset
+
+SP    = SyncPre			; define synchronous preset
+
+
+DESCRIPTION
+To define the asynchronous reset and the synchronous preset you can use
+the keywords AR and SP. But this keywords can't be used as pin names.
+For AR and SP is one product term allowed.
\ No newline at end of file
--- /dev/null
+++ b/examples/Gatter.chp
@@ -1,0 +1,25 @@
+
+
+                                GAL16V8
+
+                          -------\___/-------
+                        B |  1           20 | VCC
+                          |                 |
+                        C |  2           19 | A
+                          |                 |
+                        D |  3           18 | W
+                          |                 |
+                        E |  4           17 | X
+                          |                 |
+                        F |  5           16 | Y
+                          |                 |
+                        G |  6           15 | Z
+                          |                 |
+                        H |  7           14 | NC
+                          |                 |
+                        I |  8           13 | NC
+                          |                 |
+                        J |  9           12 | NC
+                          |                 |
+                      GND | 10           11 | K
+                          -------------------
--- /dev/null
+++ b/examples/Gatter.fus
@@ -1,0 +1,82 @@
+
+
+Pin 19 = A            XOR = 0   AC1 = 1
+  0  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  1  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  2  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  3  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  4  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  5  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx x-x- --x-
+  6  ---- ---- ---- ---- ---- ---- xxxx xxxx xxxx xxxx xxxx
+  7  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 18 = W            XOR = 1   AC1 = 0
+  8  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  9  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 10  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 11  xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- x--- x--- ----
+ 12  ---- ---- ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 13  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 14  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 15  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 17 = X            XOR = 0   AC1 = 0
+ 16  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 17  xxxx xxxx xxxx xxxx xxxx ---- ---- ---- x--- ---- ----
+ 18  ---- ---- ---- ---- ---- ---- x--- ---- ---- ---- xxxx
+ 19  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 20  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 21  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 22  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 23  xxxx xxxx xxxx ---- ---- ---- ---- ---- x--- x--- ----
+
+Pin 16 = Y            XOR = 1   AC1 = 0
+ 24  ---- ---- ---- ---- ---- ---- ---- x-x- xxxx xxxx xxxx
+ 25  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 26  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 27  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 28  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 29  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 30  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 31  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 15 = Z            XOR = 1   AC1 = 0
+ 32  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 33  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 34  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 35  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 36  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 37  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 38  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 39  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 14 = NC           XOR = 0   AC1 = 0
+ 40  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 41  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 42  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 43  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 44  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 45  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 46  xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- ---- ---- ----
+ 47  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
+Pin 13 = NC           XOR = 0   AC1 = 0
+ 48  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 49  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 50  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 51  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 52  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 53  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 54  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 55  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
+Pin 12 = NC           XOR = 0   AC1 = 0
+ 56  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 57  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 58  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 59  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 60  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 61  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 62  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 63  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
--- /dev/null
+++ b/examples/Gatter.jed
@@ -1,0 +1,23 @@
+
+Used Program:   GALasm 2.0
+GAL-Assembler:  GALasm 2.0
+Device:         GAL16V8
+
+*F0
+*G0
+*QF2194
+*L0256 01011101111111111111111111111111
+*L0512 11110111011111111111111111111111
+*L0768 11111111111101111111111111111111
+*L0800 11111111111111110111111111111111
+*L1024 11111111111111111111011101111111
+*L1056 11111111111111111111111111110101
+*L2048 01011000
+*L2056 0100001001110011011100000010111000110001001000000010000000100000
+*L2120 10000000
+*L2128 1111111111111111111111111111111111111111111111111111111111111111
+*L2192 1
+*L2193 0
+*C215e
+*
+6b85
--- /dev/null
+++ b/examples/Gatter.pin
@@ -1,0 +1,25 @@
+
+
+ Pin # | Name     | Pin Type
+-----------------------------
+   1   | B        | Input
+   2   | C        | Input
+   3   | D        | Input
+   4   | E        | Input
+   5   | F        | Input
+   6   | G        | Input
+   7   | H        | Input
+   8   | I        | Input
+   9   | J        | Input
+  10   | GND      | GND
+  11   | K        | Input
+  12   | NC       | NC
+  13   | NC       | NC
+  14   | NC       | NC
+  15   | Z        | Output
+  16   | Y        | Output
+  17   | X        | Output
+  18   | W        | Output
+  19   | A        | Input
+  20   | VCC      | VCC
+
--- /dev/null
+++ b/examples/Gatter.pld
@@ -1,0 +1,32 @@
+GAL16V8               first line : used type of GAL
+Bsp.1                 second line: any text (max. 8 character)
+
+B  C   D   E   F  G  H  I  J  GND
+K  NC  NC  NC  Z  Y  X  W  A  VCC	 
+
+
+ W = A * B * C
+/X = D * E
+ Y = F + G
+ Z = H * I + J * K
+
+
+
+DESCRIPTION:
+
+format of the boolean equations:
+
+  output pin = boolean function of input and output pins
+
+  in this mode is no feedback of output pins allowed, this means that a output
+  pin can not be a function of output pins again
+
+ 
+ *: AND
+ +: OR
+ /: NEGATION
+
+ Example: Pin Y is HIGH if pin F OR pin G is HIGH, else Y will be LOW.
+
+	  Y = F + G
+
--- /dev/null
+++ b/examples/Tristate.chp
@@ -1,0 +1,25 @@
+
+
+                                GAL16V8
+
+                          -------\___/-------
+                        A |  1           20 | VCC
+                          |                 |
+                        B |  2           19 | Y1
+                          |                 |
+                        C |  3           18 | Y2
+                          |                 |
+                        D |  4           17 | Y3
+                          |                 |
+                        E |  5           16 | NC
+                          |                 |
+                        F |  6           15 | NC
+                          |                 |
+                        G |  7           14 | NC
+                          |                 |
+                       NC |  8           13 | NC
+                          |                 |
+                       NC |  9           12 | NC
+                          |                 |
+                      GND | 10           11 | NC
+                          -------------------
--- /dev/null
+++ b/examples/Tristate.fus
@@ -1,0 +1,82 @@
+
+
+Pin 19 = Y1           XOR = 1   AC1 = 1
+  0  ---x ---- ---- ---- ---- ---- ---- ---- x--- ---- ----
+  1  ---- ---- ---- ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx
+  2  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  3  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  4  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  5  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- ----
+  6  ---- ---- ---- ---- ---- ---- ---- x--- ---- ---- ----
+  7  ---- ---- ---- ---- ---- x--- ---- ---- ---- ---- ----
+
+Pin 18 = Y2           XOR = 1   AC1 = 1
+  8  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+  9  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 10  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 11  xxxx xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- ---- x---
+ 12  x--- ---- ---- ---- ---- ---- ---- ---- ---- -x-- ----
+ 13  ---- xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 14  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 15  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 17 = Y3           XOR = 1   AC1 = 1
+ 16  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 17  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 18  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 19  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 20  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 21  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 22  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 23  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 16 = NC           XOR = 0   AC1 = 0
+ 24  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 25  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 26  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 27  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 28  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 29  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 30  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 31  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 15 = NC           XOR = 0   AC1 = 0
+ 32  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 33  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 34  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 35  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 36  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 37  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 38  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 39  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+
+Pin 14 = NC           XOR = 0   AC1 = 0
+ 40  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 41  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 42  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 43  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 44  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 45  xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ 46  xxxx xxxx xxxx xxxx xxxx xxxx ---- ---- ---- ---- ----
+ 47  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
+Pin 13 = NC           XOR = 0   AC1 = 0
+ 48  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 49  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 50  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 51  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 52  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 53  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 54  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 55  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
+Pin 12 = NC           XOR = 0   AC1 = 0
+ 56  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 57  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 58  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 59  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 60  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 61  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 62  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ 63  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+
--- /dev/null
+++ b/examples/Tristate.jed
@@ -1,0 +1,24 @@
+
+Used Program:   GALasm 2.0
+GAL-Assembler:  GALasm 2.0
+Device:         GAL16V8
+
+*F0
+*G0
+*QF2194
+*L0000 11101111111111111111111111111111
+*L0032 01111111111111111111111111111111
+*L0256 11111111111111111111111111111111
+*L0288 11110111111111111111111111111111
+*L0320 11111111011111111111111111111111
+*L0512 11111111111101110111111111111111
+*L0544 11111111111111111111101111111111
+*L2048 11100000
+*L2056 0100010101111000011000010010111000110010000000000000000000000000
+*L2120 11100000
+*L2128 1111111111111111111111111111111111111111111111111111111111111111
+*L2192 1
+*L2193 1
+*C25a8
+*
+7305
--- /dev/null
+++ b/examples/Tristate.pin
@@ -1,0 +1,25 @@
+
+
+ Pin # | Name     | Pin Type
+-----------------------------
+   1   | A        | Input
+   2   | B        | Input
+   3   | C        | Input
+   4   | D        | Input
+   5   | E        | Input
+   6   | F        | Input
+   7   | G        | Input
+   8   | NC       | Input
+   9   | NC       | Input
+  10   | GND      | GND
+  11   | NC       | Input
+  12   | NC       | NC
+  13   | NC       | NC
+  14   | NC       | NC
+  15   | NC       | NC
+  16   | NC       | NC
+  17   | Y3       | Output
+  18   | Y2       | Output
+  19   | Y1       | Output
+  20   | VCC      | VCC
+
--- /dev/null
+++ b/examples/Tristate.pld
@@ -1,0 +1,24 @@
+GAL16V8                ; this is the second example
+Exa.2
+
+A  B  C  D  E  F  G  NC NC GND
+NC NC NC NC NC NC Y3 Y2 Y1 VCC
+
+
+Y1.T = B
+
+Y2.T = C + D
+
+Y3.T = /G
+
+
+Y1.E = /A
+
+Y3.E = E * F
+
+
+DESCRIPTION
+
+ tristate output:  pinname.T
+ tristate control: pinname.E
+
--- /dev/null
+++ b/galer/asmerr.html
@@ -1,0 +1,271 @@
+<html>
+<head>
+  <title>Error Messages</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="errors.html"><img src="prev.gif" alt="PREV" border=0></a><a href="jedecerr.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.5.1 Assembler</u>
+
+&quot;Line  1: type of GAL expected&quot;
+   The first line of your source file must define for what type of GAL
+   this source file is. So the first line must contain one of the
+   following keywords: GAL16V8, GAL20V8, GAL16V8A, GAL20V8A
+
+
+&quot;unexpected end of file&quot;
+   Normaly this error occurs when there is no DESCRIPTION keyword
+   at the end of your Boolean equations.
+
+
+&quot;pin name expected after '/'&quot;
+   A '/' must be followed by a pin name. If there is a '/' but no pin name
+   this error will occur.
+
+
+&quot;max. length of pin name is 8 characters&quot;
+   Pin names are not allowed to be longer than 8 characters.
+
+
+&quot;illegal character in pin declaration&quot;
+   In a pin name is a character which is not allowed to use. Possible
+   characters are: a..z, A..Z, 0..9, /
+
+
+&quot;illegal VCC/GND assignment&quot;
+   VCC and GND are keywords. It's not allowed to use these words for
+   other pins. Use it only for the pins VCC and GND.
+
+
+&quot;pn declaration: expected VCC at VCC pin&quot;
+   The pin VCC must have the name VCC.
+
+
+&quot;pin declaration: expected GND at GND pin&quot;
+   The pin GND must have the name GND.
+
+
+&quot;pin name defined twice&quot;
+   In the pin declaration a pin name is used multiple.
+
+
+&quot;illegal use of '/'&quot;
+   Negations ('/') must be followed by a pin name. 
+
+
+&quot;unknown pin name&quot;
+   Within a Boolean equation is a undefined pin name.
+
+
+&quot;NC (Not Connected) is not allowed in logic equations&quot;
+   NC is a keyword for unused pins. So don't use this in your
+   Boolean equations.
+
+
+&quot;unknown suffix found&quot;
+   A '.' must be followed by a T, E, R, CLK, ARST or APRST. This defines
+
+
+&quot;'=' expected&quot;
+   A '=' is expected but not found (what else should I say).
+
+
+&quot;this pin can't be used as output&quot;
+   You have tried to define a pin as output which can't be used as output.
+
+
+&quot;same pin is defined multible as output&quot;
+   It's easier to show an example:
+     X = ...
+     X = ...
+   This brings up this error message.
+
+
+&quot;before using .E, the output must be defined&quot;
+   You have defined a Boolean equation for tristate enable but there
+   was no Boolean equation for the trisate output.
+   The order must be:
+     name.T = ...
+     name.E = ...
+
+   Possibly you have done:
+     name.E = ...
+     name.T = ...
+   this is wrong!
+
+
+&quot;GAL22V10: AR and SP is not allowed as pinname&quot;
+   When using a GAL22V10 AR and SP are keywords for the asynchronous reset
+   and synchronous preset. So AR and SP is not allowed to be used as pin
+   names.
+
+
+&quot;.E, .CLK, .ARST and .APRST is not allowed to be negated&quot;
+   The definitions for tristate control,... can't be negated.
+
+
+&quot;mode 2: pins 12, 19 can't be used as input&quot;
+   The GAL would be in mode 2. In this mode you can't define the pins
+   12 and 19 as input pins. These pins do not have a feedback too. This
+   means that the following equation is not allowed.
+
+     a := pin 19
+     b := pin 4
+     y := pin 17
+
+     a = b              a is output, b is input
+     y = a * b          y is output
+                        a is used as input, this is not allowed in mode 2
+                        because there is on feedback
+
+&quot;mode 2: pins 15, 22 can't be used as input&quot;
+   The GAL would be in mode 2. In this mode you can't define the pins
+   15 and 22 as input pins. These pins do not have a feedback too. This
+   means that the following eqauation is not allowed.
+
+     a := pin 22
+     b := pin 4
+     y := pin 17
+
+     a = b              a is output, b is input
+     y = a * b          y is output
+                        a is used as input, this is not allowed in mode 2
+
+
+&quot;tristate control is defined twice&quot;
+   Example:    name.E = A * B
+               name.E = C
+   this is not allowed!
+
+
+&quot;GAL16V8/20V8: tri. control for reg. output is not allowed&quot;
+   When using a GAL16V8/20V8 it is not possible to define a tristate
+   control for registered outputs.
+
+
+&quot;tristate control without previous '.T'&quot;
+   There is a tristate control for a combinational output.
+   wrong:       name   = ...
+                name.E = ...
+
+   right:       name.T = ...
+                name.E = ...
+
+
+&quot;use GND, VCC instead of /VCC, /GND&quot;
+   I think there is nothing to explain.
+
+
+&quot;mode 3: pins 1,11 are reservated for 'Clock' and '/OE'&quot;
+   Using register outputs causes mode 3 for the GAL. In this mode the
+   pins 1 and 11 of a GAL16V8 can't be used by your own. These pins are
+   reserved for Clock and /OE.
+
+
+&quot;mode 3: pins 1,13 are reservated for 'Clock' and '/OE'&quot;
+   Using register outputs causes mode 3 for the GAL. In this mode the
+   pins 1 and 13 of a GAL20V8 can't be used by your own. These pins are
+   reserved for Clock and /OE.
+
+
+&quot;use of VCC and GND is not allowed in equations&quot;
+   Expressions like  &quot;X = A * VCC&quot; are not allowed (and not necassary).
+
+
+&quot;tristate control: only one product term allowed (no OR)&quot;
+   In Boolean equations for tristate controls only one product
+   term can be used. This means no ORs in your name.E=... equation.
+
+
+&quot;too many product terms&quot;
+   In this definition are too many product terms.
+
+
+&quot;use of AR and SP is not allowed in equations&quot;
+   AR and SP are keywords which can't be used in output definitions.
+
+
+&quot;negation of AR and SP is not allowed&quot;
+   AR and SP definitions can't be negated.
+
+
+&quot;no equations found&quot;
+   Sorry, but there are no Boolean equations in your source file. So GALer
+   does not know what to do with your source file.
+
+
+&quot;.CLK is not allowed when this type of GAL is used&quot;
+   A clock definition is only allowed when a GAL20RA10 is used.
+
+
+&quot;.ARST is not allowed when this type of GAL is used&quot;
+   A .ARST definition is only allowed when a GAL20RA10 is used.
+   
+
+.APRST is not allowed when this type of GAL is used
+   A .ARPST definition is only allowed when a GAL20RA10 is used.
+
+
+&quot;GAL20RA10: pin 1 can't be used in equations&quot;
+   Pin 1 of the GAL20RA10 is reserved for the preloading /PL.
+
+
+&quot;GAL20RA10: pin 13 can't be used in equations&quot;
+   Pin 13 of the GAL20RA10 is reserved for the output enable /OE.
+
+
+&quot;AR, SP: no suffix allowed&quot;
+   It's not allowed to add a suffix to AR, SP definitions.
+
+
+&quot;AR or SP is defined twice&quot;
+   A AR or SP definition is defined twice.
+
+
+&quot;missing clock definition (.CLK) of registered output&quot;
+   When using a GAL20RA10 all registered outputs must get a clock
+   definition.
+
+
+&quot;before using .CLK, the output must be defined&quot;
+   At first you have to define the registered output by using .R before
+   you can define the clock for this output.
+
+
+&quot;before using .ARST, the output must be defined&quot;
+   At first you have to define the registered output by using .R before
+   you can define the asynchronous reset.
+
+
+&quot;before using .APRST the output must be defined&quot;
+   At first you have to define the registered output by using .R before
+   you can define the asynchronous preset.
+
+
+&quot;several .CLK definitions for the same output found&quot;
+   You have defined more than one clock definition for the same output.
+
+
+&quot;several .ARST definitions for the same output found&quot;
+   You have defined more than one asynchronous reset definition for the
+   same output.
+
+
+&quot;several .APRST definitions for the same output found&quot;
+   You have defined more than one asynchronous preset definition for the
+   same output.
+
+
+&quot;use of .CLK, .ARST, .APRST only allowed for registered outputs&quot;
+   Well, use of .CLK, .ARST and .APRST is only allowed for registered
+   outputs :-)
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="errors.html"><img src="prev.gif" alt="PREV" border=0></a><a href="jedecerr.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/assembler.html
@@ -1,0 +1,66 @@
+<html>
+<head>
+  <title>Assembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menhelp.html"><img src="prev.gif" alt="PREV" border=0></a><a href="program.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.2.4 Assembler</u>
+
+In order to program a GAL the <a href="sourcefile.html">source file</a> (&quot;.pld&quot;) must be transposed into a
+so called <a href="jedecfile.html">JEDEC file</a>. This task is assumed by the GAL-Assembler.
+
+The JEDEC file (extension &quot;.jed&quot;) is a ASCII file in which all the bits which
+can be set in a GAL are listed. The state of the fuses (0 or 1) is mediated by
+the GAL-Assembler from the source file.
+
+Besides the JEDEC file, the GAL-Assembler can generate three other files.
+These files are for documentation only. GALer do not need them really:
+
+- The Fuse-File (extension &quot;.fus&quot;) shows the state of the bits in the
+logic matrix.
+
+- The chip diagram (extension &quot;.chp&quot;) shows the connection
+diagram of the GAL and the
+
+- pin diagram file (extension &quot;.pin&quot;) lists all the pins and shows,
+whether these are programmed as inputs or outputs.
+
+The files can be read with a text-editor and possibly post-processed.
+
+
+Selecting the menu <a href="menasm.html">Assemble file</a> pops up a requester, called
+assembler requester. In the assembler requester you can select which
+files should be generated by the assembler. Just click on the corresponding
+gadget.
+
+Furthermore you can select two other gadgets:
+
+  Autosave: This means that all selected files are generated
+            automatically without bringing up an extra file requester.
+            The name of the generated files are taken from the
+            source file name.
+
+  Adjust type of GAL: This means that the type of GAL for which the
+            source file is, is taken over from GALer.
+            For example: You have set a GAL20V8 in GALer's menu.
+            Now you are assembling a source file for a GAL16V8. If the
+            assembly is successful, GAL16V8 will be set in GALer's menu.
+
+
+
+Selecting the 'Continue' gadget of the assembler requester will pop up a
+file requester. Now you have to choose your source file. After this the
+GAL assembler will start assembling. If GALer detects no errors, further
+file requesters will pop up in which you have to select where to store
+the generated files.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menhelp.html"><img src="prev.gif" alt="PREV" border=0></a><a href="program.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/construction.html
@@ -1,0 +1,97 @@
+<html>
+<head>
+  <title>Construction</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="schaltbesch.html"><img src="prev.gif" alt="PREV" border=0></a><a href="keywords.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>III.3 Construction</u>
+
+The parts list can be found in the appendix. If you want to save the cost
+of the Textool-socket, you can also use a normal 24 pin socket, but since the
+two pin rows are too far apart, you will have to carefully cut the socket
+along it's length, and set them to the correct distance. Or you might like
+to use &quot;MOLEX&quot; pins instead. For IC-sockets you should only use precision
+sockets. The 25 Pin Sub-D-socket (A1000) or the Sub-D-plug (other Amiga
+models) is connected as follows:
+
+  D0   = pin 2
+  D1   = pin 3
+  D2   = pin 4
+  D3   = pin 5
+  D4   = pin 6
+  BUSY = pin 11
+  GND  : A1000  pin 14
+         A500, A2000, A3000, ...  pin 17
+
+The supply voltage (+5V and ground (GND) you will have to get from the
+Amiga's Expansion-Port or from a regulated +5V power supply. The GAL-Burner
+has a maximum current consumption of about 220 mA.
+
+The main difficulty in the construction of the GAL-burner is probably the
+printed circuit board (PCB). Most likely a double sided through plated PCB
+is required, so probably the best solution is to use a piece of veroboard,
+and connect the relevant pins with fine hookup wire, or wire wrap wire. If
+you want the whole thing to look impressive, you can use wiring guides.
+The wires can be conducted via these guides, and wont go here there an
+everywhere.  I have constructed my GAL-Burner and endless other projects
+in this way.
+
+If you are able to make a PCB, you can find the PostScript- or
+Gerber-Files in the directory &quot;Layout&quot;. This PCB-layout is copyright by
+Thorsten Elle. Thank you Thorsten for giving me the permission to
+distribute your layout together with GALer.
+If you want to use the PCB-layout, please not this:
+On the PCB the resistors R28 to R32 of the circuit diagram are replaced
+by a resistor-array (8 * 1.8kOhm). Futhermore there is for each IC a
+capacitor for anti-interferencing. These capacitors are C5 to C14 (each 100nF).
+
+When you have built the circuit and you have connected it to the Amiga,
+and the Amiga DIDN'T blow up, you can run the test program &quot;GALerTest&quot;.
+The program set various voltage levels on the Textool-socket, which you
+can check with a VOM. The programming voltages are adjusted with R40-R44.
+For this you can use &quot;GALerTest&quot;.
+
+DON'T FORGET: adjust the programming voltage with the trimpots, otherwise
+              the GAL-burner will NOT FUNCTION !!!!
+              (start the &quot;GALerTest&quot; and click through to the
+               relevant test points).
+
+If the GAL-Burner works just as the test program demands, then you can try
+burning a test GAL and test it with the GAL-Checker function of GALer. If
+this all works then there are no faults in the hardware. GALs of the type
+GAL16V8 must be inserted in the Textool-socket, so that pin 1 of the GAL
+lines up with pin 3 of the socket. With GALs of the type GAL20V8 pin 1 of
+the GAL must line up with pin 1 of the socket.
+
+
+Here is the pin layout of the used transistors (bottom view):
+
+
+                       BC 237 and BC 327
+                               _
+                             -   -
+                            -     -
+                            -o o o-
+                             -----
+
+                             E B C
+
+
+
+
+
+Well that's about it. Chau and have fun with the cute GALs.
+
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="schaltbesch.html"><img src="prev.gif" alt="PREV" border=0></a><a href="keywords.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/errors.html
@@ -1,0 +1,21 @@
+<html>
+<head>
+  <title>Error Messages</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="example20ra10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="asmerr.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.5 Error Messages</u>
+
+In this section I want to describe all possible error messages which
+GALer can create.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="example20ra10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="asmerr.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/example16v8.html
@@ -1,0 +1,176 @@
+<html>
+<head>
+  <title>GAL16V8</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="examples.html"><img src="prev.gif" alt="PREV" border=0></a><a href="example22v10.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.4.1 GAL16V8</u>
+
+At first I want to show an example with a tristate output.
+(sorry again for the European symbols)
+
+      /A ---------+
+                |\|
+                | \
+       B -------|  +------------------------ Y1
+                | /                
+                |/                 
+                                  VCC
+                                   |
+                +----+           |\|
+       C -------|    |           | \
+                | &#062;1 |-----------|  +------- Y2
+       D -------| =  |           | /
+                +----+           |/
+
+
+                +----+
+       E -------|    |
+                | &amp;  |------+
+       F -------|    |      |
+                +----+      |
+                          |\|
+                          | \
+       G -----------------|  +o------------- Y3
+                          | /
+                          |/
+
+
+
+Y1 should only be in the &quot;B&quot; state, when &quot;A&quot; = LOW. Y2 should always be
+active (either HIGH or LOW - depending on &quot;B&quot; and &quot;C&quot;). This corresponds
+to a combinational output. Y3 should only be active if &quot;D&quot; and &quot;E&quot; = HIGH.
+
+
+                     GAL16V8
+                    ---- ----
+                A  1|       |20  VCC
+                B  2|       |19  Y1
+                C  3|       |18  Y2
+                D  4|       |17  Y3
+                E  5|       |16  NC
+                F  6|       |15  NC
+                G  7|       |14  NC
+               NC  8|       |13  NC
+               NC  9|       |12  NC
+              GND 10|       |11  NC
+                    ---------
+
+In the source file, tristate outputs are designated with a &quot;.T&quot;. The
+tristate control is followed with an &quot;.E&quot;. If the tristate control
+is absent then the normal free switching is assumed (=VCC). Tristate
+control = GND means high impedance.
+
+NOTE: With tristate outputs you can only have seven product terms in
+your equation (all other output formats have a maximum of eight).
+In the tristate control you can only have ONE product term (no OR)
+in your equation.
+
+
+The source file looks like this:
+
+******************************************************
+GAL16V8
+ex.2
+
+A  B  C  D  E  F  G  NC NC GND
+NC NC NC NC NC NC Y3 Y2 Y1 VCC
+
+Y1.T = B
+
+Y2.T = C + D
+
+Y3.T = /G
+
+Y1.E = /A
+
+Y3.E = E * F
+
+
+DESCRIPTION
+******************************************************
+
+
+
+In the last GAL16V8-example we will deal with register outputs. We will
+program a 4-bit-counter.
+
+First the pin layout:
+
+
+                            GAL16V8
+
+                           ---- ----
+        (Input)    Clock  1|       |20  VCC
+        (Input)       D0  2|       |19  Q0              (Output)
+        (Input)       D1  3|       |18  Q1              (Output)
+        (Input)       D2  4|       |17  Q2              (Output)
+        (Input)       D3  5|       |16  Q3              (Output)
+        (Input)      Set  6|       |15  NC              (not used)
+        (Input)    Clear  7|       |14  NC              (not used)
+        (Input)       NC  8|       |13  NC              (not used)
+        (Input)       NC  9|       |12  NC              (not used)
+                     GND 10|       |11  /OE             (Input)
+                           ---------
+
+
+Since register output sets the GAL in mode 3, this means that pins 1
+and 11 are reserved for Clock and /OE. When /OE is HIGH, all register
+outputs (Q0-Q3) go to &quot;high impedance&quot; (=Z).
+
+When LOW-HIGH transition pulse is presented at the clock input, then
+the counter will be incremented.
+
+When Clear = HIGH and a (LOW-HIGH) clock transition occurs,
+the outputs are cleared.
+
+The inputs D0-D3 can be used to preset the counter. While Set = HIGH
+and a Clock pulse the values in D0-D3 are transferred to Q0-Q3.
+
+
+In the source file register outputs are designated with a &quot;.R&quot;.
+
+******************************************************
+GAL16V8                 4-Bit-Counter
+Counter
+
+
+Clock D0    D1    D2    D3    Set   Clear NC    NC   GND
+/OE   NC    NC    NC    NC    Q3    Q2    Q1    Q0   VCC
+
+
+
+Q0.R =   /Clear *  Set *  D0
+       + /Clear * /Set * /Q0
+
+Q1.R =   /Clear *  Set *  D1
+       + /Clear * /Set * /Q1 *  Q0
+       + /Clear * /Set *  Q1 * /Q0
+
+Q2.R =   /Clear *  Set *  D2
+       + /Clear * /Set *  Q2 * /Q1
+       + /Clear * /Set *  Q2 * /Q0
+       + /Clear * /Set * /Q2 *  Q1 *  Q0
+
+Q3.R =   /Clear *  Set *  D3
+       + /Clear * /Set *  Q3 * /Q2
+       + /Clear * /Set *  Q3 * /Q1
+       + /Clear * /Set *  Q3 * /Q0
+       + /Clear * /Set * /Q3 *  Q2 *  Q1 *  Q0
+
+
+DESCRIPTION
+******************************************************
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="examples.html"><img src="prev.gif" alt="PREV" border=0></a><a href="example22v10.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/example20ra10.html
@@ -1,0 +1,135 @@
+<html>
+<head>
+  <title>GAL20RA10</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="example22v10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="errors.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.4.3 GAL20RA10</u>
+
+The next example can be realized only with a GAL20RA10. The reason for this
+is that each register output needs it's own clock input and tristate
+control. But GAL16V8, GAL20V8 and GAL22V10 offers just one clock input
+for all registers and GAL16V8 and GAL20V8 offers just one tristate enable
+for all registers.
+
+
+ Enable1 ----------------------------------+
+                  +----+                   |
+ ResetA1 ---------|    |                   |
+                  | &amp;  |-------+           |
+ ResetB1 ---------|    |       |         |\|
+                  +----+    +-----+      | \
+  Clock1 -------------------|&#062; R Q|------|  +------- Y1
+                            |     |      | /   
+      D1 ---o---------------|D S  |      |/   
+            |               +-----+
+            |                  |
+     Set ---+--o---------------+
+            |  |  +----+
+            |  +--|    |
+            |     | &#062;1 |---------------------------- Y2
+            o-----| =  |
+            |     +----+                 |\
+            |               +-----+      | \
+  Clock2 ---+---------------|&#062;   Q|------|  +o------ Y3
+            |               |     |      | /   
+      D2 ---+--o------------|D    |      |/|   
+            |  |            +-----+        |
+ Enable2 ---+--+---------------------------o
+            |  |                           |
+            |  |                           |
+            |  |  +----+                 |\o
+            |  +--|    |                 | \
+            |     | &amp;  |o----------------|  +------- Y4
+            +-----|    |                 | /
+                  +----+                 |/
+
+
+
+Don't think about what the function of this circuit is - there is non again.
+It is just an example again.
+
+This is one of many possible pin designations:
+
+                           GAL20RA10
+
+                           ---- ----
+                     /PL  1|       |24  +5V
+                     Set  2|       |23  Y1
+                 Enable1  3|       |22  Y2
+                 Enable2  4|       |21  Y3
+                  Clock1  5|       |20  Y4
+                  Clock2  6|       |19  D1
+                      NC  7|       |18  D2
+                      NC  8|       |17  ResetA1
+                      NC  9|       |16  ResetB1
+                      NC 10|       |15  NC
+                      NC 11|       |14  NC
+                    GND  12|       |13  /OE
+                           ---------
+
+
+Pin 1 and 13 are reserved for /PL (preload) and /OE (output enable), they
+can't be used for your own. Since Y1 to Y4 are outputs they must be at OLMC
+pins.
+
+When using a GAL20RA10 the GAL assembler provides three additonal suffixes:
+.CLK, .ARST and .APRST.
+
+.CLK defines the clock signal for the corresponding register output.
+You have to define such a clock signal for EACH register output!
+
+.ARST (asynchronous reset) and .APRST (asynchronous preset) are
+optinal, you need not to define them for each register output.
+
+For .CLK, .ARST and .APRST is only one product term allowed. For the
+definition of the output function are four product terms allowed.
+
+Please keep this in mind: when both is true the asynchnonous reset and
+the synchronous preset the register is swichted off and the output becomes
+to a &quot;normal&quot; tristate output (see section <a href="gal20ra10.html">The GAL20RA10</a>).
+So the type of the output can be changed &quot;on the fly&quot;.
+
+
+This is source file for this example:
+
+******************************************************
+GAL20RA10
+20RA10
+
+/PL Set Enable1 Enable2 Clock1  Clock2 NC NC NC NC NC GND
+/OE NC  NC      ResetB1 ResetA1 D2     D1 Y4 Y3 Y2 Y1 VCC
+
+
+Y1.R     =  D1                          ; define register output
+Y1.E     =  Enable1                     ; define tristate control
+Y1.CLK   =  Clock1                      ; define clock for the register
+Y1.ARST  =  ResetA1 * ResetB1           ; define async. reset
+Y1.APRST =  Set                         ; define async. preset
+
+Y2  =  Set + D1                         ; Y2 is a &quot;normal&quot; output
+
+/Y3.R  =  D2                            ; Y3 is active low and a reg. output
+Y3.E   =  Enable2
+Y3.CLK =  Clock2
+
+Y4.T   =  /D1 + /D2                     ; Y4 is a tristate output
+Y4.E   =  /Enable2
+
+
+DESCRIPTION
+******************************************************
+
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="example22v10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="errors.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/example22v10.html
@@ -1,0 +1,135 @@
+<html>
+<head>
+  <title>GAL22V10</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="example16v8.html"><img src="prev.gif" alt="PREV" border=0></a><a href="example20ra10.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.4.2 GAL22V10 </u>
+
+The next circuit can't be realized with a GAL16V8 or GAL20V8. The reason
+for this is that there are different tristate controls for the register
+outputs. A GAL16V8 and GAL20V8 has only one tristate control for all
+register outputs, this is the /OE (output enable) pin in mode 3.
+
+
+ Enable1 ---------------------------------+
+                                          |
+                                        |\|
+                            +----+      | \
+   Clock ---o---------------|&#062;  Q|------|  +------- Y1
+            |  +----+       |    |      | /
+       A ---+--|    |   +---|D   |      |/
+            |  | &amp;  |---+   +----+
+       B ---+--|    |          
+            |  +----+                   |\
+            |               +----+      | \
+            +---------------|&#062;  Q|------|  +------- Y2
+                            |    |      | /   
+       C -------------------|D   |      |/|   
+                            +----+        |   
+                                          |
+                            +----+        |
+ Enable2 -------------------|    |        |
+                            | &amp;  |--------o-------- Y3
+                        +---|    |
+                        |   +----+
+             +----+     |
+       D ----|    |     |
+             |    |     |
+       E ----| &#062;1 |-----o-------------------------- Y4
+             | =  |      
+       F ----|    |      
+             +----+
+
+
+     Futhermore all register outputs should be reseted asynchronously
+     when the inputs F and AsyncRe are high and they should be preseted
+     synchronously when the input SyncPre is high.
+     (To keep the circuit diagram as simple as possible the inputs
+     AsyncRe and SyncPre are not drawn in it.)
+
+
+Don't think about what the function of this circuit is - there is non.
+It is just an example.
+
+Well, and this is one of many possible pin designations:
+
+                           GAL22V10
+
+                           ---- ----
+                   Clock  1|       |24  +5V
+                       A  2|       |23  Y1
+                       B  3|       |22  Y2
+                       C  4|       |21  Y3
+                       D  5|       |20  Y4
+                       E  6|       |19  Enable1
+                       F  7|       |18  Enable2
+                      NC  8|       |17  NC
+                      NC  9|       |16  NC
+                      NC 10|       |15  NC
+                      NC 11|       |14  AsyncRe
+                    GND  12|       |13  SyncPre
+                           ---------
+
+The only thing which you have to keep in mind here is that the clock
+signal for the register outputs must be at pin 1 and that the outputs
+must be at OLMC pins (pin 14-23).
+
+To define the asynchronous reset and the synchronous preset for the register
+outputs the GAL assembler offers you the keywords AR (asynchronous reset) and
+SP (synchronous preset). Since AR and SP are keywords it is not allowed to
+use them as pin names when a GAL22V10 is used.
+
+
+The source file of this example looks like this:
+
+******************************************************
+GAL22V10
+22V10
+
+Clock   A       B  C  D  E       F       NC NC NC NC GND
+SyncPre AsyncRe NC NC NC Enable2 Enable1 Y4 Y3 Y2 Y1 VCC
+
+
+Y1.R  = A * B                   ; Y1 is a registered output =&#062; .R
+Y1.E  = Enable1
+
+Y2.R  = C
+Y2.E  = Enable2 * Y4            ; Attention: there is a feedback of Y4
+                                ; (Y4 is defined as output but it's
+                                ; used as input again)
+
+Y3    = Enable2 * Y4            ; there is a feedback again
+
+Y4    = D + E + F
+
+
+AR    = F * AsyncRe             ; define asynchronous reset
+
+SP    = SyncPre                 ; define synchronous preset
+
+
+DESCRIPTION
+******************************************************
+
+Instead of Y3 = Enable2 * Y4 you could also write:
+
+  Y3 = Enable2*D + Enable2*E + Enable2*F.
+
+But using a feedback is much more comfortable than using this long
+equation. Another reason for using a feedback is for example the
+tristate control of Y2. In tristate controls there is just one
+product term allowed, this means no ORs.
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="example16v8.html"><img src="prev.gif" alt="PREV" border=0></a><a href="example20ra10.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/examples.html
@@ -1,0 +1,22 @@
+<html>
+<head>
+  <title>Examples</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="jedecfile.html"><img src="prev.gif" alt="PREV" border=0></a><a href="example16v8.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.4 Examples</u>
+
+In the next few sections I will show you some examples about GALs, the source
+file format etc.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="jedecfile.html"><img src="prev.gif" alt="PREV" border=0></a><a href="example16v8.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/gal16_20v8.html
@@ -1,0 +1,237 @@
+<html>
+<head>
+  <title>The GAL16V8 and GAL20V8</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="intstruktur.html"><img src="prev.gif" alt="PREV" border=0></a><a href="gal22v10.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>I.2.1 The GAL16V8 and GAL20V8</u>
+
+There are several types of GAL16V8 and GAL20V8 GALs, the standard-, A- and
+B-type GAL16V8, GAL20V8. The A- and B-type GALs needs less power and are
+faster. But since there is no greate difference between them I will only
+talk about the standard GALs GAL16V8 and GAL20V8. When there are any
+differences between A-, B- and standard-GALs I will mention this extra.
+
+At first the pin designations:
+
+                          GAL16V8
+                         ---- ----
+        Input or Clock  1|       |20  +5V
+                Input   2|       |19  Configurable Output Cell
+                Input   3|       |18  Configurable Output Cell
+                Input   4|       |17  Configurable Output Cell
+                Input   6|       |15  Configurable Output Cell
+                Input   7|       |14  Configurable Output Cell    
+                Input   8|       |13  Configurable Output Cell
+                Input   9|       |12  Configurable Output Cell
+                  GND  10|       |11  Input or /OE
+                         ---------
+
+
+                          GAL20V8
+                         ---- ----
+        Input or Clock  1|       |24  +5V
+                Input   2|       |23  Input
+                Input   3|       |22  Configurable Output Cell
+                Input   4|       |21  Configurable Output Cell
+                Input   5|       |20  Configurable Output Cell
+                Input   6|       |19  Configurable Output Cell
+                Input   7|       |18  Configurable Output Cell
+                Input   8|       |17  Configurable Output Cell
+                Input   9|       |16  Configurable Output Cell
+                Input  10|       |15  Configurable Output Cell
+                Input  11|       |14  Input
+                GND    12|       |13  Input or /OE
+                         ---------
+
+
+From the pin designations you can see that the only difference between the
+GAL16V8 and GAL20V8 is the number of inputs. The choice of GAL then, is
+dependant solely on the number of required inputs.
+
+
+The essential part of every GAL is a logic-matrix. The input pins of the
+GAL are connected both inverted and uninverted to the columns of this matrix.
+If the GAL hasn't been programmed the rows and columns are connected to
+each other. Every connection between a row and a column represents an
+AND gate. If the GAL is programmed the particular connections are erased
+so that the wanted logic is programmed. A row is called a product term,
+because every column (input) that is still connected to a row represents
+an AND gate.
+
+Eight of these rows (product terms) of a GAL16V8 or GAL20V8 are connected
+with the so called OLMC (Output Logic Macro Cell). In this OLMC the
+product terms are ORed together. The OLMC is a &quot;configurable output cell&quot;.
+
+
+What is a &quot;Configurable Output Cell&quot;?
+
+A GAL16V8 or GAL20V8 contains eight of these configurable output cells. These
+output cells may be configured as input, combinational output, tristate output,
+or register output.
+
+Combinational Output:   This output can be HIGH or LOW.
+
+Tristate Output:        This output can take one of three states:
+                        HIGH, LOW, and HIGH IMPEDANCE
+                        This is used if you want to tie two outputs together,
+                        but only one may be active.
+
+Register Output:        With this output the result of an equation is not
+                        directly coupled to the output, but connected via
+                        a D-FlipFlop. Only on receipt of a clock pulse, is
+                        the signal passed to the output. When /OE is HIGH,
+                        then the output goes HIGH-IMPEDANCE.
+
+
+Besides the matrix, a GAL16V8, GAL20V8 contains extra bits:
+( (n) means that these bits are available for each output).
+
+XOR (n) : The result of the digital connection can be negated with this bit.
+        XOR (n) = 0 : Output is active LOW
+        XOR (n) = 1 : Output is active HIGH
+
+
+SYN, AC0, AC1(n):
+    These bits determine in which mode the GAL works. Mode means, which type
+    of outputs are used (register, tristate,...). There are three main
+    operating modes in which the GAL works:
+
+  Mode 1:  SYN = 1, AC0 = 0
+        AC1(n) = 1 : OLMC as input
+        AC1(n) = 0 : OLMC as combinational output
+
+  Mode 2:  SYN = 1, AC0 = 1
+        AC1(n) = 1 : tristate output
+
+  Mode 3:  SYN = 0, AC0 = 1
+        AC1(n) = 1 : OLMC as tristate output
+        AC1(n) = 0 : OLMC as register output
+
+
+PT0...63: (PT = product term)
+      These bits indicate whether the rows (product terms) 0...63 in the
+      GAL's matrix are valid or not.
+      PTx = 1: AND-junction in the row x is valid.
+      PTx = 0: AND-junction in the row x is not used (have no effect) on
+               the output.
+      (x = between 0 and 63; there are 64 rows in the matrix,
+       so that each row can be individually activated or deactivated)
+
+All these bits (82 bits) are tied together via the so called Architecture-
+Control-Word (ACW). The ACW is described in chapter III.
+
+
+Signature:
+    Here are eight bytes for your own use. Normally a short comment or
+    a version number of the GAL is placed here.
+
+
+Security fuse: (Security-Bit)
+   By setting this bit the GAL can be protected from unauthorized copying.
+   The reading of the logic matrix is no longer possible. Since the rest of
+   the bits can still be read this protection is not very effective.
+
+
+Bulk Erase:
+    By programming this row the whole GAL is erased. Now it is possible to
+    program the GAL again. A GAL can be reprogrammed about 100 times.
+
+
+
+
+<u>The Operation Modes of a GAL16V8 and GAL20V8</u>
+
+As already explained the SYN, AC0 and AC1(n) bits determine the mode
+of the GAL. The pin designations of the GAL are determined by this mode.
+
+
+GAL16V8:
+
+
+  Mode 1 |  Mode 2  |  Mode 3                 Mode 1  | Mode 2  | Mode 3
+  ---------------------------                 --------------------------
+         |          |            --- ---              |         |
+  In     |    In    |  Clock    1|     |20    +5V     |   +5V   |   +5V
+  In     |    In    |    In     2|     |19    In/C    |   T*    |  In/T/R  
+  In     |    In    |    In     3|     |18    In/C    |   In/T  |  In/T/R
+  In     |    In    |    In     4|     |17    In/C    |   In/T  |  In/T/R
+  In     |    In    |    In     5|     |16     C      |   I/T   |  In/T/R
+  In     |    In    |    In     6|     |15     C      |   In/T  |  In/T/R
+  In     |    In    |    In     7|     |14    In/C    |   In/T  |  In/T/R
+  In     |    In    |    In     8|     |13    In/C    |   In/T  |  In/T/R
+  In     |    In    |    In     9|     |12    In/C    |   T*    |  In/T/R
+  GND    |   GND    |   GND    10|     |11     In     |   In    |   /OE
+                                 -------
+
+
+
+GAL20V8:
+
+  Mode 1 |  Mode 2  |  Mode 3                 Mode 1  | Mode 2  | Mode 3
+  ---------------------------                 --------------------------
+         |          |            --- ---              |         |
+  In     |    In    |  Clock    1|      |24    +5V    |   +5V   |   +5V
+  In     |    In    |    In     2|      |23        In     |    In   |    In  
+  In     |    In    |    In     3|      |22    In/C   |   T*    |  In/T/R
+  In     |    In    |    In     4|      |21    In/C   |   In/T  |  In/T/R
+  In     |    In    |    In     5|      |20    In/C   |   In/T  |  In/T/R
+  In     |    In    |    In     6|      |19     C     |   In/T  |  In/T/R
+  In     |    In    |    In     7|      |18     C     |   In/T  |  In/T/R
+  In     |    In    |    In     8|      |17    In/C   |   In/T  |  In/T/R
+  In     |    In    |    In     9|      |16    In/C   |   In/T  |  In/T/R
+  In     |    In    |    In    10|      |15    In/C   |   T*    |  In/T/R
+  In     |    In    |    In    11|      |14     In    |    In   |    In
+  GND    |   GND    |   GND    12|      |13     In    |    In   |   /OE
+                                 -------
+
+Abbreviations:
+
+        In  :  input
+
+        C   :  combinational output without feedback
+
+        T   :  tristate-output
+
+        T*  :  tristate-output without freedback to the matrix, which means
+               that this output cannot be configured as input
+
+        R   :  register-output
+
+      Clock :  pulse for D-FlipFlops; only affects those pins which are
+               configured as register-output
+
+      /OE   :  output enable (low active): activate the register-outputs
+              (see I.2)
+
+
+From the pin designations you can see that pins 15 and 16 of the GAL16V8
+and pins 18 and 19 of GAL20V8 cannot be programmed as inputs when the GAL is
+in mode 1. The same hold true for pins 12 and 19 and 15 and 22 for mode 2.
+In mode 1, pins 1 and 11 (GAL16V8) and pins 1 and 13 (GAL20V8) are reserved 
+for Clock and /OE. These pins therefore cannot be used as inputs.
+
+As I told, eight of the rows (product terms) of a GAL16V8 or GAL20V8 are
+connected via an OR gate to the OLMC. This means that you can use eight
+product terms to define your output. But when using a tristate output, one
+row of these eight rows is needed for the tristate control. So you use
+only seven product terms for tristate output definitions.
+
+
+Here some sentences to the mode, which should make it easier to you to
+understand what mode is used:
+If you need at least one register output in your GAL, then mode 3 is used.
+When you need at least one tristate output and no register output, then the
+GAL will be in mode 2. When you need neither a tristate nor a register
+output, mode 1 is used.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="intstruktur.html"><img src="prev.gif" alt="PREV" border=0></a><a href="gal22v10.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/gal20ra10.html
@@ -1,0 +1,72 @@
+<html>
+<head>
+  <title>The GAL20RA10</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="gal22v10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="software.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>I.2.3 The GAL20RA10</u>
+
+The next and last GAL which I want to indroduce is the GAL20RA10. This
+is also a second generation GAL, but this one is a special one. It is
+not as universal as a GAL16V8, GAL20V8 or GAL22V10.
+
+
+Here the pin designations:
+
+                         GAL20RA10
+                         ---- ----
+                  /PL   1|       |24  +5V
+                Input   2|       |23  Configurable Output Cell
+                Input   3|       |22  Configurable Output Cell
+                Input   4|       |21  Configurable Output Cell
+                Input   5|       |20  Configurable Output Cell
+                Input   6|       |19  Configurable Output Cell
+                Input   7|       |18  Configurable Output Cell
+                Input   8|       |17  Configurable Output Cell
+                Input   9|       |16  Configurable Output Cell
+                Input  10|       |15  Configurable Output Cell
+                Input  11|       |14  Configurable Output Cell
+                GND    12|       |13  /OE
+                         ---------
+
+
+The GAL20RA10 provides ten OLMCs. To each OLMC eight rows of the logic
+matrix are connected. One row (product term) is needed for tristate
+control again. Furthermore there are three product terms needed for
+fully asynchronous control of the register set, reset and clock functions.
+This means that there are four product terms left for the output definition.
+The output enable product term is AND'ed with the input from pin 13 (/OE).
+This allowes either a hard wired external control or a product term control,
+or a combination of both.
+
+Each OLMC has just one bit which can be programmed, the S0-bit (=XOR). This
+bit is for the active polarity control. This means that there is no other
+bit to define whether an output should be a registered or a tristated one.
+But there is no bit needed to do this: if both is true the product term
+of asynchronous reset and the product term of asynchronous preset, then the
+register is switched off and the output becomes a &quot;normal&quot; tristate
+output.
+
+By use of pin 1, /PL (preload), all registered outputs can be preloaded.
+This enhances the functional testability of the programmed GAL.
+To preload a register do the following:
+
+   1. supply a high to /PL and to /OE (so the registered outputs
+      become high impedance outputs)
+
+   2. impress the desired state on the register output pin
+
+   3. pulse low /PL for at least 35ns
+
+After this the registers will be loaded.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="gal22v10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="software.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/gal22v10.html
@@ -1,0 +1,97 @@
+<html>
+<head>
+  <title>The GAL22V10</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="gal16_20v8.html"><img src="prev.gif" alt="PREV" border=0></a><a href="gal20ra10.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>I.2.2 The GAL22V10</u>
+
+The GAL22V10 is the successor of the GAL16V8 and GAL20V8. This second
+generation of GALs are much more flexible and better to program.
+
+At first the pin designations:
+
+                          GAL22V10
+                         ---- ----
+      Clock and Input   1|       |24  +5V
+                Input   2|       |23  Configurable Output Cell
+                Input   3|       |22  Configurable Output Cell
+                Input   4|       |21  Configurable Output Cell
+                Input   5|       |20  Configurable Output Cell
+                Input   6|       |19  Configurable Output Cell
+                Input   7|       |18  Configurable Output Cell
+                Input   8|       |17  Configurable Output Cell
+                Input   9|       |16  Configurable Output Cell
+                Input  10|       |15  Configurable Output Cell
+                Input  11|       |14  Configurable Output Cell
+                GND    12|       |13  Input
+                         ---------
+
+The GAL22V10 has ten OLMCs, whereas the GAL16V8 and GAL20V8 has &quot;only&quot;
+eight of them. GAL22V10's OLMCs are not as complex (and complicated
+to understand) as the OLMCs of the 16V8 and 20V8 GALs. But nevertheless
+there are less restrictions.
+
+For each OLMC of a GAL22V10 are just two bits which can be programmed,
+the S0- and S1-bit. The S0-bit does the same as the XOR-bit of the
+GAL16V8 and GAL20V8. It determines whether an output is active high or
+active low.
+Just for remembrance:
+        XOR (S0) = 0 : Output is active LOW
+        XOR (S0) = 1 : Output is active HIGH
+
+The S1-bit does the same as the AC1-bit of the 16V8/20V8 GALs. It determins
+whether the OLMC is used as registered-output or as tristate output.
+For each output and for each type of output you can define a tristate enable.
+So you can define a tristate enable for registered outputs too. This is
+another difference to the 16V8/20V8 GALs, because there you can switch
+just all registered outputs or non to high impetance by use of the /OE
+pin (operation mode 3).
+
+Pin 1 of the GAL22V10 can be both at the same time a &quot;normal&quot; input and
+the clock-input for the registers.
+
+There are two additional signals within this GAL, but they are not connected
+to any pin, they are internal signals. These are AR (asynchronous reset) and
+SP (synchronous preset). These signals are for the registered outputs which
+can be controlled by use of the AR and SP. AR resets the registered outputs
+when it becomes true, independent from the clock-signal at pin 1 of the GAL
+(asynchronous). SP sets the registered output when it becomes true and
+when a LOW-HIGH transition of the clock is detected (synchronous).
+
+
+Another feature of the GAL22V10 is that the amount of rows which are
+connected to an OLMC is not constant. The number of rows connected to
+an OLMC is between 9 and 17(!).
+Here is a table which shows the exactly number of OLMC's rows:
+
+        OLMC at pin |  number of rows from
+                    |   the logic-matrix
+        ------------+----------------------
+             23     |         9
+             22     |        11
+             21     |        13
+             20     |        15
+             19     |        17
+             18     |        17
+             17     |        15
+             16     |        13
+             15     |        11
+             14     |         9
+
+
+You have to consider that for each OLMC one row is needed for the
+tristate enable again. So you can use 8, 10, 12, 14 or 16 product
+terms for the output definition.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="gal16_20v8.html"><img src="prev.gif" alt="PREV" border=0></a><a href="gal20ra10.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/galer.html
@@ -1,0 +1,20 @@
+<html>
+<head>
+  <title>What is GALer</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="main.html"><img src="prev.gif" alt="PREV" border=0></a><a href="shareware.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+GALer is a GAL programming device with relevant driver software.
+So the project GALer consists of two components, a software and a
+hardware.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="main.html"><img src="prev.gif" alt="PREV" border=0></a><a href="shareware.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/history.html
@@ -1,0 +1,75 @@
+<html>
+<head>
+  <title>History</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="important.html"><img src="prev.gif" alt="PREV" border=0></a><a href="thanks.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+
+  Versions:
+
+    V1.0:    Test version
+
+    V1.1:    Intuition interface added
+
+    V1.2:    cured a few bugs
+
+    V1.3:  - cured some bugs in the GAL assembler. /name.E is no longer allowed.
+           - The pin names of the last assembled files can be assigned to the
+             indicated GAL.
+
+    V1.4:  - Kick 2.0
+           - new Intuition environment
+           - support of A- and B-type GALs
+           - new format of JEDEC files
+           - new functions: verify of programmed GALs
+                           test whether security fuse is set or not
+                           compare GALs
+                           optimizer for Boolean equations
+                           reassembler
+           - IMPORTANT CHANGE!!!:
+              '/' in pin declaration is now considered in the equations
+
+    V1.41  - support of locale.library and gadtools.library
+           - req.library replaced by reqtools.library, reqtools.library is
+             copyright by Nico Francois
+           - Help available
+
+    V1.5   - support of GAL22V10 and GAL20RA10
+           - needs WB 2.0 or later
+           - detects A- and B-type 16V8 and 20V8 GALs automatically
+           - use of #, &amp;, ! for OR, AND and NOT is now possible
+           - shortcuts changed
+           - external editor can be called from GALer
+           - comments in the source files can now be introduced by a ';'
+
+    V1.5a  - this version is equal to version 1.5
+             but now there is a layout included (see directory &quot;Layout&quot;)
+
+    V1.5b  - improved timing, therefore the access time is slowed down
+             significantly
+
+    V1.5c  - bug removed, erasing of 22V10 GALs did not work
+
+    V2.0   - new GUI (Magic User Interfac, MUI)
+           - bugs in reassembler removed
+               translation of GAL22V10 JEDEC files in source codes often failed
+               and the handling of negations in tristate enable equations was
+               wrong
+           - bug in assembler removed
+               feedback of GAL22V10 registered outputs was wrong
+
+    V2.1   - Optimizer did not work at all in version 2.0 because of a
+             typing error in the source code (I formated the source new
+             in version 2.0 and by doing this a mistake occured - SORRY).
+             Now it seems to be ok again.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="important.html"><img src="prev.gif" alt="PREV" border=0></a><a href="thanks.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/important.html
@@ -1,0 +1,44 @@
+<html>
+<head>
+  <title>Important!!!</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="shareware.html"><img src="prev.gif" alt="PREV" border=0></a><a href="history.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+
+WARNING!!! The &quot;GALer&quot; and &quot;GALerTest&quot; programs send data over your Amiga's
+parallel port. This means: when you have a printer, digitizer, or
+something else attached, it should be switched off or disconnected, since
+it is possible that you may damage them.
+
+
+I CANNOT BE HELD RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER OR PRERIPHERALS.
+
+
+
+The &quot;GALer&quot; hardware and software has been running faultlessly on my A3000.
+I have tested GALer on A1000, A3000 and A4000 machines. It should run on
+all other Amigas too.
+The circuit diagram is 100% fault free. With careful construction
+there is no reason for anything going awry. Even so the construction should
+be carried out by electronics freak (you should at least have soldering
+experience, and be able to intelligently read circuit diagrams). More
+information about the construction can be found in chapter III.
+
+
+Note: This manual sparely covers the operational theory of GAL programming.
+It is not a substitute for <a href="literature.html">further reading</a>.
+
+If you already have long experience with digital circuitry, and really don't
+care how a GAL is made, or how it works internally, then this manual together
+with the examples should suffice to intelligently implement your GALs.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="shareware.html"><img src="prev.gif" alt="PREV" border=0></a><a href="history.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
binary files /dev/null b/galer/index.gif differ
--- /dev/null
+++ b/galer/index.html
@@ -1,0 +1,188 @@
+<html>
+<head>
+  <title>Index</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="literature.html"><img src="prev.gif" alt="PREV" border=0></a>
+<hr>
+<pre>
+
+    <b>A</b>
+       <a href="gal16_20v8.html"> AC0                       </a>
+       <a href="gal16_20v8.html"> AC1                       </a>
+       <a href="gal16_20v8.html"> ACW                       </a>
+       <a href="proggal.html">   Format                  </a>
+       <a href="menacw.html">   Reading                 </a>
+       <a href="gal16_20v8.html"> AND-Matrix                </a>
+       <a href="gal22v10.html"> AR                        </a>
+       <a href="gal16_20v8.html"> Architecture Control Word </a>
+       <a href="assembler.html"> Assembler                 </a>
+       <a href="gal22v10.html"> Asynchronous Preset       </a>
+       <a href="gal22v10.html"> Asynchronous Reset        </a>
+
+    <b>B</b>
+       <a href="menempty.html"> Blank Test                </a>
+       <a href="gal16_20v8.html"> Bulk Erase                </a>
+
+    <b>C</b>
+       <a href="assembler.html"> Chip Diagramm             </a>
+       <a href="schaltbesch.html"> Circuit Description       </a>
+       <a href="sourcefile.html"> Comment                   </a>
+       <a href="mencmp.html"> Compare                   </a>
+       <a href="mensaveconfig.html"> Configuration, Save       </a>
+       <a href="jedecfile.html"> Control Characters        </a>
+       <a href="mencopy.html"> Copy                      </a>
+
+    <b>D</b>
+       <a href="sourcefile.html"> DESCRIPTION               </a>
+
+    <b>E</b>
+       <a href="proggal.html"> Edit Mode                 </a>
+       <a href="proggal.html"> Edit Voltage              </a>
+       <a href="mencalleditor.html"> Editor, Call              </a>
+       <a href="meneditor.html"> Editor, Selection         </a>
+       <a href="menerase.html"> Erase                     </a>
+       <a href="errors.html"> Error Messages            </a>
+       <a href="examples.html"> Example                   </a>
+       <a href="example16v8.html">   GA16V8                  </a>
+       <a href="example22v10.html">   GAL22V10                </a>
+       <a href="example20ra10.html">   GAL20RA10               </a>
+
+    <b>F</b>
+       <a href="gal16_20v8.html"> Feed Back                 </a>
+       <a href="menjedecpar.html"> File Checksum             </a>
+       <a href="menjedecpar.html"> Fuse Checksum             </a>
+       <a href="assembler.html"> Fuse File                 </a>
+
+    <b>G</b>
+       <a href="proglogik.html"> GAL                       </a>
+       <a href="assembler.html"> GAL-Assembler             </a>
+       <a href="testing.html"> GAL-Checker               </a>
+       <a href="mengalinfo.html"> GAL-Info                  </a>
+       <a href="intstruktur.html"> GAL-Types                 </a>
+       <a href="gal16_20v8.html"> GAL16V8                   </a>
+       <a href="gal16_20v8.html">   Intern Structure        </a>
+       <a href="gal16_20v8.html">   OLMC                    </a>
+       <a href="gal16_20v8.html">   Pin Designation         </a>
+       <a href="gal16_20v8.html">     Modes                 </a>
+       <a href="gal16_20v8.html">   Security-Bit            </a>
+       <a href="gal16_20v8.html">   Signature               </a>
+       <a href="gal20ra10.html"> GAL20RA10                 </a>
+       <a href="gal20ra10.html">   Asynchronous Preset     </a>
+       <a href="gal20ra10.html">   Asynchronous Reset      </a>
+       <a href="gal20ra10.html">   Intern Structure        </a>
+       <a href="gal20ra10.html">   OLMC                    </a>
+       <a href="gal20ra10.html">   Pin Designation         </a>
+       <a href="gal20ra10.html">   Preload                 </a>
+       <a href="gal20ra10.html">   Tristate Control        </a>
+       <a href="gal20ra10.html"> GAL20V8                   </a>
+       <a href="gal16_20v8.html">   Intern Structure        </a>
+       <a href="gal16_20v8.html">   OLMC                    </a>
+       <a href="gal16_20v8.html">   Pin Designation         </a>
+       <a href="gal16_20v8.html">     Modes                 </a>
+       <a href="gal16_20v8.html">   Security-Bit            </a>
+       <a href="gal16_20v8.html">   Signature               </a>
+       <a href="gal22v10.html"> GAL22V10                  </a>
+       <a href="gal22v10.html">   Intern Structure        </a>
+       <a href="gal22v10.html">   OLMC                    </a>
+       <a href="gal22v10.html">   Pin Designation         </a>
+       <a href="gal22v10.html">   Security-Bit            </a>
+       <a href="gal22v10.html">   Signature               </a>
+       <a href="construction.html"> GALerTest                 </a>
+
+    <b>H</b>
+       <a href="schaltbesch.html"> Hardware                  </a>
+       <a href="menhardver.html"> Hardware-Version          </a>
+       <a href="usage.html"> Help                      </a>
+       <a href="history.html"> History                   </a>
+
+    <b>I</b>
+       <a href="installation.html"> Installation              </a>
+
+    <b>J</b>
+       <a href="jedecfile.html"> JEDEC File                </a>
+       <a href="menmakejedec.html">    Generate               </a>
+       <a href="menjedecpar.html">    Parameter              </a>
+
+    <b>K</b>
+       <a href="keywords.html"> Keywords                  </a>
+
+    <b>M</b>
+       <a href="gal16_20v8.html"> Matrix, AND-              </a>
+       <a href="gal16_20v8.html"> Mode                      </a>
+
+    <b>N</b>
+       <a href="sourcefile.html"> Negation                  </a>
+
+    <b>O</b>
+       <a href="gal16_20v8.html"> OLMC                      </a>
+       <a href="optimizer.html"> Optimizer                 </a>
+       <a href="gal16_20v8.html"> Output, Combinational     </a>
+       <a href="gal16_20v8.html"> Output Cell, Configurable </a>
+
+    <b>P</b>
+       <a href="proggal.html"> P,/V                      </a>
+       <a href="construction.html"> PCB                       </a>
+       <a href="assembler.html"> Pin Description File      </a>
+       <a href="sourcefile.html"> Pin Declaration           </a>
+       <a href="sourcefile.html"> Pin Names                 </a>
+       <a href="menclearnames.html">   Clear                   </a>
+       <a href="menshownames.html">   Show                    </a>
+       <a href="gal20ra10.html"> Preload                   </a>
+       <a href="construction.html"> Printed Circuit Board     </a>
+       <a href="gal16_20v8.html"> Product Term              </a>
+       <a href="menprog.html"> Program                   </a>
+       <a href="program.html">   How to Do               </a>
+       <a href="proggal.html"> Programming-Algorithm     </a>
+       <a href="gal16_20v8.html"> PT                        </a>
+
+    <b>Q</b>
+       <a href="optimizer.html"> Quine-McCluskey           </a>
+       <a href="menquit.html"> Quit                      </a>
+
+    <b>R</b>
+       <a href="proggal.html"> RAG0-RAG5                 </a>
+       <a href="menreasm.html"> Reassembler               </a>
+       <a href="gal16_20v8.html"> Register Output           </a>
+
+    <b>S</b>
+       <a href="gal22v10.html"> S0                        </a>
+       <a href="gal22v10.html"> S1                        </a>
+       <a href="proggal.html"> SCLK                      </a>
+       <a href="proggal.html"> SDIN                      </a>
+       <a href="proggal.html"> SDOUT                     </a>
+       <a href="gal16_20v8.html"> Security-Fuse             </a>
+       <a href="mensetsec.html">   Set                     </a>
+       <a href="mentestsec.html">   Test                    </a>
+       <a href="shareware.html"> Shareware                 </a>
+       <a href="gal16_20v8.html"> Signature                 </a>
+       <a href="menreadsig.html">   Read                    </a>
+       <a href="sourcefile.html"> Source File               </a>
+       <a href="gal22v10.html"> SP                        </a>
+       <a href="gal16_20v8.html"> SYN                       </a>
+       <a href="gal22v10.html"> Synchronous Preset        </a>
+
+    <b>T</b>
+       <a href="testing.html"> Testing                   </a>
+       <a href="gal16_20v8.html"> Tristate Output           </a>
+       <a href="mentypereq.html"> Type-Requester            </a>
+
+    <b>V</b>
+       <a href="proggal.html"> VIL                       </a>
+
+    <b>W</b>
+       <a href="menwriteacc.html"> Write Access              </a>
+
+    <b>X</b>
+       <a href="gal16_20v8.html"> XOR                       </a>
+
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="literature.html"><img src="prev.gif" alt="PREV" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/installation.html
@@ -1,0 +1,32 @@
+<html>
+<head>
+  <title>Installation</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="sourcefile.html"><img src="prev.gif" alt="PREV" border=0></a><a href="usage.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.2.1 Installation</u>
+
+The installation of GALer is very easy, just start the installation
+script. Commodore's installer is used, so there should be no problems.
+Just do what your Amiga requests.
+
+If you start GALer for the very first time, please select your hardware
+version of GALer by use of the menu &quot;<a href="menhardver.html">Project - Hardware Version</a>&quot;
+and save this setting by use of the menu item &quot;<a href="mensaveconfig.html">Project - Save config.</a>&quot;.
+
+You can start GALer either from Workbench or CLI.
+
+For informations what GALer needs see <a href="systemreq.html">System Requirements</a>.
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="sourcefile.html"><img src="prev.gif" alt="PREV" border=0></a><a href="usage.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/intstruktur.html
@@ -1,0 +1,23 @@
+<html>
+<head>
+  <title>The Intern Structure of GALs</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="proglogik.html"><img src="prev.gif" alt="PREV" border=0></a><a href="gal16_20v8.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>I.2 The Intern Structure of GALs</u>
+
+Up to now there are many kinds of GALs. The most common GALs are the
+GAL16V8, GAL20V8 and GAL22V10. These GALs are supported by GALer. Furthermore
+GALer supports the GAL20RA10 too. The next sections shows you what's inside
+of such a GAL.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="proglogik.html"><img src="prev.gif" alt="PREV" border=0></a><a href="gal16_20v8.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/jedecerr.html
@@ -1,0 +1,138 @@
+<html>
+<head>
+  <title>Error Messages</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="asmerr.html"><img src="prev.gif" alt="PREV" border=0></a><a href="reasmerr.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.5.2 JEDEC File</u>
+
+&quot;unexpected end of file&quot;
+   The last thing in a JEDEC file should be either the file checksum or
+   a '*'.
+
+
+&quot;unknown command found&quot;
+   There is a unknown command in your JEDEC file (see chapter JEDEC File for
+   possible commands). In most cases the reason for this error message
+   is a missing '*'.
+
+
+&quot;bad format of number&quot;
+   A dez. or hex. number is expected and found, but there are illegal
+   characters in it.
+   Example:  C1a#3       
+
+
+&quot;number expected after command&quot;
+   After this command a dez. or hex. number is expected but not found.
+
+
+&quot;0 or 1 expected&quot;
+   Fuses can be set to 0 or 1. Using another digit will cause this error.
+
+
+&quot;can't find out type of GAL&quot;
+   GALer can't identify for which type of GAL (GAL16V8 or GAL20V8) this
+   JEDEC file is. But GALer must know this in order to program a GAL.
+
+
+&quot;QF multible found&quot;
+   In the JEDEC file the command QF is found multiple. This is not
+   allowed.
+
+
+&quot;QP multible found&quot;
+   In the JEDEC file the command QP is found multiple. This is not
+   allowed.
+
+
+&quot;ending '*' expected&quot;
+   GALer expects a '*' character.
+
+
+&quot;after 'C' command no 'L' command allowed&quot;
+   After the fuse checksum no change of fuses (L command) is allowed.
+
+
+&quot;bad fuse checksum&quot;
+   The fuse checksum is bad. The reason for this can be that you have
+   changed some state of fuses with a text editor.
+
+
+&quot;too many &#060;STX&#062; (= CTRL-B, 0x02) found&quot;
+   The &#060;STX&#062; control character should be once at the beginning of the
+   JEDEC file.
+
+
+&quot;too many &#060;ETX&#062; (= CTRL-C, 0x03) found&quot;
+   The &#060;ETX&#062; control character should be once at the end of the
+   JEDEC file.
+
+
+&quot;bad sequence of &#060;STX&#062;, &#060;ETX&#062;&quot;
+   The first control character must be a &#060;STX&#062; then a &#060;ETX&#062; not vice versa.
+
+
+&quot;after file checksum end of file expected&quot;
+   There is a character after a file checksum which is not a Space, TAB
+   or Carriage Return. This is not allowed.
+
+
+&quot;bad fuse address (L... too short)&quot;
+   It's easier to show an example:
+          L0010 1011*
+          L0013 0111*
+      Address 13 is defined twice.
+
+
+&quot;addresses skiped but no default value (F0/1*) defined&quot;
+   It's easier to show an example:
+          L0010 11*
+          L0015 01*
+    The fuses of the addresses 12, 13 and 14 are not defined and there
+    is no F command which would define the values of missing fuses.
+
+
+&quot;'*' expected&quot;
+   '*' expected but not found (what else should I say here).
+
+
+&quot;QF... and last fuse address (L...) are not equal&quot;
+   QF defines the number of fuses in this JEDEC file (GAL16V8: 2194,
+   GAL20V8: 2706). If the last fuse of a L command does not match
+   to the QF command, this error will occur.
+
+
+&quot;no values for the fuses found (no F0/1, L...)&quot;
+   In your JEDEC file are no fuses defined. Such a file is useless
+   and therefore rejected by GALer.
+
+
+&quot;only QF2194 *, QF2706 *, QF3274 *, QF5892 * allowed&quot;
+   There is a QF... command which fits to no GAL which is supported by
+   GALer.
+
+&quot;too many fuses found&quot;
+   In your JEDEC file are too many fuses defined.
+
+
+&quot;found several fuse checksumms&quot;
+   In your JEDEC file are several fuse checksumms. This is not allowed.
+
+
+&quot;selected type of GAL fits not to JEDEC file&quot;
+   You have selected a to-be-programmed-GAL which does not fit to
+   the JEDEC file.
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="asmerr.html"><img src="prev.gif" alt="PREV" border=0></a><a href="reasmerr.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/jedecfile.html
@@ -1,0 +1,141 @@
+<html>
+<head>
+  <title>JEDEC File</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="optimizer.html"><img src="prev.gif" alt="PREV" border=0></a><a href="examples.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.3 JEDEC File</u>
+
+JEDEC means (J)oint (E)lectron (D)evice (E)nineering (C)ouncil.
+This file is a ASCII file in which every bit which can be set in a
+GAL is listed. The JEDEC file has the extension &quot;.jed&quot; and it's
+generated by the GAL-Assembler.
+
+
+The JEDEC file can start with any text until there is a asterisk (*).
+The first '*' introduces the command field. The command field starts
+with the first '*' and ends at the file end.
+Within the command field are... (now be astonished) commands! A command
+is introduced by one character and it ends with a '*' character.
+
+All commands are optional. Not every command must be in a JEDEC file.
+The <a href="assembler.html">GAL-Assembler</a> normaly uses: L, F and G commands (see below)
+
+
+Possible commands are:
+
+
+ N: This introduces a comment.
+    Example:   N this is a comment *
+
+               ^        ^          ^
+               |        |          |
+         command    any text    end of command
+
+
+
+ F: You don't have to list all states of the fuses in the GAL. If you don't
+    list all fuses GALer must know what the state of the missed fuses is.
+    
+    F0 *: not listed fuses are set to 0
+    F1 *: not listed fuses are set to 1
+
+
+
+ G: Security Fuse
+
+    G0 *: don't set the security fuse after programming the GAL
+    G1 *: ask user (you) whether to set the security fuse after
+          programming the GAL or not
+
+
+ L: L defines the address of a fuse and what the state of the fuse
+    should be.
+
+    Example:  L0000  10110111111111111111111111011111 *
+
+        this means:  set fuse at address 0 to 1
+                     set fuse at address 1 to 0
+                     set fuse at address 2 to 1
+                                .
+                                .
+                                .
+
+    possible addresses are:
+
+        GAL16V8, GA16V8A, GAL16V8B:
+          0000-2047: matrix of fuses (AND-array)
+          2048-2055: XOR bits
+          2056-2119: signature
+          2120-2127: AC1 bits
+          2128-2191: product term disable bits
+          2192     : SYN bit
+          2193     : AC0 bit                    
+
+        GAL20V8, GAL20V8A, GAL20V8B:
+          0000-2559: matrix of fuses (AND-array)
+          2560-2567: XOR bits
+          2568-2631: signature
+          2632-2639: AC1 bits
+          2640-2703: product term disable bits
+          2704     : SYN bit
+          2705     : AC0 bit
+
+        GAL22V10
+          0000-5807: matrix of fuses (AND-array)
+          5808-5827: S0/S1-bits of the OLMCs
+          5828-5891: signature
+
+        GAL20RA10
+          0000-3199: matrix of fuses (AND-array)
+          3200-3209: S0-bits of the OLMCs
+          3210-3273: signature
+
+
+ QF: Defines how many fuses in the JEDEC file are. A GAL16V8 has
+     2194 fuses and a GAL20V8 has 2706 fuses. Now GALer can
+     identify for which type of GAL this JEDEC file is.
+
+     Example: QF2194 *
+
+
+
+ C: C is followed by a 16 bit hex number which is the fuse checksum of
+    the JEDEC file (see description of menu 'JEDEC file parameter').
+
+    Example: C6402 *
+
+
+
+ &#060;STX&#062;, &#060;ETX&#062;: These are control characters.
+    &#060;STX&#062;: 0x02 = CTRL-B
+    &#060;ETX&#062;: 0x03 = CTRL-C
+
+    Your text editor displays this characters in this way:
+      &#060;STX&#062;  &#002;
+      &#060;ETX&#062;  &#003;
+    &#060;STX&#062; defines the start of the JEDEC file and &#060;ETX&#062; the end of the
+    JEDEC file. &#060;ETX&#062; is followed by the file checksum (see description
+    of menu 'JEDEC file-parameter'). The file checksum is a 16 bit hex
+    number.
+
+
+
+ V: V introduces a test vector. GALer 1.4 does not support this. GALer
+    interprets this command as a N command (comment).
+
+
+
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="optimizer.html"><img src="prev.gif" alt="PREV" border=0></a><a href="examples.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/keywords.html
@@ -1,0 +1,37 @@
+<html>
+<head>
+  <title>Keywords of the Source File</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="construction.html"><img src="prev.gif" alt="PREV" border=0></a><a href="partlist.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>Keywords of the Source File</u>
+
+GAL16V8                         designates the GAL type
+GAL20V8
+GAL22V10
+GAL20RA10
+
+NC                              not connected (unused) pin
+GND                             GROUND (=LOW)
+VCC                             +5V    (=HIGH)
+.T                              output pin is tristate output
+.E                              tristate enable through product term
+.R                              output pin is register output
+=                               output pin is given an equivalence
++                               OR
+*                               AND
+/                               NOT
+DESCRIPTION                     indicates the end of the Boolean equations
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="construction.html"><img src="prev.gif" alt="PREV" border=0></a><a href="partlist.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/literature.html
@@ -1,0 +1,30 @@
+<html>
+<head>
+  <title>Further Reading</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="partlist.html"><img src="prev.gif" alt="PREV" border=0></a><a href="index.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>Further Reading</u>
+
+  1) GALs - Programmierbare Logikbausteine in Theorie und  Praxis
+     Bitterle
+     Franzis-Verlag
+
+  2) Programmable Logic Manual - GAL Products
+     SGS-Thomson
+
+  3) GAL Handbook
+     Lattice
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="partlist.html"><img src="prev.gif" alt="PREV" border=0></a><a href="index.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/main.html
@@ -1,0 +1,82 @@
+<html>
+<head>
+  <title>GALer</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="galer.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+
+
+                            <b>GALer</b> V2.1
+
+              Copyright &copy; 1991/96 by Christian Habermann
+                        All Rights Reserved
+
+
+                         <u>Table of Contents</u>
+
+
+
+        Common Things
+
+                <a href="galer.html">What is GALer</a>
+                <a href="shareware.html">Shareware</a>
+                <a href="important.html">IMPORTANT</a>
+                <a href="systemreq.html">System Requirements</a>
+                <a href="thanks.html">Thanks</a>
+
+        Chapter I     BASICS
+                I.1     <a href="proglogik.html">What are GALs?</a>
+
+                I.2     <a href="intstruktur.html">The Intern Structure of GALs</a>
+                I.2.1      <a href="gal16_20v8.html">The GAL16V8 and GAL20V8</a>
+                I.2.2      <a href="gal22v10.html">The GAL22V10</a>
+                I.2.3      <a href="gal20ra10.html">The GAL20RA10</a>
+
+        Chapter II    <a href="software.html">THE SOFTWARE</a>
+                II.1    <a href="sourcefile.html">Source File</a>
+
+                II.2    The Program GALer
+                II.2.1     <a href="installation.html">Installation</a>
+                II.2.2     <a href="usage.html">How to Use GALer</a>
+                II.2.3     <a href="menus.html">Menus</a>
+                II.2.4     <a href="assembler.html">Assembler</a>
+                II.2.5     <a href="program.html">How to Program GALs</a>
+                II.2.6     <a href="testing.html">How to Test Programmed GALs</a>
+                II.2.7     <a href="optimizer.html">Optimizer</a>
+
+                II.3    <a href="jedecfile.html">JEDEC File</a>
+
+                II.4    <a href="examples.html">Examples</a>
+                II.4.1     <a href="example16v8.html">GAL16V8</a>
+                II.4.2     <a href="example22v10.html">GAL22V10</a>
+                II.4.3     <a href="example20ra10.html">GAL20RA10</a>
+
+                II.5    <a href="errors.html">Error Messages</a>
+                II.5.1     <a href="asmerr.html">Assembler</a>
+                II.5.2     <a href="jedecerr.html">JEDEC File</a>
+                II.5.3     <a href="reasmerr.html">Reassembler</a>
+
+        Chapter III   THE HARDWARE
+                III.1   <a href="proggal.html">Programming GALs</a>
+                III.2   <a href="schaltbesch.html">Circuit Description</a>
+                III.3   <a href="construction.html">Construction</a>
+
+        Appendix
+                <a href="keywords.html">Keywords of the Source File</a>
+                <a href="partlist.html">List of Parts</a>
+                <a href="literature.html">Further Reading</a>
+                <a href="history.html">History</a>
+                <a href="index.html">Index</a>
+
+</pre>
+<hr>
+<a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="galer.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<address>Converted using <tt>GuideML</tt> V1.6, a converter written by Richard K&ouml;rber &#060;<a href="mailto:shred@chessy.aworld.de">shred@chessy.aworld.de</a>&#062;</address>
+</body>
+</html>
--- /dev/null
+++ b/galer/menabout.html
@@ -1,0 +1,19 @@
+<html>
+<head>
+  <title>Project</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menus.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menhardver.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ About GALer            Tells you who has done all this code. I can tell
+                        you, I was it.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menus.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menhardver.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menacw.html
@@ -1,0 +1,19 @@
+<html>
+<head>
+  <title>GAL-Disassembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menreadsig.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mengalinfo.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Read ACW               Read the <a href="gal16_20v8.html">architecture control word</a> of a GAL and
+                        print it on the screen.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menreadsig.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mengalinfo.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menasm.html
@@ -1,0 +1,20 @@
+<html>
+<head>
+  <title>GAL-Assembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menwriteacc.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menreadsig.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Assemble file          Assemble a <a href="sourcefile.html">source file</a> (name.pld) and generate
+                        the <a href="jedecfile.html">JEDEC file</a> and some special files.
+
+                        For further information see: <a href="assembler.html">Assembler</a>
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menwriteacc.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menreadsig.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mencalleditor.html
@@ -1,0 +1,21 @@
+<html>
+<head>
+  <title>Tools</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="meneditor.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menoptimizer.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Call editor            This function starts the <a href="meneditor.html">selected editor</a> and tries to
+                        load the last assembled source file in it.
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="meneditor.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menoptimizer.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menchecker.html
@@ -1,0 +1,21 @@
+<html>
+<head>
+  <title>Tools</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menclearnames.html"><img src="prev.gif" alt="PREV" border=0></a><a href="meneditor.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ GAL-Checker            There you can check a programmed GAL whether it does
+                        this what you want to do it or not.
+
+                        Further information see: <a href="testing.html">How to Test Programmed GALs</a>
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menclearnames.html"><img src="prev.gif" alt="PREV" border=0></a><a href="meneditor.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menclearnames.html
@@ -1,0 +1,19 @@
+<html>
+<head>
+  <title>Tools</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menshownames.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menchecker.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Clear pin names        Clears pin names from screen.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menshownames.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menchecker.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mencmp.html
@@ -1,0 +1,21 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menerase.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menempty.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Compare               There are three different types of comparison. You
+                        can compare a GAL with several GALs, a GAL with
+                        several <a href="jedecfile.html">JEDEC files</a> or a JEDEC file
+                        with several GALs.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menerase.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menempty.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mencopy.html
@@ -1,0 +1,21 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menprog.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menerase.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Copy                  Copy a GAL. You can only copy a GAL if the <a href="gal16_20v8.html">security bit</a>
+                        of the source GAL is not set and if the destination GAL
+                        is not programmed.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menprog.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menerase.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/meneditor.html
@@ -1,0 +1,25 @@
+<html>
+<head>
+  <title>Tools</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menchecker.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mencalleditor.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Select editor          Selecting this will open a window in which you can
+                        choose your favorit editor which is called when you
+                        select the menu item <a href="mencalleditor.html">Call editor</a>. In a string
+                        gadget of this window you can enter the editor and
+                        it's parameter. %s is thereby replaced by the name
+                        of the last assembled <a href="sourcefile.html">source file</a>.
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menchecker.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mencalleditor.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menempty.html
@@ -1,0 +1,18 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mencmp.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mensetsec.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Blank test            Test whether the GAL is erased or not.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mencmp.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mensetsec.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menerase.html
@@ -1,0 +1,19 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mencopy.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mencmp.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Erase                 Erase a GAL. If you want to program a GAL the GAL
+                        must be erased. Do this using this function.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mencopy.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mencmp.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mengalinfo.html
@@ -1,0 +1,18 @@
+<html>
+<head>
+  <title>GAL-Disassembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menacw.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menmakejedec.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ GAL-Info               Gives you some informations about your GAL.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menacw.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menmakejedec.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mengaltype.html
@@ -1,0 +1,21 @@
+<html>
+<head>
+  <title>GAL-Type</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menquit.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mentypereq.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  GAL16V8               Here you can select the type of GAL which should be
+  GAL20V8               read/programmed next time.
+  GAL22V10
+  GAL20RA10
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menquit.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mentypereq.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menhardver.html
@@ -1,0 +1,22 @@
+<html>
+<head>
+  <title>Project</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menabout.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mensaveconfig.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Hardware-Version       Here you can select which hardware version of GALer
+                        you have connected to your Amiga. This selection
+                        must be conform with the version of your circuit
+                        diagram. Otherwise GALer will not work correctly
+                        in some cases.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menabout.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mensaveconfig.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menhelp.html
@@ -1,0 +1,19 @@
+<html>
+<head>
+  <title>Tools</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menoptimizer.html"><img src="prev.gif" alt="PREV" border=0></a><a href="assembler.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Help                   Explains how to get help on a specific menu item.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menoptimizer.html"><img src="prev.gif" alt="PREV" border=0></a><a href="assembler.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menjedecpar.html
@@ -1,0 +1,42 @@
+<html>
+<head>
+  <title>GAL-Disassembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menmakejedec.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menreasm.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ JEDEC file parameter   Selecting this menu puts up a requester in which
+                        you can determine parameters concerning the writing
+                        of <a href="jedecfile.html">JEDEC files</a>.
+
+                        Security bit: If this is enabled, GALer will write
+                        JEDEC files in which a special flag is set.
+                        Reading this JEDEC file to program a GAL will bring
+                        up a requester in which you can choose to set the
+                        security bit after programming or not.
+
+                        Fuse-Checksum: If this is enabled, GALer will write
+                        JEDEC files with a checksum calculated over all
+                        fuses. Manually changed fuses (with text editor)
+                        will be detected by GALer and GALer will warn you
+                        that this JEDEC file has been changed when reading
+                        this file next time. You are allowed to change
+                        comments etc. but you are not allowed to change
+                        fuses ('0' and '1').
+
+                        File-Checksum: If this is enabled, GALer will write
+                        JEDEC files with a checksum calculated over all
+                        characters in this file. This means that you are
+                        not allowed to change anything in this file
+                        by using a text editor.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menmakejedec.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menreasm.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menmakejedec.html
@@ -1,0 +1,19 @@
+<html>
+<head>
+  <title>GAL-Disassembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mengalinfo.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menjedecpar.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Generate JEDEC file    Read a GAL and make a corresponding <a href="jedecfile.html">JEDEC file</a>.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mengalinfo.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menjedecpar.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menoptimizer.html
@@ -1,0 +1,20 @@
+<html>
+<head>
+  <title>Tools</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mencalleditor.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menhelp.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Optimizer              Optimize Boolean equations.
+
+                        For further information see: <a href="optimizer.html">Optimizer</a>
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mencalleditor.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menhelp.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menprog.html
@@ -1,0 +1,22 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mentypereq.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mencopy.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Program               Program a GAL. This is the most importent function of
+                        GALer. After selecting this menu, GALer will bring
+                        up a file requester in which you can select the
+                        <a href="jedecfile.html">JEDEC file</a> which should be programmed into the GAL.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mentypereq.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mencopy.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menquit.html
@@ -1,0 +1,23 @@
+<html>
+<head>
+  <title>Project</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mensaveconfig.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mengaltype.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Quit                   Quit quits GALer, but ATTENTION! Handle this function
+                        with care: If you use Quit too often, GALer will sell
+                        your Amiga's CPU.
+
+                        Are you thinking that I'm pulling your leg?
+                        Ohhhh no..., really not!!! I never would do this.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mensaveconfig.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mengaltype.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menreadsig.html
@@ -1,0 +1,20 @@
+<html>
+<head>
+  <title>GAL-Disassembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menasm.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menacw.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Read signature         Read <a href="gal16_20v8.html">signature</a> of a programmed GAL and print it
+                        on the screen.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menasm.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menacw.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menreasm.html
@@ -1,0 +1,22 @@
+<html>
+<head>
+  <title>GAL-Disassembler</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menjedecpar.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menshownames.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Reassembler            This function reads a <a href="jedecfile.html">JEDEC file</a> and generates then
+                        the original <a href="sourcefile.html">source file</a>. So you can read a unknown
+                        GAL and get back a source file with the Boolean
+                        equations.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menjedecpar.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menshownames.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mensaveconfig.html
@@ -1,0 +1,20 @@
+<html>
+<head>
+  <title>Project</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menhardver.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menquit.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Save config.           Saves some settings to the file &quot;S:GALer.config&quot;.
+                        Starting GALer next time, GALer will read this file
+                        and set your saved settings again.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menhardver.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menquit.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mensetsec.html
@@ -1,0 +1,21 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menempty.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mentestsec.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Set security bit      Set the <a href="gal16_20v8.html">security bit</a> of a GAL. The logic matrix of
+                        such a protected GAL can't be read out after doing
+                        this.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menempty.html"><img src="prev.gif" alt="PREV" border=0></a><a href="mentestsec.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menshownames.html
@@ -1,0 +1,20 @@
+<html>
+<head>
+  <title>Tools</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menreasm.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menclearnames.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Show pin names         Prints the pin names of the last assembled source
+                        file on the screen.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="menreasm.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menclearnames.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mentestsec.html
@@ -1,0 +1,18 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mensetsec.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menwriteacc.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Test security bit     Test whether the <a href="gal16_20v8.html">security bit</a> of a GAL is set or not.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mensetsec.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menwriteacc.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/mentypereq.html
@@ -1,0 +1,27 @@
+<html>
+<head>
+  <title>GAL-Type</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mengaltype.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menprog.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Type-Requester        Every time when GALer wants to read or program a GAL
+                        GALer will bring up a requester in which you can
+                        select the type of GAL you want to read or program.
+                        This selection overrides the selection in the
+                        GAL16V8, GAL20V8, ... menus.
+
+                        If you don't want this behavior of GALer, deselect
+                        the Type-Requester menu. GALer will then not bring up
+                        this requester.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mengaltype.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menprog.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menus.html
@@ -1,0 +1,62 @@
+<html>
+<head>
+  <title>Menus</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="usage.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menabout.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.2.3 Menus</u>
+
+
+  Project
+    <a href="menabout.html"> About GALer          </a>
+    <a href="menhardver.html"> Hardware-Version     </a>
+    <a href="mensaveconfig.html"> Save Config.         </a>
+    <a href="menquit.html"> Quit                 </a>
+
+  GAL-Type
+    <a href="mengaltype.html"> GAL16V8              </a>
+    <a href="mengaltype.html"> GAL20V8              </a>
+    <a href="mengaltype.html"> GAL22V10             </a>
+    <a href="mengaltype.html"> GAL20RA10            </a>
+    <a href="mentypereq.html"> Type-Requester       </a>
+
+  GAL
+    <a href="menprog.html"> Program              </a>
+    <a href="mencopy.html"> Copy                 </a>
+    <a href="menerase.html"> Erase                </a>
+    <a href="mencmp.html"> Compare              </a>
+    <a href="menempty.html"> Blank test           </a>
+    <a href="mensetsec.html"> Set security bit     </a>
+    <a href="mentestsec.html"> Test security bit    </a>
+    <a href="menwriteacc.html"> Write access         </a>
+
+  GAL-Assembler
+    <a href="menasm.html"> Assemble file        </a>
+
+  GAL-Disassembler
+    <a href="menreadsig.html"> Read signature       </a>
+    <a href="menacw.html"> Read ACW             </a>
+    <a href="mengalinfo.html"> GAL-Info             </a>
+    <a href="menmakejedec.html"> Generate JEDEC file  </a>
+    <a href="menjedecpar.html"> JEDEC file parameter </a>
+    <a href="menreasm.html"> Reassembler          </a>
+
+  Tools
+    <a href="menshownames.html"> Show pin names       </a>
+    <a href="menclearnames.html"> Clear pin names      </a>
+    <a href="menchecker.html"> GAL-Checker          </a>
+    <a href="meneditor.html"> Select editor        </a>
+    <a href="mencalleditor.html"> Call editor          </a>
+    <a href="menoptimizer.html"> Optimizer            </a>
+    <a href="menhelp.html"> Help                 </a>
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="usage.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menabout.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/menwriteacc.html
@@ -1,0 +1,39 @@
+<html>
+<head>
+  <title>GAL</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mentestsec.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menasm.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+  Write access          This function brings up a requester. In this
+                        requester you can select what GALer should do before
+                        or after programming, copying or erasing a GAL.
+
+                        programming:
+                          - with blank test: before programming a GAL test
+                                             whether it is erased or not
+
+                          - with verify    : verify GAL after programming
+
+
+                        copying:
+                          - with blank test: test destination GAL whether
+                                             it is erased or not
+
+                          - with verify    : verify programmed destination
+                                             GAL
+
+                        erasing:
+                          - with blank test: test after erasing a GAL
+                                             whether it is really cleared
+                                             or not
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="mentestsec.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menasm.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
binary files /dev/null b/galer/next.gif differ
--- /dev/null
+++ b/galer/optimizer.html
@@ -1,0 +1,67 @@
+<html>
+<head>
+  <title>Optimizer</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="testing.html"><img src="prev.gif" alt="PREV" border=0></a><a href="jedecfile.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.2.7 Optimizer</u>
+
+Boolean equations can be simplified very often, but for human beings
+it is a hard way to do. A computer can do this much faster (in most
+times).
+
+The Optimizer of GALer tries to optimize Boolean equations by use of
+the Quine-McCluskey algorithm. How this algorithm works can be read
+in many books which deal with Boolean mathamatics, so it's not
+described here. I just will described the usage of the Optimizer.
+
+Hm, well, the usage of the Optimizer:
+
+   Just select the menu <a href="menoptimizer.html">Optimizer</a> to start GALer's Optimizer.
+   After this a file requester pops up. Now you have to select the
+   <a href="sourcefile.html">source file</a> which equations you want to be optimized.
+   After successfully loading this source file GALer starts to optimize
+   the equations.
+
+   GALer displays the original equation and the optimized one. If you
+   are happy with the result of the optimization you should select the
+   gadget 'use it'. Then the original equation is replaced by the
+   optimized equation in your loaded source file.
+
+   If you don't like the result of the optimization, you should select the
+   gadget 'reject'. Then the original equation is not replaced.
+
+   After trying to optimize all equations GALer will pop up a file requester
+   again. Now you have to select a file name of your optimized source file.
+   Please don't use the file name of the original source file for the
+   optimized source file. Give the new file a new name, just like name_opt.pld
+   instead of name.pld.
+
+
+   Example of optimization:
+
+     Original Boolean equation:
+
+         X = /A*/C + A*/C + C*/D + /B*/C + /A*C*D + B*/D
+
+     By GALer optimized Boolean equation:
+
+         X = /C + /D + /A
+
+   Both equations are equal, but the second one is much easier to read.
+
+
+Not all equations can be simplified. It could be that a &quot;optimized&quot;
+equation is more complicate than the original one. Just try it.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="testing.html"><img src="prev.gif" alt="PREV" border=0></a><a href="jedecfile.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/partlist.html
@@ -1,0 +1,95 @@
+<html>
+<head>
+  <title>List of Parts</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="keywords.html"><img src="prev.gif" alt="PREV" border=0></a><a href="literature.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>List of Parts:</u>
+
+
+        <u>ICs:</u>
+
+         IC1, IC3, IC4, IC5   :   4 x   4094
+         IC2                  :   1 x   4555
+         IC6                  :   1 x   4503
+         IC7                  :   1 x   4021
+         IC8                  :   1 x   74LS06
+         IC9                  :   1 x   TL 497
+         IC10                 :   1 x   74LS145
+
+        <u>Diodes:</u>
+
+         D1-D4                :   4 x   1N4148
+         LED                  :   1 x   rot, 3 mm
+
+        <u>Transistors:</u>
+
+         T2, T4, T5           :   3 x   BC237B
+         T1, T3               :   2 x   BC327
+
+
+        <u>Resistors (5%, 1/4 Watt):</u>
+
+         R1, R2, R35-39       :   7 x   1   KOhm
+         R3-13, R19-26        :  19 x   10  KOhm
+         R28-32               :   5 x   1,8 KOhm
+         R14                  :   1 x   1   Ohm
+         R15                  :   1 x   27  KOhm
+         R34                  :   1 x   220 Ohm
+         R18                  :   1 x   4,7 Ohm
+         R27                  :   1 x   47  Ohm
+         R33                  :   1 x   22  KOhm
+         R40-44               :   5 x   2   KOhm trimpots
+         (there are no R16, R17)
+
+        <u>Relays:</u>
+
+         K1, K2                :   2 x  relays, e.g. reed-relays,
+                                        1 x single pole double throw
+
+        <u>Coil:</u>
+
+         L1                   :   1 x   100 uH, miniature fixed
+
+
+        <u>Capacitors:</u>
+
+         C1                   :   1 x   100 pF
+         C2                   :   1 x   4,7 uF, tantalum
+         C3                   :   1 x   100 nF
+         C4                   :   1 x   220 uF, 25V
+
+
+        <u>Sundries:</u>
+
+         IC-Sockets
+           7 x 16 pin
+           3 x 14 pin
+           1 x Textool-Socket 24 pin, narrow! (.3 row spacing) or use
+               a universal type
+
+           1 x 25 pin female Sub-D connector for Amiga 1000
+               or 25 pin male Sub-D connector for all other Amiga types
+
+u = mikro
+
+
+Please note this: If you use the PCB-layout, replace R28 to R32 by a
+resistor-array 8 * 1.8kOhm. Furthermore you can add ten anti-interference
+capacitors C5 to C14 (each 100nF). These capacitors are not drawn in
+the circuit diagram, but you can see them in the component mounting diagram.
+
+
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="keywords.html"><img src="prev.gif" alt="PREV" border=0></a><a href="literature.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
binary files /dev/null b/galer/prev.gif differ
--- /dev/null
+++ b/galer/proggal.html
@@ -1,0 +1,188 @@
+<html>
+<head>
+  <title>Programming GALs</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="reasmerr.html"><img src="prev.gif" alt="PREV" border=0></a><a href="schaltbesch.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>III.1 Programming GALs</u>
+
+The first question that arises is how can you program a GAL when all the
+pins are already defined and no pins are free for the programming?
+
+If you apply a voltage of 12.00 Volt up to 16.5 Volt (depends on GAL type
+and on that whether the GAL should be read or programmed) to pin 2, then
+the pin description changes, the GAL is then in the Edit mode.
+
+In this section I'll explain how a GAL16V8 and GAL20V8 is read and
+programmed. The reading/programming algorithm of the GAL22V10 and GAL20RA10
+is similar to that of the GAL16V8 and GAL20V8 so I'll explain only the
+GAL16V8 and GAL20V8.
+
+Here the pins in the Edit mode:
+
+                                GAL16V8
+                                ---- ----
+                         VIL   1|       |20  +5V
+                        EDIT   2|       |19  P,/V
+                        RAG1   3|       |18  RAG0
+                        RAG2   4|       |17  VIL
+                        RAG3   5|       |16  VIL
+                        RAG4   6|       |15  VIL
+                        RAG5   7|       |14  VIL
+                        SCLK   8|       |13  VIL
+                        SDIN   9|       |12  SDOUT
+                        GND   10|       |11  /STR
+                                ---------
+
+
+                                GAL20V8
+                                ---- ----
+                         VIL   1|       |24  +5V
+                        EDIT   2|       |23  VIL
+                        RAG1   3|       |22  P,/V
+                        RAG2   4|       |21  RAG0
+                        RAG3   5|       |20  VIL
+                         VIL   6|       |19  VIL
+                         VIL   7|       |18  VIL
+                        RAG4   8|       |17  VIL
+                        RAG5   9|       |16  VIL
+                        SCLK  10|       |15  SDOUT
+                        SDIN  11|       |14  VIL
+                         GND  12|       |13  /STR
+                                ---------
+
+
+Whether the GAL is to be read from or written to is determined by the level
+of P,/V. A HIGH means write, a LOW read.
+
+The to be read/written addresses are presented to pins RAG0-RAG5. The
+programming occurs as follows:
+
+After giving the addresses to RAG0-RAG5, the to be written bits have to be
+presented to SDIN (serially) and by clocking SCLK with a LOW-HIGH-transition
+the data is transferred to an internal shift register. A LOW-pulse on the
+/STR pin programs the addressed row. This repeats until the whole GAL is
+programmed.
+
+The reading of a GAL proceeds similarly: After presenting the addresses to
+RAG0-RAG5 the bits of the corresponding address are put into the internal
+shift register by clocking /STR with a LOW-pulse. By clocking SCLK with a
+LOW-HIGH-clock transition all the various bits are sent out the SDOUT pin.
+The bit width of an address determines the number of SCLK pulses required
+to complete the programming or reading the address.
+
+VIL means Input Voltage Low. These pins must be connected to ground
+or LOW when the GAL is in the Edit mode.
+
+GALs do have different algorithm codes. These codes determine the parameters
+Edit mode voltage and STR pulse width. GALer supports the algorithm codes
+0 to 4. The function <a href="mengalinfo.html">GAL-Info</a> of GALer returns the algorithm code of
+the inserted GAL. This code is not very importent for you, but GALer needs
+this code for reading and programming GALs.
+
+
+
+            |             READ           |           PROGRAM
+------------+----------------------------+----------------------------
+ Algorithm  |  Edit mode    | STR pulse  |   Edit mode    | STR pulse
+            | read voltage  |            | prog. voltage  |
+------------+---------------+------------+----------------+-----------
+          0 |  12 &plusmn; 0,25 V  |    5 us    | 15,75 &plusmn; 0,25 V | 80 &plusmn; 5 ms
+          1 |  12 &plusmn; 0,25 V  |    5 us    | 15,75 &plusmn; 0,25 V | 80 &plusmn; 5 ms
+          2 |  12 &plusmn; 0,25 V  |    5 us    | 16,50 &plusmn; 0,25 V | 10 &plusmn; 1 ms
+          3 |  12 &plusmn; 0,25 V  |    5 us    | 14,50 &plusmn; 0,25 V | 40 &plusmn; 5 ms
+          4 |  12 &plusmn; 0,25 V  |    5 us    | 14,00 &plusmn; 0,25 V |100 &plusmn; 5 ms
+
+
+
+To erase a GAL you have to apply HIGH to P/V then pulse STR low for
+100 ms and then apply LOW to P/V. After this the GAL is erased and ready
+to be programmed again.
+
+
+The internal organization of the GAL (addresses of the parts) looks as
+follows:
+
+
+GAL16V8, GAL16V8A,B:
+
+Address                                         Width
+
+ 0-31           Fuse-Matrix                     64 Bit
+   32           Signature                       64 Bit
+33-59           reserved space                  64 Bit
+   60           Architecture-Control-Word ACW   82 Bit
+   61           Security bit
+   62           reserved
+   63           Bulk Erase
+
+
+
+GAL20V8, GAL20V8A,B:
+
+Address                                         Width
+
+ 0-39           Fuse-Matrix                     64 Bit
+   40           Signature                       64 Bit
+41-59           reserved space                  64 Bit
+   60           Architecture-Control-Word ACW   82 Bit
+   61           Security bit
+   62           reserved
+   63           Bulk Erase
+
+
+
+The Architecture-Control-Word has the following structure (82 Bit wide):
+
+
+
+GAL16V8:
+Bits  0-31: 32 bit product term enable 0-31
+Bits 32-35: 4 Bit XOR(n) for OLMC pins 19-16
+Bit     36: AC0-Bit
+Bits 37-44: 8 Bit AC1(n) for OLMC pins 19-12
+Bit     45: SYN-Bit
+Bits 46-49: 4 Bit XOR(n) for OLMC pins 15-12
+Bits 50-81: 32 Bit product term enable 32-63
+
+GAL16V8A,B:
+Bits  0-3: 4 Bit XOR(n) for OLMC pins 19-16
+Bit     4: AC0
+Bit   5-8: 4 Bit AC1(n) for OLMC pins 19-16
+Bit  9-72: 64 Bit product term enable PT0 - PT63
+Bit 73-76: 4 Bit AC1(n) for OLMC pins 15-12
+Bit    77: SYN
+Bit 78-81: 4 Bit XOR(n) for OLMC pins 15-12
+
+
+GAL20V8:
+Bits  0-31: 32 Bit product term enable 0-31
+Bits 32-35: 4 Bit XOR(n) for OLMC pins 22-19
+Bit     36: AC0-Bit
+Bits 37-44: 8 Bit AC1(n) f&uuml;r OLMC pins 22-15
+Bit     45: SYN-Bit
+Bits 46-49: 4 Bit XOR(n) f&uuml;r OLMC pins 18-15
+Bits 50-81: 32 Bit product term enable 32-63
+
+GAL20V8A,B:
+Bits  0-3: 4 Bit XOR(n) for OLMC pins 22-19
+Bit     4: AC0
+Bit   5-8: 4 Bit AC1(n) for OLMC pins 22-19
+Bit  9-72: 64 Bit product term enable PT0 - PT63
+Bit 73-76: 4 Bit AC1(n) for OLMC pins 18-15
+Bit    77: SYN
+Bit 78-81: 4 Bit XOR(n) for OLMC pins 18-15
+
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="reasmerr.html"><img src="prev.gif" alt="PREV" border=0></a><a href="schaltbesch.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/proglogik.html
@@ -1,0 +1,40 @@
+<html>
+<head>
+  <title>What are GALs?</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="systemreq.html"><img src="prev.gif" alt="PREV" border=0></a><a href="intstruktur.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>I.1 What are GALs?</u>
+
+GALs (Generic Array Logic) are programmable logic devices. By appropriate
+programming by the user, many standard gate functions can be resolved
+into a single GAL chip.
+
+Assuming you need the following logic functions for your circuit:
+
+ - AND -Gate with 2 inputs
+ - OR  -Gate with 2 inputs
+ - NAND-Gate with 2 inputs
+ - NOR -Gate with 2 inputs
+
+
+Normally you would need FOUR standard TTL-ICs. These functions can be
+replaced with ONE GAL. The main use of GALs is to make digital circuits as
+simple as possible, by replacing many standard logic ICs by one or more
+GALs.
+A GAL is able, with appropriate programming, to replace all the logic
+functions, such as for example: AND, OR, XOR, NAND, NOR, inverters,
+FlipFlops, decoders (especially address decoders), mutiplexers, counters.
+On top of all the GAL is reprogrammable (at least 100 times), so that the
+desired logic functions may easily be altered.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="systemreq.html"><img src="prev.gif" alt="PREV" border=0></a><a href="intstruktur.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/program.html
@@ -1,0 +1,46 @@
+<html>
+<head>
+  <title>How to Program GALs</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="assembler.html"><img src="prev.gif" alt="PREV" border=0></a><a href="testing.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.2.5  How to Program GALs</u>
+
+After the GAL-Assembler has created the <a href="jedecfile.html">JEDEC file</a> from the <a href="sourcefile.html">source file</a>,
+the GAL can be programmed using this JEDEC file. To initiate the
+programming of the GAL, simply select <a href="menprog.html">Program</a> and give the JEDEC file
+name. As soon as the GAL is programmed, a requester pops up, and tells
+you the GAL is programmed, and it is OK to remove the GAL from the
+programmer's socket.
+
+
+The steps in programming a GAL:
+
+  1. With a text editor create the source file and save this
+     file as &quot;name.pld&quot; (add the extension .pld!)
+
+  2. Assemble the source file. As a result of this you'll get
+     a JEDEC file (&quot;name.jed&quot;).
+
+  3. Select the GAL type
+
+  4. Insert the GAL in the programmer's socket
+
+  5. Perform the <a href="menempty.html">Blank test</a> to verify that the GAL is empty.
+     When the GAL is not empty, then you must first erase the GAL
+     before it can be programmed, use therefore the function <a href="menerase.html">Erase</a>.
+
+  6. Initiate programming by selecting <a href="menprog.html">Program</a>.
+
+  7. Take the GAL out of the programmer's socket, -  DONE !
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="assembler.html"><img src="prev.gif" alt="PREV" border=0></a><a href="testing.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/reasmerr.html
@@ -1,0 +1,60 @@
+<html>
+<head>
+  <title>Error Messages</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="jedecerr.html"><img src="prev.gif" alt="PREV" border=0></a><a href="proggal.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.5.3 Reassembler</u>
+
+&quot;mode AC0 = SYN = 0 is not supported&quot;
+   In the JEDEC file the bits AC0 and SYN are set to 0. This mode
+   is not supported by GALer.
+
+
+&quot;Pin xx: pin name defined twice&quot;
+   A pin name is used for more than one pin.
+
+
+&quot;Pin xx: illegal character&quot;
+   Legal characters are  : digits, letters and the '/'
+   Illegal characters are: Space, #, *, ...
+
+
+&quot;Pin xx: no pin name found&quot;
+   There is no name for the pin xx defined.
+
+
+&quot;Pin xx: VCC/GND at wrong pin&quot;
+   VCC and GND must be the pin names for the VCC and GND pin of the GAL.
+
+
+&quot;Pin xx: illegal use of '/'&quot;
+   Usage of the negation character: /pinname
+   Illegal:  pinname/, /, //pinname etc.
+
+
+&quot;Pin xx: GND expected&quot;
+   Pin 10 of GAL16V8 respectively pin 12 of GAL20V8 must be defined as GND.
+
+
+&quot;Pin xx: VCC expected&quot;
+   Pin 20 of GAL16V8 respectively pin 24 of GAL20V8 must be defined as VCC.
+
+
+&quot;Pin xx: AR is not allowed as pin name&quot;
+   When using a GAL22V10, AR is a keyword which is not allowed as pin name.
+
+&quot;Pin xx: SP is not allowed as pin name&quot;
+   When using a GAL22V10, SP is a keyword which is not allowed as pin name.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="jedecerr.html"><img src="prev.gif" alt="PREV" border=0></a><a href="proggal.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/schaltbesch.html
@@ -1,0 +1,113 @@
+<html>
+<head>
+  <title>Circuit Description</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="proggal.html"><img src="prev.gif" alt="PREV" border=0></a><a href="construction.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>III.2 Circuit Description</u>
+
+In the following section I'll describe the functioning of my GAL-programming
+device. I'll refer to my circuit diagram, so if you haven't ordered that,
+you can skip this section.
+
+The hardware is connected to the Amiga's parallel port. The connected data
+signals are D0-D4 and the BUSY-Line.
+ 
+IC1, IC3, IC4 and IC5 are eight way &quot;serial in/parallel out&quot; shift registers.
+The outputs of the shift-register from IC3, IC4 and IC5 are connected to the
+Textool-Zero insertion force socket for the GAL. Therefore it is possible to
+(besides VCC and GND) define each of the GAL's pins with a level (HIGH or
+LOW).
+
+The possible outputs of the GAL (pin 14 to 23) can be read through IC7 and
+IC6. IC7 is an eight way &quot;parallel in/serial out&quot; shift register.
+
+IC1 is so to speak the switch centre, this IC selects IC3, 4 and 5 (OE).
+Furthermore, this IC switches the programming voltages for the GAL (VCC,
+Edit-voltage) on or off.
+
+Since the ICs 1, 3, 4, 5, 7 can be individually accessed, a separate clock
+line is provided for each IC. These clock lines are selected via IC2, a 1 out
+of 4-decoder, by the parallel port's data lines D0 and D1.
+
+D3 determines whether a read (low) or write (high) operation is to occur.
+It must be ensured that D3 does not go low until the IC to be accessed is
+selected through D0 and D1. Otherwise an IC gets an unwanted clock-pulse
+and at the next Strobe-pulse (D2) the wrong (once left shifted) data is
+presented at the outputs.
+
+The Strobe-pulse for the shift-register is derived from D2 . When D2 goes
+high, the data in the shift registers is transferred to the output registers
+of ICs 1, 3, 4, 5.
+
+Through IC7, D2 can be made high (D2 = high), so that the data on Pins P1-P8
+are transferred to the internal shift register and may be read through the
+BUSY line by clocking the relevant clock-line.
+
+D4 transfers the individual bits from the Amiga to the GAL-Burner.
+
+Since Pins 2 and 4 of the Textool-socket may be supplied with the programming
+voltage of up to 16.5 Volt, we have to protect IC4 with the diodes D2 and D3
+against over voltage.
+
+The programming voltage is derived from IC9, a switch mode voltage regulator.
+This voltage can be precisely adjusted with the trimpots R40-R44.
+
+The relay K1 connects the supply voltage of the GAL to pin 24 of the
+Textool-Socket, Relay K2 connects the output Q7 from IC3 or +5V supply voltage
+(according to the GAL type) to Pin 22 of the Textool-Socket. Both relays are
+driven by IC1.
+
+The LED shows whether voltage is supplied to the Textool-Socket or not
+(controlled by software). When the LED is on, a GAL may not be inserted or
+removed from the socket.
+
+
+Parallel-Port:
+
+ D0-D1:  Selection of individual ICs by Clk
+ D2:     Strobe-pulse for IC 1, 3, 4, 5
+ D3:     write = low, read = high
+ D4:     Data line for &quot;Write Bits&quot;
+ BUSY:   Data line for &quot;Read Bits&quot;
+
+IC1:
+ Q1   make 16.5V (but don't switch it!)
+ Q2   switch edit-current on pin 2 for GAL20V8
+ Q3   switch edit-current on pin 4 for GAL16V8
+ Q5   switch Vcc
+ Q6   OE for IC3, 4, 5
+ Q7   controlles LED on : high, low = off
+ Q8   not used
+
+IC3:
+ Q1-Q8  pin 16-23 of the Textool-socket over R3-R8
+
+IC4:
+ Q1-Q8  pin 1-8 of the Textool-socket
+
+IC5:
+ Q1-Q3  pin 9-11 of the Textool-socket
+ Q4     pin 13 of the Textool-socket
+ Q5-Q6  pins 14, 15 of the Textool-socket over R9, R10
+
+IC6:
+ a      read level at pin 13 of the Textool-socket
+ b      read buffer of IC7
+ c      read level at pin 23 of the Textool-socket
+
+IC7:
+ P1-P8  read level at pin 14-21 of the Textool-socket
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="proggal.html"><img src="prev.gif" alt="PREV" border=0></a><a href="construction.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/shareware.html
@@ -1,0 +1,39 @@
+<html>
+<head>
+  <title>Shareware</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="galer.html"><img src="prev.gif" alt="PREV" border=0></a><a href="important.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+GALer is SHAREWARE. If you use this program and/or the hardware, please
+send me 20 DM or 15 US $. The circuit diagram for the hardware and the
+component mounting diagram for the PCB will be sent to you on receipt of
+the shareware donation.
+
+Send money by postal money order or cash, no checks please! If you send
+me a disk you will be sent the next update of GALer when it becomes
+available.
+
+My address is: Christian Habermann
+               Asamstr. 17
+               85356 Freising
+               Germany
+               EMail: <a href="mailto:Christian.Habermann@t-online.de">Christian.Habermann@t-online.de</a>
+
+
+The distribution of GALer on PD-disks or through the networks is
+permitted, as long as no profit is made from it, and that the included
+files remain unaltered, and are distributed in their entirety. If you build
+the GAL-prommer you are allowed to sell this one, to the price of the parts.
+It is not allowed to sell this product in commercial way. The circuit
+diagram must only be distributed privately and free of charge.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="galer.html"><img src="prev.gif" alt="PREV" border=0></a><a href="important.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/software.html
@@ -1,0 +1,27 @@
+<html>
+<head>
+  <title>The Software</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="gal20ra10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="sourcefile.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+                          Chapter II
+
+                         <u>The Software</u>
+
+
+In principle you can forget all of chapter I. In principle! What you should
+remember is the pin designations of the GAL in the different modes. Thereby
+avoiding many unnecessary failures. The determination of the function mode
+and the other parameters, which are to be taken into account during the
+programming of the GAL, are taken care of by the software.
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="gal20ra10.html"><img src="prev.gif" alt="PREV" border=0></a><a href="sourcefile.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/sourcefile.html
@@ -1,0 +1,239 @@
+<html>
+<head>
+  <title>Source File</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="software.html"><img src="prev.gif" alt="PREV" border=0></a><a href="installation.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.1 Source File</u>
+
+First a source file has to be created with a text editor. This source file
+must contain the following information:
+
+  1. The GAL type (GAL16V8 or GAL20V8 )
+
+  2. an 8 byte long comment, which will be written into the GAL as the
+     signature (see I.2)
+
+  3. The pin names - here pin numbers are replaced with names, which is
+     easier to oversee.
+
+  4. The Boolean equations
+
+  5. The keyword DESCRIPTION - after this you can place some desired text.
+     This text generally describes the GAL's function. That way you can know
+     years later what the GAL's intended use was.
+
+
+Before it's getting boreing here is a first example (be happy).
+
+Example 1:
+
+Assuming you need the following gates in your circuit:
+
+- one AND  with 3 inputs
+- one NAND with 2 Inputs
+- one OR with 2 inputs
+- one small digital circuit which feeds the outputs from 2 AND gates
+  to the inputs of one OR gate.
+
+Circuit diagram:
+(sorry for the European symbols)
+
+
+    AND:                        +----+                  W = A * B * C
+                          A ----|    |
+                          B ----| &amp;  |---- W
+                          C ----|    |
+                                +----+
+
+    NAND:                       +----+                  /X = D * E
+                          D ----|    |
+                                | &amp;  |o--- X
+                          E ----|    |
+                                +----+
+    OR:
+                                +----+                  Y = F + G
+                          F ----|    |
+                                | &#062;1 |---- Y
+                          G ----| =  |
+                                +----+
+
+    small  digital              +----+                  Z = H * I + J * K
+    circuit:              H ----|    |
+                                | &amp;  |----+
+                          I ----|    |    |   +----+
+                                +----+    +---|    |
+                                              | &#062;1 |---- Z
+                                +----+    +---|    |
+                          J ----|    |    |   +----+
+                                | &amp;  |----+
+                          K ----|    |
+                                +----+
+
+     Legend:
+        * : AND  - connection
+        + : OR - Connection
+        / : low active
+
+
+In order to create the source file we have to determine which type of GAL
+will suit our purpose.
+
+For the implementation of the above logic functions, we need a total of 11
+inputs and 4 outputs. From chapter I we know (or not?) that the type of GAL
+is dependant on the number of needed inputs.
+
+The number of inputs in turn depends on the mode (see
+<a href="gal16_20v8.html">pin designations of the various modes</a>). Since neither tristate
+nor register outputs are used, the GAL will be in mode 1 after programming.
+
+It therefore follows, the GAL16V8 has 10 inputs and 8 configurable outputs.
+Since we only need 4 outputs, we can program the rest of the outputs as inputs,
+so that we obtain the total required 11 inputs and 4 outputs.
+
+Therefore GAL16V8 is adequate for our purposes. GAL20V8 can also be used, but
+that leaves a lot of unused inputs (WASTE !).
+
+
+The second thing we need is a signature for the GAL. Remember, it can
+be up to 8 characters long. For example &quot;example&quot;.
+
+
+Now we have to define the pins.  The pins are named one after the other
+from 1 to 20. Pins that are not used should be named &quot;NC&quot; (not connected),
+ground with &quot;GND&quot; and +5V with &quot;VCC&quot;.
+
+here:    B  C   D   E   F  G  H  I  J  GND
+         K  NC  NC  NC  Z  Y  X  W  A  VCC
+
+that is:
+        Pin  1 := B     Input
+        Pin  2 := C     Input
+        Pin  3 := D     Input
+        Pin  4 := E     Input
+        Pin  5 := F     Input
+        Pin  6 := G     Input
+        Pin  7 := H     Input
+        Pin  8 := I     Input
+        Pin  9 := J     Input
+        Pin 10 := GND   Ground
+        Pin 11 := K     Input
+        Pin 12 := NC    Not Connected
+        Pin 13 := NC    Not Connected
+        Pin 14 := NC    Not Connected
+        Pin 15 := Z     Combinational Output
+        Pin 16 := Y     Combinational Output
+        Pin 17 := X     Combinational Output
+        Pin 18 := W     Combinational Output
+        Pin 19 := A     (Configurable Output defined as Input)
+        Pin 20 := VCC   Voltage Supply
+
+
+                     GAL16V8
+                    ---- ----
+                B  1|       |20  VCC
+                C  2|       |19  A
+                D  3|       |18  W
+                E  4|       |17  X
+                F  5|       |16  Y
+                G  6|       |15  Z
+                H  7|       |14  NC
+                I  8|       |13  NC
+                J  9|       |12  NC
+              GND 10|       |11  K
+                    ---------
+
+
+Next come the Boolean equations:
+
+        W  = A * B * C
+        /X = D * E
+        Y  = F + G
+        Z  = H * I + J * K
+
+Therewith we have all the parts required for the source file. Now the
+question arises, what format does such a file have?:
+
+In line 1 must be the type of GAL. Here  &quot;GAL16V8&quot;
+
+In line 2 must be the signature. Here  &quot;Example&quot;
+
+Then follow the pin declaration:
+
+         B  C   D   E   F  G  H  I  J  GND
+         K  NC  NC  NC  Z  Y  X  W  A  VCC
+
+Then the Boolean Equations:
+
+        W = A * B * C
+       /X = D * E
+        Y = F + G
+        Z = H * I + J * K
+and the keyword DESCRIPTION.
+
+Comments are introduced by a ';'.
+
+Now using a text editor you can create your source file, and save it with
+the title &quot;example.pld&quot;. Don't forget the extension &quot;.pld&quot;.
+
+This is how the file should look:
+
+(**** These characters designate the start and end of the file, please
+don't type it.)
+
+******************************************************
+GAL16V8         ; this is the GAL type
+Example         ; this is the signature
+
+B  C   D   E   F  G  H  I  J  GND       ; this is the pin declaration
+K  NC  NC  NC  Z  Y  X  W  A  VCC
+
+W  = A * B * C                  ; here are the pin definitions
+/X = D * E
+Y  = F + G
+Z  = H * I + J * K
+
+DESCRIPTION:
+here could be a comment which describes the function
+of this GAL
+******************************************************
+
+
+
+Negations ('/') in the pin declaration are considered in the Boolean
+equations. This means, if you use a '/' in the pin declaration and
+if you use the related pin in a Boolean equation this pin will be
+negated.
+
+<u>Example:</u>
+
+        A  B  /C  D .....  GND
+        K  L  M   N .....  VCC
+
+        N = C
+
+
+     This is the same:
+
+        A  B  C   D .....  GND
+        K  L  M   N .....  VCC
+
+        N = /C
+
+
+
+How do you obtain from this source file a programmed GAL? For that you
+need the program &quot;GALer&quot; which is described in the following sections.
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="software.html"><img src="prev.gif" alt="PREV" border=0></a><a href="installation.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/systemreq.html
@@ -1,0 +1,59 @@
+<html>
+<head>
+  <title>System Requirements</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="thanks.html"><img src="prev.gif" alt="PREV" border=0></a><a href="proglogik.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+To use GALer you need an Amiga with at least 512 kByte RAM and
+Workbench 2.0 or higher.
+
+Furthermore you need the MagicUserInterface (MUI) which is NOT
+included in the GALer package.
+
+Since MUI is Shareware and not Freeware, I'm obliged to print the
+following text:
+
+------------------------------------------------------------------------------
+
+                            This application uses
+
+
+                          MUI - MagicUserInterface
+
+                  (c) Copyright 1993/94 by Stefan Stuntz
+
+
+  MUI is a system to generate and maintain graphical user interfaces. With
+  the  aid  of  a  preferences program, the user of an application has the
+  ability to customize the outfit according to his personal taste.
+
+  MUI is distributed as shareware. To obtain a complete package containing
+  lots of examples and more information about registration please look for
+  a  file  called  &quot;muiXXusr.lha&quot;  (XX means the latest version number) on
+  your local bulletin boards or on public domain disks.
+
+            If you want to register directly, feel free to send
+
+
+                           DM 30.-  or  US$ 20.-
+
+                                    to
+
+                               Stefan Stuntz
+                          Eduard-Spranger-Stra&szlig;e 7
+                               80935 M&uuml;nchen
+                                  GERMANY
+
+------------------------------------------------------------------------------
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="thanks.html"><img src="prev.gif" alt="PREV" border=0></a><a href="proglogik.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/testing.html
@@ -1,0 +1,57 @@
+<html>
+<head>
+  <title>How to Test Programmed GALs</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="program.html"><img src="prev.gif" alt="PREV" border=0></a><a href="optimizer.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.2.6 How to Test Programmed GALs</u>
+
+Once the GAL has been programmed, the question remains, &quot;does it work the
+way you envisaged it?&quot;. Answering this question is the purpose of the
+GAL-Checker.
+
+In order to verify the GAL's functions, you must of course first plug
+the GAL into the programmer's socket, and select the correct GAL-type.
+Now you can select the menu item GAL-Checker.
+
+In the middle of the screen you'll see a symbolic GAL displayed. In this
+GAL, you'll see a number of 'I's and 'O's. The 'I' stands for Input and
+the 'O' for Output.
+The 'O' is a gadget. By clicking on the 'O' it turns into an 'I' and
+clicking on it again it becomes an 'O' again. In other words, you can
+determine if this pin is to be used as an input or an output.
+
+If a pin is an input, then you can select from another gadget if the pin
+is to be in a  &quot;High&quot; ('H') or in a &quot;Low&quot; ('L') state. An output can
+assume three states: 'H' (High), 'L' (Low) and&nbsp;'Z' (high impedance).
+The current state is displayed near the corresponding pin.
+
+If you're using the GAL from the <a href="sourcefile.html">above example</a>, pin 19
+must be defined as an input (=&quot;A&quot;) by clicking on the 'O' (the one at pin 19),
+since this pin was defined as an input during  programming in the above
+example.
+
+The inputs of the AND gate are:  pin 19  (=&quot;A&quot;),  pin  1 (=&quot;B&quot;), pin 2 (=&quot;C&quot;).
+The output is pin 18 (=&quot;W&quot;).
+
+If you now  set the inputs of the AND gate HIGH (by clicking on the gadgets),
+the output (=pin 18) should also go HIGH.  If it doesn't work or if the output
+also goes high with other combinations of input levels, then the fault is
+probably in the source file.  The error should be corrected in the source file.
+The GAL must then be erased and reprogrammed (a GAL can be erased and
+reprogrammed at least a hundred times). In this manner the whole GAL can
+be fully tested, and if no errors are detected, it can be used in your circuit.
+
+
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="program.html"><img src="prev.gif" alt="PREV" border=0></a><a href="optimizer.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/galer/thanks.html
@@ -1,0 +1,32 @@
+<html>
+<head>
+  <title>Thanks</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="history.html"><img src="prev.gif" alt="PREV" border=0></a><a href="systemreq.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+ Thanks to:   - all registerd GALer users
+
+              - Thorsten Elle for the PCB
+
+              - Frank Stange for beta-testing
+
+              - Helmut Hohenwarter for reading the documentation files
+
+              - Nico Fran&ccedil;ois for the reqtools.library
+                reqtools.library is (c) by Nico Fran&ccedil;ois
+
+              - Stefan Stuntz for the Magic User Interface (MUI)
+                MUI is (c) by Stefan Stuntz (see <a href="systemreq.html">System Requirements</a>)
+
+              - the firm Amiga for the great product Amiga
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="history.html"><img src="prev.gif" alt="PREV" border=0></a><a href="systemreq.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
binary files /dev/null b/galer/toc.gif differ
--- /dev/null
+++ b/galer/usage.html
@@ -1,0 +1,34 @@
+<html>
+<head>
+  <title>Allgemeines zur Bedienung</title>
+  <meta name="Generator" content="GuideML V1.6">
+  <meta http-equiv="Content-Type" content="text/html">
+</head>
+<body>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="installation.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menus.html"><img src="next.gif" alt="NEXT" border=0></a>
+<hr>
+<pre>
+
+<u>II.2.2 How to Use GALer</u>
+
+The usage is easy. For each action corresponding requesters will appear
+which informs you what's going on and what to do.
+
+The most requesters can be confirmed/refused by pressing the
+corresponding gadgets or by using the Return/ESC key.
+
+In addition GALer has a online help. So if you want to get help on a
+menu item, a gadget group or a window, just move the mouse pointer
+over it and press the HELP key.
+
+GALer uses several files which have different extensions like &quot;.pld&quot;, &quot;.jed&quot;,
+&quot;.chp&quot;, &quot;.pin&quot;, &quot;.fus&quot;. If you want to load or save such a file GALer will
+choose the right extensions automatically. So you don't have to care about
+it. If you don't enter the postfix, GALer will add it.
+
+
+</pre>
+<hr>
+<a href="main.html"><img src="toc.gif" alt="CONTENTS" border=0></a><a href="index.html"><img src="index.gif" alt="INDEX" border=0></a><a href="installation.html"><img src="prev.gif" alt="PREV" border=0></a><a href="menus.html"><img src="next.gif" alt="NEXT" border=0></a>
+</body>
+</html>
--- /dev/null
+++ b/src/galasm.c
@@ -1,0 +1,2454 @@
+/******************************************************************************
+** galasm.c
+*******************************************************************************
+**
+** description:
+**
+** This file contains the GAL-assembler.
+**
+******************************************************************************/
+
+
+
+/********************************* includes **********************************/
+
+#include <u.h>
+#include <libc.h>
+#include <ctype.h>
+#include <stdio.h>
+
+#include "galasm.h"
+
+
+/********************************** defines **********************************/
+
+#define SUFFIX_NON              0       /* possible suffixes */
+#define SUFFIX_T                1
+#define SUFFIX_R                2
+#define SUFFIX_E                3
+#define SUFFIX_CLK              4
+#define SUFFIX_APRST            5
+#define SUFFIX_ARST             6
+
+#define DUMMY_OLMC11            24
+#define DUMMY_OLMC12            25
+
+
+/******************************** variables **********************************/
+ 
+
+
+
+/* Diese Arrays geben an, in welche Spalte der ent-  */
+/* sprechende Pin eingekoppelt (bzw. r�ckgekoppelt)  */
+/* wird. F�r die invertierende Einkopplung ist 1 zu  */
+/* addieren, um die entsprechende Spalte zu erhalten */
+/* -1 hei�t: keine Einkopplung auf Matrix vorhanden  */
+
+
+/* A possible translation (courtesy of Babelfish)
+ * These arrays indicate, into which column the appropriate pin
+ * becomes linked (and/or jerk-coupled). For inverting linking 
+ * is to be added 1, in order to receive the appropriate column -1 hei_t
+ * : no linking on matrix available.
+ */
+
+/* Possible interpretation (by me) 
+ * These arrays maps the pins to the fuse matrix. Each integer
+ * represents the number of the linked column or -1 if that pin
+ * dosn't link to any column . For inverted signals, the right column
+ * number can be calculated by adding one to the given number.
+ */
+
+/* GAL16V8 */
+
+int     PinToFuse16Mode1[20]    = {  2,  0,  4,  8, 12, 16, 20, 24, 28, -1,
+                                    30, 26, 22, 18, -1, -1, 14, 10,  6, -1 };
+
+int     PinToFuse16Mode2[20]    = {  2,  0,  4,  8, 12, 16, 20, 24, 28, -1,
+                                    30, -1, 26, 22, 18, 14, 10,  6, -1, -1 };
+
+int     PinToFuse16Mode3[20]    = { -1,  0,  4,  8, 12, 16, 20, 24, 28, -1,
+                                    -1, 30, 26, 22, 18, 14, 10,  6,  2, -1 };
+
+/* GAL20V8 */
+
+int     PinToFuse20Mode1[24]    = {  2, 0, 4, 8,12,16,20,24,28,32,36,-1,
+                                    38,34,30,26,22,-1,-1,18,14,10, 6,-1 };
+
+int     PinToFuse20Mode2[24]    = {  2, 0, 4, 8,12,16,20,24,28,32,36,-1,
+                                    38,34,-1,30,26,22,18,14,10,-1, 6,-1 };
+
+int     PinToFuse20Mode3[24]    = { -1, 0, 4, 8,12,16,20,24,28,32,36,-1,
+                                    -1,38,34,30,26,22,18,14,10, 6, 2,-1 };
+
+
+/* GAL22V10 */
+
+int     PinToFuse22V10[24]      = {  0, 4, 8,12,16,20,24,28,32,36,40,-1,
+                                    42,38,34,30,26,22,18,14,10, 6, 2,-1 };
+
+
+/* GAL20RA10 */
+
+int     PinToFuse20RA10[24]     = { -1, 0, 4, 8,12,16,20,24,28,32,36,-1,
+                                    -1,38,34,30,26,22,18,14,10, 6, 2,-1 };
+
+
+/* These arrays show which row is connected to */
+/* which OLMC */
+
+int     ToOLMC[8]         = { 56, 48, 40, 32, 24, 16, 8, 0 };
+
+int     ToOLMC22V10[12]   = { 122, 111, 98, 83, 66, 49, 34, 21, 10, 1, 0, 131 };
+
+int     ToOLMC20RA10[10]  = { 72, 64, 56, 48, 40, 32, 24, 16, 8, 0 };
+
+/* this array shows the size of the */
+/* 22V10-OLMCs ( AR and SP = 1 )    */
+
+int     OLMCSize22V10[12] = { 9, 11, 13, 15, 17, 17, 15, 13, 11, 9, 1, 1 };
+
+/* The last two entries of the 22V10 arrays are for the   */
+/* AR and SP rows of the 22V10 GAL. This rows are not     */
+/* connected to an OLMC. But to keep the assembler as     */
+/* simple as possible, I introduced  two "OLMCs" for the  */
+/* AR and SP. The assembler treads them like real OLMCs.  */
+/* So don't become confused when OLMC number 11 and 12    */
+/* are used as inputs, outputs, pins... by the assembler. */
+/* These two OLMCs are just dummy-OLMCs.                  */
+
+
+UBYTE   PinNames[24][10];
+UBYTE   PinDecNeg[24];
+UBYTE   ModeErrorStr[] = "Mode  x:  Pin xx";
+UBYTE   *pinnames;
+int    	modus;
+
+int     linenum;
+UBYTE   *actptr, *buffend;
+
+
+struct  JedecStruct     Jedec;
+
+struct  Pin             actPin;
+struct  GAL_OLMC        OLMC[12];
+
+UBYTE   *fbuff;
+
+
+
+/******************************************************************************
+** int AssemblePldFile(char *file)
+*******************************************************************************
+** input:   file  The file to be assembled 
+**
+** output:  0:    successful
+**          else: error
+**
+** remarks: This function does assemble a *.pld file.
+******************************************************************************/
+ 
+int AssemblePldFile(char *file, struct Config *cfg)
+{ 
+    UBYTE   chr;
+    UBYTE   *bool_start, *oldptr;
+    char    prevOp;
+    char    suffix_strn[MAX_SUFFIX_SIZE];
+    int     i = 0, j, k, l = 0, n, m;
+    int     max_chr, pass, pin_num, bool_linenum;
+    int     actOLMC, row_offset, newline, oldline;
+    int     suffix, start_row, max_row, num_of_olmcs;
+	int		gal_type;
+	int		num_of_pins;
+	int		olmc_1st_pin;
+	int  	num_of_col,fsize;
+
+        {
+            fsize = FileSize(file);
+
+		if((fbuff = malloc(fsize)))
+            {
+                if ((ReadFile(file, fsize, fbuff)))
+                {
+                    actptr  = fbuff;
+                    buffend = fbuff+fsize;
+                    linenum = 1;
+
+/* This code generates a warning about exceeding array bounds */
+#ifndef IGNOREME /* was #if 0 */
+                    for (n = 0; n < sizeof(Jedec); n++)
+                    {                            /* init. JEDEC structure */
+                        if (n < LOGIC22V10_SIZE)
+                            Jedec.GALLogic[n] = 1;         /* set fuses */
+                        else
+                            Jedec.GALLogic[n] = 0;         /* clear ACW... */
+                    }
+#endif
+/* I think this is what is intended: GALLogic is set to 1s, rest is cleared */
+                    memset(&Jedec, 0, sizeof(Jedec));
+                    memset(Jedec.GALLogic, 1, sizeof(Jedec.GALLogic));
+
+                    for (n = 0; n < 12; n++)
+                    {                              /* clear OLMC structure */
+                        OLMC[n].Active   = 0;
+                        OLMC[n].PinType  = 0;
+                        OLMC[n].TriCon   = 0;
+                        OLMC[n].Clock    = 0;
+                        OLMC[n].ARST     = 0;
+                        OLMC[n].APRST    = 0;
+                        OLMC[n].FeedBack = 0;
+                    }
+
+
+                    /*** get type of GAL ***/
+
+                    if (strncmp((char *)actptr, "GAL16V8", (usize)7) == 0)
+                    {
+                        num_of_olmcs = 8;                  /* number of OLMCs */
+                        num_of_pins  = 20;                 /* number of pins  */
+                        olmc_1st_pin = 12;                 /* 1st OLMC pin    */
+                        num_of_col   = MAX_FUSE_ADR16 + 1; /* number of col.  */
+                        gal_type     = GAL16V8;
+
+                        if ((*(actptr+7L) != ' ')  &&	/* Only ' ', newline and tab are valid 	*/
+                            (*(actptr+7L) != 0x0A) &&   /* after the GAL's name					*/
+                            (*(actptr+7L) != 0x09))		/* Any other char will produce an error */
+                        {
+                          AsmError(1, 0);
+                            return(-1);
+                        }
+                    }
+                    else
+                    if (strncmp((char *)actptr, "GAL20V8", (usize)7) == 0)
+                    {
+                        num_of_olmcs = 8;                 /* num of OLMCs */
+                        num_of_pins  = 24;                /* num of pins  */
+                        olmc_1st_pin = 15;                /* 1st OLMC pin */
+                        num_of_col   = MAX_FUSE_ADR20 + 1;/* num of col   */
+                        gal_type     = GAL20V8;
+
+                        if ((*(actptr+7L) != ' ')  &&
+                            (*(actptr+7L) != 0x0A) &&
+                            (*(actptr+7L) != 0x09))
+                        {
+                              AsmError(1, 0);
+                            return(-1);
+                        }
+                    }
+                    else
+                    if (strncmp((char *)actptr, "GAL20RA10", (usize)9) == 0)
+                    {
+                        num_of_olmcs = 10;
+                        num_of_pins  = 24;
+                        olmc_1st_pin = 14;
+                        num_of_col   = MAX_FUSE_ADR20RA10 + 1;
+                        gal_type     = GAL20RA10;
+
+                        if ((*(actptr+9L) != ' ')  &&
+                            (*(actptr+9L) != 0x0A) &&
+                            (*(actptr+9L) != 0x09) )
+                        {
+                                AsmError(1, 0);
+                            return(-1);
+                        }
+                    }
+                    else
+                    if (strncmp((char *)actptr, "GAL22V10", (usize)8) == 0)
+                    {
+                        num_of_olmcs = 10;
+                        num_of_pins  = 24;
+                        olmc_1st_pin = 14;
+                        num_of_col   = MAX_FUSE_ADR22V10 + 1;
+                        gal_type     = GAL22V10;
+
+                        if ((*(actptr+8L) != ' ')  &&
+                            (*(actptr+8L) != 0x0A) &&
+                            (*(actptr+8L) != 0x09))
+                        {
+                              AsmError(1, 0);
+                            return(-1);
+                        }
+                    }
+                    else
+                    {
+                        AsmError(1, 0);
+                        return(-1);
+                    }
+
+
+                                /*** get the leading 8 bytes of the second ***/
+                                /*** line as signature                     ***/
+
+
+                if (GetNextLine())                   /* end of file? */
+                {
+                    AsmError(2, 0);                  /* yes, then error */
+                    return(-1);
+                }
+                                            /* store signature in the */
+                n = m = 0;                  /* JEDEC structure        */
+
+
+                                        /* end of signature: after eight */
+                                        /* characters, CR or TAB         */
+
+
+                while((*actptr != 0x0A) && (*actptr != 0x09) && (n < 8))
+                {
+                    chr = *actptr;
+
+                    for (m = 0; m < 8; m++)
+                    Jedec.GALSig[n*8 + m] = (chr >> (7 - m)) & 0x1;
+
+                    actptr++;                   /* increment pointer and */
+                    n++;                        /* character-counter     */
+
+                    if (actptr>buffend)         /* end of file ?   */
+                    {                           /* yes, then error */
+
+                        AsmError(2, 0);
+                        return(-1);
+                    }
+                }
+
+
+                                /*** get name of pins ***/
+
+                                        /* clear flags for negations */
+                                        /* in the pin declaration    */
+
+                for (n = 0; n < 24; PinDecNeg[n++] = 0);
+
+
+
+                pinnames = &PinNames[0][0]; /*assembler: pin names in PinNames*/
+
+                               /* set flag 'not assembled' */
+
+                GetNextLine();
+
+            for (n = 0; n < num_of_pins; n++)
+            {
+                if (GetNextChar())              /* unexpected end of file? */
+                {                               /* yes, then error         */
+                    AsmError(2, 0);
+                    return(-1);
+                }
+
+                m = 0;
+
+                chr = *actptr;                  /* get character */
+
+                if (IsNEG(chr))                 /* is there a negation? */
+                {
+                    max_chr      = 10;
+                    PinDecNeg[n] = 1;           /* yes, then set flag */
+                }
+                else
+                    max_chr = 9;
+
+                if (!(isalpha(chr) || isdigit(chr) || IsNEG(chr)))
+                {
+                    AsmError(5, 0);             /* is character a legal */
+                    return(-1);                 /* one?                 */
+                }
+
+                k = 0;
+
+                while (isalpha(chr) || isdigit(chr) || IsNEG(chr))
+                {
+                    if (IsNEG(chr) && k != 0)    /* check position of '/' */
+                    {
+                        AsmError(10, 0);         /* must be at the beginning */
+                        return(-1);              /* of the pin name          */
+                    }
+
+                    k = 1;
+
+                    actptr++;
+
+                    if (IsNEG(chr) && (!(isalpha(*actptr) || isdigit(*actptr))))
+                    {
+                        AsmError(3, 0);
+                        return(-1);
+                    }
+
+                    *(pinnames + n*10 + m) = chr;
+
+                    m++;
+
+                    chr = *actptr;
+
+                    if (m == max_chr)          /* check number of characters */
+                    {                          /* in this pinname            */
+                        AsmError(4, 0);
+                        return(-1);            /* error: too many char. */
+                    }
+
+                }
+
+                *(pinnames+n*10+m) = 0;         /* mark end of string */
+
+                for (l = 0; l < n; l++)         /* pin name twice? */
+                {
+                    if (strcmp((char *)pinnames+l*10, "NC"))
+                    {
+                        i = j = 0;
+
+                        if (IsNEG(*(pinnames+l*10)))  /* skip negation sign */
+                            i = 1;
+
+                        if (IsNEG(*(pinnames+n*10)))
+                            j = 1;
+
+                        if (!strcmp((char *)(pinnames+l*10+i),
+                                    (char *)(pinnames+n*10+j)))
+                        {
+                            AsmError(9, 0);       /* pin name defined twice */
+                            return(-1);
+                        }
+                    }
+                }
+                                                  /* is GND at the GND-pin? */
+                if (!strcmp((char *)(pinnames + n*10), "GND"))
+                {
+                    if (n+1 != num_of_pins/2)
+                    {
+                        AsmError(6, 0);
+                        return(-1);
+                    }
+                }
+
+                if (n + 1 == num_of_pins/2)
+                {
+                    if (strcmp((char *)(pinnames + n*10), "GND"))
+                    {
+                        AsmError(8, 0);
+                        return(-1);
+                    }
+                }
+                                                /* is VCC at the VCC pin? */
+                if (!strcmp((char *)(pinnames + n*10), "VCC"))
+                {
+                    if (n+1 != num_of_pins)
+                    {
+                        AsmError(6, 0);
+                        return(-1);
+                    }
+                }
+
+                if (n + 1 == num_of_pins)
+                {
+                    if (strcmp((char *)(pinnames + n*10), "VCC"))
+                    {
+                        AsmError(7, 0);
+                        return(-1);
+                    }
+                }
+                                        /* AR and SP are key words for 22V10 */
+                                        /* they are not allowed in the pin */
+                                        /* declaration */
+                if (gal_type == GAL22V10)
+                {
+                    if (!strcmp((char *)(pinnames+n*10), "AR"))
+                    {
+                        AsmError(18, 0);
+                        return(-1);
+                    }
+
+                    if (!strcmp((char *)(pinnames + n*10), "SP"))
+                    {
+                        AsmError(18, 0);
+                        return(-1);
+                    }
+                }
+
+            }
+
+
+/* Boolean-Equations auswerten:
+   Dabei werden die Boolean-Equations zweimal untersucht. Beim ersten
+   Durchlauf werden die OLMC-Pins ausgewertet und die OLMC-Struktur ge-
+   f�llt. Mit Hilfe dieser Struktur l��t sich auf dem notwendigen Modus
+   (1, 2 oder 3) schlie�en. Beim zweiten Durchlauf wird dann die
+   Fuse-Matrix erstellt.
+*/
+
+/* Babelfish translation (slightly adapted):
+   Boolean Equations evaluate:
+   The Boolean Equations is twice examined.
+   With the first run the OLMC pins are evaluated and the OLMC structure is filled.
+   With the help of this structure the correct mode (1, 2 or 3) will be 
+   calculated. With the second run the Fuse matrix is then provided.
+*/
+    if (GetNextChar())                  /* end of file? */
+    {
+        AsmError(2, 0);
+        return(-1);
+    }
+
+                                        /* are there any equations? */
+    if (!strncmp((char *)actptr, "DESCRIPTION", (usize)11))
+    {
+        AsmError(33, 0);              /* no, then error */
+        return(-1);
+    }
+
+
+    bool_start   = actptr;            /* set pointer to the beginning of    */
+    bool_linenum = linenum;           /* the equations and save line number */
+
+
+    for (pass = 0; pass < 2; pass++)  /* this is a two-pass-assembler */
+    {
+	if (!cfg->Quiet) printf("Assembler Phase %d for \"%s\"\n", (pass+1), file);
+
+        if (pass)                       /* 2. pass? => make ACW and get */
+        {                               /* the mode for 16V8,20V8 GALs  */
+            modus = 0;
+                                /*** GAL16V8, GAL20V8 ***/
+
+            if (gal_type == GAL16V8 || gal_type == GAL20V8)
+            {
+                for (n = 0; n < 8; n++)            /* examine all OLMCs */
+                {
+                    if (OLMC[n].PinType == REGOUT) /* is there a registered  */
+                    {                              /* OLMC?, then GAL's mode */
+                                                   /* is mode 3              */
+                        if (!modus)
+                        {
+                            modus = MODE3;
+                            Jedec.GALSYN = 0;      /* set SYN and AC0 for mode 3 */
+                            Jedec.GALAC0 = 1;
+
+                            if (cfg->Verbose)
+                                printf("Using %s mode because:\n", GetModeName(modus));
+                        }
+
+                        pin_num = n + olmc_1st_pin;
+
+                        if (cfg->Verbose)
+                            printf("  pin %d (%s) is configured as registered output\n",
+                                   pin_num, GetPinName(pinnames, pin_num));
+                    }
+                }
+
+
+                if (!modus)                     /* still no mode? */
+                {
+                    for (n = 0; n < 8; n++)    /* examine all OLMCs */
+                    {
+                        if (OLMC[n].PinType == TRIOUT) /* is there a tristate */
+                        {                              /* OLMC?, then GAL's   */
+                                                       /* mode is mode 2      */
+                            if (!modus)
+                            {
+                                modus = MODE2;
+                                Jedec.GALSYN = 1;      /* set SYN, AC0 for mode 2 */
+                                Jedec.GALAC0 = 1;
+
+                                if (cfg->Verbose)
+                                    printf("Using %s mode because:\n", GetModeName(modus));
+                            }
+
+                            pin_num = n + olmc_1st_pin;
+
+                            if (cfg->Verbose) {
+                                printf("  pin %d (%s) is configured as tri-state output\n",
+                                       pin_num, GetPinName(pinnames, pin_num));
+                            }
+                        }
+                    }
+                }
+
+
+                if (!modus)           /* still no mode? */
+                {
+                                      /* if there is a violation of mode 1, */
+                                      /* then use automatically mode 2      */
+                    for (n = 0; n < 8; n++)
+                    {
+                        if (OLMC[n].PinType == INPUT || (OLMC[n].PinType == COM_TRI_OUT && OLMC[n].FeedBack))
+                        {
+                            pin_num = n + olmc_1st_pin;
+
+                            if ((gal_type == GAL16V8 && (pin_num == 15 || pin_num == 16)) ||
+                                (gal_type == GAL20V8 && (pin_num == 18 || pin_num == 19)))
+                            {
+                                if (!modus)
+                                {
+                                    modus = MODE2;      /* mode 2 */
+
+                                    Jedec.GALSYN = 1;   /* set SYN, AC0 bit */
+                                    Jedec.GALAC0 = 1;
+
+                                    if (cfg->Verbose)
+                                        printf("Using %s mode because:\n", GetModeName(modus));
+                                }
+
+			        if (cfg->Verbose)
+                                    printf("  pin %d (%s) is configured as %s\n", pin_num,
+                                           GetPinName(pinnames, pin_num),
+                                           OLMC[n].PinType == INPUT ? "input" : "output with feedback");
+                            }
+                        }
+                    }
+                }
+
+                if (!modus)             /* if there is still no mode */
+                {                       /* defined, use mode 1 */
+                    modus = MODE1;
+
+                    Jedec.GALSYN = 1;       /* set SYN and AC0 bit */
+                    Jedec.GALAC0 = 0;
+
+	            if (cfg->Verbose) {
+                        printf("Defaulting to %s mode\n", GetModeName(modus));
+                    }
+                }
+
+
+
+                /* If GAL's mode is mode 1, use all OLMCs which type is   */
+                /* not defined explicitly as combinational outputs.       */
+                /* If GAL's mode is mode 2 or 3, use all OLMCs which type */
+                /* is not defined explicitly as tristate output which is  */
+                /* always enabled */
+
+
+                for (n = 0; n < 8; n++)         /* examine all OLMCs */
+                {
+                    if (OLMC[n].PinType == COM_TRI_OUT) /* is OLMC's type */
+                    {                                   /* definded expl. */
+                        if (modus == MODE1)  /* mode 1? then comb. output */
+                            OLMC[n].PinType = COMOUT;
+                        else
+                        {
+                            OLMC[n].PinType = TRIOUT;   /* mode 2, 3? then */
+                                                        /* tri. output     */
+
+                            OLMC[n].TriCon  = TRI_VCC;  /* tristate control */
+                                                        /* = TRUE           */
+                        }
+                    }
+                }
+        
+                /* make ACW; (SYN and AC0 are */
+                /* defined already) */
+
+                for (n = 0; n < PT_SIZE; n++)   /* set product term disable */
+                    Jedec.GALPT[n] = 1;
+
+                                        /* get AC1 bits */
+                for (n = 0; n < AC1_SIZE; n++)
+                {
+                    if (OLMC[n].PinType == INPUT || OLMC[n].PinType == TRIOUT)
+                        Jedec.GALAC1[AC1_SIZE - 1 - n] = 1;
+                }
+
+                for (n = 0; n < XOR_SIZE; n++)         /* get XOR bits */
+                {
+                    if (((OLMC[n].PinType == COMOUT) ||
+                         (OLMC[n].PinType == TRIOUT) ||
+                         (OLMC[n].PinType == REGOUT)) &&
+                         (OLMC[n].Active  == ACTIVE_HIGH))
+                            Jedec.GALXOR[XOR_SIZE - 1 - n] = 1;
+                }
+
+            }
+
+            /*** GAL22V10 ***/
+            if (gal_type == GAL22V10)
+            {
+                for (n = 0; n < 10; n++)
+                {
+                    if (OLMC[n].PinType == COM_TRI_OUT)  /* output can be */
+                        OLMC[n].PinType = TRIOUT;        /* tristate or   */
+                                                         /* register      */
+
+                    if (((OLMC[n].PinType == COMOUT) ||
+                        (OLMC[n].PinType == TRIOUT) ||
+                        (OLMC[n].PinType == REGOUT)) &&
+                        (OLMC[n].Active  == ACTIVE_HIGH))
+                        Jedec.GALXOR[9 - n] = 1;
+
+                    /* get AC1 bits (S1) */
+                    if (OLMC[n].PinType == INPUT || OLMC[n].PinType == TRIOUT)
+                        Jedec.GALS1[9 - n] = 1;
+                }
+
+            }
+
+            /*** GAL20RA10 ***/
+            if (gal_type == GAL20RA10)
+            {
+                                                /* get XOR bits (S0) */
+                for (n = 0; n < 10; n++)
+                {
+                    if (OLMC[n].PinType == COM_TRI_OUT) /* output can be */
+                        OLMC[n].PinType = TRIOUT;       /* tristate or   */
+                                                        /* register      */
+
+                    if (((OLMC[n].PinType == COMOUT) ||
+                         (OLMC[n].PinType == TRIOUT) ||
+                         (OLMC[n].PinType == REGOUT)) &&
+                         (OLMC[n].Active  == ACTIVE_HIGH))
+                        Jedec.GALXOR[9 - n] = 1;
+                }
+            }
+        }
+
+	if(pass)
+	{
+			if(!cfg->Quiet) {
+			printf("GAL%s", GetGALName(gal_type));
+
+			if (gal_type == GAL16V8 || gal_type == GAL20V8)
+				printf("; Operation mode: %s", GetModeName(modus));
+
+			printf("; Security fuse %s\n", cfg->JedecSecBit ? "on" : "off");
+		}
+	}
+
+        actptr  = bool_start;
+        linenum = bool_linenum;
+        newline = linenum;
+
+        goto label1;            /* Shit, don't blame me for the gotos.       */
+                                /* I know, goto is a very bad command in C   */
+                                /* and in the most other languages. But it   */
+                                /* is very hard to remove them in this case. */
+
+loop1:
+
+        if (GetNextChar())                          /* end of file? */
+        {
+            AsmError(2, 0);
+            return(-1);
+        }
+
+        suffix = SUFFIX_NON;
+
+        if (*actptr == '.')         /* is there a suffix?       */
+        {                           /* yes, then get the string */
+            actptr++;
+
+            if (gal_type == GAL22V10 &&
+                (actPin.p_Pin == 24 || actPin.p_Pin == 25))
+            {
+                AsmError(39, 0);                /* no suffix allowed at */
+                return(-1);                     /* AR and SP */
+            }
+
+
+            n = 0;
+            while (isalpha(*actptr))            /* copy suffix string into */
+            {                                   /* suffix array            */
+                if (n < MAX_SUFFIX_SIZE)
+                    suffix_strn[n++] = *actptr++;
+                else
+                {                               /* string too long, then */
+                    AsmError(13, 0);            /* unknown suffix        */
+                    return(-1);
+                }
+            }
+
+            suffix_strn[n] = 0;                 /* mark end of string */
+
+                 if (suffix_strn[0] == 'T')				suffix = SUFFIX_T;
+            else if (suffix_strn[0] == 'R')				suffix = SUFFIX_R;
+            else if (suffix_strn[0] == 'E')				suffix = SUFFIX_E;
+            else if (!strcmp(&suffix_strn[0], "CLK"))	suffix = SUFFIX_CLK;
+            else if (!strcmp(&suffix_strn[0], "ARST"))	suffix = SUFFIX_ARST;
+            else if (!strcmp(&suffix_strn[0], "APRST"))	suffix = SUFFIX_APRST;
+            else
+            {
+                AsmError(13, 0);    /* unknown suffix */
+                return(-1);
+            }
+
+            /* check whether suffix is */
+            /* allowed or not */
+            if (gal_type != GAL20RA10)
+            {
+                switch (suffix)
+                {
+                    case SUFFIX_CLK:
+                        AsmError(34, 0);            /* no .CLK allowed */
+                        return(-1);
+                        break;
+
+                    case SUFFIX_ARST:
+                        AsmError(35, 0);            /* .ARST is not allowed */
+                        return(-1);
+                        break;
+
+                    case SUFFIX_APRST:
+                        AsmError(36, 0);            /* .APRST is not allowed */
+                        return(-1);
+                        break;
+                }
+            }
+
+            if (GetNextChar())                      /* end of file? */
+            {
+                AsmError(2, 0);
+                return(-1);
+            }
+        }
+
+        actOLMC = (int)actPin.p_Pin;                /* save offset of OLMC */
+
+        if (gal_type == GAL16V8)
+            actOLMC -= 12;
+        else
+        if (gal_type == GAL20V8)
+            actOLMC -= 15;
+        else
+            actOLMC -= 14;
+
+
+        row_offset = 0;                     /* offset for OR at OLMC*/
+        prevOp     = 0;                     /* previous operator */
+
+        if (!pass)                      /* is this pass 1? */
+        {                               /* is pin a OLMC pin? */
+            if (((gal_type == GAL16V8) &&
+                 (actPin.p_Pin >= 12)  && (actPin.p_Pin <= 19)) ||
+                ((gal_type == GAL20V8) &&
+                 (actPin.p_Pin >= 15) && (actPin.p_Pin <= 22)) ||
+                ((gal_type == GAL22V10) &&
+                 (actPin.p_Pin >= 14) && (actPin.p_Pin <= DUMMY_OLMC12)) ||
+                ((gal_type == GAL20RA10) &&
+                 (actPin.p_Pin >= 14) && (actPin.p_Pin <= 23)))
+            {
+
+                switch (gal_type)           /* get OLMC number */
+                {
+                    case GAL16V8:
+                        n = actPin.p_Pin - 12;
+                        break;
+
+                    case GAL20V8:
+                        n = actPin.p_Pin - 15;
+                        break;
+
+                    case GAL22V10:
+                    case GAL20RA10:
+                        n = actPin.p_Pin - 14;
+                        break;
+                }
+
+
+
+                switch (suffix)
+                {
+
+                    case SUFFIX_R:                /* output definition */
+                    case SUFFIX_T:
+                    case SUFFIX_NON:
+
+                        if (!OLMC[n].PinType || OLMC[n].PinType == INPUT)
+                        {
+
+                            if (actPin.p_Neg)        /* get pin's activation */
+                                OLMC[n].Active = ACTIVE_LOW;
+                            else
+                                OLMC[n].Active = ACTIVE_HIGH;
+
+                            if (suffix == SUFFIX_T)
+                                OLMC[n].PinType = TRIOUT;  /* tri. output */
+
+                            if (suffix == SUFFIX_R)
+                                OLMC[n].PinType = REGOUT;  /* reg. output */
+
+                            if (suffix == SUFFIX_NON)    /* type of output is */
+                                OLMC[n].PinType = COM_TRI_OUT; /* not defined */
+                                                               /* explicitly  */
+                        }
+                        else
+                        {
+                            if (gal_type == GAL22V10 && (n == 10 || n == 11))
+                            {
+                                AsmError(40, 0);  /* AR or SP is defined */
+                                return(-1);       /* twice               */
+                            }
+                            else
+                            {
+                                AsmError(16, 0);  /* pin is defined twice as */
+                                return(-1);       /* output                  */
+                            }
+                        }
+
+                        break;
+
+
+
+                case SUFFIX_E:
+
+                    if (actPin.p_Neg)       /* negation of the trisate */
+                    {                       /* control is not allowed */
+                        AsmError(19, 0);
+                        return(-1);
+                    }
+
+                    if (OLMC[n].TriCon)     /* tri. control twice? */
+                    {                       /* yes, then error */
+                        AsmError(22, 0);
+                        return(-1);
+                    }
+
+                    OLMC[n].TriCon = TRICON; /* set the flag that there is */
+                                             /* a tri. control equation    */
+
+                    if (!OLMC[n].PinType || OLMC[n].PinType == INPUT)
+                    {
+                        AsmError(17, 0);     /* the sequence must be output  */
+                        return(-1);          /* followed by the tri. control */
+                    }
+
+
+                    if (OLMC[n].PinType == REGOUT &&
+                        (gal_type == GAL16V8 || gal_type == GAL20V8))
+                    {
+                        AsmError(23, 0);  /* GAL16V8/20V8: tristate control */
+                        return(-1);       /* for reg. output is not allowed */
+                    }
+
+
+                    if (OLMC[n].PinType == COM_TRI_OUT)
+                    {                                   /* no tristate .T? */
+                        AsmError(24, 0);                /* then error      */
+                        return(-1);
+                    }
+
+                    break;
+
+
+
+               case SUFFIX_CLK:
+
+                    if (actPin.p_Neg)           /* negation of the .CLK   */
+                    {                           /* control is not allowed */
+                        AsmError(19, 0);
+                        return(-1);
+                    }
+
+                    if (OLMC[n].PinType == NOTUSED)
+                    {
+                        AsmError(42, 0);        /* sequence must be: output */
+                        return(-1);             /* def., .CLK definition */
+                    }
+
+                    if (OLMC[n].Clock)
+                    {                           /* is .CLK defined twice? */
+                        AsmError(45, 0);        /* yes, then error */
+                        return(-1);
+                    }
+
+                    OLMC[n].Clock = 1;          /* set flag that there is */
+                                                /* a .CLK equation        */
+                    if (OLMC[n].PinType != REGOUT)
+                    {
+                        AsmError(48, 0);        /* no .CLK allowed when     */
+                        return(-1);             /* output is not registered */
+                    }
+
+                    break;
+        
+
+
+                case SUFFIX_ARST:
+
+                    if (actPin.p_Neg)
+                    {                           /* negation of the .ARST  */
+                        AsmError(19, 0);        /* control is not allowed */
+                        return(-1);
+                    }
+
+                    if (OLMC[n].PinType == NOTUSED)
+                    {
+                        AsmError(43, 0);        /* sequence must be: output */
+                        return(-1);             /* def., .ARST definition   */
+                    }
+
+                    if (OLMC[n].ARST)
+                    {                           /* is .ARST defined twice? */
+                        AsmError(46, 0);        /* yes, then error         */
+                        return(-1);
+                    }
+
+                    OLMC[n].ARST = 1;           /* set flag that there is */
+                                                /* a .ARST equation       */
+                    if (OLMC[n].PinType != REGOUT)
+                    {
+                        AsmError(48, 0);        /* no .CLK allowed when     */
+                        return(-1);             /* output is not registered */
+                    }
+
+                    break;
+
+
+
+                case SUFFIX_APRST:
+
+                    if (actPin.p_Neg)
+                    {                           /* negation of the .APRST */
+                        AsmError(19, 0);        /* control is not allowed */
+                        return(-1);
+                    }
+
+                    if (OLMC[n].PinType == NOTUSED)
+                    {
+                        AsmError(44, 0);        /* sequence must be: output */
+                        return(-1);             /* def., .APRST definition  */
+                    }
+
+                    if (OLMC[n].APRST)
+                    {                           /* is .APRST defined twice? */
+                        AsmError(47, 0);        /* yes, then error          */
+                        return(-1);
+                    }
+
+                    OLMC[n].APRST = 1;          /* set flag that there is */
+                                                /* a .APRST equation      */
+                    if (OLMC[n].PinType != REGOUT)
+                    {
+                        AsmError(48, 0);        /* no .CLK allowed when     */
+                        return(-1);             /* output is not registered */
+                    }
+
+                    break;
+                }
+
+            }
+            else
+            {
+                AsmError(15, 0);                /* pin can't be programmed */
+                return(-1);                     /* as output               */
+            }
+        }
+
+	start_row = max_row = 0;
+
+        switch (gal_type)
+        {                                       /* get first the row of the */
+            case GAL16V8:                       /* OLMC and the number of   */
+            case GAL20V8:                       /* rows which areavailable  */
+                start_row = ToOLMC[actOLMC];
+                max_row   = 8;
+                break;
+
+            case GAL22V10:
+                start_row = ToOLMC22V10[actOLMC];
+                max_row   = OLMCSize22V10[actOLMC];
+                break;
+
+            case GAL20RA10:
+                start_row = ToOLMC20RA10[actOLMC];
+                max_row   = 8;
+                break;
+        }
+
+        if (*actptr != '=')                     /* '=' ?          */
+        {                                       /* no, then error */
+            AsmError(14, 0);
+            return(-1);
+        }
+loop2:
+        actptr++;
+
+        if (GetNextChar())
+        {                                       /* end of file?    */
+            AsmError(2, 0);                     /* yes, then error */
+            return(-1);
+        }
+
+        oldptr = actptr;                            /* save pointer */
+
+        IsPinName(pinnames, num_of_pins);
+
+        if (gal_type == GAL22V10 && !actPin.p_Pin)
+        {                               /* AR and SP is not allowed */
+            Is_AR_SP(oldptr);           /* in terms of an equation  */
+
+            if (actPin.p_Pin)
+            {                           /* when used, then error */
+                AsmError(31, 0);
+                return(-1);
+            }
+        }
+
+        if (!actPin.p_Pin)
+        {                                   /* pin name?      */
+            AsmError(11, 0);                /* no, then error */
+            return(-1);
+        }
+
+        if (actPin.p_Pin == NC_PIN)
+        {               /* NC used as pin name? */
+            AsmError(12, 0);                          /* yes, then error */
+            return(-1);
+        }
+
+
+        if (IsNEG(*(pinnames+(long)((actPin.p_Pin - 1)*10))))
+            actPin.p_Neg = !actPin.p_Neg;       /* consider negation in the */
+                                                /* pin declartion           */
+
+        oldline = linenum;
+
+        if (GetNextChar())
+        {                                       /* end of file?    */
+            AsmError(2, 0);                     /* yes, then error */
+            return(-1);
+        }
+
+        newline = linenum;
+        linenum = oldline;
+
+        if (!pass)                              /* is this pass 1?*/
+        {
+            if (((gal_type == GAL16V8) &&       /* is this pin an OLMC pin? */
+                 (actPin.p_Pin >= 12) && (actPin.p_Pin <= 19)) ||
+                ((gal_type == GAL20V8) &&
+                 (actPin.p_Pin >= 15) && (actPin.p_Pin <= 22)) ||
+                ((gal_type == GAL22V10) &&
+                 (actPin.p_Pin >= 14) && (actPin.p_Pin <= DUMMY_OLMC12)) ||
+                ((gal_type == GAL20RA10) &&
+                 (actPin.p_Pin >= 14) && (actPin.p_Pin <= 23)) )
+            {
+
+
+                switch (gal_type)                        /* get OLMC number */
+                {
+                    case GAL16V8:
+                        n = actPin.p_Pin - 12;
+                        break;
+
+                    case GAL20V8:
+                        n = actPin.p_Pin - 15;
+                        break;
+
+                    case GAL22V10:
+                    case GAL20RA10:
+                        n = actPin.p_Pin - 14;
+                        break;
+                }
+
+
+
+                if (!OLMC[n].PinType)            /* is OLMC's type already */
+                    OLMC[n].PinType = INPUT;     /* defined? no, then use  */
+                                                 /* it as input            */
+                OLMC[n].FeedBack = YES; /* if a OLMC pin is used within an */
+            }                           /* equation, a feedback is needed  */
+        }
+
+                              /* in pass 2 we have to make the fuse matrix */
+        if (pass)
+        {
+            switch (gal_type)                /* get row offset */
+            {
+                case GAL16V8:
+                case GAL20V8:
+
+                    if (suffix == SUFFIX_E)   /* when tristate control use */
+                        row_offset = 0;       /* first row (=> offset = 0) */
+                    else
+                        if (!row_offset)  /*is offset of rows still equal 0?*/
+                            if (modus != MODE1 &&
+                                OLMC[actOLMC].PinType != REGOUT)
+                                row_offset = 1;    /* then init. row-offset */
+
+                    break;
+
+                case GAL22V10:
+
+                    if (suffix == SUFFIX_E)    /* enable is the first row */
+                        row_offset = 0;        /* of the OLMC             */
+                    else
+                    {
+                        if (actOLMC == 10 || actOLMC == 11)
+                            row_offset = 0;     /* AR, SP?, then no offset */
+                        else
+                            if (!row_offset)     /* output starts at the     */
+                                row_offset = 1;  /* second row => offset = 1 */
+                    }
+
+                    break;
+
+                case GAL20RA10:
+                    switch (suffix)
+                    {
+                        case SUFFIX_E:         /* enable is the first row */
+                            row_offset = 0;    /* of the OLMC             */
+                            break;
+
+                        case SUFFIX_CLK:       /* Clock is the second row */
+                            row_offset = 1;    /* of the OLMC             */
+                            break;
+
+                        case SUFFIX_ARST:      /* AReset is the third row */
+                            row_offset = 2;    /* of the OLMC             */
+                            break;
+
+                        case SUFFIX_APRST:     /* APreset is the fourth row */
+                            row_offset = 3;    /* of the OLMC               */
+                            break;
+
+                        default:                  /* output equation starts */
+                            if (row_offset <= 3)  /* at the fifth row       */
+                                row_offset = 4;
+                    }
+                    break;
+            }
+
+            pin_num = actPin.p_Pin;
+
+
+            /* is there a valuation of GAL's mode? */
+
+            if (gal_type == GAL16V8 || gal_type == GAL20V8)
+            {
+
+                if (modus == MODE2)               /* valuation of mode 2? */
+                {
+                    if (gal_type == GAL16V8 && (pin_num == 12 || pin_num == 19))
+                    {
+                        AsmError(20, 0);
+                        return(-1);
+                    }
+
+                    if (gal_type == GAL20V8 && (pin_num == 15 || pin_num == 22))
+                    {
+                        AsmError(21, 0);
+                        return(-1);
+                    }
+                }
+
+                if (modus == MODE3)                /* valuation of mode 3? */
+                {
+                    if (gal_type == GAL16V8 && (pin_num == 1 || pin_num == 11))
+                    {
+                        AsmError(26, 0);
+                        return(-1);
+                    }
+
+                    if (gal_type == GAL20V8 && (pin_num == 1 || pin_num == 13))
+                    {
+                        AsmError(27, 0);
+                        return(-1);
+                    }
+                }
+            }
+
+            if (gal_type == GAL20RA10)       /* valuation of 20RA10? */
+            {
+                if (pin_num == 1)               /* pin 1 is reserved for */
+                {                               /* /PL (preload)         */
+                    AsmError(37, 0);
+                    return(-1);
+                }
+
+                if (pin_num == 13)
+                {                               /* pin 13 is reserved for */
+                    AsmError(38, 0);            /* /OE (output enable)    */
+                    return(-1);
+                }
+            }
+
+            /* if GND, set row equal 0 */
+            if (pin_num == num_of_pins || pin_num == num_of_pins/2)
+            {
+                if (actPin.p_Neg)
+                {                         /* /VCC and /GND are not allowed */
+                    AsmError(25, 0);
+                    return(-1);
+                }
+
+                if (!prevOp && !IsAND(*actptr) && !IsOR(*actptr))
+                {
+                    if (pin_num == num_of_pins/2)
+                    {
+                        m = (start_row + row_offset) * num_of_col;
+                                                      /* set row equal 0 */
+                        for (n = m; n < m+num_of_col; Jedec.GALLogic[n++] = 0);
+
+                    }
+                }
+                else
+                {
+                    AsmError(28, 0);
+                    return(-1);
+                }
+            }
+            else
+            {
+
+                if (suffix == SUFFIX_E || suffix == SUFFIX_CLK ||
+                    suffix == SUFFIX_ARST || suffix == SUFFIX_APRST ||
+                    (gal_type == GAL22V10 && (actOLMC == 10 || actOLMC == 11)))
+                {
+
+                    if (IsOR(prevOp))
+                    {                           /* max. one product term   */
+                        AsmError(29, 0);        /* for CLK, ARST, APRST, E */
+                        return(-1);             /* and 22V10: AR, SP       */
+                    }
+
+                    SetAND(start_row + row_offset, pin_num, actPin.p_Neg, gal_type);
+                }
+                else
+                {
+                    if (IsOR(prevOp))
+                    {                             /* OR operation? yes, then */
+                        row_offset++;             /* take the next row       */
+
+                        if (row_offset == max_row)
+                        {        /* too many ORs?*/
+                            AsmError(30, 0);
+                            return(-1);
+                        }
+                    }
+                                                           /* set ANDs */
+                    SetAND(start_row + row_offset, pin_num, actPin.p_Neg, gal_type);
+                }
+            }
+
+
+                                            /* are there any more terms? */
+            if (!IsOR(*actptr) && !IsAND(*actptr) && suffix != SUFFIX_E &&
+                suffix != SUFFIX_CLK && suffix != SUFFIX_ARST &&
+                suffix != SUFFIX_APRST)
+            {
+                                                    /* no?, then set unused */
+                row_offset++;                       /* rows of the OLMX     */
+                                                    /* equal 0              */
+                if (row_offset != max_row)
+                {
+                    m = (start_row + row_offset) * num_of_col;
+
+                    for (n = m; n < m + (max_row - row_offset)*num_of_col; n++)
+                        Jedec.GALLogic[n] = 0;
+
+                }
+            }
+        }
+
+        linenum = newline;
+
+        if (IsOR(*actptr) || IsAND(*actptr))
+        {
+            prevOp = *actptr;
+            goto loop2;
+        }
+
+        if (strncmp((char *)actptr, "DESCRIPTION", (usize)11))
+        {
+
+label1:
+            linenum = newline;
+
+            oldptr = actptr;
+
+            IsPinName(pinnames, num_of_pins);
+
+            if (gal_type == GAL22V10 && !actPin.p_Pin)
+            {                                       /* no pin name? then  */
+                Is_AR_SP(oldptr);                   /* check whether name */
+                                                    /* is AR or SP        */
+                if (actPin.p_Pin && actPin.p_Neg)
+                {                                   /* but no negation of */
+                    AsmError(32, 0);                /* AR or SP           */
+                    return(-1);
+                }
+            }
+              
+            if (!actPin.p_Pin)
+            {                                       /* pin name?      */
+                AsmError(11, 0);                    /* no, then error */
+                return(-1);
+            }
+
+            if (actPin.p_Pin == NC_PIN)
+            {                                       /* NC used as pin name? */
+                AsmError(12, 0);                    /* yes, then error      */
+                return(-1);
+            }
+
+            if (IsNEG(*(pinnames+(long)((actPin.p_Pin-1)*10))))
+                actPin.p_Neg = !actPin.p_Neg; /* negation at pin declaration */
+
+            goto loop1;
+
+        }
+
+    }
+
+
+                        /* set fuse matrix of unused OLMCs and of OLMCs */
+                        /* which are programmed as input equal 0        */
+
+    for (n = 0; n < num_of_olmcs; n++)
+    {
+        if (OLMC[n].PinType == NOTUSED || OLMC[n].PinType == INPUT)
+        {
+		int i = 0;
+
+            switch (gal_type)
+            {                           /* get first row of the     */
+                case GAL16V8:           /* OLMC and the number of   */
+                case GAL20V8:           /* rows which are available */
+                    l = ToOLMC[n];
+                    i = 8;
+                    break;
+
+                case GAL22V10:
+                    l = ToOLMC22V10[n];
+                    i = OLMCSize22V10[n];
+                    break;
+
+                case GAL20RA10:
+                    l = ToOLMC20RA10[n];
+                    i = 8;
+                    break;
+            }
+
+            l = l * num_of_col;
+
+            m = l + i * num_of_col;
+
+            for (k = l; k < m; k++)
+                Jedec.GALLogic[k] = 0;
+        }
+    }
+
+
+    if (gal_type == GAL22V10)
+    {                                   /* if AR or SP is not defined,   */
+                                        /* set corresponding row equal 0 */
+        if (!OLMC[10].PinType)                  /* set row of AR equal 0 */
+            for (n = 0; n < num_of_col; Jedec.GALLogic[n++] = 0);
+
+        if (!OLMC[11].PinType)                         /* set row of SP equal 0 */
+            for (n = 5764; n < 5764 + num_of_col; Jedec.GALLogic[n++] = 0);
+    }
+
+
+    if (gal_type == GAL20RA10)
+    {                                           /* set unused CLK, ARST */
+                                                /* and APRST equal 0    */
+        for (n = 0; n < num_of_olmcs; n++)      /* examine all OLMCs    */
+        {
+            if (OLMC[n].PinType != NOTUSED)     /* is OLMC used? */
+            {
+                if (OLMC[n].PinType == REGOUT && !OLMC[n].Clock)
+                {
+                    AsmError(41, n + 14);       /* register output        */
+                    return(-1);                 /* needs clock definition */
+                }
+
+                if (!OLMC[n].Clock)
+                {                                      /* is clock unused? */
+                    l = (ToOLMC20RA10[n] + 1) * num_of_col;  /* then clear */
+                                                             /* the row    */
+                    for (k = l; k < l + num_of_col; k++)
+                        Jedec.GALLogic[k] = 0;
+                }
+
+                if (OLMC[n].PinType == REGOUT)
+                {
+                    if (!OLMC[n].ARST)
+                    {                  /* is ARST unused? */
+                        l = (ToOLMC20RA10[n] + 2) * num_of_col;
+
+                        for (k = l; k < l + num_of_col; k++)
+                            Jedec.GALLogic[k] = 0;
+                    }
+
+                    if (!OLMC[n].APRST)
+                    {                               /* is APRST unused? */
+                        l = (ToOLMC20RA10[n] + 3) * num_of_col;
+
+                        for (k = l; k < l + num_of_col; k++)
+                            Jedec.GALLogic[k] = 0;
+                    }
+                }
+
+            }
+
+        }
+
+    }
+
+
+/* now the JEDEC structure is ready */
+/* (be happy, it was a hard task)   */
+
+
+
+                     /* set flag, so that we can see that  */
+                                      /* this file is assembled succesfully */
+
+					free(fbuff);
+
+
+
+                                      /*** now make the selected files ***/
+
+					/* Obtain the filename without the extension */
+					{
+						char *base; int l;
+
+
+						if((base = GetBaseName(file)))
+						{
+							#define extman(p,l,a,b,c) { p[l-2] = a; base[l-1] = b; base[l-0] = c; }
+
+							l = (strlen(base) - 1);
+
+							base[l-3] = '.';
+
+							extman(base,l,'j','e','d');	
+							WriteJedecFile(base, gal_type, cfg);
+
+							extman(base,l,'f','u','s');	
+    	                    if(cfg->GenFuse) WriteFuseFile(base, gal_type);
+
+							extman(base,l,'p','i','n');	
+        	                if(cfg->GenPin ) WritePinFile (base, gal_type);
+
+							extman(base,l,'c','h','p');	
+            	            if(cfg->GenChip) WriteChipFile(base, gal_type);
+
+							free(base);
+
+						}
+						else
+						{
+							ErrorReq(2);
+							return(-2);
+						}
+
+                        return(0);                 /* there was no error */
+
+					}
+                }
+                else
+                {
+                    ErrorReq(3);                          /* read error */
+					free(fbuff);
+                    return(-2);
+                }
+            }
+            else
+            {
+                ErrorReq(2);                            /* no more free memory */
+                return(-2);
+            }
+        }
+}
+
+
+
+
+
+/******************************************************************************
+** SetAND()
+*******************************************************************************
+** input:   row         row in which the AND should be set
+**          pinnum      pin which should be ANDed
+**          negation    0: pin without negation
+**                      1: pin with negation sign (/)
+**
+** output:  none
+**
+** remarks: sets an AND (=0) in the fuse matrix
+******************************************************************************/
+ 
+void SetAND(int row, int pinnum, int negation, int gal_type)
+{
+	int column = 0;
+	int numofcol = 0;
+
+    switch (gal_type)
+    {
+        case GAL16V8:
+            if (modus == MODE1)
+                column = PinToFuse16Mode1[pinnum - 1];
+            if (modus == MODE2)
+                column = PinToFuse16Mode2[pinnum - 1];
+            if (modus == MODE3)
+                column = PinToFuse16Mode3[pinnum - 1];
+
+			numofcol = MAX_FUSE_ADR16	+ 1;
+            break;
+
+        case GAL20V8:
+            if (modus == MODE1)
+                column  =  PinToFuse20Mode1[pinnum - 1];
+            if (modus == MODE2)
+                column  =  PinToFuse20Mode2[pinnum - 1];
+            if (modus == MODE3)
+                column  =  PinToFuse20Mode3[pinnum - 1];
+
+			numofcol = MAX_FUSE_ADR20 + 1;
+            break;
+
+        case GAL22V10:
+            column  =  PinToFuse22V10[pinnum - 1];
+
+                                    /* is it a registered OLMC pin that is active high? */
+                                    /* Yes, then correct the negation                   */
+            if ((pinnum >= 14 && pinnum <= 23) && !Jedec.GALS1[23 - pinnum] && Jedec.GALXOR[23 - pinnum])
+            {
+                negation = negation ? 0 : 1;
+            }
+
+			numofcol = MAX_FUSE_ADR22V10 + 1;
+            break;
+
+        case GAL20RA10:
+            column  =  PinToFuse20RA10[pinnum - 1];
+			numofcol = MAX_FUSE_ADR20RA10	+ 1;
+	        break;
+    }
+
+    Jedec.GALLogic[row*numofcol + column + negation] = 0;
+
+}
+
+
+
+
+
+/******************************************************************************
+** IsPinName()
+*******************************************************************************
+** input:   *pinnames   pointer to the pinnames array
+**          numofpins   number of pins (20 or 24, depends on the type of GAL)
+**
+**  global: actptr          pointer to the first character of the pinname
+**          actPin.p_Pin:   number of pin or NC_PIN; 0: no pin
+**          actPin.p_Neg:   pinname with '/' = 1;  without '/' = 0
+**
+** output:  none
+**
+** remarks: This function tests whether actptr points to a pinname or not
+******************************************************************************/
+ 
+void IsPinName(UBYTE *pinnames, int numofpins)
+{
+    int     i, k, n;
+    UBYTE   *oldactptr;
+
+
+    actPin.p_Neg = 0;                   /* install structure for pin */
+    actPin.p_Pin = 0;
+
+    if (IsNEG(*actptr))
+    {                                   /* negation? */
+        actptr++;
+        actPin.p_Neg = 1;
+    }
+
+    n = 0;                                /* get length of pin name */
+
+    oldactptr = actptr;
+
+    while (isalpha(*actptr) || isdigit(*actptr))
+    {
+        actptr++;
+        n++;
+    }
+
+    if (n) {
+        if ((n == 2 ) && !strncmp((char *)oldactptr, "NC", (usize)2))
+            actPin.p_Pin = NC_PIN;                      /* NC pin*/
+        else
+            for (k = 0; k < numofpins; k++)
+            {                           /* examine whole list of pin names */
+                i = 0;
+
+                if (IsNEG(*(pinnames+k*10)))
+                    i = 1;
+
+                                         /* are the string sizes equal? */
+                if (n == strlen((char *)(pinnames+k*10+i)))
+                    if (!(strncmp((char *)oldactptr, (char *)(pinnames+k*10+i),
+                          (usize)n)))   /* yes, then compare these strings */
+                {
+                    actPin.p_Pin = k + 1;
+                    break;
+                }
+            }
+    }
+}
+
+
+
+
+
+/******************************************************************************
+** Is_AR_SP()
+*******************************************************************************
+** input:   *ptr    pointer to the first character of the pinname
+**
+** output:  none
+**          global  actPin.p_Pin: 23: AR, 24: SP, 0: no AR, SP
+**                  actPin.p_Neg: pinname with '/' = 1;  without '/' = 0
+**
+** remarks: This function tests whether actptr points to a AR or SP
+******************************************************************************/
+
+void Is_AR_SP(UBYTE *ptr)
+{
+    int     n;
+    UBYTE   *oldptr;
+
+
+    actPin.p_Neg = 0;                     /* install structure for pin */
+    actPin.p_Pin = 0;
+
+    if (IsNEG(*ptr))
+    {                    /* negation? */
+        ptr++;
+        actPin.p_Neg = 1;
+    }
+
+    n = 0;                                /* get length of pin name */
+
+    oldptr = ptr;
+
+    while (isalpha(*ptr) || isdigit(*ptr))
+    {
+        ptr++;
+        n++;
+    }
+                        /* assign AR to "OLMC 11" ("pin 24") and */
+    if (n)              /* assign SP to "OLMC 12" ("pin 25")     */
+    {
+        if ((n == 2 ) && !strncmp((char *)oldptr, "AR", (usize)2))
+            actPin.p_Pin = DUMMY_OLMC11;
+
+        if ((n == 2 ) && !strncmp((char *)oldptr, "SP", (usize)2))
+            actPin.p_Pin = DUMMY_OLMC12;
+    }
+}
+
+
+
+
+
+/******************************************************************************
+** GetNextChar()
+*******************************************************************************
+** input:   none
+**
+** output:  0: character found, actptr points to it
+**          1: no character found
+**
+** remarks: searchs the next character which is no comment, space, TAB, LF
+******************************************************************************/
+
+int GetNextChar(void)
+{
+
+    for(;;)
+    {
+        switch (*actptr)
+        {
+            case 0x0A:                           /* LineFeed */
+                actptr++;
+                linenum++;
+                break;
+
+            case ' ':                            /* space */
+            case 0x09:                           /* TAB   */
+                actptr++;
+                break;
+
+            case ';':                            /* comment found?         */
+                if (GetNextLine())               /* then skip rest of line */
+                    return(0);
+                break;
+
+            default:
+                                                 /* was there a character? */
+                if (*actptr > ' ' && *actptr <= '~')
+                    return(0);
+                else
+                    actptr++;
+        }
+
+        if (actptr > buffend)                    /* end of file? */
+            return(1);
+    }
+}
+
+
+
+
+ 
+/******************************************************************************
+** GetNextLine()
+*******************************************************************************
+** input:   none
+**
+** output:  0: line found, actptr points to this line
+**          1: end of file reached
+**
+** remarks: gets pointer to next line
+******************************************************************************/
+
+int GetNextLine(void)
+{
+
+    for(;;)
+    {
+        if (*actptr == 0x0A)
+        {
+            actptr++;
+            linenum++;
+            return(0);
+        }
+
+        if (actptr > buffend)                       /* end of file? */
+            return(1);
+
+        actptr++;
+    }
+}
+
+
+
+
+
+
+/******************************************************************************
+** IsOR()
+*******************************************************************************
+** input:   none
+**
+** output:  1: chr is a OR
+**          0: chr is no OR
+**
+** remarks: checks whether or not chr is a OR sign or not
+******************************************************************************/
+
+int IsOR(char chr)
+{
+    if (chr == '+' || chr == '#')
+        return(1);
+    else
+        return(0);
+}
+
+
+
+
+
+/******************************************************************************
+** IsAND()
+*******************************************************************************
+** input:   none
+**
+** output:  1: chr is a AND
+**          0: chr is no AND
+**
+** remarks: checks whether or not chr is a AND sign or not
+******************************************************************************/
+
+int IsAND(char chr)
+{
+    if (chr == '*' || chr == '&')
+        return(1);
+    else
+        return(0);
+}
+
+
+
+
+
+/******************************************************************************
+** IsNEG()
+*******************************************************************************
+** input:   none
+**
+** output:  1: chr is a negation sign
+**          0: chr is no negation sign
+**
+** remarks: checks whether or not chr is a negation sign or not
+******************************************************************************/
+
+int IsNEG(char chr)
+{
+    if (chr == '/' || chr == '!')
+        return(1);
+    else
+        return(0);
+}
+
+
+
+
+
+/********************************************************/
+/* the following routines are for the creation of the   */
+/* documentation files                                  */
+/********************************************************/
+
+
+
+int GetPinNum(int gal_type)
+{
+	if(gal_type == GAL16V8) return(20);
+
+	return(24);
+}
+
+
+/******************************************************************************
+** WriteChipFile(char *filename, int gal_type)
+*******************************************************************************
+** input:   gal type
+**			filename 
+**
+** output:  none
+**
+** remarks: make chip file
+******************************************************************************/
+
+void WriteChipFile(char *filename, int gal_type)
+{
+    FILE    *fp;
+    int     n;
+
+	int num_of_pins = GetPinNum(gal_type);
+
+        if ((fp = fopen(filename, (char *)"w")))
+        {
+
+            fprintf(fp, "\n\n");
+
+            WriteSpaces(fp, 31);
+
+            if (gal_type == GAL16V8)
+                fprintf(fp, " GAL16V8\n\n");
+
+            if (gal_type == GAL20V8)
+                fprintf(fp, " GAL20V8\n\n");
+
+            if (gal_type == GAL22V10)
+                fprintf(fp, " GAL22V10\n\n");
+
+            if (gal_type == GAL20RA10)
+                fprintf(fp, "GAL20RA10\n\n");
+
+
+            WriteSpaces(fp, 26);
+
+            fprintf(fp,"-------\\___/-------\n");
+
+            for (n = 0; n < num_of_pins/2; n++)
+            {
+
+                WriteSpaces(fp, 25 - (int)strlen((char *)(pinnames+n*10)));
+
+                fprintf(fp,"%s | %2d           %2d | %s\n", pinnames + n*10,
+                        n+1, num_of_pins-n, pinnames+(num_of_pins-n-1)*10);
+
+                if (n < num_of_pins/2 - 1)
+                {
+                    WriteSpaces(fp, 26);
+
+                    fprintf(fp, "|                 |\n");
+                }
+            }
+
+            WriteSpaces(fp, 26);
+
+            fprintf(fp, "-------------------\n");
+
+            if (fclose(fp) == EOF)
+            {
+                ErrorReq(8);                   /* can't close file */
+                return;
+            }
+        }
+}
+
+
+
+/******************************************************************************
+** WritePinFile(char �*filename, int gal_type)
+*******************************************************************************
+** input:   gal type
+**			filename
+**
+** output:  none
+**
+** remarks: make pin file
+******************************************************************************/
+
+void WritePinFile(char *filename, int gal_type)
+{
+    FILE    *fp;
+    int     k, n, flag;
+
+	int num_of_pins = GetPinNum(gal_type);
+
+        if ((fp = fopen(filename, (char *)"w")))
+        {
+            fprintf(fp, "\n\n");
+
+            fprintf(fp, " Pin # | Name     | Pin Type\n");
+
+            fprintf(fp, "-----------------------------\n");
+
+            for (n = 1; n <= num_of_pins; n++)
+            {
+                fprintf(fp,"  %2d   | ",n);
+
+                fprintf(fp,"%s",pinnames+(n-1)*10);
+
+                WriteSpaces(fp, 9-(int)strlen((char *)(pinnames+(n-1)*10)));
+
+                flag = 0;
+
+                if (n == num_of_pins/2)
+                {
+                    fprintf(fp,"| GND\n");
+                    flag = 1;
+                }
+
+                if (n == num_of_pins)
+                {
+                    fprintf(fp,"| VCC\n\n");
+                    flag = 1;
+                }
+
+
+                if (gal_type == GAL16V8 || gal_type == GAL20V8)
+                {
+
+                    if (modus == MODE3 && n == 1)
+                    {
+                        fprintf(fp, "| Clock\n");
+                        flag = 1;
+                    }
+
+                    if (modus == MODE3)
+                    {
+                        if (gal_type == GAL16V8 && n == 11)
+                        {
+                            fprintf(fp, "| /OE\n");
+                            flag = 1;
+                        }
+
+                        if (gal_type == GAL20V8 && n == 13)
+                        {
+                            fprintf(fp, "| /OE\n");
+                            flag = 1;
+                        }
+                    }
+                }
+
+                if (gal_type == GAL22V10 && n == 1)
+                {
+                    fprintf(fp, "| Clock/Input\n");
+                    flag = 1;
+                }
+
+                                                        /* OLMC pin?*/
+
+                if ((gal_type == GAL16V8   && n >= 12 && n <= 19) ||
+                    (gal_type == GAL20V8   && n >= 15 && n <= 22) ||
+                    (gal_type == GAL20RA10 && n >= 14 && n <= 23) ||
+                    (gal_type == GAL22V10  && n >= 14 && n <= 23))
+                {
+
+
+                    if (gal_type == GAL16V8)
+                        k = n - 12;
+                    else
+                        if (gal_type == GAL20V8)
+                            k = n - 15;
+                        else
+                            k = n - 14;
+
+                    if (OLMC[k].PinType != INPUT)
+                        if (OLMC[k].PinType)
+                            fprintf(fp,"| Output\n");
+                        else
+                            fprintf(fp,"| NC\n");
+                    else
+                        fprintf(fp,"| Input\n");
+                }
+                else
+                {
+                    if (!flag)
+                        fprintf(fp,"| Input\n");
+                }
+            }
+
+            if (fclose(fp) == EOF)
+            {
+                ErrorReq(8);                           /* can't close file */
+                return;
+            }
+        }
+        else
+        {
+            ErrorReq(13);
+            return;
+        }
+
+}
+
+/******************************************************************************
+** WriteRow()
+*******************************************************************************
+** input:   *fp     pointer to the file handle
+**          row     number of row which should be written
+**
+** output:  none
+**
+** remarks: writes a row of an OLMC to the file characterized by the file
+**          handle fp
+******************************************************************************/
+ 
+void WriteRow(FILE *fp, int row, int num_of_col)
+{
+    int col;
+
+    fprintf(fp, "\n%3d ", row);                 /* print row number */
+
+    for (col = 0; col < num_of_col; col++)
+    {                                           /* print fuses of */
+        if (!((col) % 4))                       /* a row          */
+            fprintf(fp, " ");
+
+        if (Jedec.GALLogic[row*num_of_col + col])
+            fprintf(fp, "-");
+        else
+            fprintf(fp, "x");
+    }
+}
+
+/******************************************************************************
+** WriteChipFile(char *filename, int gal_type)
+*******************************************************************************
+** input:   gal type
+**			filename
+**
+** output:  none
+**
+** remarks: make fuse file
+******************************************************************************/
+
+void WriteFuseFile(char *filename, int gal_type)
+{
+    FILE    *fp;
+    int     row, pin, n, numofOLMCs, numofrows, olmc;
+
+	int num_of_col = 0;
+
+	switch(gal_type)
+	{
+		case GAL16V8: 	num_of_col = MAX_FUSE_ADR16	+ 1; break;
+		case GAL20V8: 	num_of_col = MAX_FUSE_ADR20 + 1; break;
+		case GAL20RA10: num_of_col = MAX_FUSE_ADR20RA10	+ 1; break;
+		case GAL22V10:  num_of_col = MAX_FUSE_ADR22V10 + 1; break;
+	}
+
+        if ((fp = fopen(filename, (char *)"w")))
+        {
+            if (gal_type == GAL16V8)
+            {
+                pin = 19;
+                numofOLMCs = 8;
+            }
+            else
+                if (gal_type == GAL20V8)
+                {
+                    pin = 22;
+                    numofOLMCs = 8;
+                }
+                else
+                {                                  /* 22V10, 20RA10 */
+                    pin = 23;
+                    numofOLMCs = 10;
+                }
+
+
+
+            row = 0;
+
+            for (olmc = 0; olmc < numofOLMCs; olmc++)
+            {
+
+                if (gal_type == GAL22V10 && olmc == 0)
+                {                               /* AR when 22V10 */
+                    fprintf(fp, "\n\nAR");
+                    WriteRow(fp, row, num_of_col);
+                    row++;
+                }
+
+                if (gal_type == GAL22V10)             /* get number of rows */
+                    numofrows = OLMCSize22V10[olmc];  /* of an OLMC         */
+                else
+                    numofrows = 8;
+
+
+
+                fprintf(fp, "\n\nPin %2d = ", pin);             /* print pin */
+
+                fprintf(fp, "%s", pinnames + (pin - 1)*10);
+
+                WriteSpaces(fp, 13-(int)strlen((char *)(pinnames+(pin-1)*10)));
+
+
+                if (gal_type == GAL16V8)
+                    fprintf(fp, "XOR = %1d   AC1 = %1d", Jedec.GALXOR[19-pin],
+                            Jedec.GALAC1[19 - pin]);
+                else
+                    if (gal_type == GAL20V8)
+                        fprintf(fp, "XOR = %1d   AC1 = %1d",
+                                Jedec.GALXOR[22 - pin], Jedec.GALAC1[22 - pin]);
+                    else
+                        if (gal_type == GAL22V10)
+                            fprintf(fp, "S0 = %1d   S1 = %1d",
+                                    Jedec.GALXOR[23 - pin], Jedec.GALS1[23 - pin]);
+                        else
+                            if (gal_type == GAL20RA10)
+                                fprintf(fp, "S0 = %1d",
+                                        Jedec.GALXOR[23 - pin]);
+
+
+
+                for (n = 0; n < numofrows; n++)
+                {                           /* print all fuses of an OLMC */
+                    WriteRow(fp, row, num_of_col);
+                    row++;
+                }
+
+
+                if (gal_type == GAL22V10 && olmc == 9)
+                {                                        /* SP when 22V10 */
+                    fprintf(fp, "\n\nSP");
+                    WriteRow(fp, row, num_of_col);
+                }
+
+                pin--;
+            }
+
+
+            fprintf(fp, "\n\n");
+
+            if (fclose(fp) == EOF)
+            {
+                ErrorReq(8);                            /* can't close file */
+                return;
+            }
+        }
+        else
+        {
+            ErrorReq(13);
+            return;
+        }
+
+}
+
+/******************************************************************************
+** WriteSpaces()
+*******************************************************************************
+** input:   *fp         pointer to the file handle of the file
+**          numof       number of spaces to be written to the file
+**
+** output:  none
+**
+** remarks: write "numof" spaces to the file characterized by *fp
+******************************************************************************/
+
+void WriteSpaces(FILE *fp, int numof)
+{
+    int n;
+
+    for (n = 0; n < numof; n++)
+        fprintf(fp, " ");
+
+}
+
+
+
+/******************************************************************************
+** AsmError()
+*******************************************************************************
+** input:   errornum    number of error to be printed
+**          pinnum      = 0: print "Error in line linnum:" ...
+**                      > 0: print "Pin pinnum:" ...
+**
+** output:  none
+**
+** remarks: print error messages of the GAL-assembler and free
+**          the memory allocated by the file buffer
+******************************************************************************/
+ 
+void AsmError(int errornum, int pinnum)
+{
+    free(fbuff);
+
+    if (!pinnum)
+        printf("Error in line %d: ", linenum);
+    else
+		printf("Error, pin %d: ", pinnum);
+
+	printf("%s\n", AsmErrorArray[errornum]);
+} 
+ 
+/******************************************************************************
+** main 
+*******************************************************************************
+** 
+** options:
+** 
+** -s Enable security fuse
+** -c Disable .chp file output
+** -f Disable .fus file output
+** -p Disable .pin file output
+** -a Restrict checksum to the fuse array only
+** -w Force <CR><LF> line endings for .jed file overriding platform default
+** -v Verbose output
+**
+**
+** 
+******************************************************************************/
+
+
+int main(int argc, char *argv[])
+{
+	int rc;
+  	char *p;
+
+	struct Config cfg;
+
+	cfg.GenFuse 		= TRUE;
+	cfg.GenChip 		= TRUE;
+	cfg.GenPin 	 		= TRUE;
+	cfg.JedecSecBit 	= FALSE;
+	cfg.JedecFuseChk 	= FALSE;
+	cfg.ForceCRLF		= FALSE;
+	cfg.Verbose			= FALSE;
+	cfg.Quiet			= FALSE;
+
+	p = argv[1];
+
+  	while(argc > 1 && (p[0] == '-' || (isalpha(p[1]) && (argc != 2)))) 
+	{
+    	switch(p[1]) 
+		{
+      		case 's':
+			case 'S':
+				cfg.JedecSecBit = TRUE;
+			break;
+
+      		case 'c':
+			case 'C':
+				cfg.GenChip = FALSE;
+			break;
+
+      		case 'f':
+			case 'F':
+				cfg.GenFuse = FALSE;
+			break;
+
+      		case 'p':
+			case 'P':
+				cfg.GenPin = FALSE;
+			break;
+
+      		case 'a':
+			case 'A':
+				cfg.JedecFuseChk = TRUE;
+			break;
+
+			case 'w':
+			case 'W':
+				cfg.ForceCRLF = TRUE;
+			break;
+			case 'v':
+			case 'V':
+				cfg.Verbose = TRUE;
+				break;
+
+			case 'h':
+			case 'H':
+			case '?':
+				printf("Usage:\ngalasm [-scfpawv] <filename>\n");
+				printf(	"-s Enable security fuse\n"
+						"-c Do not create the .chp file\n"
+						"-f Do not create the .fus file\n"
+						"-p Do not create the .pin file\n"
+						"-a Restrict checksum to the fuse array only\n"
+						"-w Force <CR><LF> line endings for .jed file overriding platform default\n"
+						"-v Verbose output\n");
+				exits(0);
+			
+			case 'q':
+			case 'Q':
+				cfg.Quiet = TRUE;
+				break;
+
+      		case '-': 
+      		case '\0':
+			argc--;
+			argv++;
+			goto opt_done;
+
+      		default:
+				goto usage;
+    	}
+		
+
+		if(!isalpha(p[2]))
+		{
+	    	argc--;
+    		argv++;
+
+			p = argv[1];
+		}
+		else
+			p++;
+  	}
+
+
+	opt_done:
+
+	if (!cfg.Quiet) printf( "galasm 2.1, Portable GAL Assembler\n"
+			"Copyright (c) 1998-2003 Alessandro Zummo. All Rights Reserved\n"
+			"Original sources Copyright (c) 1991-96 Christian Habermann\n\n");
+
+  	if(argc != 2) 
+	{
+		usage:
+			printf("Usage:\ngalasm [-scfpawv] <filename>\n");
+			printf("Type galasm -h for help\n");
+		exits("Usage");
+  	}
+
+
+	rc = AssemblePldFile(argv[1], &cfg);
+
+	if(rc != 0) {
+		printf("Assembling failed.\n");
+		exits(smprint("Assembly return: %d", rc));
+		} 
+	else
+		if (!cfg.Quiet) printf("Assembling successfully completed.\n");	
+
+	exits(0);
+}
--- /dev/null
+++ b/src/galasm.h
@@ -1,0 +1,270 @@
+/******************************************************************************
+** GALasm.h
+*******************************************************************************
+**
+** description:
+** This file includes some definitions and structures used by GALasm.
+**
+********************************************************************************/
+
+
+/******************************* definitions *********************************/
+
+#define GAL16V8         1               /* GAL types */
+#define GAL20V8         2
+#define GAL22V10        3
+#define GAL20RA10       4
+#define UNKNOWN         5
+#define NOT_SPECIFIED   6
+
+#define YES             1
+#define NO              0
+
+#define LOW             0
+#define HIGH            1
+#define INPUT_PIN       0
+#define OUTPUT_PIN      1
+
+		                                /* GAL16V8 */
+#define LOGIC16         0               /* location of the fuses */
+#define XOR16           2048            /* in the JEDEC file     */
+#define SIG16           2056
+#define AC116           2120
+#define PT16            2128
+#define SYN16           2192
+#define AC016           2193
+#define NUMOFFUSES16    2194
+                                        /* GAL20V8 */
+#define LOGIC20         0               /* location of the fuses */
+#define XOR20           2560            /* in the JEDEC file     */
+#define SIG20           2568
+#define AC120           2632
+#define PT20            2640
+#define SYN20           2704
+#define AC020           2705
+#define NUMOFFUSES20    2706
+
+                                        /* GAL22V10 */
+#define NUMOFFUSES22V10 5892            /* location of the fuses */
+#define XOR22V10        5808            /* in the JEDEC file     */
+#define SYN22V10        5809
+#define SIG22V10        5828
+
+                                        /* GAL20RA10 */
+#define NUMOFFUSES20RA10 3274           /* location of the fuses */
+#define XOR20RA10        3200           /* in the JEDEC file     */
+#define SIG20RA10        3210
+
+
+#define LOGIC16_SIZE    2048            /* number of bits for XOR etc. */
+#define LOGIC20_SIZE    2560
+#define LOGIC22V10_SIZE 5808
+#define LOGIC20RA10_SIZE 3200
+#define ROW_SIZE_16V8   64
+#define ROW_SIZE_20V8   64
+#define ROW_SIZE_22V10  132
+#define ROW_SIZE_20RA10 80
+#define XOR_SIZE        8
+#define SIG_SIZE        64
+#define AC1_SIZE        8
+#define PT_SIZE         64
+#define SYN_SIZE        1
+#define AC0_SIZE        1
+#define ACW_SIZE        82              /* architecture control word (ACW) */
+
+#define MAX_FUSE_ADR16          31      /* addresses of the GALs */
+#define SIG_ADR16               32      /* (fuer Fan-Post :-))   */
+#define MAX_FUSE_ADR20          39
+#define SIG_ADR20               40
+#define MAX_FUSE_ADR22V10       43
+#define SIG_ADR22V10            44
+#define MAX_FUSE_ADR20RA10      39
+#define SIG_ADR20RA10           40
+#define ACW_ADR                 60
+#define SECURITY_ADR            61
+#define ERASE_ADR               63
+
+ 
+                                  /* output's polarity: */
+#define ACTIVE_LOW      0             /* pin is high-active */
+#define ACTIVE_HIGH     1             /* pin is low-active  */
+
+                                  /* type of the pin: */
+#define NOTUSED         0             /* pin not used up to now */
+#define NOTCON          0             /* pin not used           */
+#define INPUT           2             /* input                  */
+#define COMOUT          3             /* combinational output   */
+#define TRIOUT          4             /* tristate output        */
+#define REGOUT          5             /* register output        */
+#define COM_TRI_OUT     6             /* either tristate or     */
+                                      /* combinational output   */
+
+                                  /* tristate control: */
+#define NO_TRICON       0             /* no tristate control defined       */
+#define TRICON          1             /* tristate control defined          */
+#define TRI_VCC         2             /* permanent low  impedance          */
+#define TRI_GND         3             /* permanent high impedance          */
+#define TRI_PRO         4             /* tristate control via product term */
+
+
+#define NC_PIN          30
+
+#define MODE1           1               /* modes (SYN, AC0) */
+#define MODE2           2
+#define MODE3           3
+
+
+#define MAX_SUFFIX_SIZE 6               /* max. string length of a legal */
+                                        /* suffix */
+
+#define ENTRY_SIZE      256             /* number of entries per buffer */
+
+#define SIZE_OF_EQUASTRING 80
+ 
+typedef short		BOOL;
+
+
+typedef void	       *APTR;	    /* 32-bit untyped pointer */
+
+typedef long			LONG;	    /* signed 32-bit quantity */
+typedef unsigned long	ULONG;	    /* unsigned 32-bit quantity */
+typedef unsigned long	LONGBITS;   /* 32 bits manipulated individually */
+typedef short			WORD;	    /* signed 16-bit quantity */
+typedef unsigned short	UWORD;	    /* unsigned 16-bit quantity */
+
+typedef signed char		BYTE;	    /* signed 8-bit quantity */
+typedef unsigned char	UBYTE;	    /* unsigned 8-bit quantity */
+
+typedef unsigned char  *STRPTR;     /* string pointer (NULL terminated) */
+
+#ifndef TRUE
+#define TRUE		1
+#endif
+#ifndef FALSE
+#define FALSE		0
+#endif
+#ifndef NULL
+#define NULL		0L
+#endif
+
+
+/******************************** structures *********************************/
+
+                                        /* this structure is used to store   */
+                                        /* GALasm's configuration             */
+struct  Config 
+{ 
+	BOOL GenFuse;          /* generate fuse file?        */
+    BOOL GenChip;          /* generate chip file?        */
+    BOOL GenPin;           /* generate pin file?         */
+    BOOL JedecSecBit;      /* set security bit in JEDEC? */
+    BOOL JedecFuseChk;     /* calc. fuse checksum?       */ /* azummo: if false, file checksum will be generated */
+    BOOL ForceCRLF;        /* windows line endings?      */
+    BOOL Verbose;          /* verbose output */
+	BOOL Quiet;			   /* shhhhh */
+};
+
+
+                                        /* this structure is used to store */
+                                        /* the fuses in a kind of JEDEC    */
+                                        /* format                          */
+
+struct  JedecStruct { BYTE GALLogic[5808];      /*max. size of fuse matrix */
+                      BYTE GALXOR  [10];        /* XOR bits                */
+                      BYTE GALSig  [64];        /* signature               */
+                      BYTE GALAC1  [8];         /* AC1 bits                */
+                      BYTE GALPT   [64];        /* product term disable    */
+                      BYTE GALSYN;              /* SYN bit                 */
+                      BYTE GALAC0;              /* AC0 bit                 */
+                      BYTE GALS1   [10];        /* S1 bits for 22V10       */
+                    };
+                    
+
+                                        /* used to store infos about a pin */
+struct  Pin             { BYTE p_Neg;        /* polarity of pin */
+                          BYTE p_Pin;        /* pin number      */
+                        };
+
+                                        /* used to store infos about an OLMC */
+
+struct  GAL_OLMC        { BYTE Active;       /* output's polarity           */
+                          BYTE PinType;      /* type of pin (input,...)     */
+                          BYTE TriCon;       /* user def. tristate control? */
+                          BYTE Clock;        /* user def. clock equation?   */
+                          BYTE ARST;         /* user def. ARST equation?    */
+                          BYTE APRST;        /* user def. APRST equation?   */
+                          BYTE FeedBack;     /* is there a feedback?        */
+                        };
+
+                                        /* this structure is used to store  */
+                                        /* some datas in a chained list     */
+                                        /* e.g. the coded equations for the */
+                                        /* optimizer                        */
+
+struct  Buffer  { struct Buffer *Next;
+                  struct Buffer *Prev;
+                  UBYTE  Entries[ENTRY_SIZE];   /* data area */
+                };
+                                                    
+                                        /* used to store results and     */
+                                        /* parameters of functions       */
+                                        /* which deal with chained lists */
+
+struct  ActBuffer  { struct Buffer *ThisBuff;  /* pointer to current buffer */
+                     UBYTE       *Entry;       /* pointer to data area      */
+                     UBYTE       *BuffEnd;     /* pointer to the end of the */
+                   };                          /* buffer                    */
+
+
+
+
+
+
+/********************************** globals **********************************/
+
+extern struct JedecStruct Jedec;
+extern char *ErrorArray[];
+extern char *AsmErrorArray[];
+
+/*************************** function declartions ****************************/
+
+
+/*GALasm .c */
+void  SetAND(int row, int pinnum, int negation, int gal_type);
+void  IsPinName(UBYTE *pinnames, int numofpins);
+int   GetNextChar(void);
+int   GetNextLine(void);
+void  AsmError(int errornum, int pinnum);
+void  WriteChipFile(char *filename, int gal_type);
+void  WritePinFile(char *filename, int gal_type);
+void  WriteFuseFile(char *filename, int gal_type);
+void  WriteSpaces(FILE *fp, int numof);
+void  WriteRow(FILE *fp, int row, int num_of_col);
+int   IsOR(char);
+int   IsAND(char);
+int   IsNEG(char);
+void  Is_AR_SP(UBYTE *ptr);
+
+
+/* support.c */
+char *GetBaseName(char *filename);
+int FileSize(char *filename);
+int   ReadFile(char *filename, int filesize, UBYTE *filebuff);
+int   AddByte(struct ActBuffer *buff, UBYTE code);
+int   AddString(struct ActBuffer *buff, UBYTE *strnptr);
+void  IncPointer(struct ActBuffer *buff);
+void  DecPointer(struct ActBuffer *buff);
+void  FreeBuffer(struct Buffer *buff);
+char *GetGALName(int galtype);
+char *GetPinName(UBYTE *pinnames, int pinnum);
+char *GetModeName(int mode);
+void  ErrorReq(int errornum);
+
+/* Jedec.c */
+int      FileChecksum(char* filename, unsigned* pchecksum);
+unsigned FuseChecksum(int galtype);
+int      MakeJedecBuff(struct ActBuffer buff, int galtype, struct Config *cfg);
+void     WriteJedecFile(char *filename, int galtype, struct Config *cfg);
+
+
+/* EOF */
--- /dev/null
+++ b/src/jedec.c
@@ -1,0 +1,657 @@
+/******************************************************************************
+** JEDEC.c
+*******************************************************************************
+**
+** description:
+**
+** This file contains some functions to save GAL data in JEDEC format.
+**
+******************************************************************************/
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#include "galasm.h"
+/*
+#include <stdlib.h>
+#include <string.h>
+*/
+
+static usize WriteOutputWithCRLFLineEndings(void *buf, usize size, usize nmemb, FILE *out);
+static usize WriteOutputWithNativeLineEndings(void *buf, usize size, usize nmemb, FILE *out);
+
+/******************************************************************************
+** FileChecksum()
+*******************************************************************************
+** input:   filename    Filename for which to calculate checksum
+**          pchecksum   Pointer to receive the 16 bit checksum
+**
+** output:              TRUE or FALSE to indicate success
+**
+** remarks: This function calculates the JEDEC file checksum. The start and
+**          the end of the area for which the checksum should be calculated
+**          must be marked by <STX> and <ETX>!.
+******************************************************************************/
+
+int FileChecksum(char *filename, unsigned *pchecksum)
+{
+    FILE *fp;
+    int c;
+
+    *pchecksum = 0;
+
+    if ((fp = fopen(filename, "rb")))
+    {
+        while ((c = fgetc(fp)) != 0x2)
+        {
+            if (c == EOF)
+            {
+                fclose(fp);
+                return FALSE;
+            }
+        }
+
+        while (TRUE)
+        {
+            *pchecksum = (*pchecksum + (UBYTE) c) % 0x10000;
+
+            if (c == 0x3)
+            {
+                break;
+            }
+
+            c = fgetc(fp);
+            if (c == EOF)
+            {
+                fclose(fp);
+                return FALSE;
+            }
+        }
+        fclose(fp);
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
+}
+
+
+/******************************************************************************
+** FuseChecksum()
+*******************************************************************************
+** input:   galtype     type of GAL
+**
+** output:              16 bit checksum of the JEDEC structure
+**
+** remarks: This function does calculate the fuse checksum of the JEDEC
+**          structure.
+******************************************************************************/
+
+unsigned FuseChecksum(int galtype)
+{
+    int      n;
+    unsigned checksum;
+    UBYTE    byte;
+    BYTE     *ptr, *ptrXOR, *ptrS1;
+
+
+
+    ptr    = &Jedec.GALLogic[0] - 1L;
+    ptrXOR = &Jedec.GALXOR[0];
+    ptrS1  = &Jedec.GALS1[0];
+
+    n        = 0;
+    checksum = 0;
+    byte     = 0;
+
+    for (;;)
+    {
+
+        if (galtype == GAL16V8)
+        {
+            if (n == XOR16)
+            {
+                ptr = &Jedec.GALXOR[0];
+            }
+            else
+            {
+                if (n == XOR16+8)
+                {
+                    ptr = &Jedec.GALSig[0];
+                }
+                else
+                {
+                    if (n == NUMOFFUSES16)
+                        break;
+                    else
+                        ptr++;
+                }
+            }
+        }
+
+
+        if (galtype == GAL20V8)
+        {
+            if (n == XOR20)
+            {
+                ptr = &Jedec.GALXOR[0];
+            }
+            else
+            {
+                if (n == XOR20+8)
+                {
+                    ptr = &Jedec.GALSig[0];
+                }
+                else
+                {
+                    if (n == NUMOFFUSES20)
+                        break;
+                    else
+                        ptr++;
+                }
+            }
+        }
+
+
+        if (galtype == GAL22V10)
+        {
+            if (n >= XOR22V10 && n < XOR22V10 + 20)
+            {
+                if (!(n % 2))
+                    ptr = ptrXOR++;
+                else
+                    ptr = ptrS1++;
+            }
+            else
+            {
+                if (n == SIG22V10)
+                    ptr = &Jedec.GALSig[0] - 1L;
+
+                if (n == SIG22V10 + SIG_SIZE)
+                    break;
+                else
+                    ptr++;
+            }
+        }
+
+
+        if (galtype == GAL20RA10)
+        {
+            if (n == XOR20RA10)
+            {
+                ptr = &Jedec.GALXOR[0];
+            }
+            else
+            {
+                if (n == SIG20RA10 + SIG_SIZE)
+                    break;
+                else
+                    ptr++;
+            }
+        }
+
+
+        byte |= (*ptr << (n+8) % 8);
+
+        if (!((n + 9)%8))
+        {
+            checksum = (checksum + byte) % 0x10000;
+            byte = 0;
+        }
+
+        n++;
+    }
+
+    checksum = (checksum + byte) % 0x10000;
+
+    return(checksum);
+}
+
+
+
+
+
+/******************************************************************************
+** MakeJedecBuff()
+*******************************************************************************
+** input:   buff     ActBuffer structure for the ram buffer
+**          galtype  type of GAL
+**			cfg		 pointer to the config structure
+**
+** output:  0:  o.k.
+**         -1:  not enough free memory
+**
+** remarks: generates the JEDEC file in a ram buffer
+******************************************************************************/
+ 
+int MakeJedecBuff(struct ActBuffer buff, int galtype, struct Config *cfg)
+{
+    UBYTE   mystrng[16];
+    int     n, m, bitnum, bitnum2, flag;
+    int     MaxFuseAdr = 0, RowSize = 0, XORSize = 0;
+
+
+    switch (galtype)
+    {
+         case  GAL16V8:
+                 MaxFuseAdr = MAX_FUSE_ADR16; /* This variables are defined  */
+                 RowSize    = ROW_SIZE_16V8;  /* both globally AND locally!  */
+                 XORSize    = 8;              /* All assignments concern to  */
+                 break;                       /* the locale variables!!!!    */
+
+         case GAL20V8:
+                 MaxFuseAdr = MAX_FUSE_ADR20;
+                 RowSize    = ROW_SIZE_20V8;
+                 XORSize    = 8;
+                 break;
+
+         case GAL22V10:
+                 MaxFuseAdr = MAX_FUSE_ADR22V10;
+                 RowSize    = ROW_SIZE_22V10;
+                 XORSize    = 10;
+                 break;
+
+         case GAL20RA10:
+                 MaxFuseAdr = MAX_FUSE_ADR20RA10;
+                 RowSize    = ROW_SIZE_20RA10;
+                 XORSize    = 10;
+                 break;
+    }
+
+
+    if (!cfg->JedecFuseChk)
+        if (AddString(&buff, (UBYTE *)"\2\n"))          /* <STX> */
+            return(-1);
+
+	/*** make header of JEDEC file ***/
+    if (AddString(&buff, (UBYTE *)"Used Program:   GALasm 2.1\n"))
+        return(-1);
+
+    if (AddString(&buff, (UBYTE *)"GAL-Assembler:  GALasm 2.1\n"))
+        return(-1);
+
+    if (galtype == GAL16V8)
+    {
+        if (AddString(&buff, (UBYTE *)"Device:         GAL16V8\n\n"))
+            return(-1);
+    }
+
+    if (galtype == GAL20V8)
+    {
+        if (AddString(&buff, (UBYTE *)"Device:         GAL20V8\n\n"))
+            return(-1);
+    }
+
+    if (galtype == GAL20RA10)
+    {
+        if (AddString(&buff, (UBYTE *)"Device:         GAL20RA10\n\n"))
+            return(-1);
+    }
+
+    if (galtype == GAL22V10)
+    {
+        if (AddString(&buff, (UBYTE *)"Device:         GAL22V10\n\n"))
+            return(-1);
+    }
+
+
+    if (AddString(&buff, (UBYTE *)"*F0\n"))     /* default value of fuses */
+        return(-1);
+
+    if (cfg->JedecSecBit)
+    {   /* Security-Bit */
+        if (AddString(&buff, (UBYTE *)"*G1\n"))
+            return(-1);
+    }
+    else
+        if (AddString(&buff, (UBYTE *)"*G0\n"))
+            return(-1);
+
+
+    if (galtype == GAL16V8)                       /* number of fuses */
+        if (AddString(&buff, (UBYTE *)"*QF2194\n"))
+            return(-1);
+
+    if (galtype == GAL20V8)
+        if (AddString(&buff, (UBYTE *)"*QF2706\n"))
+            return(-1);
+      
+    if (galtype == GAL20RA10)
+        if (AddString(&buff, (UBYTE *)"*QF3274\n"))
+            return(-1);
+
+    if (galtype == GAL22V10)
+        if (AddString(&buff, (UBYTE *)"*QF5892\n"))
+            return(-1);
+
+	/*** make fuse-matrix ***/
+
+    bitnum = bitnum2 = flag = 0;
+
+    for (m = 0; m < RowSize; m++)
+    {
+        flag = 0;
+
+        bitnum2 = bitnum;
+
+        for (n = 0; n <= MaxFuseAdr; n++)
+        {
+            if (Jedec.GALLogic[bitnum2])
+            {
+                flag = 1;
+                break;
+            }
+
+            bitnum2++;
+        }
+
+        if (flag)
+        {
+            sprintf((char *)&mystrng[0], "*L%04d ", bitnum);
+
+            if (AddString(&buff, (UBYTE *)&mystrng[0]))
+                return(-1);
+
+            for (n=0; n<=MaxFuseAdr; n++)
+            {
+                if (AddByte(&buff, (UBYTE)(Jedec.GALLogic[bitnum] + '0')))
+                    return(-1);
+                bitnum++;
+            }
+
+            if (AddByte(&buff, (UBYTE)'\n'))
+                return(-1);
+        }
+        else
+            bitnum = bitnum2;
+    }
+
+    if (!flag)
+        bitnum = bitnum2;
+
+                                                /*** XOR-Bits ***/
+    sprintf((char *)&mystrng[0], "*L%04d ", bitnum);    /* add fuse adr. */
+    if (AddString(&buff, (UBYTE *)&mystrng[0]))
+        return(-1);
+
+    for (n = 0; n < XORSize; n++)
+    {
+        if (AddByte(&buff, (UBYTE)(Jedec.GALXOR[n] + '0')))
+            return(-1);
+        bitnum++;
+
+        if (galtype == GAL22V10)
+        {                                           /*** S1 of 22V10 ***/
+            if (AddByte(&buff, (UBYTE)(Jedec.GALS1[n] + '0')))
+                return(-1);
+            bitnum++;
+        }
+    }
+
+    if (AddByte(&buff, (UBYTE)'\n'))
+        return(-1);
+
+
+                                                /*** Signature ***/
+    sprintf((char *)&mystrng[0], "*L%04d ", bitnum);
+
+    if (AddString(&buff, (UBYTE *)&mystrng[0]))
+        return(-1);
+
+    for (n = 0; n < SIG_SIZE; n++)
+    {
+        if (AddByte(&buff, (UBYTE)(Jedec.GALSig[n] + '0')))
+            return(-1);
+        bitnum++;
+    }
+
+    if (AddByte(&buff, (UBYTE)'\n'))
+        return(-1);
+
+
+
+    if ((galtype == GAL16V8) || (galtype == GAL20V8))
+    {
+                                                        /*** AC1-Bits ***/
+        sprintf((char *)&mystrng[0], "*L%04d ", bitnum);
+        if (AddString(&buff, (UBYTE *)&mystrng[0]))
+            return(-1);
+
+        for (n = 0; n < AC1_SIZE; n++)
+        {
+            if (AddByte(&buff, (UBYTE)(Jedec.GALAC1[n] + '0')))
+                return(-1);
+            bitnum++;
+        }
+
+        if (AddByte(&buff, (UBYTE)'\n'))
+            return(-1);
+
+
+                                                        /*** PT-Bits ***/
+        sprintf((char *)&mystrng[0], "*L%04d ", bitnum);
+        if (AddString(&buff, (UBYTE *)&mystrng[0]))
+            return(-1);
+
+        for (n = 0; n < PT_SIZE; n++)
+        {
+            if (AddByte(&buff, (UBYTE)(Jedec.GALPT[n] + '0')))
+                return(-1);
+            bitnum++;
+        }
+
+        if (AddByte(&buff, (UBYTE)'\n'))
+            return(-1);
+
+
+                                                        /*** SYN-Bit ***/
+        sprintf((char *)&mystrng[0], "*L%04d ", bitnum);
+
+        if (AddString(&buff, (UBYTE *)&mystrng[0]))
+            return(-1);
+
+        if (AddByte(&buff, (UBYTE)(Jedec.GALSYN + '0')))
+            return(-1);
+
+        if (AddByte(&buff, (UBYTE)'\n'))
+            return(-1);
+
+        bitnum++;
+
+
+                                                        /*** AC0-Bit ***/
+        sprintf((char *)&mystrng[0], "*L%04d ", bitnum);
+
+        if (AddString(&buff, (UBYTE *)&mystrng[0]))
+            return(-1);
+
+        if (AddByte(&buff, (UBYTE)(Jedec.GALAC0 + '0')))
+            return(-1);
+
+        if (AddByte(&buff, (UBYTE)'\n'))
+            return(-1);
+
+    }
+
+
+
+/*  if (cfg->JedecFuseChk)
+    {*/                                   /* add fuse-checksum */
+        sprintf((char *)&mystrng[0], "*C%04x\n", FuseChecksum(galtype));
+
+        if (AddString(&buff, (UBYTE *)&mystrng[0]))
+            return(-1);
+/*    }*/
+
+
+    if (AddString(&buff, (UBYTE *)"*\n"))                 /* closing '*' */
+        return(-1);
+
+
+    if(!cfg->JedecFuseChk)
+    {
+        if (AddByte(&buff, (UBYTE)0x3))                     /* <ETX> */
+            return(-1);
+    }
+
+
+    return(0);
+}
+
+
+/******************************************************************************
+** WriteJedecFile()
+*******************************************************************************
+** input:   galtype     type of GAL
+**          cfg			configuration structure
+**
+** output:  none
+**
+** remarks: generats the JEDEC file out of the JEDEC structure
+******************************************************************************/
+ 
+void WriteJedecFile(char *filename, int galtype, struct Config *cfg)
+{
+    struct  ActBuffer       mybuff;
+    struct  Buffer          *first_buff;
+    UBYTE   *filebuffer, *filebuffer2;
+    long    result;
+    unsigned checksum;
+	FILE *fp;
+    char   mystring[16];
+    usize  (*write)(void *buf, usize size, usize nmemb, FILE *out);
+    char   *write_mode;
+    char   *append_mode;
+
+
+    if (cfg->ForceCRLF)
+    {
+        write = WriteOutputWithCRLFLineEndings;
+        write_mode = "wb";
+        append_mode = "ab";
+    }
+    else
+    {
+        write = WriteOutputWithNativeLineEndings;
+        write_mode = "w";
+        append_mode = "a";
+    }
+
+
+	if(!(first_buff = (struct Buffer *) calloc(sizeof(struct Buffer),1)))
+    {
+        ErrorReq(2);                                /* out of memory? */
+        return;
+    }
+
+    mybuff.ThisBuff = first_buff;
+    mybuff.Entry    = (UBYTE *)(&first_buff->Entries[0]);
+    mybuff.BuffEnd  = (UBYTE *)first_buff + (long)sizeof(struct Buffer);
+
+
+
+    if (MakeJedecBuff(mybuff, galtype, cfg))
+    {                                       /* put JEDEC in ram-buffer */
+        FreeBuffer(first_buff);             /* error?                  */
+        ErrorReq(2);
+        return;
+    }
+
+    if ((fp = fopen(filename, write_mode)))
+    {
+        for (;;)
+        {
+            filebuffer = filebuffer2 = mybuff.Entry;
+
+            while (filebuffer2 < mybuff.BuffEnd)
+            {                                   /* get size of buffer */
+                if (!*filebuffer2)
+                    break;
+                filebuffer2++;
+            }
+                                                /* save buffer */
+			/* DHH - 24-Oct-2012: ensure lines are terminated with CRLF */
+			result = write(filebuffer,(usize) 1, (usize) (filebuffer2 - filebuffer),fp);
+
+            if (result != (filebuffer2 - filebuffer))
+            {                                   /* write error? */
+                fclose(fp);
+                FreeBuffer(first_buff);
+                ErrorReq(13);
+                return;
+            }
+
+            if (!mybuff.ThisBuff->Next)         /* more buffers here? */
+                break;                          /* no, then cancel */
+
+            mybuff.ThisBuff = mybuff.ThisBuff->Next;
+            mybuff.Entry    = (UBYTE *)(&mybuff.ThisBuff->Entries[0]);
+            mybuff.BuffEnd  = (UBYTE *)mybuff.ThisBuff + (long)sizeof(struct Buffer);
+        }
+
+        fclose(fp);
+
+        if (!cfg->JedecFuseChk)
+        {
+            if (FileChecksum(filename, &checksum))
+            {
+                if ((fp = fopen(filename, append_mode)))
+                {
+
+                    sprintf(mystring, "%04x\n", checksum);
+                    write(mystring, (usize) 1, strlen(mystring), fp);
+                    fclose(fp);
+                }
+                else
+                {
+                    FreeBuffer(first_buff);
+                    ErrorReq(13);
+                    return;
+                }
+            }
+            else
+            {
+                FreeBuffer(first_buff);
+                ErrorReq(13);
+                return;
+            }
+        }
+    }
+    else
+    {
+        FreeBuffer(first_buff);                     /* error?, then cancel*/
+        ErrorReq(13);                               /* can't open file */
+        return;
+    }
+
+    FreeBuffer(first_buff);
+}
+
+/*
+ * DHH - 24-Oct-2012
+ * This function works like fwrite, but outputs newlines as CRLF.
+ * My GAL programmer (Wellon VP-190) doesn't like JEDEC files
+ * with bare newlines in them.
+ */
+static usize WriteOutputWithCRLFLineEndings(void *buf_, usize size, usize nmemb, FILE *out)
+{
+	unsigned char *buf = (unsigned char *) buf_;
+	usize i;
+
+	for (i = 0; i < size*nmemb; i++) {
+		unsigned char byte = buf[i];
+		if (byte == '\n') {
+			fwrite("\r\n", 1, 2, out);
+		} else {
+			fwrite(&byte, 1, 1, out);
+		}
+	}
+
+	return nmemb;
+}
+
+
+static usize WriteOutputWithNativeLineEndings(void *buf_, usize size, usize nmemb, FILE *out)
+{
+    return fwrite(buf_, size, nmemb, out);
+}
--- /dev/null
+++ b/src/localize.c
@@ -1,0 +1,83 @@
+/******************************************************************************
+** localize.h
+*******************************************************************************
+**
+** description:
+**
+** Error strings.
+**
+******************************************************************************/
+ 
+
+
+
+char *ErrorArray[] =
+{
+"",
+"Can't find file!",
+"Not enough free memory!",
+"Can't load file!",
+"File is empty!",
+"Error in JEDEC file!",
+"Impossible error: GAL is not empty!",
+"No pinnames found.",
+"Can't close file!",
+"Wrong type of GAL selected!",
+"Impossible error: Can't load 's:GALer.config'!",
+"Impossible error: Can't save 's:GALer.config'!",
+"Impossible error: Can't open window!",
+"Can't save file!",
+};
+
+char *AsmErrorArray[] = 
+{
+"error in source file found",
+"Line  1: type of GAL expected",
+"unexpected end of file",
+"pinname expected after '/'",
+"max. length of pinname is 8 characters",
+"illegal character in pin declaration",
+"illegal VCC/GND assignment",
+"pin declaration: expected VCC at VCC pin",
+"pin declaration: expected GND at GND pin",
+"pinname defined twice",
+"illegal use of '/'",
+"unknown pinname",
+"NC (Not Connected) is not allowed in logic equations",
+"unknown suffix found",
+"'=' expected",
+"this pin can't be used as output",
+"same pin is defined multible as output",
+"before using .E, the output must be defined",
+"GAL22V10: AR and SP is not allowed as pinname",
+".E, .CLK, .ARST and .APRST is not allowed to be negated",
+"mode 2: pins 12, 19 can't be used as input",
+"mode 2: pins 15, 22 can't be used as input",
+"tristate control is defined twice",
+"GAL16V8/20V8: tri. control for reg. output is not allowed",
+"tristate control without previous '.T'",
+"use GND, VCC instead of /VCC, /GND",
+"mode 3: pins 1,11 are reserved for 'Clock' and '/OE'",
+"mode 3: pins 1,13 are reserved for 'Clock' and '/OE'",
+"use of VCC and GND is not allowed in equations",
+"only one product term allowed (no OR)",
+"too many product terms",
+"use of AR and SP is not allowed in equations",
+"negation of AR and SP is not allowed",
+"no equations found",
+".CLK is not allowed when this type of GAL is used",
+".ARST is not allowed when this type of GAL is used",
+".APRST is not allowed when this type of GAL is used",
+"GAL20RA10: pin 1 can't be used in equations",
+"GAL20RA10: pin 13 can't be used in equations",
+"AR, SP: no suffix allowed",
+"AR or SP is defined twice",
+"missing clock definition (.CLK) of registered output",
+"before using .CLK, the output must be defined",
+"before using .ARST, the output must be defined",
+"before using .APRST the output must be defined",
+"several .CLK definitions for the same output found",
+"several .ARST definitions for the same output found",
+"several .APRST definitions for the same output found",
+"use of .CLK, .ARST, .APRST only allowed for registered outputs"
+};
--- /dev/null
+++ b/src/mkfile
@@ -1,0 +1,16 @@
+< /$objtype/mkfile
+
+TARG=galasm
+
+OFILES= galasm.$O\
+		support.$O\
+		localize.$O\
+		jedec.$O
+
+HFILES= galasm.h
+
+BIN=	/$objtype/bin
+
+all:V:	$O.out test
+		
+</sys/src/cmd/mkone
--- /dev/null
+++ b/src/support.c
@@ -1,0 +1,354 @@
+/******************************************************************************
+** support.c
+*******************************************************************************
+**
+** description:
+**
+** Some support routines.
+**
+******************************************************************************/
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+ 
+#include "galasm.h"
+
+/******************************************************************************
+** GetBaseName(char *filename)
+*******************************************************************************
+** input:   *filename   filename
+**
+** output:  pointer to a string with a filename and
+**			enough space to add the extension later
+**			or NULL.
+**
+** remarks: the returned pointer must be free()ed 
+**
+******************************************************************************/
+
+char *GetBaseName(char *filename)
+{
+	int c,n;
+
+	char *p;
+
+	c = strlen(filename);
+
+	for(n = c; n != 0; n--)
+	{ 
+		if(filename[n-1] == '.')
+		{
+			n--;
+			break;
+		}
+	}
+
+	if(n == 0) n = c;
+
+	if((p = (char *)malloc(n+5)))
+	{
+		memset(p, ' ', n+4);
+		strncpy(p, filename, n); 
+		p[n+4] = '\0';
+
+		return(p);
+	}
+	else
+		return(NULL);
+}
+
+
+/******************************************************************************
+** FileSize()
+*******************************************************************************
+** input:   *filename   filename
+**
+** output:  -1   file does not exist
+**          -2   not enough memory for FileInfoBlock
+**          >0   length of the specified file
+**
+** remarks: returns length of a file
+**
+******************************************************************************/
+ 
+int FileSize(char *filename)
+{
+	FILE *fp;
+
+	int size = 0;
+
+	if((fp = fopen(filename, "r")))
+	{
+		while (fgetc(fp) != EOF)
+		{
+			size++;
+		}
+
+		fclose(fp);
+	}
+	else
+		return(-1);
+
+	return(size);
+}
+
+/******************************************************************************
+** ReadFile()
+*******************************************************************************
+** input:   *filename       name of file
+**          filesize        length of file [bytes]
+**          *filebuff       where to store the specified file
+**
+** output:  TRUE:  file loaded
+**          FALSE: failed to load
+**
+** remarks: loads the specified file into memory
+**
+******************************************************************************/
+
+int ReadFile(char *filename, int filesize, UBYTE *filebuff)
+{
+    int  actlen;
+    FILE *fp;
+
+	if((fp = fopen(filename, "r")))
+	{
+		actlen = fread(filebuff,1,filesize,fp);
+
+		fclose(fp);
+
+		if(actlen == filesize)
+			return(TRUE);
+	}
+	return(FALSE);
+}
+
+/* The functions AddByte(), AddString(), IncPointer(), DecPointer() */
+/* and FreeBuffer() are useful for handling chained lists           */
+
+/******************************************************************************
+** AddByte()
+*******************************************************************************
+** input:   *buff   pointer to buffer structure
+**          code    byte to add to the list
+**
+** output:  0:   o.k.
+*           !=0: error occured (e.g. not enough free memory)
+**
+** remarks: This function does set a byte in a buffer. If the end of the buffer
+**          is reached, a new buffer is added to the chained list of buffers.
+**
+******************************************************************************/
+
+int AddByte(struct ActBuffer *buff, UBYTE code)
+{
+    struct  Buffer  *mybuff;
+
+    if ((buff->Entry) < (buff->BuffEnd))    /* is the current address within */
+    {                                       /* the buffer ?                  */
+        *buff->Entry++ = code;              /* the fill in the byte */
+    }
+    else
+    {                                       /* if not, then add a new buffer */
+		if(!(mybuff = (struct Buffer *)calloc(sizeof(struct Buffer),1)))
+        {
+            ErrorReq(2);
+            return(-1);
+        }
+
+        buff->ThisBuff->Next = mybuff;      /* new buffer is current buffer */
+        mybuff->Prev   = buff->ThisBuff;    /* previous is old buffer       */
+        buff->ThisBuff = mybuff;            /* current buffer is new buffer */
+        buff->Entry    = (UBYTE *)(&mybuff->Entries[0]);
+        buff->BuffEnd  = (UBYTE *)mybuff + (long)sizeof(struct Buffer);
+        *buff->Entry++ = code;
+    }
+    return(0);
+}
+
+/******************************************************************************
+** AddString()
+*******************************************************************************
+** input:   *buff    pointer to buffer structure
+**          strnptr  pointer to string to be added to the buffer
+**
+** output:  0:   o.k.
+**          !=0: error occured (e.g. not enough free memory)
+**
+** remarks: This function does add a string to a buffer. If the end of the
+**          buffer is reached, a new buffer is added to the chained list of
+**          buffers.
+**
+******************************************************************************/
+ 
+int AddString(struct ActBuffer *buff, UBYTE *strnptr)
+{
+    while (*strnptr)
+    {
+        if (AddByte(buff, *strnptr++))
+            return(-1);
+    }
+    return(0);
+}
+
+/******************************************************************************
+** IncPointer()
+*******************************************************************************
+** input:   *buff   pointer to buffer structure
+**
+** output:  none
+**
+** remarks: This function does increment the pointer of the current buffer
+**          structure. If the pointer points to the end of the buffer, the
+**          pointer will be set to the beginning of the next entry of the
+**          chained list.
+**          ATTENTION: there is no test whether the absolut end of the chained
+**                     list is reached or not!
+**
+******************************************************************************/
+ 
+void IncPointer(struct ActBuffer *buff)
+{
+
+    buff->Entry++;
+
+    if (buff->Entry == buff->BuffEnd)       /* end of buffer reached? */
+    {
+        buff->ThisBuff = buff->ThisBuff->Next;  /* yes, then set the pointer */
+                                                /* to the next buffer        */
+
+        buff->Entry    = (UBYTE *)(&buff->ThisBuff->Entries[0]);
+
+        buff->BuffEnd  = (UBYTE *)buff->ThisBuff + (long)sizeof(struct Buffer);
+    }
+}
+
+/******************************************************************************
+** DecPointer()
+*******************************************************************************
+** input:   *buff   pointer to buffer structure
+**
+** output:  none
+**
+** remarks: This function does decrement the pointer of the current buffer
+**          structure. If the pointer points to the start of the buffer, the
+**          pointer will be set to the beginning of the previous entry of the
+**          chained list.
+**          ATTENTION: there is no test whether the absolut start of the chained
+**                     list is reached or not!
+**
+******************************************************************************/
+
+void DecPointer(struct ActBuffer *buff)
+{
+
+    buff->Entry--;
+
+    if (buff->Entry < &buff->ThisBuff->Entries[0])  /* start of buffer reached? */
+    {
+        buff->ThisBuff = buff->ThisBuff->Prev;    /* pointer to previous buffer */
+
+        buff->BuffEnd  = (UBYTE *)buff->ThisBuff + (long)sizeof(struct Buffer);
+
+        buff->Entry    = (UBYTE *)((buff->BuffEnd)-1L);
+    }
+
+}
+
+/******************************************************************************
+** FreeBuffer()
+*******************************************************************************
+** input:   *buff   pointer to buffer structure
+**
+** output:  none
+**
+** remarks: This function does free memory which is allocated by the chained
+**          list.
+**
+******************************************************************************/
+
+void FreeBuffer(struct Buffer *buff)
+{
+	struct Buffer *nextbuff;
+
+	while(buff)
+	{
+		nextbuff = buff->Next;
+		
+		free(buff);
+		
+		buff = nextbuff;
+	}
+}	
+
+/******************************************************************************
+** GetGALName()
+*******************************************************************************
+** input:   gal type
+**
+** output:  pointer to a string with the gal name
+**
+******************************************************************************/
+
+char *GetGALName(int galtype)
+{
+	switch(galtype)
+	{
+		case GAL16V8:	return("16V8");
+		case GAL20V8:	return("20V8");
+		case GAL22V10:	return("22V10");
+		case GAL20RA10:	return("20RA10");
+		
+		default:
+				return "UNKNOWN";
+	}
+}
+
+/******************************************************************************
+** GetPinName()
+*******************************************************************************
+** input:   *pinnames  pointer to the pinnames array
+**          pinnum     the number of the pin
+**
+** output:  pointer to a string with the pin name
+**
+******************************************************************************/
+
+char *GetPinName(UBYTE *pinnames, int pinnum)
+{
+	return (char*) (pinnames + (pinnum - 1) * 10);
+}
+
+/******************************************************************************
+** GetModeName()
+*******************************************************************************
+** input:   mode
+**
+** output:  pointer to a string with the mode name
+**
+******************************************************************************/
+
+char *GetModeName(int mode)
+{
+	switch(mode)
+	{
+		case MODE1:	return("simple");
+		case MODE2:	return("complex");
+		case MODE3:	return("registered");
+
+		default:
+				return "UNKNOWN";
+	}
+}
+
+/******************************************************************************
+** errorReq()
+*******************************************************************************
+** input:   error number
+**
+******************************************************************************/
+
+void ErrorReq(int errornum)
+{
+	printf("Error: %s\n",ErrorArray[errornum]);
+}
--- /dev/null
+++ b/src/test/mkfile
@@ -1,0 +1,18 @@
+test:V:
+		stat=''
+		cp ../../examples/*.pld .
+		for (pld in `{ls *.pld | awk -F '.' '{print $1}'}) {
+			../$O.out -q $pld^'.pld'
+			df=`{diff $pld^'.jed' ../../examples/$pld^'.jed'}
+			if (echo $df | grep '[<>] \*[A-Z][0-9][0-9][0-9][0-9] [01]+' > /dev/null) {
+				str=$pld^' FAIL: JED data mis-match'
+				stat=$stat^$str^':'
+				echo $stat
+			}
+			if not echo $pld 'Pass: JED data matches'
+		}
+		if (test -n $stat) echo 'FAILED: '^$stat
+		if not echo 'PASSED'
+
+clean:V:
+		rm -f *.pld *.chp *.jed *.fus *.pin
--