Create a simple M68K program called ADDER Your program shoul
Create a simple M68K program called ADDER. Your program should add together the numbers: 6, 4, 12, 16, 17, and 50. The program should leave the answer in register DO when it terminates.
Solution
Program :
ORG $2000 It indicates location of the program that is 2000
MOVE.B Num1,D0 This instruction used to get first number
ADD.B Num2,D0 This instruction used to Add in second number
ADD.B Num3,D0 This instruction used to Add in second number
ADD.B Num4,D0 This instruction used to Add in second number
ADD.B Num5,D0 This instruction used to Add in second number
ADD.B Num6,D0 This instruction used to Add in second number
STOP #$2700 It used to tell stop execution
ORG $2000 It indicates location of the program that is 2000
Num1 DC.B 6 Assign 6
Num2 DC.B 4 Assign 4
Num3 DC.B 12 Assign 12
Num4 DC.B 16 Assign 16
Num5 DC.B 17 Assign 17
Num6 DC.B 50 Assign 50
END $2000 End of the program
