‹ back to Computer Architecture

NotesComputer Architecture · 14 November 2015

Assembly Excercise

1…a program to add three numbers using memory variables

2….Write a program to add three numbers accessed using a single label.

3…..Write a program to add three numbers directly in memory.

4 Adding three number using indirect addressing and place the result at memory location.

5…Write a program to calculate the square of 20 by using a loop that adds 20 to the accumulator

20 times and store the result in memory.

6……write a program that load eax with variable which content are placed in memory and show the NEG instruction effect

on overflow flag when the content of variable are signed number.

7…Suppose the CMP instruction compares the integers 7FFFh and 8000h. Show how the JB

and JL instructions would generate different results if used after comparing these values.

8….Will the following code jump to the label named Target?

mov ax,-30

cmp ax,-50

jg Target

9…Suppose the CMP instruction compares the integers 7FFFh and 8000h. Show how the JB

and JL instructions would generate different results if used after comparing these values.

10…Write instructions that jump to label L2 when the signed integer in AX is greater than the

integer in CX…

11….Write a program that will take jump to the lable target testing the zero flag.show which jump will perform when

zero flag is set and not set.

First published on fatsup.wordpress.com ↗