CISC-221语言讲解、辅导C/C++程序、讲解Programs编程

- 首页 >> Matlab编程
CISC-221 Computer Architecture
Machine Representation of Programs
Assignment 5: Bracketing Assembly Code

Instructor: Dave Dove ( dove@cs.queensu.ca ).

1 Introduction

Analyzing assembly code is a very useful skill if you can step back and group clusters of instructions into blocks that can then be interpreted as performing some action at a higher level of abstraction, such as performing a transformation on a memory variable, or altering the control flow of a program such as conditionally performing some action, or calling a function. In this assignment, you are given both the high level program (in C) and the resulting compilation to assembly language. The objective is to define blocks of assembly language code and relate them to specific statements in the C code.

2 Logistics

You must do this assignment individually and submit your solution to the associated drop-box in OnQ under your own name, before the scheduled due date and time.

Before the due date and time, submit a commented pdf file to the Assignment 5 Submission item on the course web site.

3 Instructions

This is the only file you need for this assignment. Add your comments to the assembly code below.
For each statement of the C program, define the corresponding block of code in the assembly language translation by adding an opening bracket comment @( at the start of the block of instructions, the C statement, and a closing bracket at the end of the block of instructions @). For an example of the format of the required block level comments, see the file: Assembly Language Code Commenting Format file in the Extras folder. The only comments that you are to add, are the C code statements. For complex C statements, such as a for loop, break up your comments into the individual components of the statement. I have done this for you as an example in the code below – see the for loop in the main function. There is no need to comment global variable declarations.

4 Helpful Details
There is nothing in this assignment that isn't done in the HLL Translations - C to ARM item found in the Extras folder.
You may place the C code either after the opening bracket of the comment block, or before the closing bracket of the comment block.

站长地图