Advertisement
dennewbie

Esercizio Alfredo

Jan 5th, 2020
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. *Contare quanti numeri maggiori di D5 con
  2. *bit5=1 sono memorizzati nelle locazioni di
  3. *memoria da $8111 a $811A  
  4.         ORG     $8000
  5. SUBR    LEA     ARR,A0
  6.         MOVE.B  #LEN-1,D0
  7.         MOVE.B  #VAL,D5
  8.        
  9. LOOP    MOVE.B  (A0)+,D1
  10.         CMP     D5,D1
  11.         BLE     SKIP
  12.         BTST    #4,D1
  13.         BEQ     SKIP
  14.         ADD.B   #1,D2
  15. SKIP    DBRA    D0,LOOP
  16.  
  17.         MOVE.B  D2,RES
  18.         RTS
  19.        
  20. START:  MOVEM.L A0/D0-D2/D5,-(SP)
  21.         JSR     SUBR
  22.         MOVEM.L (SP)+,A0/D0-D2/D5
  23.        
  24.         SIMHALT
  25.         ORG     $8111
  26. ARR     DC.B    10,20,30,40,50,60,70,80,90
  27. LEN     EQU     9
  28. VAL     EQU     50
  29. RES     DS.B    1
  30.         END     START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement