Hardware Reference
In-Depth Information
20. You are to implement a macro assembler. For esthetic reasons, your boss has decided
that macro definitions need not precede their calls. What implications does this decis-
ion have on the implementation?
21. Think of a way to put a macro assembler into an infinite loop.
22. A linker reads five modules, whose lengths are 200, 800, 600, 500, and 700 words, re-
spectively. If they are loaded in that order, what are the relocation constants?
23. Write a symbol table package consisting of two routines: enter(symbol, value) and
lookup(symbol, value) . The former enters new symbols in the table and the latter looks
them up. Use some form of hash coding.
24. Repeat the previous problem, only this time instead of using a hash table, after the last
symbol is entered, sort the table and use a binary-lookup algorithm to find symbols.
25. Write a simple assembler for the Mic-1 computer of Chap. 4. In addition to handling
the machine instructions, provide a facility for assigning constants to symbols at as-
sembly time, and a way to assemble a constant into a machine word. These should be
pseudoinstructions, of course.
26. Add a simple macro facility to the assembler of the preceding problem.
Search WWH ::




Custom Search