Project 1 Due: 25 Feb
Requirements Specification
Create the source file jdoe1p1.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
Translate the following C program in an assembly langumonths program. Make sure that
the output from both versions is identical.
#include <stdio.h>
int main( void )
{
int i;
int j;
int k;
int num1 = 40;
int num2 = 13;
int num3 = 75;
int miles;
int gallons;
int mpg;
printf( "Enter miles driven: " );
scanf( "%d", &miles );
printf( "Enter the gallons of gasoline used (integer): " );
scanf( "%d", &gallons );
mpg = miles / gallons;
printf("Your miles per gallon was %d\n \n", mpg );
i = num1 % 12;
i++;
printf( "\n i = %d\n", i );
j = num1 + 4 + num2 * i / num3 * 3;
printf( "j = %d\n\n", j );
printf( "\nStarting FOR loop:\n" );
for( k = -18; k < 35; k+= 7 )
{
printf( "k = %d\n", k + 5 );
}
return 0;
}
Program Header Comment Block
Use the following comment block at the beginning of your source code:
;; Filename: jdoe1p1.asm
;; Name: Ima Student
;; email: jdoe1@umbc.edu
;; Date: 18 Feb 2005
;; Course: CMSC313
;; Description: (Your psuedocode goes here. Must be detailed)
;; Notes: (As needed, such has how to compile)