CS301
– Fall 2003
Prof.
Hartman
Homework
#8
Due
Wednesday, November 26th by 4:45
pm
- Assemble (ie, encode) the following
short (and non-sensical) routine by hand. You may check your work with the
assembler (well, #6 may be tricky), but I expect to see annotated bits in
the ModR/M byte if it is needed. (That is, explain in a couple of words
why the first two bits are 11, for example). You will probably want to use
the handout Encoding instructions
from class, along with the NASM documentation.
- pusha
- add edx, ebx
- mov dword [0DEADBEEFh], 12
- fmul st3
- rcr dl,cl
- sar dword [ebx + eax],2
- leave
- ret
- Test the following code on as many
architectures as you have access to, and report the average number of
clock cycles taken: loops.c timing.asm