CS320 Lab Exercises

Name ________________________

DO NOT USE ANY MACRO INSTRUCTIONS FOR YOUR CODING SOLUTIONS

1) It is possible to set both the CF and OF at the same time? Give an example of assembly language code that will do so and show using debug that this is the case.

2) Write an assembly language program that allows the user the ability to enter a 32-bit unsigned integer value. Print only the last digit of the number. For example, if the number 123 is entered, the number 3 is output.

3) Fill in the blanks in the machine language code below. Check your results using debug. There are no labels using debug but an examination of some sample debug code will show you how to jump to a location.

		01ff: 0123  90		top:		nop
		01ff: 0124  41				inc cx
		01ff: 0125  03 d1			add dx,cx
		01ff: 0127  83 fa 14			cmp dx,20
		01ff: 012a  74 __  			je out1
		01ff: 012c  41				inc cx
		01ff: 012d  48				dec ax
		01ff: 012e  75 __  			jne top
		01ff: 0130  90		out1:	     nop
Assuming Real Mode, show how the IP would be updated if jne top was taken.

What is the actual physical address associated with the first byte of the cmp ax,0 instruction?