Published
Edited
Oct 9, 2022
Importers
1 star
Insert cell
Insert cell
SPC = ({
createState: () => stateView(createState()),

// direct reads
memSlice,
read,
read16,
reg,

// "branch" instructions return true in the case where a branch would happen
beq,
bne,
bpl,
bmi,
bcc,
bcs,

...mutateWrapped
})
Insert cell
mutateFuncs = ({
// direct writes
write,
write16,

// carry
clc,
sec,

// shifts
asl,
lsr,

rol,
ror,

rolAddr,
rorAddr,

// arithmetic
inc,
inx,
iny,

dec,
dex,
dey,

adc,
addw,

sbc,

mul,
div,

// register transfers
tax,
txa,
tay,
tya,

// mem transfers
lda,
ldaAddr,
ldaAddrX,

ldx,
ldxAddr,

ldy,
ldyAddr,

ldyaAddr,

staAddr,
stxAddr,
styAddr,

styaAddr,

// compare
cmp,
cpx,
cpy,

// loop
bloop
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
SPC.memSlice(s9, 0x20, 0x20)
Insert cell
Insert cell
Insert cell
Insert cell
s0 = SPC.createState()
Insert cell
s1 = SPC.lda(s0, 0x15)
Insert cell
s2 = SPC.cmp(s1, 0x15)
Insert cell
SPC.beq(s2)
Insert cell
s3 = SPC.cmp(s2, 0x12)
Insert cell
SPC.bcs(s3)
Insert cell
s4 = SPC.bloop(
s3,
(s) => {
s = SPC.iny(s);
return SPC.dec(s);
},
SPC.bpl
)
Insert cell
SPC.bmi(s4)
Insert cell
s5 = SPC.cpy(s4, 0x16)
Insert cell
SPC.beq(s5)
Insert cell
s6 = SPC.lda(s5, 0x13)
Insert cell
s7 = SPC.sec(s6)
Insert cell
s8 = SPC.sbc(s7, 0x10)
Insert cell
s9 = SPC.cmp(s8, 0x3)
Insert cell
SPC.beq(s9)
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more