![]() ![]() The second type of memory is what most novice programmers think of as memory, and is often just called memory. This type of memory will be called registers in this text. Register memory is very limited and contained in what is often called a register file on the CPU. The first category, memory that exists in the Central Processing Unit (CPU) itself, is called register memory or more commonly simply registers. To a programmer, memory in MIPS is divided into two main categories. Some memory concepts are more appropriately covered in other courses, such as virtual memory (cache, RAM, and disk) which are generally covered in an OS class. One advantage of learning assembly language programming is that it directly exposes many of the types of memory (heap, static data, text, stack and registers) used in a program, and forces the programmer to deal with them. So every programmer should have at least a basic understanding of how the different types of memory that are used in nearly every computer platform. Some very powerful design patterns, such as an Immutable Objects, Singletons, or a State Pattern, cannot be understood properly without a knowledge of the characteristics of different types of memory. For example programs that use concurrency are difficult to implement without problems if memory is not understood. For a novice this is sufficient, but any real program will require that a programmer have at least a basic knowledge of the types of memory that are used, and the characteristics of each. ![]() It is not unusual for novice programmers to have no concept of memory except as a place to store variables. How memory is implemented and used is a complex and interesting topic, so at least some level of understanding is foundational for the study of Computer Science.). It is anticipated that the reader will have to refer to this section throughout the reading of the rest of the book, and quite possibly for future reference in programming in other languages. This material is difficult to understand, even for some experienced programmers. It might be helpful to first read lightly through this material, then implement the programs. (Note: the next two sections provide background material to assist the reader in understanding the MIPS programs later in the chapter. ![]()
0 Comments
Leave a Reply. |