68000 - Add two numbers

Discussion in 'Programmer's Corner' started by hurry-o, Nov 22, 2008.

  1. hurry-o

    Thread Starter New Member

    Nov 22, 2008
    2
    0
    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
     
  2. Mark44

    Well-Known Member

    Nov 26, 2007
    626
    1
    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.
     
  3. Dave

    Retired Moderator

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

    Dave
     
Loading...