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.
NOTE: This demonstration uses the 2's complement representation for numeric constants.
- Since each instruction occupies 16 bits (2 bytes) then the addresses of the generated instructions increment by 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.
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.
- The "labels"
that precede the instructions. These are identifiers that the assembler can
use to link names in operand fields to memory locations.
CS1104 Main Page
Last Updated 2002/03/20
©J.A.N. Lee, 2000-2002.