c64-kb 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2082 -0
- package/LICENSE +29 -0
- package/README.md +559 -0
- package/VERSION +25 -0
- package/dist/cli/setup.js +66 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli-memorize-audit.js +97 -0
- package/dist/cli-memorize-audit.js.map +1 -0
- package/dist/cli.js +335 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.js +83 -0
- package/dist/config.js.map +1 -0
- package/dist/context.js +53 -0
- package/dist/context.js.map +1 -0
- package/dist/domain/budget-notes.js +104 -0
- package/dist/domain/budget-notes.js.map +1 -0
- package/dist/domain/budget.js +417 -0
- package/dist/domain/budget.js.map +1 -0
- package/dist/domain/game-design.js +77 -0
- package/dist/domain/game-design.js.map +1 -0
- package/dist/domain/timing.js +39 -0
- package/dist/domain/timing.js.map +1 -0
- package/dist/graph/apply.js +132 -0
- package/dist/graph/apply.js.map +1 -0
- package/dist/graph/claims.js +231 -0
- package/dist/graph/claims.js.map +1 -0
- package/dist/graph/extract/archetype.js +118 -0
- package/dist/graph/extract/archetype.js.map +1 -0
- package/dist/graph/extract/common.js +69 -0
- package/dist/graph/extract/common.js.map +1 -0
- package/dist/graph/extract/failure.js +37 -0
- package/dist/graph/extract/failure.js.map +1 -0
- package/dist/graph/extract/game-design.js +189 -0
- package/dist/graph/extract/game-design.js.map +1 -0
- package/dist/graph/extract/hardware.js +124 -0
- package/dist/graph/extract/hardware.js.map +1 -0
- package/dist/graph/extract/pitfall.js +62 -0
- package/dist/graph/extract/pitfall.js.map +1 -0
- package/dist/graph/extract/raster-band.js +56 -0
- package/dist/graph/extract/raster-band.js.map +1 -0
- package/dist/graph/extract/recipe.js +71 -0
- package/dist/graph/extract/recipe.js.map +1 -0
- package/dist/graph/extract/technique-entities.js +180 -0
- package/dist/graph/extract/technique-entities.js.map +1 -0
- package/dist/graph/extract/technique.js +179 -0
- package/dist/graph/extract/technique.js.map +1 -0
- package/dist/graph/extract/toolchain.js +67 -0
- package/dist/graph/extract/toolchain.js.map +1 -0
- package/dist/graph/extract/types.js +3 -0
- package/dist/graph/extract/types.js.map +1 -0
- package/dist/graph/extract/vocabulary.js +65 -0
- package/dist/graph/extract/vocabulary.js.map +1 -0
- package/dist/graph/extract.js +43 -0
- package/dist/graph/extract.js.map +1 -0
- package/dist/graph/kernal-clobbers.js +64 -0
- package/dist/graph/kernal-clobbers.js.map +1 -0
- package/dist/graph/machine-variants.js +208 -0
- package/dist/graph/machine-variants.js.map +1 -0
- package/dist/ingest/files.js +99 -0
- package/dist/ingest/files.js.map +1 -0
- package/dist/ingest/passes.js +104 -0
- package/dist/ingest/passes.js.map +1 -0
- package/dist/ingest/points.js +50 -0
- package/dist/ingest/points.js.map +1 -0
- package/dist/ingest/report.js +140 -0
- package/dist/ingest/report.js.map +1 -0
- package/dist/ingest/tally.js +81 -0
- package/dist/ingest/tally.js.map +1 -0
- package/dist/ingest/verified-on.js +43 -0
- package/dist/ingest/verified-on.js.map +1 -0
- package/dist/ingest.js +135 -0
- package/dist/ingest.js.map +1 -0
- package/dist/schemas/cost-basis.js +5 -0
- package/dist/schemas/cost-basis.js.map +1 -0
- package/dist/schemas/machine-variant.js +25 -0
- package/dist/schemas/machine-variant.js.map +1 -0
- package/dist/schemas/plan-budget.js +121 -0
- package/dist/schemas/plan-budget.js.map +1 -0
- package/dist/schemas/tool-outputs.js +526 -0
- package/dist/schemas/tool-outputs.js.map +1 -0
- package/dist/server/define-tool.js +52 -0
- package/dist/server/define-tool.js.map +1 -0
- package/dist/server/defined-only.js +9 -0
- package/dist/server/defined-only.js.map +1 -0
- package/dist/server/tools-briefings.js +70 -0
- package/dist/server/tools-briefings.js.map +1 -0
- package/dist/server/tools-lookup.js +180 -0
- package/dist/server/tools-lookup.js.map +1 -0
- package/dist/server/tools-maintenance.js +116 -0
- package/dist/server/tools-maintenance.js.map +1 -0
- package/dist/server/tools-pitfalls.js +89 -0
- package/dist/server/tools-pitfalls.js.map +1 -0
- package/dist/server/tools-recipes.js +296 -0
- package/dist/server/tools-recipes.js.map +1 -0
- package/dist/server/tools-runtime.js +48 -0
- package/dist/server/tools-runtime.js.map +1 -0
- package/dist/server/tools.js +43 -0
- package/dist/server/tools.js.map +1 -0
- package/dist/server.js +95 -0
- package/dist/server.js.map +1 -0
- package/dist/services/analytics/schema.js +78 -0
- package/dist/services/analytics/schema.js.map +1 -0
- package/dist/services/analytics/statements.js +99 -0
- package/dist/services/analytics/statements.js.map +1 -0
- package/dist/services/analytics.js +195 -0
- package/dist/services/analytics.js.map +1 -0
- package/dist/services/bm25.js +158 -0
- package/dist/services/bm25.js.map +1 -0
- package/dist/services/chunker.js +81 -0
- package/dist/services/chunker.js.map +1 -0
- package/dist/services/embeddings.js +58 -0
- package/dist/services/embeddings.js.map +1 -0
- package/dist/services/falkor/base.js +85 -0
- package/dist/services/falkor/base.js.map +1 -0
- package/dist/services/falkor/links.js +361 -0
- package/dist/services/falkor/links.js.map +1 -0
- package/dist/services/falkor/nodes.js +183 -0
- package/dist/services/falkor/nodes.js.map +1 -0
- package/dist/services/falkor/params.js +45 -0
- package/dist/services/falkor/params.js.map +1 -0
- package/dist/services/falkor/schema.js +77 -0
- package/dist/services/falkor/schema.js.map +1 -0
- package/dist/services/falkor.js +100 -0
- package/dist/services/falkor.js.map +1 -0
- package/dist/services/qdrant.js +238 -0
- package/dist/services/qdrant.js.map +1 -0
- package/dist/services/versions.js +73 -0
- package/dist/services/versions.js.map +1 -0
- package/dist/services/vice-bin.js +51 -0
- package/dist/services/vice-bin.js.map +1 -0
- package/dist/tools/briefings/archetype.js +174 -0
- package/dist/tools/briefings/archetype.js.map +1 -0
- package/dist/tools/briefings/budget.js +177 -0
- package/dist/tools/briefings/budget.js.map +1 -0
- package/dist/tools/briefings/build-order.js +135 -0
- package/dist/tools/briefings/build-order.js.map +1 -0
- package/dist/tools/briefings/build.js +185 -0
- package/dist/tools/briefings/build.js.map +1 -0
- package/dist/tools/briefings/discovery.js +290 -0
- package/dist/tools/briefings/discovery.js.map +1 -0
- package/dist/tools/briefings/plan-pitfalls.js +69 -0
- package/dist/tools/briefings/plan-pitfalls.js.map +1 -0
- package/dist/tools/briefings/render.js +151 -0
- package/dist/tools/briefings/render.js.map +1 -0
- package/dist/tools/briefings/rows.js +41 -0
- package/dist/tools/briefings/rows.js.map +1 -0
- package/dist/tools/briefings/toolchain.js +63 -0
- package/dist/tools/briefings/toolchain.js.map +1 -0
- package/dist/tools/briefings/why-proposed.js +69 -0
- package/dist/tools/briefings/why-proposed.js.map +1 -0
- package/dist/tools/briefings.js +44 -0
- package/dist/tools/briefings.js.map +1 -0
- package/dist/tools/feedback.js +97 -0
- package/dist/tools/feedback.js.map +1 -0
- package/dist/tools/hydrate.js +75 -0
- package/dist/tools/hydrate.js.map +1 -0
- package/dist/tools/intelligence.js +67 -0
- package/dist/tools/intelligence.js.map +1 -0
- package/dist/tools/lint/asm-decimal.js +86 -0
- package/dist/tools/lint/asm-decimal.js.map +1 -0
- package/dist/tools/lint/asm-rules.js +221 -0
- package/dist/tools/lint/asm-rules.js.map +1 -0
- package/dist/tools/lint/asm-shared.js +3 -0
- package/dist/tools/lint/asm-shared.js.map +1 -0
- package/dist/tools/lint/c-rules.js +215 -0
- package/dist/tools/lint/c-rules.js.map +1 -0
- package/dist/tools/lint/text.js +122 -0
- package/dist/tools/lint/text.js.map +1 -0
- package/dist/tools/lint/types.js +40 -0
- package/dist/tools/lint/types.js.map +1 -0
- package/dist/tools/lint.js +76 -0
- package/dist/tools/lint.js.map +1 -0
- package/dist/tools/memorization-mcp.js +111 -0
- package/dist/tools/memorization-mcp.js.map +1 -0
- package/dist/tools/pitfalls/bm25.js +53 -0
- package/dist/tools/pitfalls/bm25.js.map +1 -0
- package/dist/tools/pitfalls/format.js +58 -0
- package/dist/tools/pitfalls/format.js.map +1 -0
- package/dist/tools/pitfalls/graph.js +124 -0
- package/dist/tools/pitfalls/graph.js.map +1 -0
- package/dist/tools/pitfalls.js +134 -0
- package/dist/tools/pitfalls.js.map +1 -0
- package/dist/tools/prompts.js +81 -0
- package/dist/tools/prompts.js.map +1 -0
- package/dist/tools/query/compatibility/closure.js +62 -0
- package/dist/tools/query/compatibility/closure.js.map +1 -0
- package/dist/tools/query/compatibility/facts.js +28 -0
- package/dist/tools/query/compatibility/facts.js.map +1 -0
- package/dist/tools/query/compatibility/fetch.js +164 -0
- package/dist/tools/query/compatibility/fetch.js.map +1 -0
- package/dist/tools/query/compatibility/hard-rules.js +159 -0
- package/dist/tools/query/compatibility/hard-rules.js.map +1 -0
- package/dist/tools/query/compatibility/index.js +27 -0
- package/dist/tools/query/compatibility/index.js.map +1 -0
- package/dist/tools/query/compatibility/kernal-zp-rule.js +90 -0
- package/dist/tools/query/compatibility/kernal-zp-rule.js.map +1 -0
- package/dist/tools/query/compatibility/render.js +106 -0
- package/dist/tools/query/compatibility/render.js.map +1 -0
- package/dist/tools/query/compatibility/rules.js +337 -0
- package/dist/tools/query/compatibility/rules.js.map +1 -0
- package/dist/tools/query/compatibility/unit-rules.js +253 -0
- package/dist/tools/query/compatibility/unit-rules.js.map +1 -0
- package/dist/tools/query/game-design.js +83 -0
- package/dist/tools/query/game-design.js.map +1 -0
- package/dist/tools/query/lookups.js +220 -0
- package/dist/tools/query/lookups.js.map +1 -0
- package/dist/tools/query/plan-budget.js +266 -0
- package/dist/tools/query/plan-budget.js.map +1 -0
- package/dist/tools/query/recipes.js +214 -0
- package/dist/tools/query/recipes.js.map +1 -0
- package/dist/tools/query/retrieval.js +128 -0
- package/dist/tools/query/retrieval.js.map +1 -0
- package/dist/tools/query/shared.js +121 -0
- package/dist/tools/query/shared.js.map +1 -0
- package/dist/tools/query/techniques.js +331 -0
- package/dist/tools/query/techniques.js.map +1 -0
- package/dist/tools/query/timing.js +106 -0
- package/dist/tools/query/timing.js.map +1 -0
- package/dist/tools/query/types.js +11 -0
- package/dist/tools/query/types.js.map +1 -0
- package/dist/tools/query.js +21 -0
- package/dist/tools/query.js.map +1 -0
- package/dist/tools/resources.js +186 -0
- package/dist/tools/resources.js.map +1 -0
- package/dist/tools/run-game.js +249 -0
- package/dist/tools/run-game.js.map +1 -0
- package/dist/tools/selfimprovement.js +367 -0
- package/dist/tools/selfimprovement.js.map +1 -0
- package/docker-compose.yml +35 -0
- package/docs/ARCHITECTURE.md +164 -0
- package/docs/CONVENTIONS-archetypes.md +158 -0
- package/docs/CONVENTIONS-failures.md +46 -0
- package/docs/CONVENTIONS-game-designs.md +75 -0
- package/docs/CONVENTIONS-hardware-reference.md +184 -0
- package/docs/CONVENTIONS-pitfalls.md +91 -0
- package/docs/CONVENTIONS-recipes.md +106 -0
- package/docs/CONVENTIONS-techniques.md +309 -0
- package/docs/CONVENTIONS-toolchain-reference.md +89 -0
- package/docs/ONTOLOGY.md +655 -0
- package/docs/art/art-production-reference.md +157 -0
- package/docs/art/asset-pipelines.md +586 -0
- package/docs/c64-failure-patterns.md +693 -0
- package/docs/demo-design/demo-composition.md +349 -0
- package/docs/demo-design/demo-design-philosophy.md +320 -0
- package/docs/demo-design/intro-cracktro-patterns.md +435 -0
- package/docs/figures/ctm-spd-embed-probe.png +0 -0
- package/docs/figures/dot-flag-mid-5000000.png +0 -0
- package/docs/figures/dot-flag-no-erase-12000000.png +0 -0
- package/docs/figures/edges.json +1 -0
- package/docs/figures/fig6-architecture.png +0 -0
- package/docs/figures/fig7-ontology.png +0 -0
- package/docs/figures/screen-dissolve-mid-frame25.png +0 -0
- package/docs/figures/screen-dissolve-wipe-frame25.png +0 -0
- package/docs/figures/spindle-two-parts-part1.png +0 -0
- package/docs/figures/spindle-two-parts-part2.png +0 -0
- package/docs/figures/starters/action-puzzle.png +0 -0
- package/docs/figures/starters/adventure.png +0 -0
- package/docs/figures/starters/beat-em-up.png +0 -0
- package/docs/figures/starters/demo.png +0 -0
- package/docs/figures/starters/platformer.png +0 -0
- package/docs/figures/starters/shmup-vertical.png +0 -0
- package/docs/figures/tape-kernal-master-ntsc.png +0 -0
- package/docs/figures/tape-kernal-master-pal.png +0 -0
- package/docs/figures/tape-turbo-loader-ntsc.png +0 -0
- package/docs/figures/tape-turbo-loader-pal.png +0 -0
- package/docs/figures/tape-turbo-master-ntsc.png +0 -0
- package/docs/figures/tape-turbo-master-pal.png +0 -0
- package/docs/figures/tech-tech-pad2-12000000.png +0 -0
- package/docs/figures/tech-tech-pad4-12000000.png +0 -0
- package/docs/figures/tech-tech-seven-12000000.png +0 -0
- package/docs/figures/twister-mid-5000000.png +0 -0
- package/docs/figures/twister-straight-12000000.png +0 -0
- package/docs/figures/vector-balls-nosort-ntsc.png +0 -0
- package/docs/figures/vector-balls-nosort.png +0 -0
- package/docs/formats/c64-file-formats.md +1212 -0
- package/docs/formats/iec-disk-reference.md +754 -0
- package/docs/game-design/c64-game-archetypes.md +273 -0
- package/docs/game-design/designs/falling-blocks.md +54 -0
- package/docs/game-design/designs/platformer-scaffold.md +48 -0
- package/docs/game-design/designs/simple-shmup.md +27 -0
- package/docs/game-design/enemy-behaviour-and-difficulty.md +349 -0
- package/docs/game-design/game-design-patterns.md +1189 -0
- package/docs/game-design/game-structure.md +354 -0
- package/docs/game-design/production-planning.md +349 -0
- package/docs/game-design/reference-game-sources.md +90 -0
- package/docs/hardware/6502-illegal-opcodes.md +1353 -0
- package/docs/hardware/6510-cpu-reference.md +2112 -0
- package/docs/hardware/c64-memory-map.md +3184 -0
- package/docs/hardware/c64-registers-reference.md +996 -0
- package/docs/hardware/cia-reference.md +1281 -0
- package/docs/hardware/kernal-routines-reference.md +1836 -0
- package/docs/hardware/pal-ntsc-reference.md +813 -0
- package/docs/hardware/sid-reference.md +1137 -0
- package/docs/hardware/vic-ii-reference.md +1714 -0
- package/docs/music/music-production-reference.md +403 -0
- package/docs/pitfalls/banking.md +1067 -0
- package/docs/pitfalls/cia.md +1147 -0
- package/docs/pitfalls/cpu.md +874 -0
- package/docs/pitfalls/input.md +282 -0
- package/docs/pitfalls/kernal-and-io.md +1615 -0
- package/docs/pitfalls/loader.md +1191 -0
- package/docs/pitfalls/logic.md +94 -0
- package/docs/pitfalls/maths.md +187 -0
- package/docs/pitfalls/raster-and-badline.md +721 -0
- package/docs/pitfalls/region-timing.md +660 -0
- package/docs/pitfalls/scroll.md +207 -0
- package/docs/pitfalls/sid.md +738 -0
- package/docs/pitfalls/sprite.md +979 -0
- package/docs/pitfalls/text-mode-render.md +1172 -0
- package/docs/recipes/cc65/cartridge-8k.md +398 -0
- package/docs/recipes/cc65/hello-world-conio.md +76 -0
- package/docs/recipes/cc65/memory-layout.md +312 -0
- package/docs/recipes/cc65/screenshots/README.md +14 -0
- package/docs/recipes/cc65/screenshots/cartridge-8k-ntsc.png +0 -0
- package/docs/recipes/cc65/screenshots/cartridge-8k.png +0 -0
- package/docs/recipes/cc65/screenshots/hello-world-conio.png +0 -0
- package/docs/recipes/cc65/screenshots/memory-layout-ntsc.png +0 -0
- package/docs/recipes/cc65/screenshots/memory-layout.png +0 -0
- package/docs/recipes/kickassembler/basic-float-calls.md +578 -0
- package/docs/recipes/kickassembler/basic-wedge.md +398 -0
- package/docs/recipes/kickassembler/big-font-scroller.md +620 -0
- package/docs/recipes/kickassembler/charset-copy-rom-to-ram.md +623 -0
- package/docs/recipes/kickassembler/cia-revision-detect.md +366 -0
- package/docs/recipes/kickassembler/colour-cycling.md +343 -0
- package/docs/recipes/kickassembler/colour-fade.md +303 -0
- package/docs/recipes/kickassembler/compare-16bit-signed.md +1007 -0
- package/docs/recipes/kickassembler/cracktro-template.md +526 -0
- package/docs/recipes/kickassembler/crt-banked.md +276 -0
- package/docs/recipes/kickassembler/dos-error-codes.md +466 -0
- package/docs/recipes/kickassembler/dot-flag.md +576 -0
- package/docs/recipes/kickassembler/drive-job-queue.md +667 -0
- package/docs/recipes/kickassembler/drive-via-probe.md +690 -0
- package/docs/recipes/kickassembler/dycp-scroller.md +568 -0
- package/docs/recipes/kickassembler/dypp-sprite-scroller.md +681 -0
- package/docs/recipes/kickassembler/dysp.md +670 -0
- package/docs/recipes/kickassembler/easyflash-save.md +800 -0
- package/docs/recipes/kickassembler/eight-way-scroll.md +1484 -0
- package/docs/recipes/kickassembler/file-io-roundtrip.md +546 -0
- package/docs/recipes/kickassembler/fire-effect.md +420 -0
- package/docs/recipes/kickassembler/fld.md +414 -0
- package/docs/recipes/kickassembler/fli-image.md +336 -0
- package/docs/recipes/kickassembler/four-player-read.md +672 -0
- package/docs/recipes/kickassembler/headless-verify.md +228 -0
- package/docs/recipes/kickassembler/hello-world.md +98 -0
- package/docs/recipes/kickassembler/high-score-insert.md +660 -0
- package/docs/recipes/kickassembler/hires-plot-line.md +723 -0
- package/docs/recipes/kickassembler/irq-chain.md +316 -0
- package/docs/recipes/kickassembler/irq-owns-port.md +668 -0
- package/docs/recipes/kickassembler/isometric-room.md +1145 -0
- package/docs/recipes/kickassembler/light-pen-read.md +926 -0
- package/docs/recipes/kickassembler/logic-rate-decoupling.md +670 -0
- package/docs/recipes/kickassembler/mci-interlace.md +543 -0
- package/docs/recipes/kickassembler/memory-layout.md +277 -0
- package/docs/recipes/kickassembler/mouse-1351-read.md +801 -0
- package/docs/recipes/kickassembler/nmi-timer-tick.md +562 -0
- package/docs/recipes/kickassembler/own-keyscan.md +881 -0
- package/docs/recipes/kickassembler/paddle-read.md +751 -0
- package/docs/recipes/kickassembler/palette-cells.md +219 -0
- package/docs/recipes/kickassembler/pseudo-3d-road.md +930 -0
- package/docs/recipes/kickassembler/pwm-digi.md +463 -0
- package/docs/recipes/kickassembler/raster-bars.md +264 -0
- package/docs/recipes/kickassembler/reu-dma.md +1019 -0
- package/docs/recipes/kickassembler/runtime-relocation.md +743 -0
- package/docs/recipes/kickassembler/screen-dissolve.md +545 -0
- package/docs/recipes/kickassembler/screen-wipe.md +408 -0
- package/docs/recipes/kickassembler/screenshots/README.md +72 -0
- package/docs/recipes/kickassembler/screenshots/basic-float-calls-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/basic-float-calls.png +0 -0
- package/docs/recipes/kickassembler/screenshots/basic-wedge-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/basic-wedge.png +0 -0
- package/docs/recipes/kickassembler/screenshots/big-font-scroller-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/big-font-scroller.png +0 -0
- package/docs/recipes/kickassembler/screenshots/charset-copy-rom-to-ram-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/charset-copy-rom-to-ram.png +0 -0
- package/docs/recipes/kickassembler/screenshots/cia-revision-detect-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/cia-revision-detect.png +0 -0
- package/docs/recipes/kickassembler/screenshots/colour-cycling-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/colour-cycling.png +0 -0
- package/docs/recipes/kickassembler/screenshots/colour-fade-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/colour-fade.png +0 -0
- package/docs/recipes/kickassembler/screenshots/compare-16bit-signed-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/compare-16bit-signed.png +0 -0
- package/docs/recipes/kickassembler/screenshots/cracktro-template.png +0 -0
- package/docs/recipes/kickassembler/screenshots/crt-banked-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/crt-banked.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dos-error-codes-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dos-error-codes.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dot-flag-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dot-flag.png +0 -0
- package/docs/recipes/kickassembler/screenshots/drive-job-queue-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/drive-job-queue.png +0 -0
- package/docs/recipes/kickassembler/screenshots/drive-via-probe-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/drive-via-probe.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dycp-scroller-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dycp-scroller.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dypp-sprite-scroller-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dypp-sprite-scroller.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dysp-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/dysp.png +0 -0
- package/docs/recipes/kickassembler/screenshots/easyflash-save-ntsc-run2.png +0 -0
- package/docs/recipes/kickassembler/screenshots/easyflash-save-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/easyflash-save-run2.png +0 -0
- package/docs/recipes/kickassembler/screenshots/easyflash-save.png +0 -0
- package/docs/recipes/kickassembler/screenshots/eight-way-scroll-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/eight-way-scroll.png +0 -0
- package/docs/recipes/kickassembler/screenshots/file-io-roundtrip-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/file-io-roundtrip.png +0 -0
- package/docs/recipes/kickassembler/screenshots/fire-effect-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/fire-effect.png +0 -0
- package/docs/recipes/kickassembler/screenshots/fld-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/fld.png +0 -0
- package/docs/recipes/kickassembler/screenshots/fli-image.png +0 -0
- package/docs/recipes/kickassembler/screenshots/four-player-read-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/four-player-read.png +0 -0
- package/docs/recipes/kickassembler/screenshots/headless-verify-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/headless-verify.png +0 -0
- package/docs/recipes/kickassembler/screenshots/hello-world.png +0 -0
- package/docs/recipes/kickassembler/screenshots/high-score-insert-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/high-score-insert.png +0 -0
- package/docs/recipes/kickassembler/screenshots/hires-plot-line-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/hires-plot-line.png +0 -0
- package/docs/recipes/kickassembler/screenshots/irq-chain-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/irq-chain.png +0 -0
- package/docs/recipes/kickassembler/screenshots/irq-owns-port-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/irq-owns-port.png +0 -0
- package/docs/recipes/kickassembler/screenshots/isometric-room-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/isometric-room.png +0 -0
- package/docs/recipes/kickassembler/screenshots/light-pen-read-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/light-pen-read.png +0 -0
- package/docs/recipes/kickassembler/screenshots/logic-rate-decoupling-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/logic-rate-decoupling.png +0 -0
- package/docs/recipes/kickassembler/screenshots/mci-interlace-average.png +0 -0
- package/docs/recipes/kickassembler/screenshots/mci-interlace-frame-b.png +0 -0
- package/docs/recipes/kickassembler/screenshots/mci-interlace-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/mci-interlace.png +0 -0
- package/docs/recipes/kickassembler/screenshots/memory-layout-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/memory-layout.png +0 -0
- package/docs/recipes/kickassembler/screenshots/mouse-1351-read-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/mouse-1351-read.png +0 -0
- package/docs/recipes/kickassembler/screenshots/nmi-timer-tick-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/nmi-timer-tick.png +0 -0
- package/docs/recipes/kickassembler/screenshots/own-keyscan-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/own-keyscan.png +0 -0
- package/docs/recipes/kickassembler/screenshots/paddle-read-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/paddle-read.png +0 -0
- package/docs/recipes/kickassembler/screenshots/palette-cells-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/palette-cells.png +0 -0
- package/docs/recipes/kickassembler/screenshots/pseudo-3d-road-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/pseudo-3d-road.png +0 -0
- package/docs/recipes/kickassembler/screenshots/pwm-digi-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/pwm-digi.png +0 -0
- package/docs/recipes/kickassembler/screenshots/raster-bars.png +0 -0
- package/docs/recipes/kickassembler/screenshots/reu-dma-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/reu-dma.png +0 -0
- package/docs/recipes/kickassembler/screenshots/runtime-relocation-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/runtime-relocation.png +0 -0
- package/docs/recipes/kickassembler/screenshots/screen-dissolve-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/screen-dissolve.png +0 -0
- package/docs/recipes/kickassembler/screenshots/screen-wipe-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/screen-wipe.png +0 -0
- package/docs/recipes/kickassembler/screenshots/scroll-panel-split-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/scroll-panel-split.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sfx-in-player-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sfx-in-player.png +0 -0
- package/docs/recipes/kickassembler/screenshots/shadebobs-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/shadebobs.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sideborder-open.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sine-scroller.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sine-table-runtime-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sine-table-runtime.png +0 -0
- package/docs/recipes/kickassembler/screenshots/software-sprite-preshifted-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/software-sprite-preshifted.png +0 -0
- package/docs/recipes/kickassembler/screenshots/speedcode-generator-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/speedcode-generator.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-border-scroller-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-border-scroller.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-cache-flip-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-cache-flip.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-multiplex-24.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-multiplex-game-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-multiplex-game.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-priority-classes-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-priority-classes.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-sine-chain-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-sine-chain.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-stretcher-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprite-stretcher.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprites-only-screen-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sprites-only-screen.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sqrt-atan2-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/sqrt-atan2.png +0 -0
- package/docs/recipes/kickassembler/screenshots/stable-raster-irq-control.png +0 -0
- package/docs/recipes/kickassembler/screenshots/stable-raster-irq.png +0 -0
- package/docs/recipes/kickassembler/screenshots/tech-tech-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/tech-tech.png +0 -0
- package/docs/recipes/kickassembler/screenshots/tod-alarm-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/tod-alarm.png +0 -0
- package/docs/recipes/kickassembler/screenshots/topbottom-border-open.png +0 -0
- package/docs/recipes/kickassembler/screenshots/twister-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/twister.png +0 -0
- package/docs/recipes/kickassembler/screenshots/unit-test-driver-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/unit-test-driver.png +0 -0
- package/docs/recipes/kickassembler/screenshots/vector-balls-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/vector-balls.png +0 -0
- package/docs/recipes/kickassembler/screenshots/wireframe-ships-ntsc.png +0 -0
- package/docs/recipes/kickassembler/screenshots/wireframe-ships.png +0 -0
- package/docs/recipes/kickassembler/scroll-panel-split.md +381 -0
- package/docs/recipes/kickassembler/sfx-in-player.md +907 -0
- package/docs/recipes/kickassembler/shadebobs.md +522 -0
- package/docs/recipes/kickassembler/sideborder-open.md +338 -0
- package/docs/recipes/kickassembler/sine-scroller.md +321 -0
- package/docs/recipes/kickassembler/sine-table-runtime.md +815 -0
- package/docs/recipes/kickassembler/software-sprite-preshifted.md +725 -0
- package/docs/recipes/kickassembler/speedcode-generator.md +606 -0
- package/docs/recipes/kickassembler/sprite-border-scroller.md +696 -0
- package/docs/recipes/kickassembler/sprite-cache-flip.md +1071 -0
- package/docs/recipes/kickassembler/sprite-multiplex-24.md +326 -0
- package/docs/recipes/kickassembler/sprite-multiplex-game.md +986 -0
- package/docs/recipes/kickassembler/sprite-priority-classes.md +463 -0
- package/docs/recipes/kickassembler/sprite-sine-chain.md +338 -0
- package/docs/recipes/kickassembler/sprite-stretcher.md +501 -0
- package/docs/recipes/kickassembler/sprites-only-screen.md +550 -0
- package/docs/recipes/kickassembler/sqrt-atan2.md +1014 -0
- package/docs/recipes/kickassembler/stable-raster-irq.md +360 -0
- package/docs/recipes/kickassembler/tape-turbo-loader.md +875 -0
- package/docs/recipes/kickassembler/tech-tech.md +679 -0
- package/docs/recipes/kickassembler/tod-alarm.md +754 -0
- package/docs/recipes/kickassembler/topbottom-border-open.md +407 -0
- package/docs/recipes/kickassembler/twister.md +518 -0
- package/docs/recipes/kickassembler/unit-test-driver.md +314 -0
- package/docs/recipes/kickassembler/vector-balls.md +545 -0
- package/docs/recipes/kickassembler/wireframe-ships.md +2324 -0
- package/docs/recipes/oscar64/actor-activation-window.md +807 -0
- package/docs/recipes/oscar64/adventure-engine.md +1094 -0
- package/docs/recipes/oscar64/attract-replay.md +465 -0
- package/docs/recipes/oscar64/beat-em-up-lanes.md +563 -0
- package/docs/recipes/oscar64/bfs-distance-map.md +723 -0
- package/docs/recipes/oscar64/bitmap-koala-viewer.md +355 -0
- package/docs/recipes/oscar64/car-contact.md +950 -0
- package/docs/recipes/oscar64/cave-scan.md +609 -0
- package/docs/recipes/oscar64/char-bullets.md +477 -0
- package/docs/recipes/oscar64/charset-animation.md +383 -0
- package/docs/recipes/oscar64/charset-parallax.md +401 -0
- package/docs/recipes/oscar64/destructible-terrain.md +1099 -0
- package/docs/recipes/oscar64/difficulty-tables.md +654 -0
- package/docs/recipes/oscar64/dig-and-guards.md +975 -0
- package/docs/recipes/oscar64/directory-reader.md +535 -0
- package/docs/recipes/oscar64/divide-check.md +581 -0
- package/docs/recipes/oscar64/double-buffer-nomirror.md +205 -0
- package/docs/recipes/oscar64/double-buffer.md +255 -0
- package/docs/recipes/oscar64/falling-blocks.md +874 -0
- package/docs/recipes/oscar64/fixed-point-jump-velocity.md +289 -0
- package/docs/recipes/oscar64/fixed-point-jump.md +210 -0
- package/docs/recipes/oscar64/flip-screen-rooms.md +793 -0
- package/docs/recipes/oscar64/frame-sync-loop-overrun.md +214 -0
- package/docs/recipes/oscar64/frame-sync-loop.md +254 -0
- package/docs/recipes/oscar64/game-tree-search.md +743 -0
- package/docs/recipes/oscar64/ghost-targeting.md +867 -0
- package/docs/recipes/oscar64/headless-verify.md +345 -0
- package/docs/recipes/oscar64/hello-world.md +83 -0
- package/docs/recipes/oscar64/high-score-persist.md +772 -0
- package/docs/recipes/oscar64/iffl-kernal-skip.md +421 -0
- package/docs/recipes/oscar64/joystick-input.md +358 -0
- package/docs/recipes/oscar64/lane-pursuit.md +1028 -0
- package/docs/recipes/oscar64/level-rle-decoder.md +620 -0
- package/docs/recipes/oscar64/lfsr-random-seed2.md +338 -0
- package/docs/recipes/oscar64/lfsr-random.md +403 -0
- package/docs/recipes/oscar64/load-asset-runtime.md +492 -0
- package/docs/recipes/oscar64/memory-layout.md +232 -0
- package/docs/recipes/oscar64/mixed-fighters.md +781 -0
- package/docs/recipes/oscar64/multi-sprite-object.md +533 -0
- package/docs/recipes/oscar64/nav-area-pathfinding.md +881 -0
- package/docs/recipes/oscar64/object-pool.md +572 -0
- package/docs/recipes/oscar64/pal-ntsc-detect.md +257 -0
- package/docs/recipes/oscar64/password-state.md +532 -0
- package/docs/recipes/oscar64/per-frame-hitbox.md +651 -0
- package/docs/recipes/oscar64/petscii-screen-codes.md +428 -0
- package/docs/recipes/oscar64/platformer-scaffold.md +1467 -0
- package/docs/recipes/oscar64/print-number.md +367 -0
- package/docs/recipes/oscar64/raster-bars.md +239 -0
- package/docs/recipes/oscar64/raster-profile-bars.md +404 -0
- package/docs/recipes/oscar64/rel-side-sectors.md +391 -0
- package/docs/recipes/oscar64/relative-file-records.md +378 -0
- package/docs/recipes/oscar64/save-load-seq-file.md +365 -0
- package/docs/recipes/oscar64/screenshots/README.md +99 -0
- package/docs/recipes/oscar64/screenshots/actor-activation-window-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/actor-activation-window.png +0 -0
- package/docs/recipes/oscar64/screenshots/adventure-engine-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/adventure-engine.png +0 -0
- package/docs/recipes/oscar64/screenshots/attract-replay-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/attract-replay.png +0 -0
- package/docs/recipes/oscar64/screenshots/beat-em-up-lanes-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/beat-em-up-lanes.png +0 -0
- package/docs/recipes/oscar64/screenshots/bfs-distance-map-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/bfs-distance-map.png +0 -0
- package/docs/recipes/oscar64/screenshots/bitmap-koala-viewer.png +0 -0
- package/docs/recipes/oscar64/screenshots/car-contact-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/car-contact.png +0 -0
- package/docs/recipes/oscar64/screenshots/cave-scan-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/cave-scan.png +0 -0
- package/docs/recipes/oscar64/screenshots/char-bullets-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/char-bullets.png +0 -0
- package/docs/recipes/oscar64/screenshots/charset-animation-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/charset-animation.png +0 -0
- package/docs/recipes/oscar64/screenshots/charset-parallax-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/charset-parallax.png +0 -0
- package/docs/recipes/oscar64/screenshots/destructible-terrain-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/destructible-terrain.png +0 -0
- package/docs/recipes/oscar64/screenshots/difficulty-tables-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/difficulty-tables.png +0 -0
- package/docs/recipes/oscar64/screenshots/dig-and-guards-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/dig-and-guards.png +0 -0
- package/docs/recipes/oscar64/screenshots/directory-reader-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/directory-reader.png +0 -0
- package/docs/recipes/oscar64/screenshots/divide-check-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/divide-check.png +0 -0
- package/docs/recipes/oscar64/screenshots/double-buffer-nomirror.png +0 -0
- package/docs/recipes/oscar64/screenshots/double-buffer-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/double-buffer.png +0 -0
- package/docs/recipes/oscar64/screenshots/falling-blocks-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/falling-blocks.png +0 -0
- package/docs/recipes/oscar64/screenshots/fixed-point-jump-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/fixed-point-jump-velocity-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/fixed-point-jump-velocity.png +0 -0
- package/docs/recipes/oscar64/screenshots/fixed-point-jump.png +0 -0
- package/docs/recipes/oscar64/screenshots/flip-screen-rooms-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/flip-screen-rooms.png +0 -0
- package/docs/recipes/oscar64/screenshots/frame-sync-loop-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/frame-sync-loop-overrun.png +0 -0
- package/docs/recipes/oscar64/screenshots/frame-sync-loop.png +0 -0
- package/docs/recipes/oscar64/screenshots/game-tree-search-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/game-tree-search.png +0 -0
- package/docs/recipes/oscar64/screenshots/ghost-targeting-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/ghost-targeting.png +0 -0
- package/docs/recipes/oscar64/screenshots/headless-verify-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/headless-verify.png +0 -0
- package/docs/recipes/oscar64/screenshots/hello-world.png +0 -0
- package/docs/recipes/oscar64/screenshots/high-score-persist-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/high-score-persist.png +0 -0
- package/docs/recipes/oscar64/screenshots/iffl-kernal-skip-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/iffl-kernal-skip.png +0 -0
- package/docs/recipes/oscar64/screenshots/joystick-input-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/joystick-input.png +0 -0
- package/docs/recipes/oscar64/screenshots/lane-pursuit-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/lane-pursuit.png +0 -0
- package/docs/recipes/oscar64/screenshots/level-rle-decoder-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/level-rle-decoder.png +0 -0
- package/docs/recipes/oscar64/screenshots/lfsr-random-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/lfsr-random-seed2.png +0 -0
- package/docs/recipes/oscar64/screenshots/lfsr-random.png +0 -0
- package/docs/recipes/oscar64/screenshots/load-asset-runtime-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/load-asset-runtime.png +0 -0
- package/docs/recipes/oscar64/screenshots/memory-layout-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/memory-layout.png +0 -0
- package/docs/recipes/oscar64/screenshots/mixed-fighters-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/mixed-fighters.png +0 -0
- package/docs/recipes/oscar64/screenshots/multi-sprite-object-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/multi-sprite-object.png +0 -0
- package/docs/recipes/oscar64/screenshots/nav-area-pathfinding-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/nav-area-pathfinding.png +0 -0
- package/docs/recipes/oscar64/screenshots/object-pool-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/object-pool.png +0 -0
- package/docs/recipes/oscar64/screenshots/pal-ntsc-detect-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/pal-ntsc-detect-oldntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/pal-ntsc-detect-pal.png +0 -0
- package/docs/recipes/oscar64/screenshots/password-state-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/password-state.png +0 -0
- package/docs/recipes/oscar64/screenshots/per-frame-hitbox-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/per-frame-hitbox.png +0 -0
- package/docs/recipes/oscar64/screenshots/petscii-screen-codes-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/petscii-screen-codes.png +0 -0
- package/docs/recipes/oscar64/screenshots/platformer-scaffold-d64-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/platformer-scaffold-d64.png +0 -0
- package/docs/recipes/oscar64/screenshots/platformer-scaffold-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/platformer-scaffold.png +0 -0
- package/docs/recipes/oscar64/screenshots/print-number-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/print-number.png +0 -0
- package/docs/recipes/oscar64/screenshots/raster-bars.png +0 -0
- package/docs/recipes/oscar64/screenshots/raster-profile-bars-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/raster-profile-bars.png +0 -0
- package/docs/recipes/oscar64/screenshots/rel-side-sectors-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/rel-side-sectors.png +0 -0
- package/docs/recipes/oscar64/screenshots/relative-file-records-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/relative-file-records.png +0 -0
- package/docs/recipes/oscar64/screenshots/save-load-seq-file-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/save-load-seq-file.png +0 -0
- package/docs/recipes/oscar64/screenshots/seeded-level-fill-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/seeded-level-fill.png +0 -0
- package/docs/recipes/oscar64/screenshots/sfx-engine-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/sfx-engine.png +0 -0
- package/docs/recipes/oscar64/screenshots/sid-music-player.png +0 -0
- package/docs/recipes/oscar64/screenshots/simple-shmup.png +0 -0
- package/docs/recipes/oscar64/screenshots/slope-collision-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/slope-collision.png +0 -0
- package/docs/recipes/oscar64/screenshots/soft-scroll-h.png +0 -0
- package/docs/recipes/oscar64/screenshots/sprite-animation-table-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/sprite-animation-table.png +0 -0
- package/docs/recipes/oscar64/screenshots/sprite-multiplex-8.png +0 -0
- package/docs/recipes/oscar64/screenshots/stable-raster-irq.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-input-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-input.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-overlay-playfield-gameover.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-overlay-playfield-notrail-control.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-overlay-playfield-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-overlay-playfield-ungated-control.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-overlay-playfield.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-window-menu-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/text-window-menu.png +0 -0
- package/docs/recipes/oscar64/screenshots/tile-grid-collision-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/tile-grid-collision.png +0 -0
- package/docs/recipes/oscar64/screenshots/tile-map-render-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/tile-map-render.png +0 -0
- package/docs/recipes/oscar64/screenshots/two-player-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/two-player.png +0 -0
- package/docs/recipes/oscar64/screenshots/two-word-parser-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/two-word-parser.png +0 -0
- package/docs/recipes/oscar64/screenshots/vehicle-control-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/vehicle-control.png +0 -0
- package/docs/recipes/oscar64/screenshots/wave-director-ntsc.png +0 -0
- package/docs/recipes/oscar64/screenshots/wave-director.png +0 -0
- package/docs/recipes/oscar64/seeded-level-fill.md +364 -0
- package/docs/recipes/oscar64/sfx-engine.md +514 -0
- package/docs/recipes/oscar64/sid-music-player.md +441 -0
- package/docs/recipes/oscar64/simple-shmup.md +1000 -0
- package/docs/recipes/oscar64/slope-collision.md +610 -0
- package/docs/recipes/oscar64/soft-scroll-h.md +261 -0
- package/docs/recipes/oscar64/sprite-animation-table.md +671 -0
- package/docs/recipes/oscar64/sprite-multiplex-8.md +314 -0
- package/docs/recipes/oscar64/stable-raster-irq.md +236 -0
- package/docs/recipes/oscar64/text-input.md +274 -0
- package/docs/recipes/oscar64/text-overlay-playfield.md +617 -0
- package/docs/recipes/oscar64/text-window-menu.md +551 -0
- package/docs/recipes/oscar64/tile-grid-collision.md +563 -0
- package/docs/recipes/oscar64/tile-map-render.md +395 -0
- package/docs/recipes/oscar64/two-player.md +528 -0
- package/docs/recipes/oscar64/two-word-parser.md +510 -0
- package/docs/recipes/oscar64/vehicle-control.md +771 -0
- package/docs/recipes/oscar64/wave-director.md +787 -0
- package/docs/recipes/runs.json +1606 -0
- package/docs/runtime/sim6502-reference.md +466 -0
- package/docs/runtime/vice-mcp-reference.md +351 -0
- package/docs/runtime/vice-reference.md +1393 -0
- package/docs/techniques/bitmap-modes.md +685 -0
- package/docs/techniques/cpu-cycle-tricks.md +1570 -0
- package/docs/techniques/effects-vector-3d.md +1431 -0
- package/docs/techniques/file-io.md +1427 -0
- package/docs/techniques/input.md +1072 -0
- package/docs/techniques/loaders-packers.md +768 -0
- package/docs/techniques/logic.md +3091 -0
- package/docs/techniques/maths.md +1524 -0
- package/docs/techniques/memory-banking.md +1686 -0
- package/docs/techniques/music-sid.md +1144 -0
- package/docs/techniques/raster.md +1543 -0
- package/docs/techniques/scroll.md +1292 -0
- package/docs/techniques/sprite.md +2566 -0
- package/docs/techniques/text-mode-render.md +717 -0
- package/docs/techniques/text.md +1095 -0
- package/docs/techniques/transitions.md +405 -0
- package/docs/toolchains/cartconv-reference.md +262 -0
- package/docs/toolchains/cc1541-reference.md +316 -0
- package/docs/toolchains/cc65-reference.md +667 -0
- package/docs/toolchains/error-sources/cc65/README.md +1 -0
- package/docs/toolchains/error-sources/cc65/missing-setcpu.s +4 -0
- package/docs/toolchains/error-sources/cc65/range-error.s +4 -0
- package/docs/toolchains/error-sources/cc65/segment-overflow.c +6 -0
- package/docs/toolchains/error-sources/cc65/unresolved-external.c +6 -0
- package/docs/toolchains/error-sources/kickassembler/README.md +1 -0
- package/docs/toolchains/error-sources/kickassembler/branch-out-of-range.asm +4 -0
- package/docs/toolchains/error-sources/kickassembler/failed-assert.asm +3 -0
- package/docs/toolchains/error-sources/kickassembler/flat-lib.asm +4 -0
- package/docs/toolchains/error-sources/kickassembler/import-source-no-namespace.asm +5 -0
- package/docs/toolchains/error-sources/kickassembler/macro-without-parentheses.asm +6 -0
- package/docs/toolchains/error-sources/kickassembler/memory-block-overlap.asm +4 -0
- package/docs/toolchains/error-sources/kickassembler/symbol-clash-lib.asm +5 -0
- package/docs/toolchains/error-sources/kickassembler/symbol-clash-main.asm +6 -0
- package/docs/toolchains/error-sources/kickassembler/unknown-symbol.asm +4 -0
- package/docs/toolchains/error-sources/oscar64/README.md +1 -0
- package/docs/toolchains/error-sources/oscar64/asm-addressing-mode.c +7 -0
- package/docs/toolchains/error-sources/oscar64/region-overflow.c +6 -0
- package/docs/toolchains/error-sources/oscar64/undefined-extern-var.c +5 -0
- package/docs/toolchains/error-sources/oscar64/undefined-extern.c +6 -0
- package/docs/toolchains/error-sources/oscar64/unknown-vic-field.c +6 -0
- package/docs/toolchains/error-sources/oscar64/void-main.c +3 -0
- package/docs/toolchains/kickassembler-reference.md +1020 -0
- package/docs/toolchains/memory-layout-planning.md +362 -0
- package/docs/toolchains/oscar64-headers-reference.md +583 -0
- package/docs/toolchains/oscar64-reference.md +892 -0
- package/docs/toolchains/petcat-reference.md +290 -0
- package/docs/toolchains/png2prg.md +188 -0
- package/docs/toolchains/release-disk.md +314 -0
- package/docs/toolchains/sidreloc.md +236 -0
- package/docs/toolchains/spindle-reference.md +487 -0
- package/docs/toolchains/tape-mastering.md +592 -0
- package/docs/toolchains/unit-testing-6502.md +281 -0
- package/docs/workflow/agent-harness.md +478 -0
- package/package.json +105 -0
- package/templates/_harness/CLAUDE.md.template +91 -0
- package/templates/_harness/PLAN.md.template +72 -0
- package/templates/_harness/check.py +442 -0
- package/templates/_harness/claude/settings.json +17 -0
- package/templates/_harness/gen-asm-header.py +96 -0
- package/templates/_harness/harness.mk +273 -0
- package/templates/_harness/hooks/plan-gate.py +185 -0
- package/templates/_harness/meter/frame_meter.asm +311 -0
- package/templates/_harness/meter/frame_meter.c +155 -0
- package/templates/_harness/meter/frame_meter.h +80 -0
- package/templates/_harness/zp-used.py +104 -0
- package/templates/action-puzzle/.claude/settings.json +17 -0
- package/templates/action-puzzle/.mcp.json +10 -0
- package/templates/action-puzzle/CLAUDE.md +120 -0
- package/templates/action-puzzle/Makefile +125 -0
- package/templates/action-puzzle/PLAN.md +388 -0
- package/templates/action-puzzle/README.md +240 -0
- package/templates/action-puzzle/expect.json +25 -0
- package/templates/action-puzzle/src/cave.c +280 -0
- package/templates/action-puzzle/src/cave.h +80 -0
- package/templates/action-puzzle/src/gen_autopilot.h +20 -0
- package/templates/action-puzzle/src/gen_caves.h +59 -0
- package/templates/action-puzzle/src/gen_notes.h +16 -0
- package/templates/action-puzzle/src/hiscore.c +152 -0
- package/templates/action-puzzle/src/hiscore.h +41 -0
- package/templates/action-puzzle/src/level.c +64 -0
- package/templates/action-puzzle/src/level.h +24 -0
- package/templates/action-puzzle/src/main.c +599 -0
- package/templates/action-puzzle/src/render.c +239 -0
- package/templates/action-puzzle/src/render.h +31 -0
- package/templates/action-puzzle/src/sound.c +158 -0
- package/templates/action-puzzle/src/sound.h +22 -0
- package/templates/action-puzzle/tools/disk_check.py +77 -0
- package/templates/action-puzzle/tools/drive.py +106 -0
- package/templates/action-puzzle/tools/gen.py +454 -0
- package/templates/action-puzzle/tools/model_check.py +49 -0
- package/templates/action-puzzle/tools/verdict_codes.py +24 -0
- package/templates/adventure/.claude/settings.json +17 -0
- package/templates/adventure/.mcp.json +10 -0
- package/templates/adventure/CLAUDE.md +118 -0
- package/templates/adventure/Makefile +113 -0
- package/templates/adventure/PLAN.md +396 -0
- package/templates/adventure/README.md +277 -0
- package/templates/adventure/expect.json +25 -0
- package/templates/adventure/src/engine.c +543 -0
- package/templates/adventure/src/engine.h +48 -0
- package/templates/adventure/src/gen_script.h +141 -0
- package/templates/adventure/src/gen_world.h +511 -0
- package/templates/adventure/src/main.c +439 -0
- package/templates/adventure/src/picture.c +83 -0
- package/templates/adventure/src/picture.h +16 -0
- package/templates/adventure/src/save.c +159 -0
- package/templates/adventure/src/save.h +25 -0
- package/templates/adventure/src/sound.c +71 -0
- package/templates/adventure/src/sound.h +16 -0
- package/templates/adventure/src/text.c +349 -0
- package/templates/adventure/src/text.h +40 -0
- package/templates/adventure/tools/disk_check.py +128 -0
- package/templates/adventure/tools/drive.py +119 -0
- package/templates/adventure/tools/gen.py +1033 -0
- package/templates/adventure/tools/world.py +356 -0
- package/templates/beat-em-up/.claude/settings.json +17 -0
- package/templates/beat-em-up/.mcp.json +10 -0
- package/templates/beat-em-up/CLAUDE.md +136 -0
- package/templates/beat-em-up/Makefile +96 -0
- package/templates/beat-em-up/PLAN.md +502 -0
- package/templates/beat-em-up/README.md +315 -0
- package/templates/beat-em-up/expect-gameover.json +8 -0
- package/templates/beat-em-up/expect.json +29 -0
- package/templates/beat-em-up/src/anim.c +70 -0
- package/templates/beat-em-up/src/art.c +344 -0
- package/templates/beat-em-up/src/autopilot.h +154 -0
- package/templates/beat-em-up/src/brute.c +273 -0
- package/templates/beat-em-up/src/enemy.c +281 -0
- package/templates/beat-em-up/src/engine.asm +512 -0
- package/templates/beat-em-up/src/fighter.c +384 -0
- package/templates/beat-em-up/src/game.h +269 -0
- package/templates/beat-em-up/src/hud.c +135 -0
- package/templates/beat-em-up/src/main.c +341 -0
- package/templates/beat-em-up/src/sound.c +44 -0
- package/templates/beat-em-up/src/street.c +93 -0
- package/templates/beat-em-up/src/verdict.h +523 -0
- package/templates/beat-em-up/src/view.c +362 -0
- package/templates/beat-em-up/tools/drive.py +105 -0
- package/templates/beat-em-up/tools/flickercheck.py +273 -0
- package/templates/demo/.claude/settings.json +17 -0
- package/templates/demo/.mcp.json +10 -0
- package/templates/demo/CLAUDE.md +129 -0
- package/templates/demo/Makefile +66 -0
- package/templates/demo/PLAN.md +401 -0
- package/templates/demo/README.md +322 -0
- package/templates/demo/expect.json +945 -0
- package/templates/demo/src/config.asm +80 -0
- package/templates/demo/src/framework.asm +390 -0
- package/templates/demo/src/main.asm +139 -0
- package/templates/demo/src/music.asm +197 -0
- package/templates/demo/src/part_main.asm +279 -0
- package/templates/demo/src/part_title.asm +79 -0
- package/templates/demo/src/parts.asm +43 -0
- package/templates/demo/src/tables.asm +73 -0
- package/templates/demo/src/verdict.asm +179 -0
- package/templates/demo/tools/audio.py +80 -0
- package/templates/demo/tools/gen_expect.py +167 -0
- package/templates/demo/tools/probe.py +95 -0
- package/templates/hello/.claude/settings.json +17 -0
- package/templates/hello/.mcp.json +10 -0
- package/templates/hello/CLAUDE.md +100 -0
- package/templates/hello/Makefile +38 -0
- package/templates/hello/PLAN.md +200 -0
- package/templates/hello/expect.json +20 -0
- package/templates/hello/src/main.c +161 -0
- package/templates/hello/src/sprite.asm +27 -0
- package/templates/hello-kick/.claude/settings.json +17 -0
- package/templates/hello-kick/.mcp.json +10 -0
- package/templates/hello-kick/CLAUDE.md +100 -0
- package/templates/hello-kick/Makefile +17 -0
- package/templates/hello-kick/PLAN.md +199 -0
- package/templates/hello-kick/expect.json +20 -0
- package/templates/hello-kick/src/main.asm +233 -0
- package/templates/platformer/.claude/settings.json +17 -0
- package/templates/platformer/.mcp.json +10 -0
- package/templates/platformer/CLAUDE.md +125 -0
- package/templates/platformer/Makefile +86 -0
- package/templates/platformer/PLAN.md +360 -0
- package/templates/platformer/README.md +277 -0
- package/templates/platformer/expect.json +32 -0
- package/templates/platformer/src/actors.c +289 -0
- package/templates/platformer/src/anim.c +51 -0
- package/templates/platformer/src/art.c +212 -0
- package/templates/platformer/src/autopilot.h +30 -0
- package/templates/platformer/src/engine.asm +253 -0
- package/templates/platformer/src/game.h +248 -0
- package/templates/platformer/src/hud.c +90 -0
- package/templates/platformer/src/level.c +184 -0
- package/templates/platformer/src/main.c +306 -0
- package/templates/platformer/src/player.c +268 -0
- package/templates/platformer/src/sound.c +42 -0
- package/templates/platformer/src/verdict.h +206 -0
- package/templates/platformer/src/view.c +331 -0
- package/templates/platformer/stage-expect.json +6 -0
- package/templates/platformer/tools/drive.py +112 -0
- package/templates/platformer/tools/tearcheck.py +229 -0
- package/templates/shmup-vertical/.claude/settings.json +17 -0
- package/templates/shmup-vertical/.mcp.json +10 -0
- package/templates/shmup-vertical/CLAUDE.md +137 -0
- package/templates/shmup-vertical/Makefile +131 -0
- package/templates/shmup-vertical/PLAN.md +569 -0
- package/templates/shmup-vertical/README.md +189 -0
- package/templates/shmup-vertical/expect.json +38 -0
- package/templates/shmup-vertical/src/bullets.c +158 -0
- package/templates/shmup-vertical/src/bullets.h +35 -0
- package/templates/shmup-vertical/src/display.c +239 -0
- package/templates/shmup-vertical/src/display.h +40 -0
- package/templates/shmup-vertical/src/game.h +85 -0
- package/templates/shmup-vertical/src/glyph.asm +358 -0
- package/templates/shmup-vertical/src/hiscore.c +141 -0
- package/templates/shmup-vertical/src/hiscore.h +16 -0
- package/templates/shmup-vertical/src/hit.asm +180 -0
- package/templates/shmup-vertical/src/hitbox.c +59 -0
- package/templates/shmup-vertical/src/hitbox.h +25 -0
- package/templates/shmup-vertical/src/kernel.asm +330 -0
- package/templates/shmup-vertical/src/level.c +174 -0
- package/templates/shmup-vertical/src/level.h +27 -0
- package/templates/shmup-vertical/src/main.c +824 -0
- package/templates/shmup-vertical/src/mux.asm +321 -0
- package/templates/shmup-vertical/src/sound.asm +255 -0
- package/templates/shmup-vertical/src/step.asm +169 -0
- package/templates/shmup-vertical/src/waves.c +195 -0
- package/templates/shmup-vertical/src/waves.h +33 -0
- package/templates/shmup-vertical/stage-expect.json +6 -0
- package/templates/shmup-vertical/tools/drive.py +152 -0
- package/templates/shmup-vertical/tools/joytest.py +159 -0
- package/templates/shmup-vertical/tools/meter.py +15 -0
- package/templates/shmup-vertical/tools/phases.py +73 -0
|
@@ -0,0 +1,2112 @@
|
|
|
1
|
+
---
|
|
2
|
+
chip: 6510
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 6510 CPU Reference
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
The MOS 6510 is the CPU of the Commodore 64. It is binary-compatible with the
|
|
10
|
+
MOS 6502 — same instruction set, same cycle counts, same addressing modes,
|
|
11
|
+
same bus protocol, same interrupt behavior — with one Commodore-specific
|
|
12
|
+
addition: a built-in six-bit I/O port mapped into the lowest two bytes of the
|
|
13
|
+
CPU's address space at $00 (data direction) and $01 (data). That port drives
|
|
14
|
+
the C64's bank-switching logic and the cassette motor / sense lines. Apart
|
|
15
|
+
from those two addresses the 6510 looks and behaves exactly like a 6502 to
|
|
16
|
+
software.
|
|
17
|
+
|
|
18
|
+
For the assembly programmer the practical consequences are:
|
|
19
|
+
|
|
20
|
+
- All 151 official 6502 opcodes work unchanged.
|
|
21
|
+
- The ~30 documented "illegal" / unofficial opcodes behave exactly as on
|
|
22
|
+
any NMOS 6502: the stable majority identically across 6502/6510/8500,
|
|
23
|
+
and the small unstable group (XAA/ANE, LAX #imm and the AHX/SHX/SHY/TAS
|
|
24
|
+
family) varying per chip on the 6510 just as on the 6502. They are
|
|
25
|
+
documented, with per-opcode stability ratings, in
|
|
26
|
+
[6502-illegal-opcodes.md](6502-illegal-opcodes.md).
|
|
27
|
+
- The classic 6502 errata are all present: the JMP indirect page-wrap bug,
|
|
28
|
+
the BRK 2-byte signature, the undefined decimal flag at reset, the
|
|
29
|
+
invalid N/V/Z flags after ADC/SBC in decimal mode (C is correct; an
|
|
30
|
+
earlier version of this bullet named a "lack of carry-propagation" in
|
|
31
|
+
decimal mode, which is not a real erratum — measured in VICE,
|
|
32
|
+
SED / CLC / LDA #$99 / ADC #$01 gives A=$00 with C=1, see
|
|
33
|
+
[BCD mode](#bcd-mode)), and so on.
|
|
34
|
+
- Reading address $00 returns the data-direction register; reading $01
|
|
35
|
+
returns the value at the port pins, AND-ed with the direction mask in a
|
|
36
|
+
way that depends on which lines are configured as outputs vs inputs.
|
|
37
|
+
- The CPU runs at one of two slightly different clock rates depending on
|
|
38
|
+
region: 0.985 MHz on PAL machines (985248 Hz) and 1.022 MHz on NTSC
|
|
39
|
+
machines (1022727 Hz). All instruction cycle counts in this document are
|
|
40
|
+
CPU cycles; convert to wall-clock time using the regional clock.
|
|
41
|
+
|
|
42
|
+
This document covers the 6510's programmer-visible model: registers, status
|
|
43
|
+
flags, addressing modes, stack mechanics, interrupt vectors, page-crossing
|
|
44
|
+
penalties, the I/O port at $00/$01, and a per-opcode reference for every
|
|
45
|
+
legal instruction. Illegal/undocumented opcodes are in a companion document.
|
|
46
|
+
|
|
47
|
+
### 6510 vs 6502 — the differences
|
|
48
|
+
|
|
49
|
+
| Item | 6502 | 6510 |
|
|
50
|
+
|------|------|------|
|
|
51
|
+
| Instruction set | 56 mnemonics, 151 opcodes | identical |
|
|
52
|
+
| Illegal opcodes | NMOS behaviour: most stable, a handful unstable per chip | identical — same NMOS core, same stable set, same unstable set |
|
|
53
|
+
| Address space | full 64 KB visible | full 64 KB visible (banked via $01) |
|
|
54
|
+
| Built-in I/O port | none | 6-bit port at $00 (DDR) / $01 (data) |
|
|
55
|
+
| Clock | external | external, divided from VIC dot clock |
|
|
56
|
+
| BCD mode | works | works |
|
|
57
|
+
| Reset behavior | I=1, D undefined | I=1, D undefined (KERNAL clears D) |
|
|
58
|
+
|
|
59
|
+
In practical terms: a 6502 disassembler reads 6510 code without modification,
|
|
60
|
+
a 6502 cycle-counter is accurate on a 6510, and a 6502 assembler emits valid
|
|
61
|
+
6510 code. The only place 6510-specific behavior shows up is when code reads
|
|
62
|
+
or writes addresses $00 or $01.
|
|
63
|
+
|
|
64
|
+
### What this document is for
|
|
65
|
+
|
|
66
|
+
- Looking up the encoding, cycles, flag effects, and page-cross penalty of
|
|
67
|
+
any legal opcode.
|
|
68
|
+
- Understanding the addressing modes well enough to read and write 6510
|
|
69
|
+
assembly fluently.
|
|
70
|
+
- Understanding the interrupt model (IRQ, NMI, BRK, RESET) and the layout
|
|
71
|
+
of stack frames each one pushes.
|
|
72
|
+
- Understanding the 6510-specific I/O port and how it controls C64 banking.
|
|
73
|
+
- Avoiding the classic 6502 pitfalls (JMP indirect, BRK is 2 bytes, decimal
|
|
74
|
+
mode tricks).
|
|
75
|
+
|
|
76
|
+
For complete C64 memory layout including ROM/RAM banking driven by $01, see
|
|
77
|
+
[c64-memory-map.md](c64-memory-map.md). For the illegal opcodes, see
|
|
78
|
+
[6502-illegal-opcodes.md](6502-illegal-opcodes.md).
|
|
79
|
+
|
|
80
|
+
## Registers
|
|
81
|
+
|
|
82
|
+
The 6510 has a deliberately small register file. There are three 8-bit
|
|
83
|
+
general-purpose registers, an 8-bit stack pointer, a 16-bit program counter,
|
|
84
|
+
and an 8-bit status register. That is the entire programmer-visible state.
|
|
85
|
+
|
|
86
|
+
### A — Accumulator
|
|
87
|
+
|
|
88
|
+
The 8-bit accumulator is the primary arithmetic and logic register. All
|
|
89
|
+
ADC, SBC, AND, ORA, EOR, ASL, LSR, ROL, ROR, BIT, CMP, LDA, STA, and the
|
|
90
|
+
transfer instructions involving A (TAX, TAY, TXA, TYA) operate on or
|
|
91
|
+
through it. The accumulator can be pushed and pulled from the stack with
|
|
92
|
+
PHA/PLA. Most arithmetic results land here.
|
|
93
|
+
|
|
94
|
+
### X — Index Register X
|
|
95
|
+
|
|
96
|
+
An 8-bit index register. It can be used as a loop counter (INX/DEX/CPX),
|
|
97
|
+
as a stack pointer for relocatable stack frames (TXS, TSX), and as the
|
|
98
|
+
offset in zero-page,X / absolute,X / (zp,X) addressing modes. Unlike the
|
|
99
|
+
accumulator, X cannot be pushed/pulled directly on the stack; you transfer
|
|
100
|
+
via A (TXA/PHA, PLA/TAX) or use TXS to dump X into the SP register.
|
|
101
|
+
|
|
102
|
+
### Y — Index Register Y
|
|
103
|
+
|
|
104
|
+
An 8-bit index register similar to X but with a different addressing-mode
|
|
105
|
+
footprint. Y is used in zero-page,Y (only LDX/STX), absolute,Y, and
|
|
106
|
+
(zp),Y addressing. The (zp),Y mode (indirect indexed) is the most common
|
|
107
|
+
way to dereference a 16-bit pointer in zero page — Y is the index added
|
|
108
|
+
*after* the indirection.
|
|
109
|
+
|
|
110
|
+
Critically: X is used for *pre-indexed* indirect addressing `(zp,X)` and
|
|
111
|
+
Y is used for *post-indexed* indirect addressing `(zp),Y`. The two modes
|
|
112
|
+
have very different semantics; see [Addressing modes](#addressing-modes).
|
|
113
|
+
|
|
114
|
+
### SP — Stack Pointer
|
|
115
|
+
|
|
116
|
+
An 8-bit register that always points to the *next free byte* on the stack.
|
|
117
|
+
The stack lives at $0100–$01FF, so the effective stack address is
|
|
118
|
+
$01 || SP. SP decrements on push and increments on pull. Both operations
|
|
119
|
+
happen *before* the value is written / *after* the value is read, which
|
|
120
|
+
gives the "next-free-byte" semantics.
|
|
121
|
+
|
|
122
|
+
Initial value at reset: 6502 hardware does not initialize SP. The C64
|
|
123
|
+
KERNAL reset routine sets SP to $FF, giving an empty stack at $01FF
|
|
124
|
+
working downward. Code that runs at startup can rely on this; code that
|
|
125
|
+
takes over from the KERNAL should set its own SP via LDX #$FF / TXS.
|
|
126
|
+
|
|
127
|
+
### PC — Program Counter
|
|
128
|
+
|
|
129
|
+
A 16-bit register holding the address of the next instruction byte to
|
|
130
|
+
fetch. It increments through instruction fetches; JMP, JSR, RTS, RTI,
|
|
131
|
+
branches, BRK, and interrupts all modify it explicitly. PC cannot be
|
|
132
|
+
read or written directly by software; it is observed only via the
|
|
133
|
+
addresses pushed on the stack by JSR/BRK/IRQ/NMI.
|
|
134
|
+
|
|
135
|
+
The PC pushed for JSR points to the *last byte of the JSR instruction*,
|
|
136
|
+
not the next instruction. RTS therefore pulls and adds 1. This becomes
|
|
137
|
+
relevant when constructing fake return addresses on the stack.
|
|
138
|
+
|
|
139
|
+
### P — Processor Status Register
|
|
140
|
+
|
|
141
|
+
An 8-bit register containing six independent flags. Bit layout:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
7 6 5 4 3 2 1 0
|
|
145
|
+
N V - B D I Z C
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| Bit | Symbol | Name | Set when |
|
|
149
|
+
|-----|--------|------|----------|
|
|
150
|
+
| 7 | N | Negative | Result MSB is 1 (treating the byte as signed) |
|
|
151
|
+
| 6 | V | Overflow | Signed overflow in ADC/SBC, or bit 6 of BIT operand |
|
|
152
|
+
| 5 | - | (unused) | Always 1 when pushed; physically not a flip-flop |
|
|
153
|
+
| 4 | B | Break | Set in pushed status if the push was from BRK or PHP |
|
|
154
|
+
| 3 | D | Decimal | ADC/SBC use BCD arithmetic |
|
|
155
|
+
| 2 | I | Interrupt disable | IRQ line is ignored when set |
|
|
156
|
+
| 1 | Z | Zero | Result was zero |
|
|
157
|
+
| 0 | C | Carry | Unsigned carry-out or borrow-not from ADC/SBC; shift bit |
|
|
158
|
+
|
|
159
|
+
See [Status flags + BCD mode](#status-flags--bcd-mode) for full semantics
|
|
160
|
+
including how each instruction modifies each flag.
|
|
161
|
+
|
|
162
|
+
## Addressing modes
|
|
163
|
+
|
|
164
|
+
The 6510 has 13 addressing modes. Operand length, cycle count, and which
|
|
165
|
+
opcodes encode in which mode are determined entirely by the mode. The
|
|
166
|
+
mnemonics in this section follow the syntax used in most modern 6502/6510
|
|
167
|
+
assemblers (cc65, kickass, dasm, acme): `#$xx` for immediate, `$xxxx,X`
|
|
168
|
+
for absolute,X, and so on.
|
|
169
|
+
|
|
170
|
+
### Implied
|
|
171
|
+
|
|
172
|
+
No operand. The instruction byte itself encodes the entire operation.
|
|
173
|
+
Examples: NOP, CLC, SEI, INX, RTS. One byte total.
|
|
174
|
+
|
|
175
|
+
### Accumulator
|
|
176
|
+
|
|
177
|
+
Operates on A directly. Encoded the same way as implied — no operand
|
|
178
|
+
byte. Most assemblers write this as `LSR A` or just `LSR`. Examples:
|
|
179
|
+
ASL A, LSR A, ROL A, ROR A. One byte total.
|
|
180
|
+
|
|
181
|
+
### Immediate — `#$xx`
|
|
182
|
+
|
|
183
|
+
The operand byte *is* the value. Two bytes total: opcode + immediate
|
|
184
|
+
value. Example: `LDA #$10` loads the literal value $10 into A. Cycles:
|
|
185
|
+
always 2 for register loads, 2 for ADC/SBC/AND/ORA/EOR/CMP/CPX/CPY.
|
|
186
|
+
|
|
187
|
+
### Zero page — `$xx`
|
|
188
|
+
|
|
189
|
+
The operand byte is the low byte of a zero-page address; the high byte
|
|
190
|
+
is implicitly $00. Two bytes total. Faster than absolute (saves one
|
|
191
|
+
cycle) because the CPU does not need to fetch a separate high byte.
|
|
192
|
+
Example: `LDA $80` loads from address $0080.
|
|
193
|
+
|
|
194
|
+
Zero page is the most precious resource on the 6510 — fast access and the
|
|
195
|
+
only location where indirect addressing modes can dereference pointers.
|
|
196
|
+
On the C64, BASIC's workspace occupies most of $02–$8F and the KERNAL's
|
|
197
|
+
most of $90–$FA ($00–$01 are the 6510 port, $FF is BASIC's
|
|
198
|
+
number-formatting scratch). With BASIC running, the only bytes both
|
|
199
|
+
leave alone are $02 and $FB–$FE — not "$02–$07", as an earlier version
|
|
200
|
+
of this paragraph said. $03–$06 hold the float↔integer conversion
|
|
201
|
+
vectors that BASIC's cold start installs ($B1AA at $03/$04, $B391 at
|
|
202
|
+
$05/$06, stored at $E3D4–$E3DE); BASIC never calls through them itself,
|
|
203
|
+
so they are usable only if nothing else on the machine relies on them.
|
|
204
|
+
$07–$08 are live BASIC temporaries — string literals, DATA/READ, GOTO
|
|
205
|
+
line numbers, AND/OR and INT all write them — and are not free while
|
|
206
|
+
BASIC runs. Much more is usable once BASIC is not in use. See
|
|
207
|
+
[c64-memory-map.md](c64-memory-map.md).
|
|
208
|
+
|
|
209
|
+
### Zero page,X — `$xx,X`
|
|
210
|
+
|
|
211
|
+
Operand byte plus X gives the effective zero-page address, *modulo 256*
|
|
212
|
+
(the address wraps within zero page; it never crosses into $0100). Two
|
|
213
|
+
bytes total. Adds 1 cycle over plain zero-page to perform the addition.
|
|
214
|
+
Example: `LDA $80,X` with X=$04 reads from $0084. With X=$F0 it reads
|
|
215
|
+
from `($80 + $F0) & $FF` = $70.
|
|
216
|
+
|
|
217
|
+
The wrap is a frequent source of bugs in code that walks a table near
|
|
218
|
+
the top of zero page: the index runs off the top and back to the bottom
|
|
219
|
+
of zero page rather than into $0100.
|
|
220
|
+
|
|
221
|
+
### Zero page,Y — `$xx,Y`
|
|
222
|
+
|
|
223
|
+
Same as zero page,X but using Y. Only available for `LDX $xx,Y` and
|
|
224
|
+
`STX $xx,Y`. There is no `LDA $xx,Y` — you must use absolute,Y or
|
|
225
|
+
copy Y into X first.
|
|
226
|
+
|
|
227
|
+
### Absolute — `$xxxx`
|
|
228
|
+
|
|
229
|
+
Three bytes total: opcode + low byte + high byte. The effective address
|
|
230
|
+
is the full 16-bit operand. Example: `LDA $1234` reads from address
|
|
231
|
+
$1234. No page-cross consideration because the address is fully fixed.
|
|
232
|
+
|
|
233
|
+
### Absolute,X — `$xxxx,X`
|
|
234
|
+
|
|
235
|
+
Three bytes total. Effective address = `$xxxx + X`. If the addition
|
|
236
|
+
crosses a page boundary (i.e. the high byte of the sum differs from the
|
|
237
|
+
high byte of the base), read operations pay a +1 cycle penalty. Write
|
|
238
|
+
operations always pay the penalty (a "dummy read" is performed at the
|
|
239
|
+
unfixed address, then a real write to the corrected address) so STA
|
|
240
|
+
absolute,X is always 5 cycles, never 4.
|
|
241
|
+
|
|
242
|
+
### Absolute,Y — `$xxxx,Y`
|
|
243
|
+
|
|
244
|
+
Same as absolute,X but using Y. Same +1 page-cross penalty for reads,
|
|
245
|
+
same always-pay-the-penalty rule for writes.
|
|
246
|
+
|
|
247
|
+
### Indirect — `($xxxx)`
|
|
248
|
+
|
|
249
|
+
Only used by JMP. Three bytes total. The effective address is the
|
|
250
|
+
16-bit value stored at $xxxx (low byte) and $xxxx+1 (high byte). Cycles:
|
|
251
|
+
5. **Known bug:** if the low byte of the operand is $FF, the high byte
|
|
252
|
+
of the pointer is fetched from $xx00, not $xx00+$100. So
|
|
253
|
+
`JMP ($10FF)` fetches the low byte from $10FF and the high byte from
|
|
254
|
+
$1000 (not $1100). This is a 6502 silicon bug; the 6510 inherits it.
|
|
255
|
+
See [Pitfalls](#pitfalls).
|
|
256
|
+
|
|
257
|
+
### Indexed indirect — `($xx,X)` ("pre-indexed")
|
|
258
|
+
|
|
259
|
+
Two bytes total. Add X to the operand byte (modulo 256, no carry into
|
|
260
|
+
the high byte), then fetch a two-byte little-endian pointer from
|
|
261
|
+
zero page starting at that address. The effective address is what that
|
|
262
|
+
pointer holds. Cycles: 6.
|
|
263
|
+
|
|
264
|
+
Useful for jump tables and small dispatch trees in zero page where X
|
|
265
|
+
selects which entry. Far less common than `(zp),Y`.
|
|
266
|
+
|
|
267
|
+
### Indirect indexed — `($xx),Y` ("post-indexed")
|
|
268
|
+
|
|
269
|
+
Two bytes total. Fetch a two-byte little-endian pointer from
|
|
270
|
+
`$00xx` and `$00xx+1` (with the high byte address wrapping inside zero
|
|
271
|
+
page if `$xx`=$FF), then add Y to that pointer to form the effective
|
|
272
|
+
address. Cycles: 5 plus 1 if adding Y crosses a page boundary. Writes
|
|
273
|
+
always pay the penalty (always 6 cycles for STA ($zp),Y).
|
|
274
|
+
|
|
275
|
+
The bread-and-butter pointer-dereference mode. Every "for each byte in
|
|
276
|
+
this string / buffer" loop on the C64 uses it.
|
|
277
|
+
|
|
278
|
+
### Relative — `$xx` (branches)
|
|
279
|
+
|
|
280
|
+
Two bytes total: opcode + signed 8-bit displacement. The displacement
|
|
281
|
+
is added to the PC *after* the branch instruction has been fetched
|
|
282
|
+
(i.e. PC points to the next instruction). Range: −128 to +127 bytes
|
|
283
|
+
from the byte following the branch. Cycles: 2 if not taken, 3 if
|
|
284
|
+
taken, 4 if taken and the target is on a different page.
|
|
285
|
+
|
|
286
|
+
All conditional branches (BCC, BCS, BEQ, BMI, BNE, BPL, BVC, BVS) use
|
|
287
|
+
this mode. There is no unconditional relative branch on the 6510;
|
|
288
|
+
`JMP abs` is the substitute (3 cycles, 3 bytes).
|
|
289
|
+
|
|
290
|
+
## Stack mechanics
|
|
291
|
+
|
|
292
|
+
The stack is a 256-byte region at $0100–$01FF. It is *not* relocatable
|
|
293
|
+
(the high byte is hardwired to $01). The 8-bit SP register holds the
|
|
294
|
+
low byte and always points to the next free byte. Operations:
|
|
295
|
+
|
|
296
|
+
| Op | What it does | Cycles |
|
|
297
|
+
|----|--------------|--------|
|
|
298
|
+
| PHA | Store A at $0100+SP, then SP = SP − 1 | 3 |
|
|
299
|
+
| PHP | Store P (with B=1, bit-5=1) at $0100+SP, then SP = SP − 1 | 3 |
|
|
300
|
+
| PLA | SP = SP + 1, then A = byte at $0100+SP | 4 |
|
|
301
|
+
| PLP | SP = SP + 1, then P = byte at $0100+SP (bits B and unused are ignored on pull) | 4 |
|
|
302
|
+
| JSR | Push (PC + 2) high, push (PC + 2) low, jump to operand | 6 |
|
|
303
|
+
| RTS | Pull low, pull high, PC = (pulled) + 1 | 6 |
|
|
304
|
+
| BRK | Push (PC + 2) high, push (PC + 2) low, push P with B=1, set I=1, load PC from $FFFE/$FFFF | 7 |
|
|
305
|
+
| IRQ | Push PC high, push PC low, push P with B=0, set I=1, load PC from $FFFE/$FFFF | 7 |
|
|
306
|
+
| NMI | Push PC high, push PC low, push P with B=0, set I=1, load PC from $FFFA/$FFFB | 7 |
|
|
307
|
+
| RTI | Pull P, pull low, pull high, PC = (pulled) — **no +1**, unlike RTS | 6 |
|
|
308
|
+
|
|
309
|
+
Notes on the JSR / RTS pairing:
|
|
310
|
+
|
|
311
|
+
- JSR pushes the address of *its last operand byte* — PC + 2 where PC
|
|
312
|
+
is the address of the JSR opcode, which is one less than the address
|
|
313
|
+
of the next instruction (an earlier version of this note said
|
|
314
|
+
"(PC + 2) minus one", using PC in a different sense from the table
|
|
315
|
+
above). RTS pulls that and adds 1, landing on the correct next
|
|
316
|
+
instruction. This means you can JSR to a location whose return path
|
|
317
|
+
is constructed by hand on the stack — push (target − 1) and execute
|
|
318
|
+
RTS to "jump" to `target`.
|
|
319
|
+
|
|
320
|
+
Notes on the B flag:
|
|
321
|
+
|
|
322
|
+
- The B flag is a software-only convention: there is no B flip-flop in
|
|
323
|
+
the silicon. When P is pushed, bit 4 of the pushed byte indicates
|
|
324
|
+
whether the push happened due to a software cause (BRK or PHP → B=1)
|
|
325
|
+
or a hardware cause (IRQ or NMI → B=0). The CPU's *live* P register
|
|
326
|
+
has no meaningful B bit; PLP and RTI ignore the B and unused bits
|
|
327
|
+
of the pulled byte.
|
|
328
|
+
- This is how a BRK handler distinguishes a BRK from an IRQ: both
|
|
329
|
+
vector through $FFFE/$FFFF, but only BRK pushes a P value with bit
|
|
330
|
+
4 set. The handler inspects the pushed P on the stack.
|
|
331
|
+
|
|
332
|
+
Notes on stack overflow:
|
|
333
|
+
|
|
334
|
+
- The 6502/6510 has no overflow detection. If SP wraps from $00 back
|
|
335
|
+
to $FF, the stack silently corrupts whatever was at the top of
|
|
336
|
+
$0100. Defensive code occasionally checks SP after deep nesting but
|
|
337
|
+
this is uncommon.
|
|
338
|
+
|
|
339
|
+
## Status flags + BCD mode
|
|
340
|
+
|
|
341
|
+
### Flag semantics
|
|
342
|
+
|
|
343
|
+
#### N — Negative
|
|
344
|
+
|
|
345
|
+
Set whenever the most significant bit of the most recent ALU result is
|
|
346
|
+
1. Loads, transfers, arithmetic, logical, increment, decrement, and
|
|
347
|
+
shifts all set N. CMP/CPX/CPY set N to bit 7 of the implied subtraction
|
|
348
|
+
(A/X/Y − operand), the same direction as the C rule below (C set if
|
|
349
|
+
register ≥ operand) and as the CMP entry in the instruction reference;
|
|
350
|
+
an earlier version of this sentence had the operands the other way
|
|
351
|
+
round (measured in VICE: LDA #$10 / CMP #$20 leaves N=1, C=0). Because
|
|
352
|
+
this is bit 7 of an 8-bit unsigned difference, N after CMP is not a
|
|
353
|
+
signed less-than test (e.g. A=$80 CMP #$01 gives N=0, C=1 although
|
|
354
|
+
−128 < +1): use C (BCS/BCC) for unsigned ≥/<, and for a signed compare
|
|
355
|
+
use SEC / SBC and test N XOR V (BVC/BVS then BMI/BPL) — CMP itself
|
|
356
|
+
never writes V.
|
|
357
|
+
|
|
358
|
+
BIT is the exception: BIT sets N to bit 7 of the *operand*, regardless
|
|
359
|
+
of A. This is the standard trick for reading the high bit of a memory
|
|
360
|
+
byte without disturbing A.
|
|
361
|
+
|
|
362
|
+
#### V — Overflow
|
|
363
|
+
|
|
364
|
+
Set when a signed ADC or SBC produced a result outside the range
|
|
365
|
+
−128..+127. Specifically, V is set when the sign of the result differs
|
|
366
|
+
from the sign of *both* operands.
|
|
367
|
+
|
|
368
|
+
BIT also writes V: BIT sets V to bit 6 of the operand.
|
|
369
|
+
|
|
370
|
+
Cleared by CLV. Set only by ADC, SBC, BIT, and PLP/RTI (which restore
|
|
371
|
+
it from the pushed status byte).
|
|
372
|
+
|
|
373
|
+
#### B — Break
|
|
374
|
+
|
|
375
|
+
Software-visible only in the pushed-status byte. See the stack-mechanics
|
|
376
|
+
section above. Not a hardware flip-flop.
|
|
377
|
+
|
|
378
|
+
#### D — Decimal
|
|
379
|
+
|
|
380
|
+
When set, ADC and SBC perform BCD (binary-coded-decimal) arithmetic on
|
|
381
|
+
their operands. See [BCD mode](#bcd-mode) below for details.
|
|
382
|
+
|
|
383
|
+
D is **undefined at power-on / reset** on a real 6502 — the silicon
|
|
384
|
+
makes no guarantee. The 6510 inherits this, and the C64 KERNAL reset
|
|
385
|
+
routine explicitly executes `CLD` before any ADC/SBC. Code that takes
|
|
386
|
+
over the reset vector and forgets to CLD can hit garbage arithmetic on
|
|
387
|
+
the first ADC after a cold boot.
|
|
388
|
+
|
|
389
|
+
#### I — Interrupt disable
|
|
390
|
+
|
|
391
|
+
When set, the IRQ pin is ignored. The NMI pin is *not* affected (NMI
|
|
392
|
+
is non-maskable). I is automatically set to 1 by BRK and by hardware
|
|
393
|
+
IRQ/NMI acknowledgment; it is the handler's responsibility to clear
|
|
394
|
+
it (via PLP / RTI / explicit CLI) when ready to accept further IRQs.
|
|
395
|
+
|
|
396
|
+
Cleared by CLI. Set by SEI.
|
|
397
|
+
|
|
398
|
+
#### Z — Zero
|
|
399
|
+
|
|
400
|
+
Set when the most recent ALU result was zero. Affected by essentially
|
|
401
|
+
all loads, transfers, arithmetic, logical, increment/decrement, and
|
|
402
|
+
shift instructions. BIT sets Z to whether `A AND operand` is zero.
|
|
403
|
+
|
|
404
|
+
CMP/CPX/CPY set Z when the operand equals the register (so BEQ after
|
|
405
|
+
a CMP means "equal").
|
|
406
|
+
|
|
407
|
+
#### C — Carry
|
|
408
|
+
|
|
409
|
+
Multiple meanings depending on instruction:
|
|
410
|
+
|
|
411
|
+
- ADC: C is the carry-in; after the operation, C holds the carry-out.
|
|
412
|
+
- SBC: C is the *inverted* borrow-in (you must SEC before the first
|
|
413
|
+
SBC to mean "no borrow"). After the operation C holds the
|
|
414
|
+
inverted borrow-out.
|
|
415
|
+
- CMP/CPX/CPY: C is set if register ≥ operand (unsigned).
|
|
416
|
+
- ASL/ROL: C receives the bit shifted *out of* bit 7.
|
|
417
|
+
- LSR/ROR: C receives the bit shifted *out of* bit 0.
|
|
418
|
+
- ROL/ROR: C also supplies the bit shifted *in* on the empty side.
|
|
419
|
+
|
|
420
|
+
Cleared by CLC. Set by SEC. Restored on PLP/RTI from the pushed byte.
|
|
421
|
+
|
|
422
|
+
### BCD mode
|
|
423
|
+
|
|
424
|
+
When D=1, ADC and SBC interpret their operands as packed BCD: the high
|
|
425
|
+
nibble is the tens digit, the low nibble is the units digit, both in
|
|
426
|
+
the range 0–9. The result is a packed BCD value.
|
|
427
|
+
|
|
428
|
+
Key behaviors and gotchas:
|
|
429
|
+
|
|
430
|
+
- N, V, and Z flags after a BCD ADC/SBC are **undefined** on the NMOS
|
|
431
|
+
6502/6510. Only C is reliable. (The 65C02 fixed this; the 6510 did
|
|
432
|
+
not.) Code that runs BCD arithmetic and then branches on N/V/Z is
|
|
433
|
+
buggy on 6510.
|
|
434
|
+
- A nibble outside 0–9 (i.e. $0A–$0F) as input produces a defined but
|
|
435
|
+
not-very-useful result. Avoid feeding hex digits to BCD ADC.
|
|
436
|
+
- BCD applies only to ADC and SBC. INC/DEC/INX/INY/DEX/DEY ignore D.
|
|
437
|
+
- CLD before regular arithmetic; SED only when entering a BCD block;
|
|
438
|
+
always CLD before returning to caller code that may not expect D=1.
|
|
439
|
+
- The KERNAL clears D only in its reset routine ($FCE6, the sole CLD
|
|
440
|
+
instruction in either ROM). Neither the IRQ dispatcher at $FF48, the
|
|
441
|
+
default IRQ service at $EA31, nor the NMI path at $FE43/$FE47
|
|
442
|
+
executes CLD, so KERNAL interrupt code runs with whatever D the
|
|
443
|
+
interrupted code left — an earlier version of this bullet said the
|
|
444
|
+
KERNAL clears D at the start of every IRQ/NMI, and it does not. The
|
|
445
|
+
default IRQ path survives D=1 only by accident: its only ADC/SBC are
|
|
446
|
+
UDTIM's three compare-style SBCs ($F6AA/$F6AE/$F6B2), which use just
|
|
447
|
+
the carry, and on the NMOS 6510 SBC's carry-out is the same in
|
|
448
|
+
decimal and binary mode. Do not rely on that — anything else you
|
|
449
|
+
route through ($0314)/($0318) inherits the caller's D. Keep SED/CLD
|
|
450
|
+
pairs short, SEI around them if an interrupt that does arithmetic
|
|
451
|
+
could land inside, and CLD first thing in any handler of your own
|
|
452
|
+
that uses ADC/SBC.
|
|
453
|
+
|
|
454
|
+
### Flag-modification summary
|
|
455
|
+
|
|
456
|
+
Quick lookup of which flags each instruction touches (the per-opcode
|
|
457
|
+
H3 entries below give the canonical list, this is just a cheat sheet):
|
|
458
|
+
|
|
459
|
+
| Instruction | N | V | Z | C | I | D |
|
|
460
|
+
|-------------|---|---|---|---|---|---|
|
|
461
|
+
| ADC | ✓ | ✓ | ✓ | ✓ | | |
|
|
462
|
+
| AND, ORA, EOR | ✓ | | ✓ | | | |
|
|
463
|
+
| ASL, LSR, ROL, ROR | ✓ | | ✓ | ✓ | | |
|
|
464
|
+
| BIT | M7 | M6 | ✓ | | | |
|
|
465
|
+
| BRK | | | | | 1 | |
|
|
466
|
+
| CLC, SEC | | | | ✓ | | |
|
|
467
|
+
| CLD, SED | | | | | | ✓ |
|
|
468
|
+
| CLI, SEI | | | | | ✓ | |
|
|
469
|
+
| CLV | | ✓ | | | | |
|
|
470
|
+
| CMP, CPX, CPY | ✓ | | ✓ | ✓ | | |
|
|
471
|
+
| DEC, INC, DEX, DEY, INX, INY | ✓ | | ✓ | | | |
|
|
472
|
+
| LDA, LDX, LDY | ✓ | | ✓ | | | |
|
|
473
|
+
| PLA, PLP, RTI | (PLP/RTI: all flags from stack; PLA: N,Z) |
|
|
474
|
+
| SBC | ✓ | ✓ | ✓ | ✓ | | |
|
|
475
|
+
| TAX, TAY, TSX, TXA, TYA | ✓ | | ✓ | | | |
|
|
476
|
+
| TXS | | | | | | |
|
|
477
|
+
| JMP, JSR, RTS, branches, PHA, PHP, NOP, STA, STX, STY | none | | | | | |
|
|
478
|
+
|
|
479
|
+
## IRQ / NMI / BRK / RESET vectors
|
|
480
|
+
|
|
481
|
+
The top six bytes of the address space hold three 16-bit interrupt vectors:
|
|
482
|
+
|
|
483
|
+
| Address | Vector | Triggered by |
|
|
484
|
+
|-------------|--------|--------------|
|
|
485
|
+
| $FFFA / $FFFB | NMI | Falling edge on NMI pin (on the C64: CIA2's /IRQ output and the RESTORE key — an earlier version of this row named only CIA2; the expansion port's /NMI line shares the pin, which is why the KERNAL's NMI handler at $FE47 tests for a cartridge signature and jumps through $8002 when CIA2 was not the source) |
|
|
486
|
+
| $FFFC / $FFFD | RESET | RESET pin held low then released |
|
|
487
|
+
| $FFFE / $FFFF | IRQ/BRK | Low level on IRQ pin (with I=0), or BRK instruction |
|
|
488
|
+
|
|
489
|
+
All three vectors are 16-bit little-endian pointers. On the C64 they
|
|
490
|
+
sit in KERNAL ROM at the top of $FFxx. The IRQ/BRK and NMI vectors
|
|
491
|
+
point to small ROM dispatchers ($FF48 and $FE43) which in turn jump
|
|
492
|
+
through user-modifiable RAM vectors in page 3 ($0314–$0319) — page 3
|
|
493
|
+
only; an earlier version of this sentence said "zero page or page 3",
|
|
494
|
+
and nothing in zero page is involved. The RESET vector points to the
|
|
495
|
+
KERNAL reset routine ($FCE2), which ends in `JMP ($A000)` (or
|
|
496
|
+
`JMP ($8000)` when a cartridge signature is present) and reads no
|
|
497
|
+
page-3 vector:
|
|
498
|
+
|
|
499
|
+
| RAM vector | Address | What ROM dispatcher reads here |
|
|
500
|
+
|------------|----------|--------------------------------|
|
|
501
|
+
| IRQ | $0314/$0315 | KERNAL hardware IRQ handler |
|
|
502
|
+
| BRK | $0316/$0317 | KERNAL BRK handler |
|
|
503
|
+
| NMI | $0318/$0319 | KERNAL NMI handler |
|
|
504
|
+
|
|
505
|
+
For a custom IRQ on the C64, the typical pattern is:
|
|
506
|
+
|
|
507
|
+
1. Bank out KERNAL ROM (set $01 bit 1 to 0) so that $FFFE/$FFFF reads
|
|
508
|
+
from RAM, *or*
|
|
509
|
+
2. Leave KERNAL banked in but overwrite the RAM vector at $0314/$0315
|
|
510
|
+
so that the KERNAL dispatcher jumps to your handler.
|
|
511
|
+
|
|
512
|
+
Option 2 is more common in BASIC-friendly code; option 1 is the
|
|
513
|
+
demo-coder default because the ROM dispatcher at $FF48 (PHA TXA PHA TYA
|
|
514
|
+
PHA TSX LDA $0104,X AND #$10 BEQ JMP ($0314)) costs 29 cycles before
|
|
515
|
+
your handler's first instruction, on top of the 7-cycle interrupt
|
|
516
|
+
sequence you pay either way (measured in VICE: a $0314 handler starts
|
|
517
|
+
exactly 29 cycles after a $FFFE handler does; an earlier version of
|
|
518
|
+
this paragraph said "~40", which matches no path through the ROM).
|
|
519
|
+
Returning through $EA81 (PLA TAY PLA TAX PLA RTI) costs 22. A direct
|
|
520
|
+
handler that saves and restores the same three registers pays 13 in
|
|
521
|
+
and 22 out itself, so the net saving is the 16 cycles of
|
|
522
|
+
TSX/LDA/AND/BEQ/JMP plus whatever register saves your handler can skip.
|
|
523
|
+
|
|
524
|
+
### IRQ / NMI / BRK detail
|
|
525
|
+
|
|
526
|
+
When an IRQ or NMI is taken, the CPU:
|
|
527
|
+
|
|
528
|
+
1. Finishes the current instruction.
|
|
529
|
+
2. Pushes the high byte of PC.
|
|
530
|
+
3. Pushes the low byte of PC.
|
|
531
|
+
4. Pushes P with bit 4 (B) = 0 and bit 5 = 1.
|
|
532
|
+
5. Sets I = 1.
|
|
533
|
+
6. Loads PC from the vector ($FFFE/$FFFF for IRQ, $FFFA/$FFFB for NMI).
|
|
534
|
+
7. Begins executing at the new PC.
|
|
535
|
+
|
|
536
|
+
Total: 7 cycles.
|
|
537
|
+
|
|
538
|
+
For BRK, the same sequence runs except:
|
|
539
|
+
|
|
540
|
+
1. The instruction is one of these.
|
|
541
|
+
2. PC is pushed *after being advanced by 2* (so the pushed PC points
|
|
542
|
+
one past the BRK signature byte).
|
|
543
|
+
3. P is pushed with bit 4 (B) = 1.
|
|
544
|
+
|
|
545
|
+
The B-flag trick is how a handler that vectors through $FFFE
|
|
546
|
+
distinguishes IRQ from BRK: pull the stacked P, AND with $10, BEQ to
|
|
547
|
+
IRQ path / BNE to BRK path.
|
|
548
|
+
|
|
549
|
+
### RESET detail
|
|
550
|
+
|
|
551
|
+
RESET does *not* save state. The CPU:
|
|
552
|
+
|
|
553
|
+
1. Sets I = 1.
|
|
554
|
+
2. Loads PC from $FFFC/$FFFD.
|
|
555
|
+
3. Begins execution.
|
|
556
|
+
|
|
557
|
+
SP is not initialized by the hardware. D is undefined. The KERNAL
|
|
558
|
+
reset routine on the C64 explicitly sets SP = $FF, clears D, sets up
|
|
559
|
+
the I/O port at $00/$01, banks in KERNAL/BASIC/IO, and jumps to the
|
|
560
|
+
BASIC cold-start routine. Code that hooks $FFFC should do the same.
|
|
561
|
+
|
|
562
|
+
## Quick reference — all 151 official opcodes
|
|
563
|
+
|
|
564
|
+
The table below lists every legal 6502/6510 opcode grouped by mnemonic.
|
|
565
|
+
"Mode" uses the standard assembler shorthand. "Bytes" includes the
|
|
566
|
+
opcode itself. "Cyc" is the base cycle count; entries with `+1*` add
|
|
567
|
+
one cycle when the address calculation crosses a page boundary
|
|
568
|
+
(only for reads; writes always pay the penalty as part of their base
|
|
569
|
+
count). Entries with `+1**` add one cycle for a taken branch and
|
|
570
|
+
+2 for a taken branch that crosses a page (only the branch
|
|
571
|
+
instructions). Flags column lists flags affected (N V Z C I D B).
|
|
572
|
+
|
|
573
|
+
| Opcode | Mnemonic | Mode | Bytes | Cyc | Flags |
|
|
574
|
+
|--------|----------|------|-------|-----|-------|
|
|
575
|
+
| $69 | ADC | #imm | 2 | 2 | N V Z C |
|
|
576
|
+
| $65 | ADC | zp | 2 | 3 | N V Z C |
|
|
577
|
+
| $75 | ADC | zp,X | 2 | 4 | N V Z C |
|
|
578
|
+
| $6D | ADC | abs | 3 | 4 | N V Z C |
|
|
579
|
+
| $7D | ADC | abs,X | 3 | 4+1* | N V Z C |
|
|
580
|
+
| $79 | ADC | abs,Y | 3 | 4+1* | N V Z C |
|
|
581
|
+
| $61 | ADC | (zp,X) | 2 | 6 | N V Z C |
|
|
582
|
+
| $71 | ADC | (zp),Y | 2 | 5+1* | N V Z C |
|
|
583
|
+
| $29 | AND | #imm | 2 | 2 | N Z |
|
|
584
|
+
| $25 | AND | zp | 2 | 3 | N Z |
|
|
585
|
+
| $35 | AND | zp,X | 2 | 4 | N Z |
|
|
586
|
+
| $2D | AND | abs | 3 | 4 | N Z |
|
|
587
|
+
| $3D | AND | abs,X | 3 | 4+1* | N Z |
|
|
588
|
+
| $39 | AND | abs,Y | 3 | 4+1* | N Z |
|
|
589
|
+
| $21 | AND | (zp,X) | 2 | 6 | N Z |
|
|
590
|
+
| $31 | AND | (zp),Y | 2 | 5+1* | N Z |
|
|
591
|
+
| $0A | ASL | A | 1 | 2 | N Z C |
|
|
592
|
+
| $06 | ASL | zp | 2 | 5 | N Z C |
|
|
593
|
+
| $16 | ASL | zp,X | 2 | 6 | N Z C |
|
|
594
|
+
| $0E | ASL | abs | 3 | 6 | N Z C |
|
|
595
|
+
| $1E | ASL | abs,X | 3 | 7 | N Z C |
|
|
596
|
+
| $90 | BCC | rel | 2 | 2+1** | — |
|
|
597
|
+
| $B0 | BCS | rel | 2 | 2+1** | — |
|
|
598
|
+
| $F0 | BEQ | rel | 2 | 2+1** | — |
|
|
599
|
+
| $24 | BIT | zp | 2 | 3 | N V Z |
|
|
600
|
+
| $2C | BIT | abs | 3 | 4 | N V Z |
|
|
601
|
+
| $30 | BMI | rel | 2 | 2+1** | — |
|
|
602
|
+
| $D0 | BNE | rel | 2 | 2+1** | — |
|
|
603
|
+
| $10 | BPL | rel | 2 | 2+1** | — |
|
|
604
|
+
| $00 | BRK | impl | 1 | 7 | I (B in pushed P) |
|
|
605
|
+
| $50 | BVC | rel | 2 | 2+1** | — |
|
|
606
|
+
| $70 | BVS | rel | 2 | 2+1** | — |
|
|
607
|
+
| $18 | CLC | impl | 1 | 2 | C |
|
|
608
|
+
| $D8 | CLD | impl | 1 | 2 | D |
|
|
609
|
+
| $58 | CLI | impl | 1 | 2 | I |
|
|
610
|
+
| $B8 | CLV | impl | 1 | 2 | V |
|
|
611
|
+
| $C9 | CMP | #imm | 2 | 2 | N Z C |
|
|
612
|
+
| $C5 | CMP | zp | 2 | 3 | N Z C |
|
|
613
|
+
| $D5 | CMP | zp,X | 2 | 4 | N Z C |
|
|
614
|
+
| $CD | CMP | abs | 3 | 4 | N Z C |
|
|
615
|
+
| $DD | CMP | abs,X | 3 | 4+1* | N Z C |
|
|
616
|
+
| $D9 | CMP | abs,Y | 3 | 4+1* | N Z C |
|
|
617
|
+
| $C1 | CMP | (zp,X) | 2 | 6 | N Z C |
|
|
618
|
+
| $D1 | CMP | (zp),Y | 2 | 5+1* | N Z C |
|
|
619
|
+
| $E0 | CPX | #imm | 2 | 2 | N Z C |
|
|
620
|
+
| $E4 | CPX | zp | 2 | 3 | N Z C |
|
|
621
|
+
| $EC | CPX | abs | 3 | 4 | N Z C |
|
|
622
|
+
| $C0 | CPY | #imm | 2 | 2 | N Z C |
|
|
623
|
+
| $C4 | CPY | zp | 2 | 3 | N Z C |
|
|
624
|
+
| $CC | CPY | abs | 3 | 4 | N Z C |
|
|
625
|
+
| $C6 | DEC | zp | 2 | 5 | N Z |
|
|
626
|
+
| $D6 | DEC | zp,X | 2 | 6 | N Z |
|
|
627
|
+
| $CE | DEC | abs | 3 | 6 | N Z |
|
|
628
|
+
| $DE | DEC | abs,X | 3 | 7 | N Z |
|
|
629
|
+
| $CA | DEX | impl | 1 | 2 | N Z |
|
|
630
|
+
| $88 | DEY | impl | 1 | 2 | N Z |
|
|
631
|
+
| $49 | EOR | #imm | 2 | 2 | N Z |
|
|
632
|
+
| $45 | EOR | zp | 2 | 3 | N Z |
|
|
633
|
+
| $55 | EOR | zp,X | 2 | 4 | N Z |
|
|
634
|
+
| $4D | EOR | abs | 3 | 4 | N Z |
|
|
635
|
+
| $5D | EOR | abs,X | 3 | 4+1* | N Z |
|
|
636
|
+
| $59 | EOR | abs,Y | 3 | 4+1* | N Z |
|
|
637
|
+
| $41 | EOR | (zp,X) | 2 | 6 | N Z |
|
|
638
|
+
| $51 | EOR | (zp),Y | 2 | 5+1* | N Z |
|
|
639
|
+
| $E6 | INC | zp | 2 | 5 | N Z |
|
|
640
|
+
| $F6 | INC | zp,X | 2 | 6 | N Z |
|
|
641
|
+
| $EE | INC | abs | 3 | 6 | N Z |
|
|
642
|
+
| $FE | INC | abs,X | 3 | 7 | N Z |
|
|
643
|
+
| $E8 | INX | impl | 1 | 2 | N Z |
|
|
644
|
+
| $C8 | INY | impl | 1 | 2 | N Z |
|
|
645
|
+
| $4C | JMP | abs | 3 | 3 | — |
|
|
646
|
+
| $6C | JMP | (abs) | 3 | 5 | — |
|
|
647
|
+
| $20 | JSR | abs | 3 | 6 | — |
|
|
648
|
+
| $A9 | LDA | #imm | 2 | 2 | N Z |
|
|
649
|
+
| $A5 | LDA | zp | 2 | 3 | N Z |
|
|
650
|
+
| $B5 | LDA | zp,X | 2 | 4 | N Z |
|
|
651
|
+
| $AD | LDA | abs | 3 | 4 | N Z |
|
|
652
|
+
| $BD | LDA | abs,X | 3 | 4+1* | N Z |
|
|
653
|
+
| $B9 | LDA | abs,Y | 3 | 4+1* | N Z |
|
|
654
|
+
| $A1 | LDA | (zp,X) | 2 | 6 | N Z |
|
|
655
|
+
| $B1 | LDA | (zp),Y | 2 | 5+1* | N Z |
|
|
656
|
+
| $A2 | LDX | #imm | 2 | 2 | N Z |
|
|
657
|
+
| $A6 | LDX | zp | 2 | 3 | N Z |
|
|
658
|
+
| $B6 | LDX | zp,Y | 2 | 4 | N Z |
|
|
659
|
+
| $AE | LDX | abs | 3 | 4 | N Z |
|
|
660
|
+
| $BE | LDX | abs,Y | 3 | 4+1* | N Z |
|
|
661
|
+
| $A0 | LDY | #imm | 2 | 2 | N Z |
|
|
662
|
+
| $A4 | LDY | zp | 2 | 3 | N Z |
|
|
663
|
+
| $B4 | LDY | zp,X | 2 | 4 | N Z |
|
|
664
|
+
| $AC | LDY | abs | 3 | 4 | N Z |
|
|
665
|
+
| $BC | LDY | abs,X | 3 | 4+1* | N Z |
|
|
666
|
+
| $4A | LSR | A | 1 | 2 | N Z C |
|
|
667
|
+
| $46 | LSR | zp | 2 | 5 | N Z C |
|
|
668
|
+
| $56 | LSR | zp,X | 2 | 6 | N Z C |
|
|
669
|
+
| $4E | LSR | abs | 3 | 6 | N Z C |
|
|
670
|
+
| $5E | LSR | abs,X | 3 | 7 | N Z C |
|
|
671
|
+
| $EA | NOP | impl | 1 | 2 | — |
|
|
672
|
+
| $09 | ORA | #imm | 2 | 2 | N Z |
|
|
673
|
+
| $05 | ORA | zp | 2 | 3 | N Z |
|
|
674
|
+
| $15 | ORA | zp,X | 2 | 4 | N Z |
|
|
675
|
+
| $0D | ORA | abs | 3 | 4 | N Z |
|
|
676
|
+
| $1D | ORA | abs,X | 3 | 4+1* | N Z |
|
|
677
|
+
| $19 | ORA | abs,Y | 3 | 4+1* | N Z |
|
|
678
|
+
| $01 | ORA | (zp,X) | 2 | 6 | N Z |
|
|
679
|
+
| $11 | ORA | (zp),Y | 2 | 5+1* | N Z |
|
|
680
|
+
| $48 | PHA | impl | 1 | 3 | — |
|
|
681
|
+
| $08 | PHP | impl | 1 | 3 | — |
|
|
682
|
+
| $68 | PLA | impl | 1 | 4 | N Z |
|
|
683
|
+
| $28 | PLP | impl | 1 | 4 | all |
|
|
684
|
+
| $2A | ROL | A | 1 | 2 | N Z C |
|
|
685
|
+
| $26 | ROL | zp | 2 | 5 | N Z C |
|
|
686
|
+
| $36 | ROL | zp,X | 2 | 6 | N Z C |
|
|
687
|
+
| $2E | ROL | abs | 3 | 6 | N Z C |
|
|
688
|
+
| $3E | ROL | abs,X | 3 | 7 | N Z C |
|
|
689
|
+
| $6A | ROR | A | 1 | 2 | N Z C |
|
|
690
|
+
| $66 | ROR | zp | 2 | 5 | N Z C |
|
|
691
|
+
| $76 | ROR | zp,X | 2 | 6 | N Z C |
|
|
692
|
+
| $6E | ROR | abs | 3 | 6 | N Z C |
|
|
693
|
+
| $7E | ROR | abs,X | 3 | 7 | N Z C |
|
|
694
|
+
| $40 | RTI | impl | 1 | 6 | all |
|
|
695
|
+
| $60 | RTS | impl | 1 | 6 | — |
|
|
696
|
+
| $E9 | SBC | #imm | 2 | 2 | N V Z C |
|
|
697
|
+
| $E5 | SBC | zp | 2 | 3 | N V Z C |
|
|
698
|
+
| $F5 | SBC | zp,X | 2 | 4 | N V Z C |
|
|
699
|
+
| $ED | SBC | abs | 3 | 4 | N V Z C |
|
|
700
|
+
| $FD | SBC | abs,X | 3 | 4+1* | N V Z C |
|
|
701
|
+
| $F9 | SBC | abs,Y | 3 | 4+1* | N V Z C |
|
|
702
|
+
| $E1 | SBC | (zp,X) | 2 | 6 | N V Z C |
|
|
703
|
+
| $F1 | SBC | (zp),Y | 2 | 5+1* | N V Z C |
|
|
704
|
+
| $38 | SEC | impl | 1 | 2 | C |
|
|
705
|
+
| $F8 | SED | impl | 1 | 2 | D |
|
|
706
|
+
| $78 | SEI | impl | 1 | 2 | I |
|
|
707
|
+
| $85 | STA | zp | 2 | 3 | — |
|
|
708
|
+
| $95 | STA | zp,X | 2 | 4 | — |
|
|
709
|
+
| $8D | STA | abs | 3 | 4 | — |
|
|
710
|
+
| $9D | STA | abs,X | 3 | 5 | — |
|
|
711
|
+
| $99 | STA | abs,Y | 3 | 5 | — |
|
|
712
|
+
| $81 | STA | (zp,X) | 2 | 6 | — |
|
|
713
|
+
| $91 | STA | (zp),Y | 2 | 6 | — |
|
|
714
|
+
| $86 | STX | zp | 2 | 3 | — |
|
|
715
|
+
| $96 | STX | zp,Y | 2 | 4 | — |
|
|
716
|
+
| $8E | STX | abs | 3 | 4 | — |
|
|
717
|
+
| $84 | STY | zp | 2 | 3 | — |
|
|
718
|
+
| $94 | STY | zp,X | 2 | 4 | — |
|
|
719
|
+
| $8C | STY | abs | 3 | 4 | — |
|
|
720
|
+
| $AA | TAX | impl | 1 | 2 | N Z |
|
|
721
|
+
| $A8 | TAY | impl | 1 | 2 | N Z |
|
|
722
|
+
| $BA | TSX | impl | 1 | 2 | N Z |
|
|
723
|
+
| $8A | TXA | impl | 1 | 2 | N Z |
|
|
724
|
+
| $9A | TXS | impl | 1 | 2 | — |
|
|
725
|
+
| $98 | TYA | impl | 1 | 2 | N Z |
|
|
726
|
+
|
|
727
|
+
Total: 151 opcodes.
|
|
728
|
+
|
|
729
|
+
## Detailed opcode list
|
|
730
|
+
|
|
731
|
+
Each opcode below has a structured H3 entry suitable for entity
|
|
732
|
+
extraction. Entries are grouped by mnemonic in alphabetical order.
|
|
733
|
+
|
|
734
|
+
### ADC — Add with Carry
|
|
735
|
+
|
|
736
|
+
ADC adds the operand to A together with the current carry flag. In
|
|
737
|
+
binary mode (D=0): `A := A + operand + C`, setting C if the unsigned
|
|
738
|
+
sum exceeds $FF, V if the signed result overflows. In decimal mode
|
|
739
|
+
(D=1): both operands are packed BCD; the result is packed BCD with C
|
|
740
|
+
set on decimal carry; N, V, Z are undefined on NMOS.
|
|
741
|
+
|
|
742
|
+
To start an addition chain, **clear C first with CLC**. ADC always
|
|
743
|
+
uses the live C, so leftover C from a comparison or shift will perturb
|
|
744
|
+
the sum if not cleared.
|
|
745
|
+
|
|
746
|
+
### $69 — ADC #imm — Add with carry, immediate
|
|
747
|
+
|
|
748
|
+
**Cycles:** 2
|
|
749
|
+
**Flags:** N V Z C
|
|
750
|
+
|
|
751
|
+
### $65 — ADC zp — Add with carry, zero page
|
|
752
|
+
|
|
753
|
+
**Cycles:** 3
|
|
754
|
+
**Flags:** N V Z C
|
|
755
|
+
|
|
756
|
+
### $75 — ADC zp,X — Add with carry, zero page indexed by X
|
|
757
|
+
|
|
758
|
+
**Cycles:** 4
|
|
759
|
+
**Flags:** N V Z C
|
|
760
|
+
|
|
761
|
+
### $6D — ADC abs — Add with carry, absolute
|
|
762
|
+
|
|
763
|
+
**Cycles:** 4
|
|
764
|
+
**Flags:** N V Z C
|
|
765
|
+
|
|
766
|
+
### $7D — ADC abs,X — Add with carry, absolute indexed by X
|
|
767
|
+
|
|
768
|
+
**Cycles:** 4
|
|
769
|
+
**Flags:** N V Z C
|
|
770
|
+
**Page-cross:** +1
|
|
771
|
+
|
|
772
|
+
### $79 — ADC abs,Y — Add with carry, absolute indexed by Y
|
|
773
|
+
|
|
774
|
+
**Cycles:** 4
|
|
775
|
+
**Flags:** N V Z C
|
|
776
|
+
**Page-cross:** +1
|
|
777
|
+
|
|
778
|
+
### $61 — ADC (zp,X) — Add with carry, indexed indirect
|
|
779
|
+
|
|
780
|
+
**Cycles:** 6
|
|
781
|
+
**Flags:** N V Z C
|
|
782
|
+
|
|
783
|
+
### $71 — ADC (zp),Y — Add with carry, indirect indexed
|
|
784
|
+
|
|
785
|
+
**Cycles:** 5
|
|
786
|
+
**Flags:** N V Z C
|
|
787
|
+
**Page-cross:** +1
|
|
788
|
+
|
|
789
|
+
### AND — Logical AND
|
|
790
|
+
|
|
791
|
+
AND performs a bitwise AND between A and the operand and stores the
|
|
792
|
+
result in A. The result is reflected in N (bit 7 of result) and Z.
|
|
793
|
+
|
|
794
|
+
Common uses: masking off unwanted bits (e.g. `AND #$0F` to keep the
|
|
795
|
+
low nibble), testing whether specific bits are set (followed by a
|
|
796
|
+
BEQ/BNE), and clearing flags inside packed status bytes.
|
|
797
|
+
|
|
798
|
+
### $29 — AND #imm — Logical AND, immediate
|
|
799
|
+
|
|
800
|
+
**Cycles:** 2
|
|
801
|
+
**Flags:** N Z
|
|
802
|
+
|
|
803
|
+
### $25 — AND zp — Logical AND, zero page
|
|
804
|
+
|
|
805
|
+
**Cycles:** 3
|
|
806
|
+
**Flags:** N Z
|
|
807
|
+
|
|
808
|
+
### $35 — AND zp,X — Logical AND, zero page indexed by X
|
|
809
|
+
|
|
810
|
+
**Cycles:** 4
|
|
811
|
+
**Flags:** N Z
|
|
812
|
+
|
|
813
|
+
### $2D — AND abs — Logical AND, absolute
|
|
814
|
+
|
|
815
|
+
**Cycles:** 4
|
|
816
|
+
**Flags:** N Z
|
|
817
|
+
|
|
818
|
+
### $3D — AND abs,X — Logical AND, absolute indexed by X
|
|
819
|
+
|
|
820
|
+
**Cycles:** 4
|
|
821
|
+
**Flags:** N Z
|
|
822
|
+
**Page-cross:** +1
|
|
823
|
+
|
|
824
|
+
### $39 — AND abs,Y — Logical AND, absolute indexed by Y
|
|
825
|
+
|
|
826
|
+
**Cycles:** 4
|
|
827
|
+
**Flags:** N Z
|
|
828
|
+
**Page-cross:** +1
|
|
829
|
+
|
|
830
|
+
### $21 — AND (zp,X) — Logical AND, indexed indirect
|
|
831
|
+
|
|
832
|
+
**Cycles:** 6
|
|
833
|
+
**Flags:** N Z
|
|
834
|
+
|
|
835
|
+
### $31 — AND (zp),Y — Logical AND, indirect indexed
|
|
836
|
+
|
|
837
|
+
**Cycles:** 5
|
|
838
|
+
**Flags:** N Z
|
|
839
|
+
**Page-cross:** +1
|
|
840
|
+
|
|
841
|
+
### ASL — Arithmetic Shift Left
|
|
842
|
+
|
|
843
|
+
Shifts the operand left one bit. The bit shifted out of bit 7 goes
|
|
844
|
+
into C; bit 0 is filled with 0. Effectively multiplies by 2 for
|
|
845
|
+
unsigned values. N and Z are set from the result.
|
|
846
|
+
|
|
847
|
+
ASL on the accumulator is `ASL A` (or just `ASL` in some assemblers).
|
|
848
|
+
ASL on memory performs a read-modify-write cycle on that location.
|
|
849
|
+
|
|
850
|
+
### $0A — ASL A — Arithmetic shift left, accumulator
|
|
851
|
+
|
|
852
|
+
**Cycles:** 2
|
|
853
|
+
**Flags:** N Z C
|
|
854
|
+
|
|
855
|
+
### $06 — ASL zp — Arithmetic shift left, zero page
|
|
856
|
+
|
|
857
|
+
**Cycles:** 5
|
|
858
|
+
**Flags:** N Z C
|
|
859
|
+
|
|
860
|
+
### $16 — ASL zp,X — Arithmetic shift left, zero page indexed by X
|
|
861
|
+
|
|
862
|
+
**Cycles:** 6
|
|
863
|
+
**Flags:** N Z C
|
|
864
|
+
|
|
865
|
+
### $0E — ASL abs — Arithmetic shift left, absolute
|
|
866
|
+
|
|
867
|
+
**Cycles:** 6
|
|
868
|
+
**Flags:** N Z C
|
|
869
|
+
|
|
870
|
+
### $1E — ASL abs,X — Arithmetic shift left, absolute indexed by X
|
|
871
|
+
|
|
872
|
+
**Cycles:** 7
|
|
873
|
+
**Flags:** N Z C
|
|
874
|
+
|
|
875
|
+
### BCC — Branch if Carry Clear
|
|
876
|
+
|
|
877
|
+
If C=0, branch to PC + signed displacement; otherwise fall through.
|
|
878
|
+
2 cycles if not taken, 3 if taken (same page), 4 if taken to a
|
|
879
|
+
different page. Branches do not modify flags.
|
|
880
|
+
|
|
881
|
+
Typical idiom after CMP: BCC is "branch if A < operand" (unsigned).
|
|
882
|
+
|
|
883
|
+
### $90 — BCC rel — Branch if carry clear
|
|
884
|
+
|
|
885
|
+
**Cycles:** 2 (+1 if taken)
|
|
886
|
+
**Flags:** —
|
|
887
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
888
|
+
|
|
889
|
+
### BCS — Branch if Carry Set
|
|
890
|
+
|
|
891
|
+
If C=1, branch. Typical idiom after CMP: BCS is "branch if
|
|
892
|
+
A ≥ operand" (unsigned).
|
|
893
|
+
|
|
894
|
+
### $B0 — BCS rel — Branch if carry set
|
|
895
|
+
|
|
896
|
+
**Cycles:** 2 (+1 if taken)
|
|
897
|
+
**Flags:** —
|
|
898
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
899
|
+
|
|
900
|
+
### BEQ — Branch if Equal (Z=1)
|
|
901
|
+
|
|
902
|
+
If Z=1, branch. Typical idiom: branch when the last value was zero,
|
|
903
|
+
or after CMP, branch when A equals the operand.
|
|
904
|
+
|
|
905
|
+
### $F0 — BEQ rel — Branch if equal (Z=1)
|
|
906
|
+
|
|
907
|
+
**Cycles:** 2 (+1 if taken)
|
|
908
|
+
**Flags:** —
|
|
909
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
910
|
+
|
|
911
|
+
### BIT — Test Bits
|
|
912
|
+
|
|
913
|
+
BIT performs `A AND operand` but discards the result. Z is set from
|
|
914
|
+
the AND result. N and V are set from the *operand* (not the AND): N
|
|
915
|
+
gets bit 7 of the operand, V gets bit 6 of the operand.
|
|
916
|
+
|
|
917
|
+
This makes BIT the only way to non-destructively read bits 6 and 7 of
|
|
918
|
+
a memory location into the flags. Common uses: polling VIA/CIA bit-7
|
|
919
|
+
status registers without destroying A; testing two bits at once.
|
|
920
|
+
|
|
921
|
+
### $24 — BIT zp — Test bits, zero page
|
|
922
|
+
|
|
923
|
+
**Cycles:** 3
|
|
924
|
+
**Flags:** N V Z
|
|
925
|
+
|
|
926
|
+
### $2C — BIT abs — Test bits, absolute
|
|
927
|
+
|
|
928
|
+
**Cycles:** 4
|
|
929
|
+
**Flags:** N V Z
|
|
930
|
+
|
|
931
|
+
### BMI — Branch if Minus (N=1)
|
|
932
|
+
|
|
933
|
+
If N=1, branch.
|
|
934
|
+
|
|
935
|
+
### $30 — BMI rel — Branch if minus (N=1)
|
|
936
|
+
|
|
937
|
+
**Cycles:** 2 (+1 if taken)
|
|
938
|
+
**Flags:** —
|
|
939
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
940
|
+
|
|
941
|
+
### BNE — Branch if Not Equal (Z=0)
|
|
942
|
+
|
|
943
|
+
If Z=0, branch.
|
|
944
|
+
|
|
945
|
+
### $D0 — BNE rel — Branch if not equal (Z=0)
|
|
946
|
+
|
|
947
|
+
**Cycles:** 2 (+1 if taken)
|
|
948
|
+
**Flags:** —
|
|
949
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
950
|
+
|
|
951
|
+
### BPL — Branch if Plus (N=0)
|
|
952
|
+
|
|
953
|
+
If N=0, branch.
|
|
954
|
+
|
|
955
|
+
### $10 — BPL rel — Branch if plus (N=0)
|
|
956
|
+
|
|
957
|
+
**Cycles:** 2 (+1 if taken)
|
|
958
|
+
**Flags:** —
|
|
959
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
960
|
+
|
|
961
|
+
### BRK — Force Interrupt
|
|
962
|
+
|
|
963
|
+
Software interrupt. Pushes (PC + 2), pushes P with B=1, sets I=1,
|
|
964
|
+
and jumps to the address in $FFFE/$FFFF. The byte following the
|
|
965
|
+
BRK opcode is reserved as a signature byte and is *skipped* — the
|
|
966
|
+
return address pushed is PC + 2, not PC + 1. This means BRK is
|
|
967
|
+
effectively a 2-byte instruction even though its opcode is one byte.
|
|
968
|
+
|
|
969
|
+
Used historically for breakpoints in monitors (the monitor inserts a
|
|
970
|
+
$00 byte and reads its own table by the address of the BRK − 1).
|
|
971
|
+
|
|
972
|
+
### $00 — BRK impl — Force interrupt / break
|
|
973
|
+
|
|
974
|
+
**Cycles:** 7
|
|
975
|
+
**Flags:** I
|
|
976
|
+
|
|
977
|
+
### BVC — Branch if Overflow Clear (V=0)
|
|
978
|
+
|
|
979
|
+
If V=0, branch.
|
|
980
|
+
|
|
981
|
+
### $50 — BVC rel — Branch if overflow clear (V=0)
|
|
982
|
+
|
|
983
|
+
**Cycles:** 2 (+1 if taken)
|
|
984
|
+
**Flags:** —
|
|
985
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
986
|
+
|
|
987
|
+
### BVS — Branch if Overflow Set (V=1)
|
|
988
|
+
|
|
989
|
+
If V=1, branch. Note: V is set by ADC/SBC and by BIT; CLV explicitly
|
|
990
|
+
clears it. A common trick: use BVS with V cleared as a hand-rolled
|
|
991
|
+
unconditional non-branch placeholder, or use BVS / BVC as control
|
|
992
|
+
flow based on BIT's bit-6 readout.
|
|
993
|
+
|
|
994
|
+
### $70 — BVS rel — Branch if overflow set (V=1)
|
|
995
|
+
|
|
996
|
+
**Cycles:** 2 (+1 if taken)
|
|
997
|
+
**Flags:** —
|
|
998
|
+
**Page-cross:** +1 (only when the branch is taken; total 4)
|
|
999
|
+
|
|
1000
|
+
### CLC — Clear Carry
|
|
1001
|
+
|
|
1002
|
+
Clears C. Standard preamble before the first ADC of an addition chain.
|
|
1003
|
+
|
|
1004
|
+
### $18 — CLC impl — Clear carry flag
|
|
1005
|
+
|
|
1006
|
+
**Cycles:** 2
|
|
1007
|
+
**Flags:** C
|
|
1008
|
+
|
|
1009
|
+
### CLD — Clear Decimal
|
|
1010
|
+
|
|
1011
|
+
Clears D, returning ADC/SBC to binary mode. The KERNAL reset routine
|
|
1012
|
+
runs this; user code that hooks $FFFC should also run this before
|
|
1013
|
+
any arithmetic.
|
|
1014
|
+
|
|
1015
|
+
### $D8 — CLD impl — Clear decimal flag
|
|
1016
|
+
|
|
1017
|
+
**Cycles:** 2
|
|
1018
|
+
**Flags:** D
|
|
1019
|
+
|
|
1020
|
+
### CLI — Clear Interrupt Disable
|
|
1021
|
+
|
|
1022
|
+
Clears I, allowing IRQ requests through. Typical at the end of an
|
|
1023
|
+
interrupt handler that wants to be re-entrant, or at the end of a
|
|
1024
|
+
critical section that started with SEI.
|
|
1025
|
+
|
|
1026
|
+
### $58 — CLI impl — Clear interrupt disable
|
|
1027
|
+
|
|
1028
|
+
**Cycles:** 2
|
|
1029
|
+
**Flags:** I
|
|
1030
|
+
|
|
1031
|
+
### CLV — Clear Overflow
|
|
1032
|
+
|
|
1033
|
+
Clears V. There is no "SEV" — V can only be set by ADC/SBC, BIT, or
|
|
1034
|
+
restored from a pushed status byte by PLP/RTI.
|
|
1035
|
+
|
|
1036
|
+
### $B8 — CLV impl — Clear overflow flag
|
|
1037
|
+
|
|
1038
|
+
**Cycles:** 2
|
|
1039
|
+
**Flags:** V
|
|
1040
|
+
|
|
1041
|
+
### CMP — Compare with Accumulator
|
|
1042
|
+
|
|
1043
|
+
CMP performs `A − operand`, discards the result, and sets N, Z, C from
|
|
1044
|
+
the subtraction:
|
|
1045
|
+
|
|
1046
|
+
- C is set if A ≥ operand (unsigned).
|
|
1047
|
+
- Z is set if A == operand.
|
|
1048
|
+
- N reflects bit 7 of the subtraction result.
|
|
1049
|
+
|
|
1050
|
+
CMP does not modify A. Typical idiom: `CMP #$xx / BEQ / BCS / BCC` to
|
|
1051
|
+
dispatch on the value of A.
|
|
1052
|
+
|
|
1053
|
+
### $C9 — CMP #imm — Compare A with immediate
|
|
1054
|
+
|
|
1055
|
+
**Cycles:** 2
|
|
1056
|
+
**Flags:** N Z C
|
|
1057
|
+
|
|
1058
|
+
### $C5 — CMP zp — Compare A with zero page
|
|
1059
|
+
|
|
1060
|
+
**Cycles:** 3
|
|
1061
|
+
**Flags:** N Z C
|
|
1062
|
+
|
|
1063
|
+
### $D5 — CMP zp,X — Compare A with zero page indexed by X
|
|
1064
|
+
|
|
1065
|
+
**Cycles:** 4
|
|
1066
|
+
**Flags:** N Z C
|
|
1067
|
+
|
|
1068
|
+
### $CD — CMP abs — Compare A with absolute
|
|
1069
|
+
|
|
1070
|
+
**Cycles:** 4
|
|
1071
|
+
**Flags:** N Z C
|
|
1072
|
+
|
|
1073
|
+
### $DD — CMP abs,X — Compare A with absolute indexed by X
|
|
1074
|
+
|
|
1075
|
+
**Cycles:** 4
|
|
1076
|
+
**Flags:** N Z C
|
|
1077
|
+
**Page-cross:** +1
|
|
1078
|
+
|
|
1079
|
+
### $D9 — CMP abs,Y — Compare A with absolute indexed by Y
|
|
1080
|
+
|
|
1081
|
+
**Cycles:** 4
|
|
1082
|
+
**Flags:** N Z C
|
|
1083
|
+
**Page-cross:** +1
|
|
1084
|
+
|
|
1085
|
+
### $C1 — CMP (zp,X) — Compare A with indexed indirect
|
|
1086
|
+
|
|
1087
|
+
**Cycles:** 6
|
|
1088
|
+
**Flags:** N Z C
|
|
1089
|
+
|
|
1090
|
+
### $D1 — CMP (zp),Y — Compare A with indirect indexed
|
|
1091
|
+
|
|
1092
|
+
**Cycles:** 5
|
|
1093
|
+
**Flags:** N Z C
|
|
1094
|
+
**Page-cross:** +1
|
|
1095
|
+
|
|
1096
|
+
### CPX — Compare with X
|
|
1097
|
+
|
|
1098
|
+
Same as CMP but uses X. Three addressing modes: immediate, zero page,
|
|
1099
|
+
absolute.
|
|
1100
|
+
|
|
1101
|
+
### $E0 — CPX #imm — Compare X with immediate
|
|
1102
|
+
|
|
1103
|
+
**Cycles:** 2
|
|
1104
|
+
**Flags:** N Z C
|
|
1105
|
+
|
|
1106
|
+
### $E4 — CPX zp — Compare X with zero page
|
|
1107
|
+
|
|
1108
|
+
**Cycles:** 3
|
|
1109
|
+
**Flags:** N Z C
|
|
1110
|
+
|
|
1111
|
+
### $EC — CPX abs — Compare X with absolute
|
|
1112
|
+
|
|
1113
|
+
**Cycles:** 4
|
|
1114
|
+
**Flags:** N Z C
|
|
1115
|
+
|
|
1116
|
+
### CPY — Compare with Y
|
|
1117
|
+
|
|
1118
|
+
Same as CMP but uses Y. Three addressing modes: immediate, zero page,
|
|
1119
|
+
absolute.
|
|
1120
|
+
|
|
1121
|
+
### $C0 — CPY #imm — Compare Y with immediate
|
|
1122
|
+
|
|
1123
|
+
**Cycles:** 2
|
|
1124
|
+
**Flags:** N Z C
|
|
1125
|
+
|
|
1126
|
+
### $C4 — CPY zp — Compare Y with zero page
|
|
1127
|
+
|
|
1128
|
+
**Cycles:** 3
|
|
1129
|
+
**Flags:** N Z C
|
|
1130
|
+
|
|
1131
|
+
### $CC — CPY abs — Compare Y with absolute
|
|
1132
|
+
|
|
1133
|
+
**Cycles:** 4
|
|
1134
|
+
**Flags:** N Z C
|
|
1135
|
+
|
|
1136
|
+
### DEC — Decrement Memory
|
|
1137
|
+
|
|
1138
|
+
Subtracts 1 from the memory operand. N and Z are set from the result.
|
|
1139
|
+
Read-modify-write: the original value is read, the new value is
|
|
1140
|
+
computed, and the new value is written back.
|
|
1141
|
+
|
|
1142
|
+
### $C6 — DEC zp — Decrement zero page
|
|
1143
|
+
|
|
1144
|
+
**Cycles:** 5
|
|
1145
|
+
**Flags:** N Z
|
|
1146
|
+
|
|
1147
|
+
### $D6 — DEC zp,X — Decrement zero page indexed by X
|
|
1148
|
+
|
|
1149
|
+
**Cycles:** 6
|
|
1150
|
+
**Flags:** N Z
|
|
1151
|
+
|
|
1152
|
+
### $CE — DEC abs — Decrement absolute
|
|
1153
|
+
|
|
1154
|
+
**Cycles:** 6
|
|
1155
|
+
**Flags:** N Z
|
|
1156
|
+
|
|
1157
|
+
### $DE — DEC abs,X — Decrement absolute indexed by X
|
|
1158
|
+
|
|
1159
|
+
**Cycles:** 7
|
|
1160
|
+
**Flags:** N Z
|
|
1161
|
+
|
|
1162
|
+
### DEX — Decrement X
|
|
1163
|
+
|
|
1164
|
+
Subtracts 1 from X. N and Z reflect the new X.
|
|
1165
|
+
|
|
1166
|
+
### $CA — DEX impl — Decrement X
|
|
1167
|
+
|
|
1168
|
+
**Cycles:** 2
|
|
1169
|
+
**Flags:** N Z
|
|
1170
|
+
|
|
1171
|
+
### DEY — Decrement Y
|
|
1172
|
+
|
|
1173
|
+
Subtracts 1 from Y. N and Z reflect the new Y.
|
|
1174
|
+
|
|
1175
|
+
### $88 — DEY impl — Decrement Y
|
|
1176
|
+
|
|
1177
|
+
**Cycles:** 2
|
|
1178
|
+
**Flags:** N Z
|
|
1179
|
+
|
|
1180
|
+
### EOR — Exclusive OR
|
|
1181
|
+
|
|
1182
|
+
Bitwise exclusive-or between A and the operand, result in A. Useful
|
|
1183
|
+
for inverting specific bits (`EOR #$FF` flips all bits, `EOR #$80`
|
|
1184
|
+
flips the high bit), comparing two values for difference, and
|
|
1185
|
+
running stream XOR ciphers.
|
|
1186
|
+
|
|
1187
|
+
### $49 — EOR #imm — Exclusive OR, immediate
|
|
1188
|
+
|
|
1189
|
+
**Cycles:** 2
|
|
1190
|
+
**Flags:** N Z
|
|
1191
|
+
|
|
1192
|
+
### $45 — EOR zp — Exclusive OR, zero page
|
|
1193
|
+
|
|
1194
|
+
**Cycles:** 3
|
|
1195
|
+
**Flags:** N Z
|
|
1196
|
+
|
|
1197
|
+
### $55 — EOR zp,X — Exclusive OR, zero page indexed by X
|
|
1198
|
+
|
|
1199
|
+
**Cycles:** 4
|
|
1200
|
+
**Flags:** N Z
|
|
1201
|
+
|
|
1202
|
+
### $4D — EOR abs — Exclusive OR, absolute
|
|
1203
|
+
|
|
1204
|
+
**Cycles:** 4
|
|
1205
|
+
**Flags:** N Z
|
|
1206
|
+
|
|
1207
|
+
### $5D — EOR abs,X — Exclusive OR, absolute indexed by X
|
|
1208
|
+
|
|
1209
|
+
**Cycles:** 4
|
|
1210
|
+
**Flags:** N Z
|
|
1211
|
+
**Page-cross:** +1
|
|
1212
|
+
|
|
1213
|
+
### $59 — EOR abs,Y — Exclusive OR, absolute indexed by Y
|
|
1214
|
+
|
|
1215
|
+
**Cycles:** 4
|
|
1216
|
+
**Flags:** N Z
|
|
1217
|
+
**Page-cross:** +1
|
|
1218
|
+
|
|
1219
|
+
### $41 — EOR (zp,X) — Exclusive OR, indexed indirect
|
|
1220
|
+
|
|
1221
|
+
**Cycles:** 6
|
|
1222
|
+
**Flags:** N Z
|
|
1223
|
+
|
|
1224
|
+
### $51 — EOR (zp),Y — Exclusive OR, indirect indexed
|
|
1225
|
+
|
|
1226
|
+
**Cycles:** 5
|
|
1227
|
+
**Flags:** N Z
|
|
1228
|
+
**Page-cross:** +1
|
|
1229
|
+
|
|
1230
|
+
### INC — Increment Memory
|
|
1231
|
+
|
|
1232
|
+
Adds 1 to the memory operand. N and Z are set from the result.
|
|
1233
|
+
Read-modify-write.
|
|
1234
|
+
|
|
1235
|
+
### $E6 — INC zp — Increment zero page
|
|
1236
|
+
|
|
1237
|
+
**Cycles:** 5
|
|
1238
|
+
**Flags:** N Z
|
|
1239
|
+
|
|
1240
|
+
### $F6 — INC zp,X — Increment zero page indexed by X
|
|
1241
|
+
|
|
1242
|
+
**Cycles:** 6
|
|
1243
|
+
**Flags:** N Z
|
|
1244
|
+
|
|
1245
|
+
### $EE — INC abs — Increment absolute
|
|
1246
|
+
|
|
1247
|
+
**Cycles:** 6
|
|
1248
|
+
**Flags:** N Z
|
|
1249
|
+
|
|
1250
|
+
### $FE — INC abs,X — Increment absolute indexed by X
|
|
1251
|
+
|
|
1252
|
+
**Cycles:** 7
|
|
1253
|
+
**Flags:** N Z
|
|
1254
|
+
|
|
1255
|
+
### INX — Increment X
|
|
1256
|
+
|
|
1257
|
+
Adds 1 to X.
|
|
1258
|
+
|
|
1259
|
+
### $E8 — INX impl — Increment X
|
|
1260
|
+
|
|
1261
|
+
**Cycles:** 2
|
|
1262
|
+
**Flags:** N Z
|
|
1263
|
+
|
|
1264
|
+
### INY — Increment Y
|
|
1265
|
+
|
|
1266
|
+
Adds 1 to Y.
|
|
1267
|
+
|
|
1268
|
+
### $C8 — INY impl — Increment Y
|
|
1269
|
+
|
|
1270
|
+
**Cycles:** 2
|
|
1271
|
+
**Flags:** N Z
|
|
1272
|
+
|
|
1273
|
+
### JMP — Jump
|
|
1274
|
+
|
|
1275
|
+
Unconditional jump. Two modes: absolute (jump to a fixed address) and
|
|
1276
|
+
indirect (jump to the address stored at the operand). The indirect
|
|
1277
|
+
form has the famous page-wrap bug — see [Pitfalls](#pitfalls).
|
|
1278
|
+
|
|
1279
|
+
### $4C — JMP abs — Jump, absolute
|
|
1280
|
+
|
|
1281
|
+
**Cycles:** 3
|
|
1282
|
+
**Flags:** —
|
|
1283
|
+
|
|
1284
|
+
### $6C — JMP (abs) — Jump, indirect
|
|
1285
|
+
|
|
1286
|
+
**Cycles:** 5
|
|
1287
|
+
**Flags:** —
|
|
1288
|
+
|
|
1289
|
+
### JSR — Jump to Subroutine
|
|
1290
|
+
|
|
1291
|
+
Pushes (PC + 2) (the address of the last byte of the JSR
|
|
1292
|
+
instruction), then jumps to the operand address. The matching RTS
|
|
1293
|
+
pulls the address and adds 1 to land on the next instruction.
|
|
1294
|
+
|
|
1295
|
+
### $20 — JSR abs — Jump to subroutine, absolute
|
|
1296
|
+
|
|
1297
|
+
**Cycles:** 6
|
|
1298
|
+
**Flags:** —
|
|
1299
|
+
|
|
1300
|
+
### LDA — Load Accumulator
|
|
1301
|
+
|
|
1302
|
+
Loads the operand into A. Sets N and Z from the loaded value. The
|
|
1303
|
+
most heavily used instruction in 6502/6510 code.
|
|
1304
|
+
|
|
1305
|
+
### $A9 — LDA #imm — Load A, immediate
|
|
1306
|
+
|
|
1307
|
+
**Cycles:** 2
|
|
1308
|
+
**Flags:** N Z
|
|
1309
|
+
|
|
1310
|
+
### $A5 — LDA zp — Load A, zero page
|
|
1311
|
+
|
|
1312
|
+
**Cycles:** 3
|
|
1313
|
+
**Flags:** N Z
|
|
1314
|
+
|
|
1315
|
+
### $B5 — LDA zp,X — Load A, zero page indexed by X
|
|
1316
|
+
|
|
1317
|
+
**Cycles:** 4
|
|
1318
|
+
**Flags:** N Z
|
|
1319
|
+
|
|
1320
|
+
### $AD — LDA abs — Load A, absolute
|
|
1321
|
+
|
|
1322
|
+
**Cycles:** 4
|
|
1323
|
+
**Flags:** N Z
|
|
1324
|
+
|
|
1325
|
+
### $BD — LDA abs,X — Load A, absolute indexed by X
|
|
1326
|
+
|
|
1327
|
+
**Cycles:** 4
|
|
1328
|
+
**Flags:** N Z
|
|
1329
|
+
**Page-cross:** +1
|
|
1330
|
+
|
|
1331
|
+
### $B9 — LDA abs,Y — Load A, absolute indexed by Y
|
|
1332
|
+
|
|
1333
|
+
**Cycles:** 4
|
|
1334
|
+
**Flags:** N Z
|
|
1335
|
+
**Page-cross:** +1
|
|
1336
|
+
|
|
1337
|
+
### $A1 — LDA (zp,X) — Load A, indexed indirect
|
|
1338
|
+
|
|
1339
|
+
**Cycles:** 6
|
|
1340
|
+
**Flags:** N Z
|
|
1341
|
+
|
|
1342
|
+
### $B1 — LDA (zp),Y — Load A, indirect indexed
|
|
1343
|
+
|
|
1344
|
+
**Cycles:** 5
|
|
1345
|
+
**Flags:** N Z
|
|
1346
|
+
**Page-cross:** +1
|
|
1347
|
+
|
|
1348
|
+
### LDX — Load X
|
|
1349
|
+
|
|
1350
|
+
Loads the operand into X.
|
|
1351
|
+
|
|
1352
|
+
### $A2 — LDX #imm — Load X, immediate
|
|
1353
|
+
|
|
1354
|
+
**Cycles:** 2
|
|
1355
|
+
**Flags:** N Z
|
|
1356
|
+
|
|
1357
|
+
### $A6 — LDX zp — Load X, zero page
|
|
1358
|
+
|
|
1359
|
+
**Cycles:** 3
|
|
1360
|
+
**Flags:** N Z
|
|
1361
|
+
|
|
1362
|
+
### $B6 — LDX zp,Y — Load X, zero page indexed by Y
|
|
1363
|
+
|
|
1364
|
+
**Cycles:** 4
|
|
1365
|
+
**Flags:** N Z
|
|
1366
|
+
|
|
1367
|
+
### $AE — LDX abs — Load X, absolute
|
|
1368
|
+
|
|
1369
|
+
**Cycles:** 4
|
|
1370
|
+
**Flags:** N Z
|
|
1371
|
+
|
|
1372
|
+
### $BE — LDX abs,Y — Load X, absolute indexed by Y
|
|
1373
|
+
|
|
1374
|
+
**Cycles:** 4
|
|
1375
|
+
**Flags:** N Z
|
|
1376
|
+
**Page-cross:** +1
|
|
1377
|
+
|
|
1378
|
+
### LDY — Load Y
|
|
1379
|
+
|
|
1380
|
+
Loads the operand into Y.
|
|
1381
|
+
|
|
1382
|
+
### $A0 — LDY #imm — Load Y, immediate
|
|
1383
|
+
|
|
1384
|
+
**Cycles:** 2
|
|
1385
|
+
**Flags:** N Z
|
|
1386
|
+
|
|
1387
|
+
### $A4 — LDY zp — Load Y, zero page
|
|
1388
|
+
|
|
1389
|
+
**Cycles:** 3
|
|
1390
|
+
**Flags:** N Z
|
|
1391
|
+
|
|
1392
|
+
### $B4 — LDY zp,X — Load Y, zero page indexed by X
|
|
1393
|
+
|
|
1394
|
+
**Cycles:** 4
|
|
1395
|
+
**Flags:** N Z
|
|
1396
|
+
|
|
1397
|
+
### $AC — LDY abs — Load Y, absolute
|
|
1398
|
+
|
|
1399
|
+
**Cycles:** 4
|
|
1400
|
+
**Flags:** N Z
|
|
1401
|
+
|
|
1402
|
+
### $BC — LDY abs,X — Load Y, absolute indexed by X
|
|
1403
|
+
|
|
1404
|
+
**Cycles:** 4
|
|
1405
|
+
**Flags:** N Z
|
|
1406
|
+
**Page-cross:** +1
|
|
1407
|
+
|
|
1408
|
+
### LSR — Logical Shift Right
|
|
1409
|
+
|
|
1410
|
+
Shifts the operand right one bit. Bit 0 goes into C; bit 7 is filled
|
|
1411
|
+
with 0. N is always 0 after LSR. Z reflects whether the result is zero.
|
|
1412
|
+
|
|
1413
|
+
### $4A — LSR A — Logical shift right, accumulator
|
|
1414
|
+
|
|
1415
|
+
**Cycles:** 2
|
|
1416
|
+
**Flags:** N Z C
|
|
1417
|
+
|
|
1418
|
+
### $46 — LSR zp — Logical shift right, zero page
|
|
1419
|
+
|
|
1420
|
+
**Cycles:** 5
|
|
1421
|
+
**Flags:** N Z C
|
|
1422
|
+
|
|
1423
|
+
### $56 — LSR zp,X — Logical shift right, zero page indexed by X
|
|
1424
|
+
|
|
1425
|
+
**Cycles:** 6
|
|
1426
|
+
**Flags:** N Z C
|
|
1427
|
+
|
|
1428
|
+
### $4E — LSR abs — Logical shift right, absolute
|
|
1429
|
+
|
|
1430
|
+
**Cycles:** 6
|
|
1431
|
+
**Flags:** N Z C
|
|
1432
|
+
|
|
1433
|
+
### $5E — LSR abs,X — Logical shift right, absolute indexed by X
|
|
1434
|
+
|
|
1435
|
+
**Cycles:** 7
|
|
1436
|
+
**Flags:** N Z C
|
|
1437
|
+
|
|
1438
|
+
### NOP — No Operation
|
|
1439
|
+
|
|
1440
|
+
Does nothing for 2 cycles. The single legal NOP is $EA; there are
|
|
1441
|
+
several illegal NOP opcodes documented in
|
|
1442
|
+
[6502-illegal-opcodes.md](6502-illegal-opcodes.md) covering 1, 2, and
|
|
1443
|
+
3 byte forms with various cycle counts.
|
|
1444
|
+
|
|
1445
|
+
### $EA — NOP impl — No operation
|
|
1446
|
+
|
|
1447
|
+
**Cycles:** 2
|
|
1448
|
+
**Flags:** —
|
|
1449
|
+
|
|
1450
|
+
### ORA — Logical Inclusive OR
|
|
1451
|
+
|
|
1452
|
+
Bitwise OR between A and the operand, result in A. Common uses:
|
|
1453
|
+
setting specific bits in A, combining flags.
|
|
1454
|
+
|
|
1455
|
+
### $09 — ORA #imm — Logical OR, immediate
|
|
1456
|
+
|
|
1457
|
+
**Cycles:** 2
|
|
1458
|
+
**Flags:** N Z
|
|
1459
|
+
|
|
1460
|
+
### $05 — ORA zp — Logical OR, zero page
|
|
1461
|
+
|
|
1462
|
+
**Cycles:** 3
|
|
1463
|
+
**Flags:** N Z
|
|
1464
|
+
|
|
1465
|
+
### $15 — ORA zp,X — Logical OR, zero page indexed by X
|
|
1466
|
+
|
|
1467
|
+
**Cycles:** 4
|
|
1468
|
+
**Flags:** N Z
|
|
1469
|
+
|
|
1470
|
+
### $0D — ORA abs — Logical OR, absolute
|
|
1471
|
+
|
|
1472
|
+
**Cycles:** 4
|
|
1473
|
+
**Flags:** N Z
|
|
1474
|
+
|
|
1475
|
+
### $1D — ORA abs,X — Logical OR, absolute indexed by X
|
|
1476
|
+
|
|
1477
|
+
**Cycles:** 4
|
|
1478
|
+
**Flags:** N Z
|
|
1479
|
+
**Page-cross:** +1
|
|
1480
|
+
|
|
1481
|
+
### $19 — ORA abs,Y — Logical OR, absolute indexed by Y
|
|
1482
|
+
|
|
1483
|
+
**Cycles:** 4
|
|
1484
|
+
**Flags:** N Z
|
|
1485
|
+
**Page-cross:** +1
|
|
1486
|
+
|
|
1487
|
+
### $01 — ORA (zp,X) — Logical OR, indexed indirect
|
|
1488
|
+
|
|
1489
|
+
**Cycles:** 6
|
|
1490
|
+
**Flags:** N Z
|
|
1491
|
+
|
|
1492
|
+
### $11 — ORA (zp),Y — Logical OR, indirect indexed
|
|
1493
|
+
|
|
1494
|
+
**Cycles:** 5
|
|
1495
|
+
**Flags:** N Z
|
|
1496
|
+
**Page-cross:** +1
|
|
1497
|
+
|
|
1498
|
+
### PHA — Push Accumulator
|
|
1499
|
+
|
|
1500
|
+
Pushes A onto the stack. SP decrements after the push.
|
|
1501
|
+
|
|
1502
|
+
### $48 — PHA impl — Push accumulator
|
|
1503
|
+
|
|
1504
|
+
**Cycles:** 3
|
|
1505
|
+
**Flags:** —
|
|
1506
|
+
|
|
1507
|
+
### PHP — Push Processor Status
|
|
1508
|
+
|
|
1509
|
+
Pushes P onto the stack with bit 4 (B) = 1 and bit 5 = 1.
|
|
1510
|
+
|
|
1511
|
+
### $08 — PHP impl — Push processor status
|
|
1512
|
+
|
|
1513
|
+
**Cycles:** 3
|
|
1514
|
+
**Flags:** —
|
|
1515
|
+
|
|
1516
|
+
### PLA — Pull Accumulator
|
|
1517
|
+
|
|
1518
|
+
Pulls a byte from the stack into A. SP increments before the read.
|
|
1519
|
+
N and Z reflect the value pulled.
|
|
1520
|
+
|
|
1521
|
+
### $68 — PLA impl — Pull accumulator
|
|
1522
|
+
|
|
1523
|
+
**Cycles:** 4
|
|
1524
|
+
**Flags:** N Z
|
|
1525
|
+
|
|
1526
|
+
### PLP — Pull Processor Status
|
|
1527
|
+
|
|
1528
|
+
Pulls a byte from the stack into P. Bits 4 (B) and 5 (unused) of the
|
|
1529
|
+
pulled byte are *ignored* — they are not transferred to the live P
|
|
1530
|
+
register, which has no B flip-flop.
|
|
1531
|
+
|
|
1532
|
+
### $28 — PLP impl — Pull processor status
|
|
1533
|
+
|
|
1534
|
+
**Cycles:** 4
|
|
1535
|
+
**Flags:** N V Z C I D
|
|
1536
|
+
|
|
1537
|
+
### ROL — Rotate Left
|
|
1538
|
+
|
|
1539
|
+
Rotates the operand left one bit through C. C becomes new bit 0; old
|
|
1540
|
+
bit 7 becomes new C.
|
|
1541
|
+
|
|
1542
|
+
### $2A — ROL A — Rotate left, accumulator
|
|
1543
|
+
|
|
1544
|
+
**Cycles:** 2
|
|
1545
|
+
**Flags:** N Z C
|
|
1546
|
+
|
|
1547
|
+
### $26 — ROL zp — Rotate left, zero page
|
|
1548
|
+
|
|
1549
|
+
**Cycles:** 5
|
|
1550
|
+
**Flags:** N Z C
|
|
1551
|
+
|
|
1552
|
+
### $36 — ROL zp,X — Rotate left, zero page indexed by X
|
|
1553
|
+
|
|
1554
|
+
**Cycles:** 6
|
|
1555
|
+
**Flags:** N Z C
|
|
1556
|
+
|
|
1557
|
+
### $2E — ROL abs — Rotate left, absolute
|
|
1558
|
+
|
|
1559
|
+
**Cycles:** 6
|
|
1560
|
+
**Flags:** N Z C
|
|
1561
|
+
|
|
1562
|
+
### $3E — ROL abs,X — Rotate left, absolute indexed by X
|
|
1563
|
+
|
|
1564
|
+
**Cycles:** 7
|
|
1565
|
+
**Flags:** N Z C
|
|
1566
|
+
|
|
1567
|
+
### ROR — Rotate Right
|
|
1568
|
+
|
|
1569
|
+
Rotates the operand right one bit through C. C becomes new bit 7; old
|
|
1570
|
+
bit 0 becomes new C.
|
|
1571
|
+
|
|
1572
|
+
The original NMOS 6502 mask-rev A did not have ROR — it executed as
|
|
1573
|
+
an unspecified result. All 6510s and all post-rev-A 6502s implement
|
|
1574
|
+
ROR correctly. Practical C64 code can assume ROR works.
|
|
1575
|
+
|
|
1576
|
+
### $6A — ROR A — Rotate right, accumulator
|
|
1577
|
+
|
|
1578
|
+
**Cycles:** 2
|
|
1579
|
+
**Flags:** N Z C
|
|
1580
|
+
|
|
1581
|
+
### $66 — ROR zp — Rotate right, zero page
|
|
1582
|
+
|
|
1583
|
+
**Cycles:** 5
|
|
1584
|
+
**Flags:** N Z C
|
|
1585
|
+
|
|
1586
|
+
### $76 — ROR zp,X — Rotate right, zero page indexed by X
|
|
1587
|
+
|
|
1588
|
+
**Cycles:** 6
|
|
1589
|
+
**Flags:** N Z C
|
|
1590
|
+
|
|
1591
|
+
### $6E — ROR abs — Rotate right, absolute
|
|
1592
|
+
|
|
1593
|
+
**Cycles:** 6
|
|
1594
|
+
**Flags:** N Z C
|
|
1595
|
+
|
|
1596
|
+
### $7E — ROR abs,X — Rotate right, absolute indexed by X
|
|
1597
|
+
|
|
1598
|
+
**Cycles:** 7
|
|
1599
|
+
**Flags:** N Z C
|
|
1600
|
+
|
|
1601
|
+
### RTI — Return from Interrupt
|
|
1602
|
+
|
|
1603
|
+
Pulls P, then pulls a 16-bit return address (low first, then high)
|
|
1604
|
+
into PC. Unlike RTS, RTI does *not* add 1 to the pulled address. This
|
|
1605
|
+
matches the way IRQ/NMI/BRK pushed the address.
|
|
1606
|
+
|
|
1607
|
+
### $40 — RTI impl — Return from interrupt
|
|
1608
|
+
|
|
1609
|
+
**Cycles:** 6
|
|
1610
|
+
**Flags:** N V Z C I D
|
|
1611
|
+
|
|
1612
|
+
### RTS — Return from Subroutine
|
|
1613
|
+
|
|
1614
|
+
Pulls a 16-bit address (low first, then high), adds 1, and stores
|
|
1615
|
+
the result in PC. This matches JSR, which pushed (PC + 2) i.e. the
|
|
1616
|
+
address of its last operand byte.
|
|
1617
|
+
|
|
1618
|
+
### $60 — RTS impl — Return from subroutine
|
|
1619
|
+
|
|
1620
|
+
**Cycles:** 6
|
|
1621
|
+
**Flags:** —
|
|
1622
|
+
|
|
1623
|
+
### SBC — Subtract with Carry
|
|
1624
|
+
|
|
1625
|
+
SBC subtracts the operand and the inverted carry from A: `A := A − operand − (1 − C)`.
|
|
1626
|
+
The carry flag is the *inverted borrow*: SEC before the first SBC of
|
|
1627
|
+
a subtraction chain.
|
|
1628
|
+
|
|
1629
|
+
After the operation, C=1 means "no borrow out" (i.e. A ≥ operand) and
|
|
1630
|
+
C=0 means "borrow out". V is set on signed overflow. In decimal mode,
|
|
1631
|
+
SBC produces packed BCD output; N, V, Z are undefined on NMOS.
|
|
1632
|
+
|
|
1633
|
+
### $E9 — SBC #imm — Subtract with carry, immediate
|
|
1634
|
+
|
|
1635
|
+
**Cycles:** 2
|
|
1636
|
+
**Flags:** N V Z C
|
|
1637
|
+
|
|
1638
|
+
### $E5 — SBC zp — Subtract with carry, zero page
|
|
1639
|
+
|
|
1640
|
+
**Cycles:** 3
|
|
1641
|
+
**Flags:** N V Z C
|
|
1642
|
+
|
|
1643
|
+
### $F5 — SBC zp,X — Subtract with carry, zero page indexed by X
|
|
1644
|
+
|
|
1645
|
+
**Cycles:** 4
|
|
1646
|
+
**Flags:** N V Z C
|
|
1647
|
+
|
|
1648
|
+
### $ED — SBC abs — Subtract with carry, absolute
|
|
1649
|
+
|
|
1650
|
+
**Cycles:** 4
|
|
1651
|
+
**Flags:** N V Z C
|
|
1652
|
+
|
|
1653
|
+
### $FD — SBC abs,X — Subtract with carry, absolute indexed by X
|
|
1654
|
+
|
|
1655
|
+
**Cycles:** 4
|
|
1656
|
+
**Flags:** N V Z C
|
|
1657
|
+
**Page-cross:** +1
|
|
1658
|
+
|
|
1659
|
+
### $F9 — SBC abs,Y — Subtract with carry, absolute indexed by Y
|
|
1660
|
+
|
|
1661
|
+
**Cycles:** 4
|
|
1662
|
+
**Flags:** N V Z C
|
|
1663
|
+
**Page-cross:** +1
|
|
1664
|
+
|
|
1665
|
+
### $E1 — SBC (zp,X) — Subtract with carry, indexed indirect
|
|
1666
|
+
|
|
1667
|
+
**Cycles:** 6
|
|
1668
|
+
**Flags:** N V Z C
|
|
1669
|
+
|
|
1670
|
+
### $F1 — SBC (zp),Y — Subtract with carry, indirect indexed
|
|
1671
|
+
|
|
1672
|
+
**Cycles:** 5
|
|
1673
|
+
**Flags:** N V Z C
|
|
1674
|
+
**Page-cross:** +1
|
|
1675
|
+
|
|
1676
|
+
### SEC — Set Carry
|
|
1677
|
+
|
|
1678
|
+
Sets C. Standard preamble before the first SBC of a subtraction chain.
|
|
1679
|
+
|
|
1680
|
+
### $38 — SEC impl — Set carry flag
|
|
1681
|
+
|
|
1682
|
+
**Cycles:** 2
|
|
1683
|
+
**Flags:** C
|
|
1684
|
+
|
|
1685
|
+
### SED — Set Decimal
|
|
1686
|
+
|
|
1687
|
+
Sets D, switching ADC/SBC to BCD mode.
|
|
1688
|
+
|
|
1689
|
+
### $F8 — SED impl — Set decimal flag
|
|
1690
|
+
|
|
1691
|
+
**Cycles:** 2
|
|
1692
|
+
**Flags:** D
|
|
1693
|
+
|
|
1694
|
+
### SEI — Set Interrupt Disable
|
|
1695
|
+
|
|
1696
|
+
Sets I, blocking IRQ. NMI is still allowed. Used to protect critical
|
|
1697
|
+
code sections.
|
|
1698
|
+
|
|
1699
|
+
### $78 — SEI impl — Set interrupt disable
|
|
1700
|
+
|
|
1701
|
+
**Cycles:** 2
|
|
1702
|
+
**Flags:** I
|
|
1703
|
+
|
|
1704
|
+
### STA — Store Accumulator
|
|
1705
|
+
|
|
1706
|
+
Writes A to the operand address. Does not modify flags. The indexed
|
|
1707
|
+
modes always take their unindexed cycle count plus one (write modes
|
|
1708
|
+
always pay the page-cross-style penalty as a dummy-read cycle).
|
|
1709
|
+
|
|
1710
|
+
### $85 — STA zp — Store A, zero page
|
|
1711
|
+
|
|
1712
|
+
**Cycles:** 3
|
|
1713
|
+
**Flags:** —
|
|
1714
|
+
|
|
1715
|
+
### $95 — STA zp,X — Store A, zero page indexed by X
|
|
1716
|
+
|
|
1717
|
+
**Cycles:** 4
|
|
1718
|
+
**Flags:** —
|
|
1719
|
+
|
|
1720
|
+
### $8D — STA abs — Store A, absolute
|
|
1721
|
+
|
|
1722
|
+
**Cycles:** 4
|
|
1723
|
+
**Flags:** —
|
|
1724
|
+
|
|
1725
|
+
### $9D — STA abs,X — Store A, absolute indexed by X
|
|
1726
|
+
|
|
1727
|
+
**Cycles:** 5
|
|
1728
|
+
**Flags:** —
|
|
1729
|
+
|
|
1730
|
+
### $99 — STA abs,Y — Store A, absolute indexed by Y
|
|
1731
|
+
|
|
1732
|
+
**Cycles:** 5
|
|
1733
|
+
**Flags:** —
|
|
1734
|
+
|
|
1735
|
+
### $81 — STA (zp,X) — Store A, indexed indirect
|
|
1736
|
+
|
|
1737
|
+
**Cycles:** 6
|
|
1738
|
+
**Flags:** —
|
|
1739
|
+
|
|
1740
|
+
### $91 — STA (zp),Y — Store A, indirect indexed
|
|
1741
|
+
|
|
1742
|
+
**Cycles:** 6
|
|
1743
|
+
**Flags:** —
|
|
1744
|
+
|
|
1745
|
+
### STX — Store X
|
|
1746
|
+
|
|
1747
|
+
Writes X to the operand address. Note: zero-page-indexed form uses Y
|
|
1748
|
+
(`STX zp,Y`), not X — symmetrical with LDX zp,Y. There is no
|
|
1749
|
+
`STX abs,X` or `STX abs,Y`.
|
|
1750
|
+
|
|
1751
|
+
### $86 — STX zp — Store X, zero page
|
|
1752
|
+
|
|
1753
|
+
**Cycles:** 3
|
|
1754
|
+
**Flags:** —
|
|
1755
|
+
|
|
1756
|
+
### $96 — STX zp,Y — Store X, zero page indexed by Y
|
|
1757
|
+
|
|
1758
|
+
**Cycles:** 4
|
|
1759
|
+
**Flags:** —
|
|
1760
|
+
|
|
1761
|
+
### $8E — STX abs — Store X, absolute
|
|
1762
|
+
|
|
1763
|
+
**Cycles:** 4
|
|
1764
|
+
**Flags:** —
|
|
1765
|
+
|
|
1766
|
+
### STY — Store Y
|
|
1767
|
+
|
|
1768
|
+
Writes Y to the operand address. There is no `STY abs,X` or
|
|
1769
|
+
`STY abs,Y`.
|
|
1770
|
+
|
|
1771
|
+
### $84 — STY zp — Store Y, zero page
|
|
1772
|
+
|
|
1773
|
+
**Cycles:** 3
|
|
1774
|
+
**Flags:** —
|
|
1775
|
+
|
|
1776
|
+
### $94 — STY zp,X — Store Y, zero page indexed by X
|
|
1777
|
+
|
|
1778
|
+
**Cycles:** 4
|
|
1779
|
+
**Flags:** —
|
|
1780
|
+
|
|
1781
|
+
### $8C — STY abs — Store Y, absolute
|
|
1782
|
+
|
|
1783
|
+
**Cycles:** 4
|
|
1784
|
+
**Flags:** —
|
|
1785
|
+
|
|
1786
|
+
### TAX — Transfer A to X
|
|
1787
|
+
|
|
1788
|
+
Copies A into X. Sets N and Z from the new X.
|
|
1789
|
+
|
|
1790
|
+
### $AA — TAX impl — Transfer A to X
|
|
1791
|
+
|
|
1792
|
+
**Cycles:** 2
|
|
1793
|
+
**Flags:** N Z
|
|
1794
|
+
|
|
1795
|
+
### TAY — Transfer A to Y
|
|
1796
|
+
|
|
1797
|
+
Copies A into Y. Sets N and Z from the new Y.
|
|
1798
|
+
|
|
1799
|
+
### $A8 — TAY impl — Transfer A to Y
|
|
1800
|
+
|
|
1801
|
+
**Cycles:** 2
|
|
1802
|
+
**Flags:** N Z
|
|
1803
|
+
|
|
1804
|
+
### TSX — Transfer Stack Pointer to X
|
|
1805
|
+
|
|
1806
|
+
Copies SP into X. Sets N and Z. The only way to *read* SP.
|
|
1807
|
+
|
|
1808
|
+
### $BA — TSX impl — Transfer stack pointer to X
|
|
1809
|
+
|
|
1810
|
+
**Cycles:** 2
|
|
1811
|
+
**Flags:** N Z
|
|
1812
|
+
|
|
1813
|
+
### TXA — Transfer X to A
|
|
1814
|
+
|
|
1815
|
+
Copies X into A.
|
|
1816
|
+
|
|
1817
|
+
### $8A — TXA impl — Transfer X to A
|
|
1818
|
+
|
|
1819
|
+
**Cycles:** 2
|
|
1820
|
+
**Flags:** N Z
|
|
1821
|
+
|
|
1822
|
+
### TXS — Transfer X to Stack Pointer
|
|
1823
|
+
|
|
1824
|
+
Copies X into SP. **Does not set flags** — this is the one transfer
|
|
1825
|
+
instruction that is flag-silent, so you can set up SP without
|
|
1826
|
+
disturbing the rest of the program state. Conventional startup:
|
|
1827
|
+
`LDX #$FF / TXS`.
|
|
1828
|
+
|
|
1829
|
+
### $9A — TXS impl — Transfer X to stack pointer
|
|
1830
|
+
|
|
1831
|
+
**Cycles:** 2
|
|
1832
|
+
**Flags:** —
|
|
1833
|
+
|
|
1834
|
+
### TYA — Transfer Y to A
|
|
1835
|
+
|
|
1836
|
+
Copies Y into A.
|
|
1837
|
+
|
|
1838
|
+
### $98 — TYA impl — Transfer Y to A
|
|
1839
|
+
|
|
1840
|
+
**Cycles:** 2
|
|
1841
|
+
**Flags:** N Z
|
|
1842
|
+
|
|
1843
|
+
## Page-crossing penalties
|
|
1844
|
+
|
|
1845
|
+
A "page" on the 6510 is a 256-byte aligned region of address space:
|
|
1846
|
+
$0000–$00FF is page 0, $0100–$01FF is page 1 (the stack), $0200–$02FF
|
|
1847
|
+
is page 2, etc. Crossing a page during effective-address computation
|
|
1848
|
+
costs an extra cycle on read instructions because the CPU performs
|
|
1849
|
+
the high-byte addition as a separate microcode step.
|
|
1850
|
+
|
|
1851
|
+
### Which instructions pay
|
|
1852
|
+
|
|
1853
|
+
Page-cross penalties apply to:
|
|
1854
|
+
|
|
1855
|
+
- `abs,X` and `abs,Y` read forms of ADC, AND, CMP, EOR, LDA, LDY, LDX,
|
|
1856
|
+
ORA, SBC.
|
|
1857
|
+
- `(zp),Y` read form of ADC, AND, CMP, EOR, LDA, ORA, SBC.
|
|
1858
|
+
- Taken branches that land on a different page (+1; the branch is
|
|
1859
|
+
always +1 cycle when taken, +2 when taken across a page).
|
|
1860
|
+
|
|
1861
|
+
### Which instructions do not pay (always max cycles)
|
|
1862
|
+
|
|
1863
|
+
Write instructions always take their worst-case cycle count regardless
|
|
1864
|
+
of page-cross, because the CPU performs a dummy read at the
|
|
1865
|
+
pre-fixup address before the real write:
|
|
1866
|
+
|
|
1867
|
+
- `STA abs,X`, `STA abs,Y`, `STA (zp),Y` — always 5 / 5 / 6 cycles.
|
|
1868
|
+
- Read-modify-write instructions (`ASL abs,X`, `DEC abs,X`,
|
|
1869
|
+
`INC abs,X`, `LSR abs,X`, `ROL abs,X`, `ROR abs,X`) — always 7
|
|
1870
|
+
cycles.
|
|
1871
|
+
|
|
1872
|
+
For these, the cycle count in the table and detail entries is the
|
|
1873
|
+
*real* cycle count; there is no "+1*" because the penalty is
|
|
1874
|
+
already baked in.
|
|
1875
|
+
|
|
1876
|
+
### Cycle-counting in practice
|
|
1877
|
+
|
|
1878
|
+
Demo coders avoid page crosses in their innermost loop to keep the
|
|
1879
|
+
cycle count constant. The standard trick is to align tables so the
|
|
1880
|
+
indexed-into-table reads never cross a page; or to use zero-page
|
|
1881
|
+
indirection (`(zp),Y`) with a manually-incremented high byte; or to
|
|
1882
|
+
unroll the loop so each iteration's address is a fixed absolute.
|
|
1883
|
+
|
|
1884
|
+
Branch crossings are easier to deal with: keep tight loops within a
|
|
1885
|
+
single page so the back-branch is always same-page (3 cycles, not 4).
|
|
1886
|
+
|
|
1887
|
+
## The I/O port at $00 / $01
|
|
1888
|
+
|
|
1889
|
+
The 6510 (and 6502) instruction set has no built-in I/O. The 6510
|
|
1890
|
+
adds a six-bit on-chip I/O port mapped into the low two bytes of
|
|
1891
|
+
the address space:
|
|
1892
|
+
|
|
1893
|
+
| Address | Name | Description |
|
|
1894
|
+
|---------|------|-------------|
|
|
1895
|
+
| $00 | DDR | Data direction register: bit n = 1 means "pin n is output", bit n = 0 means "pin n is input" |
|
|
1896
|
+
| $01 | DATA | Data register: writing sets output-pin levels; reading returns pin levels (output pins return what was last written; input pins return live pin state) |
|
|
1897
|
+
|
|
1898
|
+
The port has six physical pins on the chip. Bits 6 and 7 have no pins
|
|
1899
|
+
on the 6510. If configured as outputs they read back whatever was last
|
|
1900
|
+
written; if configured as inputs they read the last driven value,
|
|
1901
|
+
decaying to 0 over hundreds of milliseconds (see
|
|
1902
|
+
[Reading the port](#reading-the-port)). Mask them off (AND #$3F) before
|
|
1903
|
+
comparing $01. An earlier version of this paragraph said the two bits
|
|
1904
|
+
"behave as if always 0"; measured in VICE, $F7 written to $01 with
|
|
1905
|
+
DDR=$EF reads back as $F7.
|
|
1906
|
+
|
|
1907
|
+
### What each bit controls on the C64
|
|
1908
|
+
|
|
1909
|
+
Wired to the C64 board, the six port pins drive the C64's
|
|
1910
|
+
ROM/RAM/IO banking and the Datasette interface:
|
|
1911
|
+
|
|
1912
|
+
| Bit | Output meaning | Input meaning |
|
|
1913
|
+
|-----|----------------|---------------|
|
|
1914
|
+
| 0 | LORAM: bank BASIC ROM at $A000–$BFFF (0=RAM, 1=ROM) | (output) |
|
|
1915
|
+
| 1 | HIRAM: bank KERNAL ROM at $E000–$FFFF (0=RAM, 1=ROM) | (output) |
|
|
1916
|
+
| 2 | CHAREN: when LORAM or HIRAM is 1, 0 = character ROM at $D000–$DFFF, 1 = I/O. When LORAM=HIRAM=0 the region is RAM regardless of CHAREN (an earlier version of this row conditioned the character ROM on HIRAM alone; mode %001 shows it with HIRAM=0) | (output) |
|
|
1917
|
+
| 3 | Datasette write line | (output) |
|
|
1918
|
+
| 4 | (no output — input only) | Datasette switch sense: 0 = a tape button is pressed, 1 = none. Not the tape data line — tape READ pulses arrive on CIA1 /FLAG ($DC0D bit 4). |
|
|
1919
|
+
| 5 | Datasette motor (0=motor on, 1=motor off) | (output) |
|
|
1920
|
+
|
|
1921
|
+
The KERNAL uses bit 4 only as a button switch: its cassette-switch test
|
|
1922
|
+
at $F82E (`LDA #$10 / BIT $01`) drives the "PRESS PLAY ON TAPE" wait at
|
|
1923
|
+
$F817 and the "PRESS RECORD & PLAY ON TAPE" wait at $F838 — the same
|
|
1924
|
+
single bit, so software cannot tell which button is down — and the
|
|
1925
|
+
default IRQ's motor interlock at $EA61 turns the motor off (bit 5 = 1)
|
|
1926
|
+
while bit 4 reads 1 and on while it reads 0. Tape data is never read
|
|
1927
|
+
from this port: the tape-read setup enables the CIA1 FLAG interrupt
|
|
1928
|
+
(clears $DC0D, then writes $90 to it, at $F877/$F87A) and the read IRQ
|
|
1929
|
+
at $F92C times pulses with CIA1 timer B. An earlier version of the
|
|
1930
|
+
table above called bit 4 the "Datasette read sense", which reads as the
|
|
1931
|
+
data line; it is the switch.
|
|
1932
|
+
|
|
1933
|
+
The KERNAL's IOINIT ($FDA3; entered from RESET at $FCE2 and from the
|
|
1934
|
+
jump table at $FF84) writes DATA=$E7 to $01 first and then DDR=$2F to
|
|
1935
|
+
$00 (`LDA #$E7 / STA $01 / LDA #$2F / STA $00` at $FDD5) — an earlier
|
|
1936
|
+
version of this paragraph said "DATA=$37", which is what the port
|
|
1937
|
+
*reads back*, not what is written. DDR=$2F makes bits 0,1,2,3,5 outputs
|
|
1938
|
+
and bit 4 an input. With no tape button pressed, $01 then reads back as
|
|
1939
|
+
$37: LORAM=HIRAM=CHAREN=1, datasette write=0, sense=1 (input, pulled
|
|
1940
|
+
high), motor off; bits 6/7 are not connected on the 6510 and read as 0
|
|
1941
|
+
once the written 1s have decayed. This gives the default boot
|
|
1942
|
+
configuration: BASIC ROM at $A000, KERNAL ROM at $E000, I/O at $D000,
|
|
1943
|
+
datasette idle.
|
|
1944
|
+
|
|
1945
|
+
### The seven banking modes
|
|
1946
|
+
|
|
1947
|
+
The bottom three bits of $01 select one of eight combinations, seven of
|
|
1948
|
+
them distinct: %000 and %100 are both all-RAM. %110 ($36) and %111 ($37)
|
|
1949
|
+
are NOT the same — %110 has RAM at $A000–$BFFF, %111 has BASIC ROM
|
|
1950
|
+
there (an earlier version of this sentence called 6 and 7 the identical
|
|
1951
|
+
pair; the table below, and a VICE read of $A000 in each mode, say
|
|
1952
|
+
otherwise):
|
|
1953
|
+
|
|
1954
|
+
| Bits 210 | $A000–$BFFF | $D000–$DFFF | $E000–$FFFF |
|
|
1955
|
+
|----------|-------------|-------------|-------------|
|
|
1956
|
+
| 000 | RAM | RAM | RAM |
|
|
1957
|
+
| 001 | RAM | CHARROM | RAM |
|
|
1958
|
+
| 010 | RAM | CHARROM | KERNAL |
|
|
1959
|
+
| 011 | BASIC | CHARROM | KERNAL |
|
|
1960
|
+
| 100 | RAM | RAM | RAM |
|
|
1961
|
+
| 101 | RAM | I/O | RAM |
|
|
1962
|
+
| 110 | RAM | I/O | KERNAL |
|
|
1963
|
+
| 111 | BASIC | I/O | KERNAL |
|
|
1964
|
+
|
|
1965
|
+
(With expansion-port cartridge signals GAME and EXROM, additional
|
|
1966
|
+
banking modes are available; those are covered in
|
|
1967
|
+
[c64-memory-map.md](c64-memory-map.md).)
|
|
1968
|
+
|
|
1969
|
+
### Use cases
|
|
1970
|
+
|
|
1971
|
+
- Bank out I/O (set bit 2 = 0 with bit 1 = 1) to access character
|
|
1972
|
+
ROM at $D000–$DFFF for copying it into RAM.
|
|
1973
|
+
- Bank out everything (set bits 0,1,2 = 0) for a 64KB RAM space —
|
|
1974
|
+
needed by full-RAM games and many demos.
|
|
1975
|
+
- Bank out KERNAL (bit 1 = 0) to install a custom IRQ vector at
|
|
1976
|
+
$FFFE/$FFFF without going through the KERNAL dispatcher.
|
|
1977
|
+
|
|
1978
|
+
### Reading the port
|
|
1979
|
+
|
|
1980
|
+
When reading $01, the value returned is:
|
|
1981
|
+
|
|
1982
|
+
- For each pin configured as output (DDR bit = 1): the value last
|
|
1983
|
+
written to $01 for that bit.
|
|
1984
|
+
- For each pin configured as input (DDR bit = 0): the live state of
|
|
1985
|
+
the input pin.
|
|
1986
|
+
|
|
1987
|
+
Reading $00 returns the data direction register itself.
|
|
1988
|
+
|
|
1989
|
+
A subtle hardware effect on the two pin-less bits: bits 6 and 7 have
|
|
1990
|
+
no package pin, so when they are switched from output to input the
|
|
1991
|
+
last driven level lingers on the floating input. A 1 written there
|
|
1992
|
+
keeps reading as 1 for a few hundred milliseconds before decaying to 0
|
|
1993
|
+
(VICE models 350,000–420,000 cycles, about 0.35–0.43 s, randomised
|
|
1994
|
+
independently for each bit, and its source notes a measured average of
|
|
1995
|
+
roughly 350 ms for a 6510 and 1.5 s for an 8500, varying with
|
|
1996
|
+
temperature); a driven 0 stays 0. An earlier version of this paragraph
|
|
1997
|
+
said "several milliseconds" and attributed the effect to every pin —
|
|
1998
|
+
two orders of magnitude short, and wrong about the wired pins. The six
|
|
1999
|
+
wired pins do not behave this way on a C64 board: LORAM/HIRAM/CHAREN
|
|
2000
|
+
(bits 0–2) have pull-ups and read 1 as inputs regardless of what was
|
|
2001
|
+
last driven, bit 4 is always an input, and bits 3 and 5 read whatever
|
|
2002
|
+
the cassette circuitry holds them at (VICE: bit 3 keeps its last driven
|
|
2003
|
+
level, bit 5 reads 0). Do not rely on bits 6/7 for anything; the memory
|
|
2004
|
+
map's $0000–$0001 entry says the same. Defensive code that toggles DDR
|
|
2005
|
+
mid-frame should account for this — see
|
|
2006
|
+
[$0000-$0001 — Processor I/O port](c64-memory-map.md#0000-0001--processor-io-port)
|
|
2007
|
+
and the [Pitfalls](c64-memory-map.md#pitfalls) bullet on bits 6/7 in
|
|
2008
|
+
the memory map, which note the decay but give no figure.
|
|
2009
|
+
|
|
2010
|
+
### Why this matters for code
|
|
2011
|
+
|
|
2012
|
+
Any code that writes to $00 or $01 changes the visible memory map for
|
|
2013
|
+
the very next instruction fetch. If your code is running from a
|
|
2014
|
+
location that gets banked out, the *next* fetch returns the new
|
|
2015
|
+
mapping's contents. Standard practice: run banking-switch code from a
|
|
2016
|
+
location that maps to RAM in BOTH the old and the new configuration.
|
|
2017
|
+
With no cartridge, $0002–$9FFF and $C000–$CFFF are RAM in every $01
|
|
2018
|
+
setting (in practice use $0200 upward, clear of zero page and the
|
|
2019
|
+
stack), so put general-purpose banking switchers there. $A000–$BFFF,
|
|
2020
|
+
$D000–$DFFF and $E000–$FFFF are the multiplexed region (see the table
|
|
2021
|
+
above) — code there is fetched from BASIC ROM, character ROM/I/O or
|
|
2022
|
+
KERNAL ROM the instant a write to $01 selects them, so only place a
|
|
2023
|
+
switcher there if neither configuration it switches between maps ROM
|
|
2024
|
+
or I/O over it. An earlier version of this paragraph said "$0200–$BFFF
|
|
2025
|
+
is always present"; $A000–$BFFF is BASIC ROM whenever LORAM and HIRAM
|
|
2026
|
+
are both 1.
|
|
2027
|
+
|
|
2028
|
+
The very common idiom:
|
|
2029
|
+
|
|
2030
|
+
```asm
|
|
2031
|
+
SEI ; block IRQ (which would re-read KERNAL)
|
|
2032
|
+
LDA #$35 ; LORAM=1, HIRAM=0, CHAREN=1 → KERNAL out, I/O in
|
|
2033
|
+
STA $01
|
|
2034
|
+
; ... do stuff with KERNAL banked out ...
|
|
2035
|
+
LDA #$37 ; restore default
|
|
2036
|
+
STA $01
|
|
2037
|
+
CLI
|
|
2038
|
+
```
|
|
2039
|
+
|
|
2040
|
+
## Pitfalls
|
|
2041
|
+
|
|
2042
|
+
- **BRK is a 2-byte instruction.** The opcode is $00, but the byte
|
|
2043
|
+
following it is reserved as a "signature" byte. BRK pushes
|
|
2044
|
+
(PC + 2), not (PC + 1), as the return address. A BRK followed by
|
|
2045
|
+
RTI returns to the byte *two* past the BRK. Code that disassembles
|
|
2046
|
+
raw bytes naively will misalign after a BRK.
|
|
2047
|
+
- **JMP indirect page-wrap bug.** `JMP ($xxFF)` reads the low byte
|
|
2048
|
+
from $xxFF but the high byte from $xx00, not $xx00+$100. Always
|
|
2049
|
+
place indirect-JMP pointers so the low byte is not on the last
|
|
2050
|
+
byte of a page.
|
|
2051
|
+
- **Decimal flag undefined at reset.** The hardware does not zero D
|
|
2052
|
+
on RESET. The KERNAL reset routine clears it; custom reset
|
|
2053
|
+
handlers must do `CLD` before any ADC/SBC.
|
|
2054
|
+
- **N/V/Z undefined after BCD ADC/SBC.** Only C is reliable after a
|
|
2055
|
+
BCD operation on the NMOS 6510. Code that needs to branch on the
|
|
2056
|
+
result of a BCD compare must convert back to binary first or use
|
|
2057
|
+
CMP after a SED block.
|
|
2058
|
+
- **Zero-page,X wraps inside zero page.** `LDA $80,X` with X=$F0
|
|
2059
|
+
reads from $70, not $0170. The same applies to `STA $xx,X` and
|
|
2060
|
+
the rest of the `zp,X` family.
|
|
2061
|
+
- **(zp,X) and (zp),Y are different beasts.** `LDA ($10,X)` adds X
|
|
2062
|
+
to the pointer *address* inside zero page; `LDA ($10),Y` adds Y
|
|
2063
|
+
to the dereferenced pointer *value*. Mixing them up is the most
|
|
2064
|
+
common 6510 bug.
|
|
2065
|
+
- **Branches are signed 8-bit relative.** Range is −128 to +127. If
|
|
2066
|
+
your assembler reports "branch out of range", insert a `BCC :+ /
|
|
2067
|
+
JMP target / :` trampoline.
|
|
2068
|
+
- **C must be cleared before first ADC, set before first SBC.** ADC
|
|
2069
|
+
and SBC always use the live C; stale C from a CMP or shift will
|
|
2070
|
+
perturb arithmetic by 1.
|
|
2071
|
+
- **PHP and BRK push P with B=1; IRQ and NMI push P with B=0.** The
|
|
2072
|
+
pushed B bit is how a handler distinguishes BRK from IRQ when
|
|
2073
|
+
both vector through $FFFE.
|
|
2074
|
+
- **RTI does not add 1.** RTS does. Mismatching them (RTI from a JSR
|
|
2075
|
+
or RTS from an IRQ) lands one byte off.
|
|
2076
|
+
- **TXS does not modify flags.** All other T?? transfers do. This is
|
|
2077
|
+
intentional so you can set SP between flag-sensitive operations.
|
|
2078
|
+
- **STA abs,X/Y, STA (zp),Y, and all RMW indexed always pay the
|
|
2079
|
+
page-cross penalty.** No "+1*" in their cycle table — the penalty
|
|
2080
|
+
is baked into the constant cycle count. Demo coders who balance
|
|
2081
|
+
read and write cycles need to remember this.
|
|
2082
|
+
- **Reading $01 with input pins.** Pins configured as input in $00
|
|
2083
|
+
return live pin state. If a cartridge or external hardware drives
|
|
2084
|
+
these lines, the read value is not what was last written.
|
|
2085
|
+
- **Writing to $01 immediately remaps memory.** If your code is
|
|
2086
|
+
located in the region being remapped, the next fetch hits the
|
|
2087
|
+
new mapping. Always bank-switch from a region that is identical
|
|
2088
|
+
in both mappings (i.e. $0200–$9FFF or $C000–$CFFF on the C64).
|
|
2089
|
+
- **The IRQ handler must save A, X, Y by hand on the 6510.** Only PC
|
|
2090
|
+
and P are pushed by the hardware. A handler that clobbers A but
|
|
2091
|
+
did not PHA on entry will corrupt the interrupted code's state.
|
|
2092
|
+
- **CLI inside an IRQ handler immediately re-enables IRQ.** If the
|
|
2093
|
+
IRQ source has not been acknowledged before CLI, a second IRQ will
|
|
2094
|
+
re-enter the handler.
|
|
2095
|
+
|
|
2096
|
+
## Sources
|
|
2097
|
+
|
|
2098
|
+
- "6502 Instruction Set", *masswerk.at*.
|
|
2099
|
+
https://www.masswerk.at/6502/6502_instruction_set.html
|
|
2100
|
+
- "6502/6510 Opcodes", *oxyron.de* (legal opcode section).
|
|
2101
|
+
https://www.oxyron.de/html/opcodes02.html
|
|
2102
|
+
- "Processor (C64)", *C64-Wiki*. https://www.c64-wiki.com/wiki/Processor
|
|
2103
|
+
- "6502", *pagetable.com c64ref*. https://www.pagetable.com/c64ref/6502/
|
|
2104
|
+
- *MCS 6500 Microcomputer Family Programming Manual*, MOS Technology,
|
|
2105
|
+
1976. The original MOS programmer's reference.
|
|
2106
|
+
- *Programming the Commodore 64*, Raeto West, Compute! Publications,
|
|
2107
|
+
1985. Chapters on the 6510 and the $00/$01 port.
|
|
2108
|
+
- "Zeropage", Codebase 64. https://codebase64.org/doku.php?id=base:zeropage
|
|
2109
|
+
- "6510 I/O port", Codebase 64.
|
|
2110
|
+
https://codebase64.org/doku.php?id=base:6510_processor_port
|
|
2111
|
+
|
|
2112
|
+
<!-- doc-type: hardware-reference -->
|