ECE243 Practice Question Website


Main Assembly Programming Input/Output Memory Computer Architecture Advanced Topics

Assembly Programming Questions





Question 1

The following piece of assembly code is executed with the initial register and memory values shown in the table in the ‘before’ column. Fill in the memory and register values that result from this execution in the ‘after’ column. Cross any intermediate answers out that are not to be marked.

	MyVar1	equ $20000
		
		org $23000
		move.l #$20010,a7
		move.b d0, MyVar1
		pea.l $4(a3)
		rts
	
Memory Before After
PC $23000  
a7 $20004  
a3 $20014  
d0 $19283746  
     
$20000 $12345678  
$20004 $22222222  
$20008 $33333333  
$2000C $44444444  
$20010 $55555555  
$20014 $66666666  

Answer

Memory Before After
PC $23000 $20018
a7 $20004 $20010, $2000C, $20010
a3 $20014  
d0 $19283746  
     
$20000 $12345678 $46345678
$20004 $22222222  
$20008 $33333333  
$2000C $44444444  
$20010 $55555555 $20018
$20014 $66666666