PROJECT

Write an assembly language program to read a sequence of integers, add 10 to each one, printing out the sum each time. Assume 16 bit instructions and 16 bit integers. Stop when the input is negative one.

INSTRUCTION FORMAT
OPCODE
OPERAND
 
4 bits
12 bits

NOTE: This demonstration uses the 2's complement representation for numeric constants.

TEMP
ALU
EQ
PC
       

 

NOTES:
  1. Since each instruction occupies 16 bits (2 bytes) then the addresses of the generated instructions increment by 2!

  2. Data values are converted to binary and occupy all 16 bits in the word, thus the "split" into opcode and operand after pass 1 is really irrelevant.

  3. The "pseudo-code" or "declarative" operation codes that start with a period (.) These are NOT translated into operations but are instructions to the assembler to treat the information in the line differently.

  4. The "labels" that precede the instructions. These are identifiers that the assembler can use to link names in operand fields to memory locations.

[Prev] [Next]


CS1104 Main Page
Last Updated 2002/03/20
©J.A.N. Lee, 2000-2002.