Assembly Language Programming - Exam #1
Write all answers on the answer sheets provided. You may refer to the ASCII
chart included with the exam sheet and to the list of commands given in class.
- (2 pts each) Briefly define each of the following terms:
- program counter
- (4 pts) List the steps of the fetch-execute cycle.
- (4 pts) Name two reasons why a person might want to learn assembly
- (3 pts each) Show how each of the values below would be represented
in the computer. Write your answers in binary.
- the character `<'
- the 8-bit integer 77
- the 8-bit integer -20
- the single-precision float 30.375
- (3 pts each) Interpret each of the hexadecimal values below
- as a character
- as a 16-bit signed integer
- (3 pts each) Give the 64-, 32-,16-, and 8-bit names of each of the
- (16 pts) Suppose the following
declarations are placed in memory at the
address . Show the address and contents of each byte
generated by the following declarations. Write all answers
a: db 2
b: db -1
c: db "Fun",0xA,0
d: dd 30.375 ; Hint see problem above ...
e: db 80,0x4F
f: dd 0x524557
- (4 pts) Given the memory configuration of problem 7,
what would the following move command accomplish? (Be specific about
exactly what and how much gets moved where).
- (6 pts) Suppose that labels a, b, and c mark locations
in memory where 32-bit signed integers are stored. Write the x86 assembly
language commands that will perform the following actions:
if (a < b && a < c)
- (10 pts) The skeleton program below provides the IO macros and gives
structure for an assembly language program.
Show what declarations and assembly language statements you would add to
this skeleton program to use a loop to produce a list of all powers of
. The output should display followed by
a space followed by followed by a newline character for each of the
31 displayed values.
- (4 pts) What commands would you type to compile, link, and run the
modified program you created in problem 10?