assign4.c - /* * *Name: Arria P. Owlia *EID: apo223...

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

View Full Document Right Arrow Icon
Page 1 /****************************************************************************** *Name:Arria P. Owlia *EID:apo223 *Section #:15735 *Assignment#:4 *Purpose:To become familiar with IO streams and strings with the DecMack *******************************************************************************/ #include <stdio.h> #define EXIT_FAILURE 1 #define input_file "interpreter.txt" clearAll(int RAM[1000], int REG[10])/*Clears all values in RAM and Registers*/ { int Count = 0 for (Count = 0 REG[Count] = 0 for (Count = 0 RAM[Count] = 0 } int main(void) { int REG[10] = {0}, output[1000][11] = {0}, counter[1000][10] = {0}, RAM[1000]={0} int i = 0, n = 0, j = 0, k = 0, X = 1, PC = 0, Count = 0 int opcode = 0, destination = 0, source = 0, address = 0, halt = 0, number = 0, temp = 0, value = 0 char s[6] FILE *fp = fopen(input_file, "r") if (fp == NULL)/*If fp is NULL, exit with EXIT_FAILURE as the return value*/ { printf("unable to open %s\n", input_file) getchar() exit(EXIT_FAILURE) } fgets(s,5,fp)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/01/2008 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas at Austin.

Page1 / 9

assign4.c - /* * *Name: Arria P. Owlia *EID: apo223...

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

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