diff options
author | bd <bdunahu@operationnull.com> | 2025-03-21 16:06:07 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-21 16:06:07 -0400 |
commit | 431cba9a4bcef0e0ae047d45a7f3d98e601e30ed (patch) | |
tree | 178eefa29cd9ac5ba88efd989364e1bbf591189e /src/utils | |
parent | 41a6a317964c7ff09a98e9bbdb1995ac46937ff3 (diff) |
Small cleanups to up a lot of inplementation 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; +} |