<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools.nes/tests/asan_reserve_constant.s, branch main</title>
<subtitle>Tools for NES/Famicom development.
</subtitle>
<id>https://git.mssola.com/nes/tools.nes/atom?h=main</id>
<link rel='self' href='https://git.mssola.com/nes/tools.nes/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/'/>
<updated>2026-04-08T14:04:12Z</updated>
<entry>
<title>Implement the asan:stack statement</title>
<updated>2026-04-08T14:04:12Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2026-04-08T14:04:12Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=a2cb050ca18fd7c5533d69e9aa093e4f0a40d0fa'/>
<id>urn:sha1:a2cb050ca18fd7c5533d69e9aa093e4f0a40d0fa</id>
<content type='text'>
This statement allows programmers to reserve a memory range for the
stack. This is useful to reserve a memory region which is not attached
to any variable, and:

1. It is a way to safely reserve space on the $0100 page.
2. The --stats/--write-info flags will be able to add up the memory
   space reserved for the stack.
3. Future tooling might be able to use this value as a way to detect
   stack overflows.

Signed-off-by: Miquel Sabaté Solà &lt;mssola@mssola.com&gt;
</content>
</entry>
<entry>
<title>Allow constants in asan:reserve statements</title>
<updated>2025-12-15T21:15:09Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2025-12-15T21:15:09Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=ec935330d4518829d01bbdf5670c4569fa07a567'/>
<id>urn:sha1:ec935330d4518829d01bbdf5670c4569fa07a567</id>
<content type='text'>
This way, if you define a constant like:

     MY_BUFFER_LEN_IN_BYTES = $10

You can then declare your buffer like so:

    zp_buffer = $00 ; asan:reserve MY_BUFFER_LEN_IN_BYTES

And then further in the code you can rely on just using the constant for
bound checking, and then the address sanitizer will check on bound
checks via static analysis as well.

Signed-off-by: Miquel Sabaté Solà &lt;mssola@mssola.com&gt;
</content>
</entry>
</feed>
