diff options
author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-03-22 11:00:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-22 11:00:14 -0400 |
commit | b73f7fbe952494e245c44fdd4b6123bac1b4ec97 (patch) | |
tree | 9386aa3ccd2302fceb9750858d74ab56f156b4e2 /src/utils | |
parent | 45d63d831637ba9c4fb8cd8070dc7d2705fd3348 (diff) | |
parent | 544e764cd5a774c5d653771923b3ae8a28a618f7 (diff) |
Merge pull request #29 from bdunahu/bdunahu
Small cleanups to up a lot of implementation details
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/utils.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/utils.cc b/src/utils/utils.cc index ebbc1e9..3a11c2c 100644 --- a/src/utils/utils.cc +++ b/src/utils/utils.cc @@ -34,3 +34,9 @@ int wrap_address(int address) { } return address % MEM_WORDS; } + +void get_memory_index(int address, int &line, int &word) +{ + line = wrap_address(address) / LINE_SIZE; + word = address % LINE_SIZE; +} |