Skip to content

Block Types and Helpers

Every byte in a Regenerator 2000 project belongs to a Block Type, which controls how the disassembler decodes, labels, and formats that byte range.

Press any block shortcut on the current line—or press Shift+V first to enter Visual Mode and convert an entire range at once.

Quick Reference

Key Block Type Labels & X-Refs? Best Used For
D Disassemble Address (Flow) Yes Tracing entry points and subroutines automatically
C Code Yes Forcing 6502 instruction decoding on a fixed range
B Data Byte — Sprite/charset bytes, lookup tables, single-byte variables
W Data Word — 16-bit numeric counters and non-pointer constants
A Address Yes Jump tables and 16-bit pointer arrays
P PETSCII Text — CHROUT strings, menus, high-score text
S Screencode Text — Strings copied straight into Screen RAM (e.g. $0400)
< Lo/Hi Address Table Yes Split pointer tables (low bytes first, high bytes second)
> Hi/Lo Address Table Yes Split pointer tables (high bytes first, low bytes second)
, Lo/Hi Word Table — Split 16-bit numeric tables (e.g. SID frequency tables)
. Hi/Lo Word Table — Split 16-bit numeric tables stored high-byte first
Shift+E External File — Large binary blobs (SID music, bitmaps) exported to .bin
? Undefined — Clearing classifications back to unexplored bytes

Assembler Directive Conventions

Most block types look nearly identical across all four assemblers—only three syntax conventions differ globally:

  • ACME prefixes data and fill directives with ! instead of . (!byte, !word, !fill, !binary).
  • KickAssembler uses // for comments instead of ;.
  • ca65 emits .res N, $XX for compressed byte fill runs instead of .fill / !fill.

Multi-assembler tabs are shown below only where directives diverge significantly (text encodings, external binaries, and lexical scopes).


Code & Flow Analysis

Disassemble Address (Flow Analysis)

Shortcut: D

Traces execution starting from the cursor across 6502 branches, jumps, and JSR calls, converting every reachable instruction range into Code blocks. Because flow analysis skips inline data tables parked between subroutines, prefer D over C when exploring unknown code.

Where Tracing Stops

Unconditional return instructions (RTS and RTI) stop the active trace path. Unreferenced bytes immediately after a return remain unexplored until another branch or jump reaches them.

Code

Shortcut: C

Decodes the selected byte range directly as MOS 6502/6510 instructions without following branches beyond the selection. Useful when jump tables or self-modifying code jump into a block that flow analysis did not discover.

64tass / ca65
lda #$00
sta a_D020

Data & Pointer Blocks

Data Byte

Shortcut: B

Formats bytes as 8-bit hexadecimal values—ideal for graphics bytes, lookup tables, and 8-bit variables.

64tass / ca65
.byte $80, $40, $a2, $ff

Fill Run Threshold

When a contiguous run of identical bytes meets or exceeds the Fill run threshold in Document Settings (default 8), Regenerator 2000 collapses it into a single fill directive:

Assembler Fill Syntax
64tass / KickAssembler .fill N, $XX
ACME !fill N, $XX
ca65 .res N, $XX

Data Word

Shortcut: W

Formats pairs of bytes as little-endian 16-bit numeric constants without generating labels or cross-references. Use this for numeric values—never for pointers.

64tass / ca65
.word $1234, $ffaa, $5678, $0000, $abcd

Address

Shortcut: A

Formats pairs of bytes as 16-bit little-endian memory pointers. Unlike Data Word, the analyzer resolves every word to a label and records an [O] offset cross-reference at the target address.

64tass / ca65
.word a_1234, a_FFAA, a_5678, a_0000, a_ABCD ; (1)!
  1. Each entry creates (or reuses) a label at that target address and links it to the Jump to Operand picker (Enter).

Text Blocks

PETSCII Text

Shortcut: P

Decodes bytes as Commodore PETSCII strings—the standard encoding for CHROUT ($FFD2) output and BASIC messages. Contiguous printable runs are grouped into quoted strings.

.encode
.enc "none"
.text "hello world"
.endencode
!text "hello world"
.encoding "petscii_upper"
.text "hello world"
.byte "hello world"

Screencode Text

Shortcut: S

Decodes bytes as Commodore video-matrix screen codes for buffers written directly to Screen RAM (such as $0400 on the C64, where 'A' is $01 instead of PETSCII $41).

.encode
.enc "screen"
.text "hello world"
.endencode
!scr "hello world"
.encoding "screencode_mixed"
.text "hello world"
; Requires .macpack cbm
scrcode "hello world"

Split Lo/Hi & Hi/Lo Tables

6502 programs frequently store 16-bit tables as two separate parallel arrays indexed by X or Y (LDA table_lo,X / LDA table_hi,X). Select an even number of bytes in Visual Mode and choose one of the four split formats:

Key Block Type First Half Second Half Labels & X-Refs? Typical Use
< Lo/Hi Address Low bytes High bytes Yes Split jump/RTS/pointer tables (low first)
> Hi/Lo Address High bytes Low bytes Yes Split jump/RTS/pointer tables (high first)
, Lo/Hi Word Low bytes High bytes — Split numeric tables like SID frequencies
. Hi/Lo Word High bytes Low bytes — Split numeric tables stored high-byte first

Here is how the exact same 8 raw bytes ($00, $01, $02, $03, $c0, $d1, $e2, $f3) decode under each split block type:

64tass / ca65
.byte <a_C000, <a_D101, <a_E202, <a_F303 ; (1)!
.byte >a_C000, >a_D101, >a_E202, >a_F303
  1. Pairs $00+$C0 as $C000, generating a_C000 (or reusing any user label) and [O] cross-references.
64tass / ca65
.byte >a_00C0, >a_01D1, >a_02E2, >a_03F3 ; (1)!
.byte <a_00C0, <a_01D1, <a_02E2, <a_03F3
  1. Pairs $00 (high) + $C0 (low) as $00C0, generating a_00C0 and [O] cross-references.
64tass / ca65
.byte <$C000, <$D101, <$E202, <$F303 ; (1)!
.byte >$C000, >$D101, >$E202, >$F303
  1. Keeps $C000–$F303 as raw 16-bit literals with no labels or cross-references.
64tass / ca65
.byte >$00C0, >$01D1, >$02E2, >$03F3 ; (1)!
.byte <$00C0, <$01D1, <$02E2, <$03F3
  1. Pairs $00 (high) + $C0 (low) as raw 16-bit literal $00C0 with no labels.

External Files & Resetting

External File

Shortcut: Shift+E

Keeps large binary blobs—such as SID music, bitmaps, or level maps—out of your .asm listing. During export, Regenerator 2000 writes the range to a separate .bin file and emits the target assembler's binary include directive (for bytes at $1000–$1007):

.binary "export-$1000-$1007.bin"
!binary "export-$1000-$1007.bin"
.import binary "export-$1000-$1007.bin"
.incbin "export-$1000-$1007.bin"

Undefined

Shortcut: ?

Clears manual block classifications back to unexplored single-byte lines:

64tass / ca65
.byte $00
.byte $ca
.byte $ff

Immediate Mode Helpers

Cycle Immediate Operand Formats

Shortcuts: I (forward) · Shift+I (backward)

Cycles the immediate operand under the cursor across six representations—handy when a bitmask reads better in binary or a counter reads better in decimal:

Disassembly Output Format
lda #$d2 Hexadecimal
lda #~$2d Inverse Hexadecimal
lda #210 Decimal
lda #-46 Inverse Decimal
lda #%11010010 Binary
lda #~%00101101 Inverse Binary

Pack Lo/Hi or Hi/Lo Immediate Addresses

Shortcuts: [ (Lo/Hi) · ] (Hi/Lo)

Links two separate 8-bit immediate loads (LDA, LDX, or LDY) into a single 16-bit symbolic pointer reference (#<label and #>label).

For example, to turn the raw bytes loading an IRQ vector at $1480 into a symbolic reference, select lines 1–3 in Visual Mode and press [:

lda #$80        ; $80 is the low byte of $1480
sta $0314
lda #$14        ; $14 is the high byte of $1480
sta $0315

; IRQ handler at $1480
rti
lda #<p_1480 ; (1)!
sta $0314
lda #>p_1480
sta $0315

p_1480
rti
  1. Regenerator 2000 creates p_1480 (or reuses an existing label) and replaces both immediates with #< / #>.

To revert, press U to undo the command or press I on either instruction to cycle back to hex.


Organization Tools

Use comments, scopes, splitters, and collapsing to keep large disassemblies navigable.

Comments

  • Side Comment (;): Appears inline to the right of an instruction or data directive.
  • Line Comment (:): Appears on dedicated lines above the address (Shift+Enter or Ctrl+J inserts newlines; Alt+-, Alt+=, and Alt+\ insert divider lines).

Line Comments Split Tables

Adding a line comment inside a grouped Address or Word block also splits the table at that address.

Scopes

Shortcuts: R (create) · Del (remove at boundary) · Alt+Up / Alt+Down (nudge boundary)

Scopes wrap existing blocks in a lexical namespace so subroutines can reuse short local names (like l00 or loop) without global collisions.

Non-Destructive Grouping

Scopes do not alter block types—they wrap the underlying Code or Data blocks inside native assembler scope directives during export.

Places the scope label immediately before .block / .bend:

my_routine
    .block
    lda #$00
    beq l00
    bne l11
l00
    sta $d020
l11
    rts
    .bend

    jsr my_routine
    jmp my_routine.l00

ACME does not support lexical scopes in Regenerator 2000 exports. The exporter omits scope wrappers when ACME is active.

Wraps scopes in { and } with the label above the opening brace:

my_routine
{
    lda #$00
    beq l00
    bne l11
l00:
    sta $d020
l11:
    rts
}

    jsr my_routine
    jmp my_routine.l00

Maps scopes to .proc / .endproc (unnamed scopes default to unnamed_scope):

    .proc my_routine
    lda #$00
    beq l00
    bne l11
l00:
    sta $d020
l11:
    rts
    .endproc

    jsr my_routine
    ; ca65 is single-pass: external jumps into a scope require
    ; the target label to be defined before the jump.
    jmp my_routine::l00

Splitters and Auto-Merging

Shortcut: |

By default, Regenerator 2000 automatically merges adjacent blocks that share the exact same Block Type.

graph LR
    A["`Byte Block A
    $1000–$1FFF`"] -->|Auto-Merge| M["`Merged Byte Block
    $1000–$2FFF`"]
    B["`Byte Block B
    $2000–$2FFF`"] --> M

Press | at an address to place a Splitter—this draws a visual separator line and stops the auto-merger from combining blocks across that boundary:

graph LR
    A["`Lo/Hi Table 1
    $C000–$C0FF`"] --- S(("Splitter |")) --- B["`Lo/Hi Table 2
    $C100–$C1FF`"]

Always Split Adjacent Lo/Hi and Hi/Lo Tables

Split tables compute their midpoint (lo vs hi half) from the total length of the block. If two adjacent Lo/Hi tables merge into one, every paired 16-bit address is corrupted—insert a splitter (|) between them.

Collapsing Blocks

Shortcut: Ctrl+K

Folds a large data table or finished subroutine into a single summary line in the TUI without changing exported .asm output or secondary views:

Expanded
a_1000  .byte $01, $02, $03, $04, $05, $06, $07, $08
        .byte $09, $0a, $0b, $0c, $0d, $0e, $0f, $10
Collapsed (Ctrl+K)
a_1000  ; Collapsed Byte block from $1000-$100F

A + marker highlights collapsed ranges in the Blocks pane:

  $0900-$09FF [Code]
+ $1000-$100F [Byte]
  $1010-$11FF [Code]