ECE243 Practice Question Website


Main Assembly Programming Input/Output Memory Computer Architecture Advanced Topics

Assembly Programming Questions





Question 28

	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
	
How many memory cycles are needed for execution of the program?

Answer

54 or 53 if you used absolute short addressing for RESULT