68000 - Add two numbers

Thread Starter

hurry-o

Joined Nov 22, 2008
2
hello everyone i've got doubts if my program is correct(my micro is 68000).I want to make a program which adds 2 numbers NUM1=$82 saved in $400400, NUM2=$F1 saved in $400401 and save the sum in $400402.Check my code::

ORG $400400
NUM1 DC.B $80
NUM2 DC.B $F1
SUM DS.B 1
ORG $400410
ADNUMS MOVE.B NUM1,D0
ADD.B NUM2,D0
MOVE.B D0,SUM
END $400410
 

Mark44

Joined Nov 26, 2007
626
hello everyone i've got doubts if my program is correct(my micro is 68000).I want to make a program which adds 2 numbers NUM1=$82 saved in $400400, NUM2=$F1 saved in $400401 and save the sum in $400402.Check my code::
Rich (BB code):
             ORG $400400
NUM1     DC.B $80
NUM2     DC.B $F1
SUM       DS.B 1
            ORG $400410
ADNUMS MOVE.B NUM1,D0
             ADD.B NUM2,D0
            MOVE.B D0,SUM
             END $400410
I added code tags. Your code looks like it would work. Have you tried it out? There are several emulators out there that you can run M68000 code on an x86 computer.
 

Dave

Joined Nov 17, 2003
6,960
Since the other thread has been locked, I have moved these posts to a new thread of their own.

Dave
 
Top