| <html> |
| <head> |
| <meta name="viewport" content="width=device-width"> |
| <link rel="stylesheet" |
| href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/default.min.css"> |
| <link rel="stylesheet" href="styles.css"> |
| <title>Examples</title> |
| </head> |
| <body> |
| <main class="split container"> |
| <div class="sidebar"> |
| <h2><a href="/">6502</a></h2> |
| |
| <p> |
| 6502 Toolchain written by <a href="https://github.com/swissChili">swissChili</a> |
| </p> |
| |
| <ul> |
| <li><a href="https://github.com/swissChili/6502">Git</a></li> |
| <li><a href="/usage.html">Basic usage</a></li> |
| <li><a href="/examples.html">Example programs</a></li> |
| <li><a href="/building.html">Building from source</a></li> |
| </ul> |
| </div> |
| <div class="body"> |
| <h1> Example Programs</h1> |
| Download the compiled programs and try them out in the emulator! |
| <h3> Colors</h3> |
| Draws every supported color on the screen. |
| <a href="colors.dat" download>Download</a> |
| <br> |
| <pre><code class> LDY #$0 |
| loop: |
| TYA |
| STA $200, Y |
| STA $300, Y |
| STA $400, Y |
| STA $500, Y |
| INY |
| CMP #$ff |
| BCC loop |
| BRK</code></pre> |
| <h3> Disco</h3> |
| Epilepsy warning: lots of flashing colors. Due to how much faster this emulator is |
| than the one this program was written for, it's more of just flashing colors than |
| what it originally looked like. |
| <a href="disco.dat" download>Download</a> |
| <br> |
| <pre><code class>; Taken from 6502asm.com |
| <br> |
| start: |
| inx |
| txa |
| sta $200, y |
| sta $300, y |
| sta $400, y |
| sta $500, y |
| iny |
| tya |
| cmp 16 |
| bne do |
| iny |
| jmp start |
| do: |
| iny |
| iny |
| iny |
| iny |
| jmp start</code></pre> |
| </div> |
| </main> |
| |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script> |
| <script> |
| document.addEventListener('DOMContentLoaded', (event) => { |
| document.querySelectorAll('pre code').forEach((block) => { |
| hljs.highlightBlock(block); |
| }); |
| }); |
| </script> |
| </body> |
| </html> |