*----------------------------------------------------------- * Program : Simple Addition * Written by : Jacob Pettie * Description: Simple Addition using User Input *----------------------------------------------------------- ORG $1000 START: ; first instruction of program LEA BEGIN,A1 MOVE.B #13,D0 TRAP #15 LEA INPUT,A1 MOVE.B #14,D0 TRAP #15 MOVE.B #4,D0 TRAP #15 MOVE.B D1,D2 CLR.B D1 MOVE.B #14,D0 TRAP #15 MOVE.B #4,D0 TRAP #15 ADD.B D2,D1 LEA ANSWER,A1 MOVE.B #14,D0 TRAP #15 CLR.B D2 MOVE.B #20,D0 TRAP #15 MOVE.B #9,D0 TRAP #15 ; halt simulator * Variables and Strings BEGIN DC.B 'Add Two Numbers!',0 INPUT DC.B 'Input a Number: ',0 ANSWER DC.B 'The Answer is: ',0 END START ; last line of source {{http://i47.tinypic.com/vp9bmd.png}}