DOC PREVIEW
MIT 6 111 - Lecture notes

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ASSEMBLER(1) ASSEMBLER(1) NAME assembler, assem, assem16to8, assem24to8, assem32to8 - translate symbolic microcode into hex integer file(s) SYNOPSIS assembler < xxx.as > xxx.dat assem xxx assem16to8 xxx assem24to8 xxx assem32to8 xxx DESCRIPTION This program translates symbolic microcode instructions into a file of hex integers. An optional listing file can also be produced which reproduces the source file with the addition of the address and value for each microinstruction. The assembler output must then be processed by the dat2ntl program to format this file into one that can be sent to the PROM programmer. The dat2ntl program is described in a separate man-page. The assembler accommodates a large number of microinstruction formats. The user can (must) define individual keywords and instruction formats in a specification file. There are several shell scripts which run both assembler and dat2ntl so these programs do not have to be run separately. These scripts pipe the output of assembler through the program dat2ntl. By the recommended convention, the source file name has an extension of .as, i.e., it is of the following form: xxx.as The specification file name is of the form: xxx.sp The listing file name should be of the form: xxx.list USE OF THE PROGRAM To use the program one must create a specification file and a source file. The specification file, xxx.sp, contains the declaration of the command names and the bits which each com-mand asserts. It also specifies which bits will be used for the address field, the instruction size, and, option-ally, whether the default assertion for signals is low or high. The microinstructions must all be of the same length and can only reference a single address. The source file, xxx.as, contains the assembly code which uses the declarations given in xxx.sp. It must include a #SPEC_FILE statement in order to know where to look for these declarations. It may also include a #LIST_FILE statement which provides a file name for the assembler listing, a #SET_ADDRESS statement to tell the assembler the beginning address for the assembled code, and a #NEW_PROGRAM statement to tell the assembler to treat the following text as a completely new program. Any other com-mand statement - "#command_name = value ;" - will be passed through the assembler. There can be multiple #SET_ADDRESS statements interspersed within the code so that the address can be changed anywhere in the code. This is useful for subroutines or when a certain part of the code needs to be put in a specific position in memory. The formats of these statements can be obtained from the examples or from the man page for dat2ntl. MIT EECS Dept. 1ASSEMBLER(1) ASSEMBLER(1) Note that the LIST_FILE produced by the assembler can be used in your project reports. WHAT THE ASSEMBLER DOES The assembler operates in two passes. It first opens xxx.as. From this it determines the name of your spec-ification file, xxx.sp, and processes this file to determine your instruction formats. The assembler then pro-ceeds to process xxx.as. During this first pass, the values of all address labels are evaluated and stored. Except for forward address references, the values of the microinstructions are also determined during this first pass. During the second pass, the values of the forward referenced address labels are included in the final microinstruction values; and the final output is produced along with the optional listing file. To produce an output number for a microinstruction, the assembler first evaluates a token. It then shifts the value left so that it lines up with the specified field and logically ORs the value into the output number. While doing this it checks to see if the value is wholly contained within the specified field. If not, it pro-duces a warning error comment. It also produces a (different) warning if successive tokens cause the same bit in the output number to be specified more than once. When the statement terminating semicolon is reached, the assembler increments the address counter and processes the next microinstruction. You may include multiple, separate programs within the same source file. All of these programs must use the same specification file. These programs are delineated by the inclusion of a command statement, # new_program = prom_address This command statement will be translated into a # load_address = prom_address statement. HOW TO RUN THE PROGRAM The assembler by itself translates its input file into a data file of hex integers. This file then has to be pro-cessed by dat2ntl to create the file, xxx.ntl, before you can program a PROM on a DATA I/O programmer. assembler <xxx.as >xxx.dat There are several shell scripts which run both assembler and dat2ntl so these programs do not have to be run separately. These scripts pipe the output of assembler through the program dat2ntl. The following shell scripts all process xxx.as: assem xxx Creates xxx.ntl assem16to8 xxx Creates byt0xxx.ntl and byt1xxx.ntl assem24to8 xxx Creates byt0xxx.ntl through byt2xxx.ntl assem32to8 xxx Creates byt0xxx.ntl through byt3xxx.ntl INPUT FILE FORMAT The assembler parses its input into tokens. White space, i.e., spaces, tabs, returns, and newlines, are ignored, although your file must end with a newline or else the last line will not be read. The parser is case insensitive. Internally, all upper case characters are mapped into lower case characters. Since the names of the specification file, xxx.sp, and of the listing file, xxx.list, are specified in the source MIT EECS Dept. 2ASSEMBLER(1) ASSEMBLER(1) file, xxx.as, the actual UNIX file names must not include upper case characters. Legal characters for labels or symbols include a through z, 0 through 9, . (period), _ (underscore), / (slash), and %. Labels and symbols must include at least one nonnumeric character. The same label cannot be used as an address label and a command symbol, as the assembler will consider this to be a redeclaration error. Comments are delimited as in C. For example, /* this is a comment */ /* * This is also * a comment. */ Integers are normally interpreted as decimal numbers. If you precede an integer with %b or %h, then that integer will be interpreted as a binary or hex number respectively. For example, %b10001 will be read as 17 and %h1c will be read as 28. CAUTION - The integer in a #SET_ADDRESS, #LOAD_ADDRESS, or #NEW_PROGRAM


View Full Document

MIT 6 111 - Lecture notes

Documents in this Course
Verilog

Verilog

21 pages

Video

Video

28 pages

Bass Hero

Bass Hero

17 pages

Deep 3D

Deep 3D

12 pages

SERPENT

SERPENT

8 pages

Vertex

Vertex

92 pages

Vertex

Vertex

4 pages

Snapshot

Snapshot

15 pages

Memories

Memories

42 pages

Deep3D

Deep3D

60 pages

Design

Design

2 pages

Frogger

Frogger

11 pages

SkiFree

SkiFree

81 pages

Vertex

Vertex

10 pages

EXPRESS

EXPRESS

2 pages

Labyrinth

Labyrinth

81 pages

Load more
Download Lecture notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?