Motorola M68CPU32BUG Manuel d'utilisateur Page 31

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 35
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 30
APPENDIX 6
A sample MC68000 assembly language program.
* Program 1 - Find the maximum value of an array of number
* T. Obuchowicz
* October 29, 2008
ORG $3000
RSLT DS.B 1 * reserve 1 byte of storage to hold the result
ARRAY DC.B 2,5,1,4,3 * declare byte sized constants
ORG $5000
CLR.L D0
CLR.L D1
MOVE.L #4,D0 * setup D0 as a counter
MOVEA.L #ARRAY,A0
MOVE.B (A0),D1 * get first element of array
LOOP CMP.B (A0)+,D1
BGT BIGGER
MOVE.B -1(A0),D1
BIGGER DBRA D0,LOOP
MOVE.B D1,RSLT
END
NOTE: If you intend the run the program using the GO command, add the two lines
TRAP #15
DC.W $63
as the last two instructions before the END assembler directive.
Vue de la page 30
1 2 ... 26 27 28 29 30 31 32 33 34 35

Commentaires sur ces manuels

Pas de commentaire