UMBC CMSC 313, Computer Organization & Assembly Language, Fall 2003

Project 1: Change in Character

Also available in PDF.


Tue 09/16/03Section 0101 (Chang) & Section 0301 (Macneil)
Wed 09/17/03Section 0201 (Patel & Bourner)


This project is a finger-warming exercise to make sure that everyone can compile an assembly language program, run it through the debugger and submit the requisite files using the systems in place for the programming projects.


For this project, you must do the following:
  1. Write an assembly language program that prompts the user for an input string and a replacement character. The program then replaces all occurrences of the digits 0-9 with the replacement character. A sample run of the program should look like:
    Input String: Today's date is August 23, 2003.
    Replacement character: X
    Output: Today's date is August XX, XXXX.
    If the user enters several characters instead of a single replacement character, you can ignore the extra ones and just use the first character entered as the replacement. A good starting point for your project is the program toupper.asm (shown in class) which converts lower case characters in the user's input string to upper case. The source code is available on the GL file system at: /afs/
  2. Using the UNIX script command, record some sample runs of your program and a debugging session using gdb. In this session, you should fully exercise the debugger. You must set several breakpoints, single step through some instructions, use the automatic display function and examine the contents of memory before and after processing. The script command is initiated by typing script at the UNIX prompt. This puts you in a new UNIX shell which records every character typed or printed to the screen. You exit from this shell by typing exit at the UNIX prompt. A file named typescriptis placed in the current directory. You must exit from the scriptcommand before submitting your project. Also, remember not to record yourself editing your programs --- this makes the typescript file very large.

Turning in your program

Use the UNIX submit command on the GL system to turn in your project. You should submit two files: 1) the modified assembly language program and 2) the typescript file of your debugging session. The class name for submit is cs313_0101, cs313_0102 or cs313_0103 for respectively sections 0101 (Chang), 0201 (Patel & Bourner) or 0301 (Macneil). The name of the assignment name is proj1. The UNIX command to do this should look something like:

submit cs313_0101 proj1 change.asm typescript


Additional help on running NASM, gdb and making system calls in Linux are available on the assembly language programming web page for this course.

Recall that the project policy states that programming assignments must be the result of individual effort. You are not allowed to work together. Also, your projects will be graded on five criteria: correctness, design, style, documentation and efficiency. So, it is not sufficient to turn in programs that assemble and run. Assembly language programming can be a messy affair --- neatness counts.

Last Modified: 25 Sep 2003 22:21:52 EDT by Richard Chang
to Fall 2003 CMSC 313 Section Homepage