Department of Electrical and Computer Engineering
ECED 3403: Computer Architecture
Last updated: 23 May 2018
For a copy of assignment 1, click
18 05 15 - Typo in table 1 fixed.
Pre-assembler error - clarification:
Section 2.2 of Assignment 1 states, "If errors are detected, they should be
flagged; however, pre-assembly should continue for the remaining records".
The pre-assembler is looking for pre-assembler instructions only.
Any record that does not have a pre-assembler instruction should be written
to the output file unchanged.
Pre-assembler instructions have either no arguments or one argument.
A no-argument instruction, such as CLRC, should be converted to BIC #1,R6.
Input record: CLRC ; Clear carry bit
Output record: BIC #1,R6 ; Clear carry bit
However, if the no-argument instruction has an argument, an error has
Input record: CLRC R4 ; Clear carry bit
In this case, the pre-assembler could simply convert the CLRC and let the
assembler deal with the problem:
Output record: BIC #1,R6 R4 ; Clear carry bit
Alternatively, the pre-assembler can handle it (the preferred method), by
indicating that a no-argument instruction has an argument and is therefore
A one-argument instruction such as JUMP Rx should have an argument (a
user-supplied register name - you are not required to check the register
For example, JUMP R1, should be converted to MOV R1,R7.
Three possible one-argument scenarios are:
Some emulated instructions refer to the equated registers SP (R5),
PSW (R6), and PC (R7).
If the following records are not added to the output file, the assembler
could produce errors:
No argument is supplied with the emulated instruction; for example:
JUMP ; over the lazy dog!
This is an error that can be detected by the pre-assembler.
One argument is supplied with the emulated instruction; for example:
Jump R6 ; Jump to address in PSW
More than one argument is supplied with the emulated instruction; for
Jump right now ; Okay?
Jump to the left and a step to the right
This is another error that can be detected by the pre-assembler.
PSW EQU R6
SP EQU R5
PC EQU R7
To avoid requiring the input file including these equates or the pre-assembler
adding them, simply change the equated records to include the unequated
A file containing examples of input records for your pre-assembler is
Other examples of X-Makina assembly files can be found on the
X-Makina Documentation and Software page.
|CLRC || BIC #1,R6|
|CLRN || BIC #4,R6|
|CLRZ || BIC #2,R6|
|JUMP Rx || MOV Rx,R7|
|NOP || MOV R6,R6|
|PULL Rx || LD R5+,Rx |
|PUSH Rx || ST Rx,-R5 |
|RET || MOV R4,R7|
|SETC || BIS #1,R6|
|SETN || BIS #4,R6|
|SETZ || BIS #2,R6|
Information on the X-Makina assembler can be found in the
The X-Makina Assembler User's Guide (24 May 2018)
For help on Process Specification, click
For help on Data Dictionaries, click
For help on Dataflow diagrams (DFDs):
Available: 14 May 2018
Design document submission (3pm, at start of class): 24 May 2018
Demonstrations (during lab): 5 June 2018
Software and testing submission (3pm, at start of lab): 5 June 2018
If the software deviates from the original design, the design document must be updated and resubmitted.
Late submissions for this assignment will not be accepted.