Шукаєте відповіді та рішення тестів для CA & OS (Computer Architecture) - EFREI - Fall 2026? Перегляньте нашу велику колекцію перевірених відповідей для CA & OS (Computer Architecture) - EFREI - Fall 2026 в moodle.lab.ii.agh.edu.pl.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
Load and execute in step mode following program:
.textmain: div.d f1,f0,f1 halt
Analyze clock cycle diagram of execution of the program and answer the question:How many clock cycles does the execution of the instruction div.d f1,f0,f1 take ?
Load and execute in step mode following program:
.textmain: mul.d f1,f0,f1 halt
Analyze clock cycle diagram of execution of the program and answer the question:How many clock cycles does the execution of the instruction mul.d f1,f0,f1 take ?
How many clock cycles does the execution of the instruction halt take?
Load and execute in step mode following program:
.textmain: add.d f1,f0,f1 halt
Analyze clock cycle diagram of execution of the program and answer the question:How many clock cycles does the execution of the instruction add.d f1,f0,f1 take ?
How many clock cycles does the execution of the instruction nop take?
This exercise focuses on how different types of data are arranged in memory.
The x86 memory organization is called little endian. It means that the least significant byte (LSB) of a multi-byte variable will be placed at a lower memory address. For a review, a slide from the lecture:
So, let's start with some basics. Which byte sequence would you rather find in a memory dump if the machine you're working with is little-endian and the memory contains a 32-bit variable which has the value of 0x01020304 in hexadecimal?
Before you start doing this exercise, some configuration of SASM environment is required. After starting the SASM environment go to the Settings menu and find the Build tab. On that tab check if x86 is checked in Mode section and GAS is checked in Assembler section. DO NOT touch rest of the settings ! Correct settings are shown on figure below.
Please open SASM, make sure your settings are correct (x86 & GAS), copy & paste the simple program provided separately in this section (Lab 1) of the course, build it and run it. Was the program build correctly without errors?
Here's an example on how it could look like after building and running the program with the button (under Linux, so no "_" here, but you'll probably need the underscores):
This exercise focuses on how different types of data are arranged in memory.
The x86 memory organization is called little endian. It means that the least significant byte (LSB) of a multi-byte variable will be placed at a lower memory address. For a review, a slide from the lecture:
So, let's start with some basics. Which byte sequence would you rather find in a memory dump if the machine you're working with is little-endian and the memory contains a 32-bit variable which has the value of 0x01020304 in hexadecimal?
Modifiez le programme afin de définir la déclaration suivante pour la section .data :
Variables de données :.long 0xDEADCAFE
.long 1678
num_i32s :
.long -24786
La directive .long est utilisée pour déclarer une variable de type entier d'une longueur de 32 bits.
Modifiez également le programme de manière à ce qu'il se compile correctement et effectuez un vidage mémoire en mode débogage. Vous pourrez ainsi visualiser correctement le contenu de la section de données.
Comme pour l'exercice précédent, copiez-collez les fichiers de vidage mémoire et mettez en surbrillance les valeurs selon les instructions du modèle . Joignez également le fichier source .asm à titre de référence (cependant, le code source ne sera pas évalué).
Lancez maintenant le débogueur en cliquant sur le bouton « Déboguer ».
Dans le menu Débogage, veuillez vous assurer que la case Afficher les registres est cochée :
Maintenant, en utilisant l'instruction Step over, passez à l'instruction suivante, puis à l'instruction ret.
movl $variables, %eaxretVous devriez maintenant voir quelque chose de similaire à ceci :
Dans la section Registres , vous pouvez consulter le contenu des registres internes du processeur. L'instruction mise en évidence a déplacé l'adresse indiquée sous l' étiquette Variables vers le registre eax. Veuillez donc lire cette valeur en hexadécimal et l'inscrire dans la zone de réponse en utilisant le modèle fourni. Notez également cette valeur, car nous l'utiliserons ultérieurement.
Si vous utilisez Windows, ce sera probablement quelque chose comme 0x402000 , et si vous utilisez Linux, plutôt quelque chose comme 0x804c020 . Ne quittez pas encore la session de débogage ;)