Motorola M68CPU32BUG Manuel d'utilisateur Page 32

  • 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 31
APPENDIX 7
A MC68000 assembly language program listing containing assmebler directives to define
memory constants, a subroutine definition, and a main program which calls the subrou-
tine.
* Program 1 - Adds two numbers using a subroutine
* makes use of parameter passing using CPU registers
* T. Obuchowicz
* August 29, 2010
* define a subroutine which adds two numbers
* the addend and augend are expected to be in registers D0 and D1
* the sum is returned via register D1
00003000 ORG $3000
00003000 d240 MYSUB ADD D0,D1
00003002 4e75 RTS
* define some memory locations which hold the
* numbers to be added and place to store the
* sum
00004000 ORG $4000
00004000 0001 MICK DC.W 1
00004002 0002 KEITH DC.W 2
00004004 0000 RON DC.W ?
* The main program
00005000 ORG $5000
00005000 3038 4000 MOVE MICK,D0
00005004 3238 4002 MOVE KEITH,D1
Vue de la page 31
1 2 ... 27 28 29 30 31 32 33 34 35

Commentaires sur ces manuels

Pas de commentaire