Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. void StoreData(int Memory_Location) {
  2. char temp_data[5]; // temporary array for data to write to memory
  3. snprintf(temp_data, 5, "%04d", ACC); // store accumulator into temporary character array
  4. for (int i = 0; i < 4; i++) { // move characters into memory
  5. if (i == 0 || i == 1) memory[Memory_Location][i] = 'Z';
  6. memory[Memory_Location][i+2] = temp_data[i];
  7. }
  8. if (Memory_Location > (program_line_count - 1)) new_data_count++; // increment if new line of memory
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement