Motorola M68CPU32BUG Manuale Utente Pagina 31

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 35
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 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.
Vedere la pagina 30
1 2 ... 26 27 28 29 30 31 32 33 34 35

Commenti su questo manuale

Nessun commento