Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site exodus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!exodus!dhc From: dhc@exodus.UUCP (David H. Copp) Newsgroups: net.wanted Subject: Re: Simple Cross Assemblers Message-ID: <155@exodus.UUCP> Date: Thu, 3-May-84 09:28:38 EDT Article-I.D.: exodus.155 Posted: Thu May 3 09:28:38 1984 Date-Received: Fri, 4-May-84 02:40:30 EDT References: <1599@burdvax.UUCP> Organization: Bell Communications Research Lines: 33 If it really is a small job, for a small machine--writing your own assembler might be easier than you think. I once saw an assembler that consisted of little more than two tables, a reserved word table and a symbol table. The reserved word table contained the mnemonic names for the opcodes and the registers, etc.. Each entry consisted of the pair where the bit pattern was one machine word wide, and consisted of the corresponding op-code, etc., in the right place in the word, and zeros elsewhere. The symbol table contained (as I recall) only address symbols and their definitions (numerical addresses). This was a teeny bit complicated--a hash table--but only a teeny bit. Again, each definition was one machine word wide, with the address in the appropriate field and zeros elsewhere. The assembler only did two basic things; make entries in the address table (whenever a label was encountered), and -- TA DA ... generate code, by Boolean-ORing the definitions for all tokens (except labels and comments) on one line of assembler input! It implements a primitive assembly language, but it works. -- David H. Copp