Please answer these questions Assembly Language How does the system know whether
ID: 3647689 • Letter: P
Question
Please answer these questions Assembly LanguageHow does the system know whether some memory location contains an integer
number, floating point number or a machine instruction? What happens, if during
an integer add instruction one encounters a floating point value in one of the
argument registers?
Which problem does the cache memory solve? How is the solution implemented? How can application programmer best influence the proper operation of this solution?
Which problem does the virtual memory solve? How is the solution
implemented? How can application programmer best influence the proper
operation of this solution?
Explanation / Answer
Main memory is a simple array of bytes, numbered from zero up. When accessing multibyte values, the most significant byte is stored first (big-endian). Multibyte values are not necessarily aligned in memory. The stack is an array of values. It is not a part of main memory; the terp maintains it separately. The format of the stack is technically up to the implementation. However, the needs of the machine (especially the game-save format) leave about one good option. The stack consists of a set of call frames, one for each function in the current chain. When a function is called, a new stack frame is pushed, containing the function's local variables. The function can then push or pull 32-bit values on top of that, to store intermediate computations. All values are treated as unsigned integers, unless otherwise noted. Signed integers are handled with the usual two's-complement notation. Arithmetic overflows and underflows are truncated, also as usual. Note that decompression tables are not necessarily in ROM. This is particularly important for tables that are generated and selected at run-time. Furthermore, it is technically legal for a table in RAM to be altered at runtime -- possibly even when it is the currently-selected table. Therefore, an interpreter that caches or preloads this decompression data must be careful. If it caches data from RAM, it must watch for writes to that RAM space, and invalidate its cache upon seeing such a write. When all of your computer's real physical memory (RAM) is in use, Windows will try to create virtual memory by grabbing a chunk of hard drive space and treating it like real memory. Your software can't tell the difference between real and virtual memory, but you might because virtual memory access is much slower, due to the hard drive activity it requires.