联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2020-10-16 10:54

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.


版权所有:留学生编程辅导网 2018 All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。