[Brandon University crest][The famous "Halfway Tree" of the Prairies, between Winnipeg and Brandon]

Micro Programmable Computer

Site Map
MPC Home
Program Structure
Computer
Macro Assembler
Micro Assembler
Example
Diagram
Download

 

 

Microassembler

MicroAssembler encapsulates an instance of ROM and provides methods to specify which bits in each control word are to be set.

Here is an example microinstruction. Assume m is an instance of MicroAssembler.

	m.org(1);
		m.label("ADD");
		m.FS(2);
		m.RW();
		m.NA("IF");
		m.MS(1);
  1. Each micro-control-word field has a corresponding method in MicroAssembler. 
  2. Methods corresponding to single-bit fields have no arguments. Invoking such a method sets the field to 1. 
  3. Methods corresponding to multi-bit fields, like NA, MS, and FS each take an argument conveying the value to be assigned to the field.
  4. NA is overloaded with a method that takes a string argument. This allows the NA field to be coded symbolically instead of numerically. See resolve(), below.

Utility methods are provided.

  • org() specifies the micro-control word to which all subsequent methods are to be applied. org() is used to introduce new micro-control-word specifications.
  • label() specifies a string to be associated with the current micro-control word. This string can be referenced as the argument to NA() in another word. The current org() value is associated with the label.
  • resolve() updates the numeric value of each symbolic NA field to the org value corresponding to a label(). resolve() is called once, after all other micro-assembly methods. This permits the use of forward references from NA() to label().
  • display() formats and prints non-zero control words.
  • findLabel() returns the location of a label.

Last update 10/23/03
Copyright © Gerald Dueck
[=]