In other words: you're sticking by the mailbox?

This commit is contained in:
2015-06-09 15:36:34 +02:00
parent 58cf428549
commit 00533fcde1

View File

@@ -4,29 +4,29 @@
* Date : 2015-06-09 * Date : 2015-06-09
* Description: RTFT * Description: RTFT
*----------------------------------------------------------- *-----------------------------------------------------------
ORG $3000 ORG $3000
* Put program code here * Put program code here
FACTORIZATION: FACTORIZATION:
move.l #2, D2 move.l #2, D2
FACTORIZATION_LOOP: FACTORIZATION_LOOP:
move.l D0, D3 move.l D0, D3
divu D2, D0 divu D2, D0
swap D0 swap D0
cmp.w #0, D0 cmp.w #0, D0
beq FACTOR_FOUND beq FACTOR_FOUND
add.w #1, D2 add.w #1, D2
move.l D3, D0 move.l D3, D0
bra FACTORIZATION_LOOP bra FACTORIZATION_LOOP
FACTOR_FOUND: FACTOR_FOUND:
swap D0 swap D0
move.w D2, (A1)+ move.w D2, (A1)+
cmp.w #1, D0 cmp.w #1, D0
bgt FACTORIZATION_LOOP bgt FACTORIZATION_LOOP
rts rts