home *** CD-ROM | disk | FTP | other *** search
- ================
- == !WimpFetch ==
- ================
-
- (c) Jochen Lueg
- Lecturer in Electronics and Computing
- College of Further Education
- Mainstreet
- Limavady
-
- £10 donations please to the Computer kitty, room 57 at the above address
-
- What is !WimpFetch?
- ===================
- !WimpFetch was written to aid the understanding and teaching of the famous
- Fetch- Execute cycle used by every CISC computer. Ideal for A-Level in com-
- puting and BTEC National Diplome in Computing.
-
- It uses a processor that is so basic, it will just about work.
-
- !WimpFetch can also be used to learn or to teach the basic principles of
- assembly code. The computer model provided is the 65-JL, a product of pure
- fantasy and some heavy borrowing from the noble 6502. This new processor
- has the unique ability to store an instruction plus an address (i.e 16 bits)
- in its memory and registers, but only 8-bits for data. (It does this by
- using unique extra flexible rubber registers. These are of my own invention
- and not yet patented.)
-
- !WimpFetch can single-step in slow or fast mode through a program written
- in !Edit. The behaviour of all relevant registers, control lines and data
- lines is displayed in real time.
-
- A separate panel displays the pseudo code for every step.
-
-
-
- The 65-JL microprocessor
- ========================
-
- The 65-JL microprocessor is loosely based on the 6502 chip. It has one
- general purpose register, the Accumulator. It also boasts an index register
- and three flags - Zero, Carry and Negative. The 65-JL has three addressing
- modes. Absolute, immediate and indexed. Two further addressing modes are
- used for certain instructions only. Implied addressing mode is used by all
- register address instructions and relative addressing mode is used for all
- branch instructions. Notice the absence of a stack register - type 65-JL
- does not yet support a stack structure. Further improvements are of course
- always possible.
-
- The 65-JL addresses a small memory of 96 locations. Memory locations can
- only be used for reading and writing - they cannot be shifted or rotated.
- There is no operating system - so don't try SWI's or OSByte calls.
-
-
-
-
- 65-JL Assembly Code
- ===================
-
- Programs should be written in !Edit and saved into the special directory
- inside the !WimpFetch application. Easy access to this directory can be
- gained by clicking on the switch labelled "Files" or by selecting the same
- option from the menu. Once saved, programmes can be loaded into memory by
- the usual click, drag, release method.
-
- There is limited error checking and programs must follow strict rules,
- otherwise the processor will hang up. All programs must start with BEGIN
- followed by ORIGIN nn, where nn is the start location in hex. This value
- will automatically be loaded into the SCR on reset.
-
- The above must be followed by the directive CODE START. The code must start
- with an instruction followed by a single space followed by a hexadecimal
- address nn or by #nn to indicate immediate mode. The line must not contain
- any empty spaces.
-
- It must be emphasised that the program will only understand two digit
- hexadecimal numbers, i.e. A is not understood - it must be 0A. Opcodes must
- use upper case.
-
- The code section must be terminated by the directive CODE END. The
- directive DATA nn, where nn is the start location of the numbers that
- follow is next. These must be in the form n1,n2,n3 and all must be in the
- same line. There can be as many DATA statements as are desired but each
- statement should be followed by at least one operand.
-
- END terminates the program.
-
- Here is an example. The program adds the number that is in location 30 to
- the number in 31 and stores the result in 32. The numbers 45 and 55 are put
- into locations 30,31 via the DATA directive.
-
- BEGIN
- ORIGIN 00
- CODE START
- CLC
- LDA 30
- ADC 31
- STA 32
- CODE END
- DATA 30
- 45,55
- END
-
-
- Branches
- ========
- Branches must be expressed in two's complement notation relative to the
- present content of the program counter. This means that a branch of -1 (FF)
- returns to the current statement.
-
-
- A practice session
- ==================
- Double click on !WimpFetch to install it on the icon bar. Click once on
- the icon and two windows will open. The 65-JL processor window and the
- memory window. The two windows are linked, so that when you move the
- processor window, the memory travels with it. The memory window can however
- be moved independently. To return it to its proper place, click on the red
- switch "Return memory" that it leaves behind.
-
- On the left bottom of the processor window is a bank of switches. Click on
- "Files". This will open a filer window containing all available programs.
- Select one by pressing and holding "Select" on it and dragging it anywhere
- within the processor window. The programs may be examined by double
- clicking on their icons. This will load them into an edit window, ready to
- be edited.
-
- The program should now be in memory. This may not be obvious if the Origin
- is not 00. All computers must be reset, so click on the "Reset" button. The
- start location of the program should now appear in the SCR.
-
- To step through the program click on the switch "Clock". This will activate
- one step of the fetch execute cycle. The SCR will be copied into the MAR
- and the pseudo code will appear in the left panel. By the way, all data
- lines are red and all control lines are black.
-
- Clicking on "Clock" again will trigger the next step, and so on.
-
- If you get fed up with the slow speed or know what to expect, try clicking
- on "Fast". This will accelerate the proceedings considerably. If you want
- to see maximum speed, click on "Astable". This will override the clock
- button and go into free running mode. Sit back in amazement and watch the
- worlds slowest computer do its stuff!
-
-
- Writing a new program
- =====================
-
- Load !WimpFetch, click on files and double click on the file "Blank". This
- will load a file into edit that contains all directives but no program.
- Type your program and save it under a different name into the same folder
- it came from.
-
-
- Experimenting wit !WimpFetch
- ============================
-
- The program runs in real time. This means that any location or register can
- be changed at any time and the sequence will pick up from this point. Flags
- can be changed - even memory contents. This enables any amount of crazed
- experimentation. A limited amount of Error checking takes place, but don't
- be suprised if the machine hangs up when illegal characters are entered.
-
-
- Things not mentioned till now
- =============================
-
- Clicking on "Decimal" or "Binary" will convert all relevant location to
- this base - the program runs in hex by default, as soon as you activate the
- clock everything will be turned back into hex as if by hex.
-
-
-
-
- The Main Menu
- =============
-
- Clicking the middle mouse button reveals the menu as usual. Most items on
- the menu are obvious. "Reset" duplicated the "Return memory" switch,
- "Files" duplicates the "Files" switch. "Code Help" displays that splendid
- example of lucid English you are reading at the moment and "Quit" .....
-
- The most interesting selection is "Code" . Follow the arrow to see the
- complete instruction set of the 65-JL processor. Clicking on each of the
- instructions will reveal a window with some more relevant information, like
- addressing modes and flag behaviour.
-
- Note:
-
- If you use the Editor Zap, you might have some problems. Make sure !Edit is
- on the icon bar before you run this program. This way you should have fewer
- problems.
-
-
- And finally
- ===========
-
- Have fun.
-
- Jochen Lueg
-
-
-
-
-
-
-
-