Motorola M68CPU32BUG Manual do Utilizador Página 31

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 35
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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.
Vista de página 30
1 2 ... 26 27 28 29 30 31 32 33 34 35

Comentários a estes Manuais

Sem comentários