You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members




Download 18.88 Kb.
NameYou should save/rename this document using the naming convention muid muid doc using the mu ids of the team members
A typeDocumentation
manual-guide.com > manual > Documentation

DUE DATE:

FRI, OCT 24 2008 BY 5:00 PM (EST)




Computer Architecture

Exercise #13

(Friday, October 24, 2008)


You must work as a Team of 2. No more than 2 students per team.


You should save/rename this document using the naming convention MUid_MUid.doc using the MU IDs of the team members.
The objective of this exercise to get started with typing, compiling, linking, and running assembly language programs under the Linux operating system. Fill in answers to all of the questions. For almost all the questions you can simply copy-paste appropriate text from the shell window into this document. You are free to refer to Blackboard contents as well. You may discuss the questions with your neighbors or with the lab instructor. You must upload hello.s to Blackboard to earn points for this exercise.


Names of team Members:

1.




2.







  1. Follow the directions provided by your instructor (and available off Blackboard in handouts folder) to:

    1. Run the X-Server Xming from →EAS Applications → Communications → XMing → XMing

    2. Use PuTTY ( → EAS Applications → Communications → PuTTY) to log into the Linux server easlnx01.eas.muohio.edu.

    3. When you log onto the server, you will be presented with a shell ($) prompt. You need to perform various tasks by typing commands at the shell prompt and pressing the enter () key.




  1. When you log onto the Linux server, you will start off in a default directory called your home directory. You should create all your files and save your work off your home directory or sub-directories under your home directory. To figure out what your home directory is, you need to use the pwd (present working directory) command (that is, type pwd at the shell ($) prompt and press enter key) as shown below:

  • pwd 




What is your home directory:

/home/raodm

Note: The home directory will be similar to /home/raodm. The home directory changes for every user.

  1. To organize your files better, create a subdirectory in your home directory using the following (make directory) command:




  • mkdir csa278 




  1. Change your present working directory to the newly created csa278 directory using the (change directory) command:




  • cd csa278 


Double check your present working directory has changed using the pwd command.

  • pwd



  1. Now launch the text editor emacs from the command line to edit a new assembly program in a file called hello.s using the following command line:

  • emacs hello.s &


The above command should run emacs in the background (due to trailing &) and free up the shell for accepting further commands.


  1. Copy-paste the following assembly program into your emacs buffer. The assembly program prints the message “Hello World\n” on the console using a Linux system call.

.text

.global _start
_start:

mov $4, %eax /* System call to write to a file handle */

mov $1, %ebx /* File handle=1 implies standard output */

mov $msg, %ecx /* Address of message to be displayed */

mov $len, %edx /* Number of bytes to be displayed */

int $0x80 /* Call OS to display the characters. */
mov $1,%eax /* The system call for exit (sys_exit) */

mov $0,%ebx /* Exit with return code of 0 (no error) */

int $0x80
.data

/* The data to be displayed */

msg: .string "Hello World\n"

.equ len, . - msg




  1. Save your emacs buffer (to save hello.s) and run the following commands at the shell prompt to compile and link your assembly program.

  • as –-gdwarf2 hello.s –o hello.o

  • ld hello.o –o hello


You may have to fix any errors (syntax or semantic) that are reported during the assembly or linking steps and repeat the above process.



  1. Once you have successfully assembled and linked your program try running it from the shell prompt as shown below:




  • hello


You should see the message “Hello World” displayed on your console.


  1. Once you have tested your program use WinSCP2 ( → EAS Applications → Communications → WinSCP2) to copy the assembly source file hello.s from easlnx01.eas.muohio.edu to your local Windows machine. See LinuxEnvironment.pdf in the handouts folder for details on how to use WinSCP2.




  1. Use Internet Explorer to upload the file to Blackboard using the appropriate exercise link (we could have uploaded the file from Linux if Blackboard was compatible with FireFox).




    • Ensure you include both your name and your partner’s name in the submission notes

    • Don’t forget to click the Submit button. If you don’t click the Submit button, I cannot view your submissions and you will get a 0 (zero) score for this exercise.



Page of




Share in:

Related:

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconOS8cktig. Doc os/8 Combined Kit Information Guide disclaimer this...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconMaclnkum. Doc macrel/link user's Manual Order No. Aa-5664b-ta disclaimer...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconInternational Convention on the Protection of the Rights of All Migrant...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconInternational Convention on the Protection of the Rights of All Migrant...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconInternational Convention on the Protection of the Rights of All Migrant...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconCreating a data-dictionary subclass for each data file, naming the...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconCmw international Convention on the Protection of the Rights of All...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconQuizbowl team members from Case Western Reserve University and Tennessee-Chattanooga

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconReporting to the cfo operating as Head of the Comml. Department & heading a team of 45 members

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconSr doc disclaimer this document file was created by scanning the...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconTechnical Design Document Template doc

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconUser: Principal Investigators and other study team members responsible...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconCmw+ 1 Installation Cover Letter (cmw435c doc) 0 The purpose of this...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconWhen a nation is corrupt to the core, and is daily sinking lower...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconAs a minimum this document should be reviewed by the project team...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconXymtx500. doc On-line document for XyMTeX in English (C) 1993, 1996,...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members icon2015 Distech Controls, Inc. ()
Save to database” and Save to ddevice options” menu options from ec-schedule when the device is Offline. (T21854)

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconXymtx501. doc On-line document for XyMTeX in English (C) 1993, 1996,...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconOp version 99b for BibTeX 99c ] with the command "/lib/cpp -p -dunsrt...

You should save/rename this document using the naming convention muid muid doc using the mu ids of the team members iconGuidelines for the cerd-specific document to be submitted by States...




manual




When copying material provide a link © 2017
contacts
manual-guide.com
search