User Tools

Site Tools


user:jpettie:portfolio:hpcproject68kassembly

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
user:jpettie:portfolio:hpcproject68kassembly [2012/12/14 23:35] jpettieuser:jpettie:portfolio:hpcproject68kassembly [2012/12/14 23:36] (current) jpettie
Line 1: Line 1:
 +<code>
 +*-----------------------------------------------------------
 +* 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
 +</code>
 +
 +{{http://i47.tinypic.com/vp9bmd.png}}