SlideServe
Menu
Préférences
© SlideServe · v2026

CSCI 2510 Tutorial 1 Basic Assembly and Data Representation

aquila avatar
12 diapositives · 379 Views · Aug 13, 2014

CSCI 2510 Tutorial 1 Basic Assembly and Data Representation. ZONG Wen Department of Computer Science and Engineering The Chinese University of Hong Kong wzong@cse.cuhk.edu.hk. Main topic:. 1. Write an assembly program with given instruction 2. Two’s complement operation

CSCI 2510 Tutorial 1 Basic Assembly and Data Representation - slide 1
01 / 12CSCI 2510 Tutorial 1 Basic Assembly and Data Representation
1 / 17

Télécharger la présentation

CSCI 2510 Tutorial 1 Basic Assembly and Data Representation
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. CSCI 2510 Tutorial 1Basic Assembly and Data Representation ZONG Wen Department of Computer Science and Engineering The Chinese University of Hong Kongwzong@cse.cuhk.edu.hk

  2. Main topic: 1. Write an assembly program with given instruction 2. Two’s complement operation 3. Ordering of bytes in data

  3. Write a machine program with given instruction Basic component of a computer

  4. Write a machine program with given instruction There are only 6 machine instructions on a single-accumulator processor, namely: Load [Memory] {to ACC} e.g. Load [2872] Store [Memory] {from ACC} e.g. Store [1536] Add Constant {to ACC} e.g. Add -95 Add [Memory] {to ACC} e.g. Add [2132] Multiply Constant {to ACC} e.g. Multiply 23 Multiply [Memory] {to ACC} e.g. Multiply [298]

  5. Write a machine program with given instruction Variable x and y are stored in address 1000 and 1004, try to implement x2 + y2, store the result in 1008. Load [1000]; load data to register Multiply [1000]; perform memory + register operation Store [1008]; store temporary result to memory Load[1004]; Multiply[1004]; Add[1008]; Store[1008]; store result

  6. Operation on two’s complement Example: (–6) + 8 * 3 – 1 Step 1  11111010 + (00001000 * 00000011) – 00000001 Step 2  (11111010 + 00011000) – 00000001 Step 3  00010010 – 00000001 Step 4  00010001 Step 5  17 (decimal answer without overflow)

  7. Operation on two’s complement Example: (–6) + 8 * 3 – 1 Step 1  11111010 + (00001000 * 00000011) – 00000001 Step 2  (11111010 + 00011000) – 00000001 Step 3  00010010 – 00000001 Step 4  00010001 Step 5  17 (decimal answer without overflow)

  8. Big endian and little endian In big endian, you store the most significant byte in the smallest address In little endian, you store the least significant byte in the smallest address

  9. Big endian and little endian For a data of 4 bytes: 90AB12CD Big endian:

  10. Big endian and little endian For a data of 4 bytes: 90AB12CD Little endian:

  11. Float point representation

  12. Q&A