CS 233 Study Guide - Midterm Guide: Louisiana Baptist University, Data Segment, Compile Time

67 views3 pages
4 Apr 2016
Course
Professor

Document Summary

In software, we"ll use them for di erent purposes. For temporary values, we"ll use the registers. If you have no reason for picking another register, then you should probably be using the register. So, to compute with memory-based data, you must: load the data from memory to the register le, do the computation, leaving the result in a register, store that value back to memory if needed. For example, let"s say that you wanted to do the same addition, but the values were in memory. A: byte 1 2 3 4 result: . word null. text main: la , a lbu , 0() lbu , 1() lbu , 2() lbu , 3() add , , add , , add , , sw , 4() Data de ned outside of functions is called global data. These variables can be accessed from any function. This data is placed in the program"s global data segment.