Project 2 Due: 7 April
This project will count as two projects and will be worth 200 points.
Requirements Specification
Create the source file jdoe1p2.asm, assembly it, link it, and run it.
When it runs correctly, submit using Blackboard.
(Remember that the jdoe1 is suppose to be your id that you use to log onto
the GL computers, so that there is a unique file! Do not use jdoe1 unless that
is in YOUR ID!!)
Specifications
For this project, you can not use C library calls. You must use only system calls for all I/O. You will have
to write your own code to get the length of a string. (Just count the number of characters until you find
the null byte.) To do the required output, you must convert the number into the appropriate string first.
When you execute the command line, it will be in the form:
jdoe1p2 123d 0F2Bh 11101010b
Output will be in the form of:
pgmname
dec hex bin
Sample:
jdoe1p2 127d 0FFh 00011000b
127 7F 01111111
255 FF 11111111
24 18 00011000
All numeric columns must be right justified.
There are to be three arguments, one will a decimal number and ends with a 'd'. One will be a hexadecimal number,
end with a 'h', and the characters 'A' - 'F' will be upper case. One will be a binary number and end with a 'b'.
The arguments can be in any order, so you must determine the numeric base and convert it appropriately.
Additional Requirements
- All values are unsigned.
- Input values will fit into a 32-bit register.
- Input will only have lower-case 'b', 'd', 'h', for base indicators.
- Hexadecimal letters will be upper case.
- Hexadecimal inputs will start with a digit.
- Violations of the assumptions will cause the program to report an error and then terminate.
- Program must include at least one sub-program, more are recommended.
- Link the program with ld, instead of gcc. Use "_start:" instead of "main:"
Getting Command Line Arguments
Check out the tutorial for NASM that shows how
to get the command line arguments. Remember that what is on the stack is the pointers, not the actual values.
The arguments are strings and must be converted to a number before you can use it.
Program Header Comment Block
Use the following comment block at the beginning of your source code:
;; Filename: jdoe1p2.asm
;; Name: Ima Student
;; email: jdoe1@umbc.edu
;; Date: 28 Mar 2006
;; Course: CMSC313
;; Description: (Your psuedocode goes here. Must be detailed)
;; Notes: (As needed, such has how to compile)
©2006, Gary L. Burt