SlideServe
Menu
Préférences
© SlideServe · v2026

Chapter 8 – Machine Instructions

oneida avatar
8 diapositives · 238 Views · Sep 23, 2014

Chapter 8 – Machine Instructions. These are lecture notes to accompany the book SPARC Architecture, Assembly Language Programming, and C , by Richard P. Paul, 2 nd edition, 2000. By Michael Weeks & Abinashi Dhungel. Decoding Instructions. SPARC Instructions are 32 bits long

Chapter 8 – Machine Instructions - slide 1
01 / 8Chapter 8 – Machine Instructions
1 / 17

Télécharger la présentation

Chapter 8 – Machine Instructions
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Chapter 8 – Machine Instructions These are lecture notes to accompany the book SPARC Architecture, Assembly Language Programming, and C, by Richard P. Paul, 2nd edition, 2000. By Michael Weeks &Abinashi Dhungel Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

  2. Decoding Instructions • SPARC Instructions are 32 bits long • Bits <31:30> specify the “op” field • These first 2 bits indicate how the other bits should be handled. op 31 30 29 0 Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

  3. Decoding Instructions • Instructions are classified according to “op” op 31 30 29 0 op Instruction class 00 Branch instructions 01 Call instructions 10 Format Three instructions 11 Format Three instructions Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

  4. Format 1 Instructions • Call instruction • The displacement must be word aligned • Address is calculated by right shifting displacement 2 positions 01 30 bit displacement 31 30 29 0 Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

  5. Format 2 Instructions • branch 0 0 a cond op2 22 bit immediate 31 30 29 28 25 24 22 21 0 • sethi 0 0 rd 1 0 0 22 bit immediate 31 30 29 25 24 22 21 0 Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

  6. Branch Instructions • The branch is (or is not) taken based on the “cond” (condition) field. • op2 = 010 means integer condition code cond branch type 0000 never 0001 if equal to zero 0010 if less than or equal to zero 0011 if less than zero 0100 if less or equal, unsigned 0101 if carry set 0110 if negative 0111 if overflow is set cond branch type 1000 always 1001 if not equal to zero 1010 if greater than zero 1011 if greater than or equal to zero 1100 if greater, unsigned 1101 if carry is clear 1110 if positive 1111 if overflow is clear Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

  7. Format 3 Instructions • 2 source registers • Immediate constant op = 10 op3 Instruction000000 add000001 and000010 or000011 xor000100 sub000101 andn000110 orn000111 xnor001000 addx111100 save111101 restore111110 <unused>111111 <unused> op = 11 op3 Instruction000000 ld000001 ldub000010 lduh000011 ldd000100 st000101 stb000110 sth000111 std001000 <unused> See page 235 and 236for a complete list of the instructions Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

  8. Classwork • Decode the following commands: • 0x9de3bfa0 • 0xd007bfec • 0x92102004 • 0x90020009 • 0xd027bfec save %sp, -96, %sp ld [%fp-20], %o0 Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C