Prof. Tak Auyeung
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.
New rules, read this! As of 2003.09.22, I no longer deduct points for wrong answers. Each correct answer is worth one point, each wrong answer is worth zero point, and each unanswered question is also worth zero point. This means you should guess and leave no question unanswered.
As a result, I also need to adjust the letter grade assignment break points. For your individual examinuation, ``A'' means at least 94%, ``B'' means at least 74%, ``C'' means at least 54%, ``D'' means at least 34% and ``F'' means below 34%. The break points for the final grade are now 26.83%, 48.5%, 70.17% and 91.83% as minimums for ``D'', ``C'', ``B'' and ``A'', respectively.
Please note that this change does not affect your letter grade at all, it is just a number game to make some people feel better about guessing.
Make sure you write down you name on the upper right corner first, otherwise I cannot give points to anonymous students!
The baseline is XX, there are YY questions.
add r0,r1
r0=0x20, r1=0x30
r0=0x40, r1=0x30
r0=0x20, r1=0xf0
r0=0xa0, r1=0x30
r0=0xe0, r1=0x30
L0:
cp a,b
brcc L1
cpi b,50
brcc L2
L1:
dec b
inc a
rjmp L0
L2:
L0:
cp a,b
brcs L1
cpi b,50
breq L2
brcs L2
L1:
dec b
inc a
rjmp L0
L2:
L0:
cp a,b
brcs L1
cpi b,50
brcc L2
L1:
dec b
inc a
rjmp L0
L2:
L0:
cp a,b
brcs L1
cpi b,50
breq L2
brcs L2
L1:
dec b
inc a
rjmp L0
L2:
L0:
cp a,b
brcc L1
cpi b,50
brne L1
brcc L2
L1:
dec b
inc a
rjmp L0
L2:
; ... code to set up the stack pointer
sub r0,r0
rcall sub1
rcall sub2
eop: nop
sub1:
rcall sub2
rcall sub2
ret
sub2:
inc r0
ret
lds r16,1
ldi r16,1
sts 16,r1
sts 1,r16
mov r1,r16
ldi r1,16
add r0,r1
brmi invalid_result ; N = 1
brcs invalid_result ; C = 1
brlt invalid_result ; V = 1
breq invalid_result ; Z = 1
brne invalid_result ; Z = 0
ldi r16,5
L0:
L1: sbic PINA,2
rjmp L1
L2: sbis PINA,2
rjmp L2
dec r16
brne L0
nop
L1: cp V1, V2
breq L2
inc V1
dec V2
rjmp L1
L2: nop
ldi r26,low(L1)
ldi r27,high(L1)
ld r16,X
subi r16,6