You, as an individual, are expected to do your own work. This means you cannot seek, receive or otherwise acquire any assistance except clarifications from the professor during an examination. Any communication involving the contents of the subject matter or the examination is considered cheating. Do not initiate or accept such communication, or the result of your examination is automatically voided.
Each correct answer is worth one point, each wrong answer is worth -0.25 point, and each unanswered question is worth zero point.
Make sure you write down you name on the upper right corner first, otherwise I cannot give points to anonymous students!
movl %eax, (%edx)
movl %eax, 123
movl $123, -3(%edx)
movl $123, %ebx
jmp label1
L1 if and only if the value of register eax is greater
than the value of register ebx? Assume both registers should
be interpreted as unsigned values.
ja?
C
Z
C and Z
O, S and Z
O and S
movb $0x7f, %al cmpb $0x7e, %al
S
C
Z
O
S, C, Z or O flags is set
eax at label test?
.data someData: .long 0x11223344 someOtherData: .long 0xaabbccdd .text .global _start _start: movl someData,%eax movw someOtherData,%ax test: nop # the rest of the program is not important
0x3344
0xccdd
0x1122ccdd
0xaabb3344
0xccdd1122
movl %eax, (%ebx, %edx, 1)
%eax
%ebx
%ebx and edx
eax, ebx and edx
Z flag is set?
C
S
O
C and S
C and O
L1: addl $1,%eax jnz L1
eax
before the loop
eax was odd before the loop
eax was even before the loop
eax at label test?
.data someData: .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 someDataEnd: .text .global _start _start: movl $someData, %eax movl $0, %ebx L1: cmpl $someDataEnd, %eax jnc test addb (%eax), %bl addl $1,%eax jmp L1 test: # some more code to follow
someDataEnd
0x06
someData