HW2 - 0306-250 Assembly Language Programming Fall 2009...

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0306-250 Assembly Language Programming Fall 2009 Homework Two 1. Write an assembly language code fragment to implement the following conditional expression, where A and B refer to the accumulator registers A and B. if (A <= 0) A = 0 else A = A + B 2. Write an assembly language code fragment to implement the following loop expression using a conditional branch instruction, (i.e., Bcond). Use an index register to hold the address of the array element being added to the sum. A and B refer to the accumulator registers A and B, and Array is an array of byte values. A = 0 for (B = 0; B < 100; B++) A = A + Array[B] 3. Write an assembly language code fragment which implements the following loop expression using a decrement and branch instruction, (i.e., DBcond). Use an index register to hold the address of the array element being added to the sum. A and B refer to the accumulator registers A and B, and Array is an array of byte values. A = 0 for (B = 0; B < 100; B++) A = A + Array[B] Page 1 of 1 ...
View Full Document

Ask a homework question - tutors are online