CS 210 PROJECT #1 Due: Noon Friday 02/23/07 This project introduces students to the design of a system program, written in Linux assembly language, that can display some information on the terminal screen in a prescribed format. PROBLEM STATEMENT Write an assembly language program (named 'today.s') that will show today's date in the 'dd mmm yyyy' format (i.e., day, month, year), where 'dd' is a two-digit number, 'mmm' is a three-letter abbreviation for the current month, and 'yyyy' is a four-digit number for the current year: HERE IS A SAMPLE TERMINAL-SESSION: $ ./today 12 FEB 2007 $ (It is a requirement of this assignment that your 'today.s' source-file should include all of your program-code; in other words, you should not 'link' your program to any external modules or any standard libraries.) BACKGROUND The Linux operating system provides a system-call named 'sys_time' that can be used by an application program to find out the exact number of seconds that have elapsed since midnight on January 1, 1970. So you could get the number of days that have passed since 1970 if you divided by the number of seconds in each day (i.e., by 60*60*24). Some further arithmetic operations, based on your knowledge of the calendar, provide your program with the current year, month, and day-of-the-month. (Look in a header-file named "/usr/src/linux/include/asm/unistd.h" to get the system-call ID-number for the 'sys_time' system-call; look at the 'man' page for the 'time()' library-function to discover what parameters this function expects and what value it will return.) WHAT TO SUBMIT Your project-submission has two required parts: (1) a printout of your source-file (i.e., 'today.s'); (2) electronic copies of all your program-files; Use the 'ljpages' utility-program (under 'System Software' on our cs210 website) to produce your printout on a laserprinter in our classroom or in one of the Harney Fifth-Floor CS Labs -- Be sure your printout shows YOUR NAME as the project's programmer -- and turn in your 'printout' to the instructor's mailbox (Mathematics Office: Harney-222). Submit your program files (i.e., 'today.s', 'today.o', and 'today') by copying them into your '/submit' directory, where your instructor can them for doing testing and grading: $ cp today* /home/submit/cs210//. ________________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2007