examples-1-3-feb-3

examples-1-3-feb-3 - routine mov r2 r0 Counter mov r0#0...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 379 Example Example #1 Consider the following example. What task does the program accomplish? The result is returned in r0 Step through the routine with the following sets of data r0=9 and r1=15 r0=1,024 and r1=1 r0=5 and r1=90 r0=1 and r1=28 What is the result when zero is passed into r0 or r1?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: routine mov r2, r0 ; Counter mov r0, #0 repeat add r2, r2, #-1 ; Decrement counter add r0, r0, r1 cmp r2, #0 bgt repeat mov pc, lr Example #2 Example #1 is augmented to handle signed numbers Example #3 Discuss how the CPSR can be used to branch to a routine to handle overflow of a signed multiplication routine....
View Full Document

This document was uploaded on 11/03/2011 for the course CSE 380 at SUNY Buffalo.

Ask a homework question - tutors are online