C85Quiz2Prob-29FSol - CSC C85 2008F Problems for Quiz2 Nov....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC C85 2008F Problems for Quiz2 Nov. 26 in LECTURE. Chap. 8 8.4, 8.9, 8.10 Chap. 10 10.2, 10.3, 10.4, 10.9 8.4 .text .global _start _start: LDR r2,= Values LDR r4, [r2] @load 1 st value for comparison MOV r0, #50 Loop: LDR r3, [r2] CMP r3, r4 @ current > previous max ? MOVGT r4, r3 @ if so, new max SUBS r0, r0, #1 @ decrement counter, set flags ADD r2, r2, #4 @ increment pointer BNE Loop LDR r2,= Max STR r4, [r2] Done: B Done .data .align Values: .word 1, 2, 4, 5, 6, 7, -8, 11, 23, 100 .word 4, 5, 6, 2, 3, 4, 5, 13, 45, 200 .word 5, -4, 888, 2, 1, 2, 7, 88, 45, 444 .word 3, 4, -5, 1, 0, 2, 0, 23, -23, 111 .word 3, 4, 5, 6, 7, -8, 9, 33, 22, 666 Max: .skip 4 .end 8.9. Translate the following conditions into a single ARM instruction: a. Add registers r3 and r6 only if N is clear. Store the result in register r7. ADDPL r7, r3, r6 b. Multiply registers r7 and r12, putting the results in register r3 only if C is set and Z is clear. MULHI r3, r7, r12
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/20/2010 for the course CSC CSCC85 taught by Professor Lorincz during the Spring '10 term at University of Toronto- Toronto.

Page1 / 3

C85Quiz2Prob-29FSol - CSC C85 2008F Problems for Quiz2 Nov....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online