Upload
zhang-shiun
View
217
Download
0
Embed Size (px)
DESCRIPTION
Tutorial of microprocessor
Citation preview
1-Design a 68000 assembly program at address $1000 to move a block of 16 bit data of length 100 from the source block starting at location $2000 to destination block starting at location $3000 from LOW to HIGH address. AnswerORG$1000;start address
START
MOVEA.L#$2000,A0;load A0 with $2000
MOVEA.L#$3000,A1;load A1 with $3000
MOVE.W#100,D0;
LOOPMOVE.W(A0)+,(A1)+;move source data to destination
SUBI.W#1,D0;move 1 time
CMPI.W#100,D0;check until move 100 times
BNELOOP;
FINISHENDSTART;
2- Design a 68000 assembly program at address $1000 to decrease 100 to 0 in step of 2 starting from HIGH to LOW address starting at location $3000.AnswerORG$1000;start address
MOVEA.L#$3000,A0;load A0 with $3000
MOVE.B#100,D0;load 100 into D0
LOOPMOVE.BD0,-(A0);move data D0 into A0
SUBI.B#2,D0;Decrease D0 in step of 2
CMPI.B#0,D0;check if 0
BNELOOP;branch if not equal 0
ENDJMPEND;end
3-Design a 68000 assembly program at address $1000 to clear register D0 100 times to obtain zero byte (D0=$00000000) starting from LOW to HIGH address starting at location $3000. Assume the initial value of D0=$00640000. AnswerORG$1000;start address
MOVEA.L#$3000,A0;load A0 with $3000
MOVE.L#$00640000,D0;
SWAPD0;D0 become $00000064 or in decimal is 100
LOOPMOVE.BD0,(A0)+;move data D0 into A0
SUBI.B#$1,D0;clear D0 1 time
CMPI.B#100,D0;check D0 until 100 times
BNELOOP;branch if not equal
ENDJMPEND