Przejdź do treści
Biblioteka skilli
Nauka i badania · Nauka i wyjaśnianie

6502-commenting

/6502-commenting

Dodaje komentarze semantyczne i etykiety do dezasemblowanego kodu 6502, wyjaśniając rutyny i sekwencje instrukcji.

Licencja
MIT
Ostatnia zmiana repozytorium
08.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
7
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 08.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: examples/pointer_step.py

Co robi i kiedy

Dodaje komentarze semantyczne i etykiety do dezasemblowanego kodu 6502, wyjaśniając rutyny i sekwencje instrukcji.

Oryginalny opis (EN)

Analyze already identified 6502 assembly code and add useful semantic comments, labels, and explanations. Use when documenting disassembly, explaining what individual instructions and short sequences accomplish, identifying variables and hardware accesses, or deeply analyzing routines such as PRNGs, arithmetic, state machines, parsers, and algorithms. May write small Python programs to simulate difficult code when that provides stronger evidence than static inspection alone.

Jak działa

  1. Prerequisite gate
  2. Read by task
  3. Rules to keep visible
  4. Routine summary template
  5. Small worked example
  6. Completion
Sekcje z nagłówków SKILL.md, w oryginale · 56 linii, 581 słów
Podgląd SKILL.md
---
name: 6502-commenting
description: Analyze already identified 6502 assembly code and add useful semantic comments, labels, and explanations. Use when documenting disassembly, explaining what individual instructions and short sequences accomplish, identifying variables and hardware accesses, or deeply analyzing routines such as PRNGs, arithmetic, state machines, parsers, and algorithms. May write small Python programs to simulate difficult code when that provides stronger evidence than static inspection alone.
---

# 6502 Code Commenting

Explain **what established code does and why**, not each opcode in English. Input is structurally supported disassembly plus its machine context and evidence; output is annotated routines, justified labels/contracts and explicit unknowns. This skill does not require a particular model, harness or debugger.

## Prerequisite gate

Confirm code/data boundaries, entry points and CPU/mapping first. If structure, indirect flow or runtime-decrypted bytes remain uncertain, use `6502-disassembly` first or alongside this skill. Do not make questionable assembly look authoritative by adding polished comments.

Before commenting a routine, inspect its callers, callees, flag dependencies, referenced state/tables and all known entries/exits. Explain every confirmed reachable instruction within a block or retain an explicit unresolved item; “accounted for” does not mean one comment per opcode.

## Read by task

| Task/trigger | Required reference | Result |
|---|---|---|
| First use or deciding what deserves a comment | [Commenting contract](references/commenting-contract.md) | Semantic rather than mechanical style |
| Any routine-level annotation or new semantic name | [Routine analysis](references/routine-analysis.md) | Coverage, caller evidence, inputs/outputs/clobbers and block roles |
| Hardware, arithmetic, loops, flag-based branches or tables | [Hardware, arithmetic and tables](references/hardware-arithmetic-and-tables.md) | Proven widths, bounds, signedness, flag producers and table interpretation |
| Simulation, live experiments, final comments or confidence review | [Validation and presentation](references/validation-and-presentation.md) | Checked model/observations, confidence labels and concise summaries |

Read only applicable references, but read them **before** the corresponding analysis. For C64/1541 internal calls or register meanings, also use `c64-rom-reference` with the actual mapping/revision.

## Rules to keep visible

- Trace where branch flags were established; many instructions change N/Z implicitly. Do not translate `BEQ` into a game condition without proving its producer.
- Derive routine inputs, outputs, preserved/clobbered registers/flags, memory effects and hardware side effects. Include inline parameters and self-modified operands when material.
- Interpret arithmetic using actual widths, wraparound, carry/borrow, signedness and relevant decimal/CPU behavior. A plausible formula is a hypothesis until checked.
- Analyze tables with their consumers: entry count/width, pointer or numeric interpretation, index formula and parallel-table relationships.
- Keep neutral labels until supported. One access is not enough to rename a location `player_hp`; “likely” and “context pending” are useful, honest outcomes.
- Prefer a block comment such as “advance pointer by one 40-column row” over repeating LDA/ADC/STA meanings. Comment individual instructions when constants, flag setup or hardware effects carry nonobvious meaning.
- Simulations are evidence tools, not independent truth. Supply material state, keep tests bounded and check against a known or observed case when practical. Never claim a Python model proves the real program merely because it agrees with itself.
- Use focused runtime observations when they resolve a specific uncertainty; they do not prove unobserved paths. Preserve evidence and identify assumptions/limits.

## Routine summary template

Use only fields established by evidence; mark missing contracts unknown rather than fill them from convention:

```text
Purpose and scope:
Entry points / calling assumptions:
Inputs (registers, flags, memory, hardware):
Outputs and clobbers:
Memory / hardware side effects:
Algorithm / loop / table invariant:
Evidence and confidence:
Unresolved effects or paths:
```

## Small worked example

See the [synthetic pointer-step example](examples/README.md) for a semantic contract, carry-path explanation, and bounded executable check using the shared CPU model.

## Completion

Deliver semantic comments/labels that fit the surrounding assembly style, routine contracts, block-level instruction accountability and a retained uncertainty list. No byte modification is implied by a commenting request. A partial explanation is preferable to an unsupported complete story; if structural evidence breaks down, return to disassembly instead of guessing.
Pliki w paczce (7)
  • SKILL.md 5 KB
  • examples/README.md 2 KB
  • examples/pointer_step.py 1 KB
  • references/commenting-contract.md 2 KB
  • references/hardware-arithmetic-and-tables.md 2 KB
  • references/routine-analysis.md 3 KB
  • references/validation-and-presentation.md 4 KB

Wersje

W bazie nie ma innych skilli o nazwie 6502-commenting.

Migawka bazy z 13.11.2026 · wersja paczki d37774c82aa2 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 1006502-disassembly
    Analizuje kod maszynowy 6502, rozróżnia kod i dane oraz buduje uporządkowany dezasembler w Retro Debuggerze.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.