Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage pcengine.package·originates fromworld 47b50fcd-5…

asm

A two-pass HuC6280 assembler (65C02 + HuC6280 extras) written in Luau, used to build the PC Engine package's homebrew HuCards inside the engine; any 6502/65C02 machine's homebrew can use it too. Labels and `.local` labels, `equ`/`=`, `bank`/`org` for 8 KB HuCard banks, `db/dw/ds`…

by◐Deata·posted 2d ago
What it does

pcengine.asm

A two-pass HuC6280 assembler (65C02 + HuC6280 extras) written in Luau, used to build the PC Engine package's homebrew HuCards inside the engine; any 6502/65C02 machine's homebrew can use it too. Labels and .local labels, equ/=, bank/org for 8 KB HuCard banks, db/dw/ds, align, assert, expressions (*/$ = here, lo()/hi()/bank(label)), every 65C02 addressing mode with [zp] or (zp) indirect, and the HuC6280 forms (tst #i, ea, tii s, d, n and friends, bbr0 zp, label, smb3 zp, st0 #i, tam #mask). Zero page is chosen by <expr or a value known in pass 1, so sizes never change between passes (see the header of init.luau).

local Asm = require("pcengine.asm")
local bin, symbols = Asm.assemble(sourceText, { size = 0x8000, fill = 0xFF })

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

strict

fail(ctx: Ctx, msg: string) → never

argtypedescription
ctxCtx
msgstring

tokenize(s: string) → void

expressions

argtypedescription
sstring

number(t: string) → number

argtypedescription
tstring

symName(ctx: Ctx, t: string) → string

argtypedescription
ctxCtx
tstring

eval(ctx: Ctx, s: string) → number

argtypedescription
ctxCtx
sstring

peek( ) → string

take( ) → string

atom( ) → number

mul( ) → number

add( ) → number

sh( ) → number

bitand( ) → number

bitxor( ) → number

expr( ) → void

group(base: number, names: { string }) → void

argtypedescription
basenumber
names{ string }

isMnemonic(k: string) → boolean

argtypedescription
kstring

splitOperands(s: string) → void

argtypedescription
sstring

stripComment(s: string) → string

argtypedescription
sstring

wrapped(s: string) → string

"[...]" or "(...)" whose first bracket closes at the end

argtypedescription
sstring

assemble(src: string, opts: any?) → void

assemble

argtypedescription
srcstring
optsany?

emit(b: number) → void

argtypedescription
bnumber

ev(x: string) → number

argtypedescription
xstring

define(name: string, v: number) → void

argtypedescription
namestring
vnumber

w8(x: string) → void

argtypedescription
xstring

w16(v: number) → void

argtypedescription
vnumber

zeroPage(x: string) → void

is this operand zero page? decided once, in pass 1

argtypedescription
xstring

zpByte(x: string) → number

argtypedescription
xstring

relTo(x: string, nextPc: number) → number

argtypedescription
xstring
nextPcnumber

encode(op: string, args: { string }) → void

argtypedescription
opstring
args{ string }

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.