diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2023-12-22 08:17:32 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2023-12-22 08:17:32 +0100 |
| commit | 53a3004db78103e8738e8b73040d1b18a3fdc7dd (patch) | |
| tree | 821749627f94f69357eda9a5a172b3ca4d0051ee | |
| parent | df8d8cca0759c919ad1918911737adb674fcd338 (diff) | |
| download | list.nes-53a3004db78103e8738e8b73040d1b18a3fdc7dd.tar.gz list.nes-53a3004db78103e8738e8b73040d1b18a3fdc7dd.zip | |
Further clarifications on small lists
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
| -rw-r--r-- | README.md | 7 | ||||
| -rw-r--r-- | list.s | 2 |
2 files changed, 8 insertions, 1 deletions
@@ -13,6 +13,13 @@ it added a bunch of code that was unrelated to the challenge itself. Hence, I extracted the logic into this library and tuned things down from the lessons I learnt along the way. +Moreover, you could also use this library to keep track of small lists, but you +have to keep in mind that pointer arithmetics and bound checks can hinder +performance. In other words, if you have a small list (less or equal than what +it can be addressed with an 8-bit index), then it's not worth the trouble: there +are other more performant ways to achieve the same thing. In short, this library +is useful only when indexing this list requires 16-bit arithmetic. + It's all pretty simple but being assembly code it comes with some gotchas that you need to be aware of. @@ -52,7 +52,7 @@ ;; List provides the scope for the variables and subroutines that have been ;; defined in order to maintain and manipulate big lists on the NES. ;; -;; This library can also work for smaller list but there are other more +;; This library can also work for smaller lists but there are other more ;; performant ways to achieve the same thing. Thus, use this library only if you ;; need to have a list that may store more than 255 bytes and indexing in the ;; usual ways might be a problem otherwise. |
