TABLE


;Understanding Assembler, by Henrik Stolpe
;adds contents in sourcetabs and write it to desttab

s:
moveq	#0,d0			;clear d0
moveq	#0,d1			;clear d1
lea	sourcetab,a0		`
lea	sourcetab2,a1
lea	disttab,a2
moveq	#5,d0

loop:
add	(a0),d1
add	(a1),d1
move	d1,(a2)
add	#1,a0
add	#1,a2
cmp	#5,d0
bne	loop
move	8(a0),d3		;get last entry in desttab
rts

sourcetab:
dc.w	1
dc.w	2
dc.w	3
dc.w	4
dc.w	5

sourcetab2:
dc.w	5
dc.w	4
dc.w	3
dc.w	2
dc.w	1	

disttab:
blk.w	5