ECE243 Practice Question Website


Main Assembly Programming Input/Output Memory Computer Architecture Advanced Topics

Assembly Programming Questions





Question 27

	COUNT 	equ 	10
	TUTOR 	equ 	228
	PROGRAM	equ 	$1000
		org 	PROGRAM
		move.w 	#0,d0		;Point A
		move.w 	#COUNT,d1
	LOOP 	subq 	#1,d1
		addq 	#1,d0
		tst 	d1
		bne 	LOOP
		move.w 	d0,RESULT
		move.w 	#TUTOR,d7
		trap 	#15
	RESULT 	ds.w 	1
		end
	
What is the signed displacement (or offset) to the destination in the “bne LOOP” instruction? (express this as a decimal number)

Answer

-8