| 88 | } |
| 89 | |
| 90 | int MemoryManager::getTotalMemory() |
| 91 | { |
| 92 | |
| 93 | if(!this->totalMemory) |
| 94 | { |
| 95 | int memory = *((int *)MEMORY_SIZE_ADDRESS); |
| 96 | // ax寄存器保存的内容 |
| 97 | int low = memory & 0xffff; |
| 98 | // bx寄存器保存的内容 |
| 99 | int high = (memory >> 16) & 0xffff; |
| 100 | |
| 101 | this->totalMemory = low * 1024 + high * 64 * 1024; |
| 102 | |
| 103 | } |
| 104 | |
| 105 | return this->totalMemory; |
| 106 | } |
nothing calls this directly
no outgoing calls
no test coverage detected