Skip to content

Instantly share code, notes, and snippets.

@jaheba
Created January 24, 2012 13:52
Show Gist options
  • Select an option

  • Save jaheba/1670268 to your computer and use it in GitHub Desktop.

Select an option

Save jaheba/1670268 to your computer and use it in GitHub Desktop.
*-----------------------------------------------------------
* Program :
* Written by :
* Date :
* Description:
*-----------------------------------------------------------
START ORG $1000
LEDADR EQU $E00010
MOVE.B #9, D1
MOVE.B #3, D2
JSR MUL
MUL CLR D0 *Initialisiere Summenspeicher
LOOP MOVE.B #1, D5
AND D2, D5 *Lege Bitmaske über Faktor2
BEQ SHIFT
ADD D1, D0
SHIFT LSL #1, D1
LSR #1, D2
BNE LOOP *testen auf zero flag (z=0: d2 ist >0; zur loop springen)
RTS
END START
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment