programing assignment PA0

SPARC Architecture, Assembly Language Programming, and C (2nd Edition)

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
http://ieng9.ucsd.edu/~cs30x/pa0.html Programming Assignment Zero: PA0 Due Wednesday night, January 16 @ 11:59pm ) The purpose of this assignment is to introduce you to SPARC assembly language instructions and the sytnax used in assembly files, to help you use make and a Makefile to compile your C and assembly language source files, to introduce you to the GNU debugger gdb , lint (static C source code checker), and the turnin facility to turn in your programs. This assignment is not worth very much of your grade so make all the mistakes now :-). The C and assembly language source files and a Makefile will be provided. Please DO NOT CHANGE the Makefile rules unless instructed to do so. Procedure : 1. Log in using your class account and make a directory called pa0 . (Do the following at the prompt) 2. Type mkdir pa0 <press enter> 3. Type ls <press enter> to list out the files and directories in the current working directory. Here is the actual output : ieng9.ucsd.edu% mkdir pa0 ieng9.ucsd.edu% ls pa0 ieng9.ucsd.edu% At this point, you are encouraged to check out the Subversion Notes page to set up a Subversion repository for pa0 or CVS Notes page to set up a CVS repository and module for pa0. 4. cd to directory pa0 ( cd pa0 ). 5. Type the C and assembly source files provided in class into the files pa0.h , main.c , printHello. s , printBirthDateInfo.c , and sum3.s , respectively. You can use your favorite editor (vi/vim, emacs, pico, etc. -- we highly discourage using TextEditor) to type the files and save them in the pa0 directory. Use your real cs30x login, name, etc. in place of the dummy student info. 6. There is a Makefile template for PA0 in the public directory (~/. ./public). Copy the PA0 Makefile into your pa0 directory. To accomplish this do the following at the command prompt, pressing Enter after each line. : ieng9.ucsd.edu% cd ~/pa0 (Just to make sure you are in the pa0 directory.) ieng9.ucsd.edu% cp ~/. ./public/Makefile-PA0 Makefile (Note you are naming the copy in your pa0 directory Makefile without the -PA0 suffix.) ieng9.ucsd.edu% 6. Now you have the source files (which you created) and the Makefile in your pa0 directory. You need to run " make " to compile these files. Simply type make at the prompt. This will create the executable necessary to run the program -- by default, the target executable will be named a.out . Make will abort if any warnings are found by lint or if any errors are found in the program code by the compiler, assembler, or linker. 7. After compiling using make just type a.out at the prompt to execute your code. You should see http://ieng9.ucsd.edu/~cs30x/pa0.html (1 of 6) [2/8/2008 12:34:24 PM]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
http://ieng9.ucsd.edu/~cs30x/pa0.html Hello, my name is: Joe Jane Student My birth date is: December 17, 1978 The sum of 1, 2, and 3 = 6 printed out on your screen ( it should have your own personal info ). 8. Once you have checked, compiled, executed your code, and finished your README file (see below),
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

programing assignment PA0 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online