Jacquard

Weft-8 · an 8-bit machine you can hold

The loom
you program.

Automation usually hides behind coloured boxes. Jacquard puts a real machine underneath it: sixteen registers, four flags, and instructions that are exactly two bytes — the clock, the calendar, the clipboard and the accelerometer are memory-mapped peripherals you read like any other byte.

Open the loom Read the reference card

A machine small enough to keep in your head

Nothing is hidden behind a framework. The engine is one file, and the page you are looking at runs the same file the tests run.

27opcodes

Two bytes each

Opcode, then operand, little-endian. Register pairs pack into one byte as a<<4 | b, so ADD R12, R5 is literally 04 C5.

256bytes of address space

A map you can memorise

Program ROM at 0x00, scratch RAM at 0x80, peripherals from 0xC0. Writing into ROM is refused, and the machine says so.

4flags

Signed, properly

Z, C, N and V are all set, and JG/JL use N against V — so -1 < 1 even though 255 > 1.

What a program looks like

This is leave-now, the example that ships with the app: notify ten minutes before the next event, unless you are already at the office. It runs against the simulated device in the page, and the test suite proves all four of its branches.

leave-now.asm
; R0 is the accumulator:
; LDI, IN and LOAD all fill it.
        IN  OFFICE_INSIDE
        CMP R0, R15      ; R15 is 0
        JNZ done         ; already there
        IN  NEXT_EVENT_MIN
        MOV R1, R0       ; minutes left
        LDI 10
        MOV R2, R0       ; ten
        CMP R1, R2
        JG  done         ; too early
        LDI 1
        OUT NOTIFY       ; leave now
done:   HLT
what the page shows you
registers   R0  1     R1  6     R2  10
flags       Z · C · N · V        (none set)
output      NOTIFY 1
bytes       00 C3 0C F0 0F C4 01 04
            00 0A 01 20 0C 12 10 A1
            00 01 17 C5 1A 00

step · run · reset      watch it happen

The reference card in the app is generated from the engine itself, so the documentation cannot drift from the machine — if an instruction changes, the card changes with it.

The instruction set, in full

No omissions and no "coming soon": these are all 27 instructions the Weft-8 has.

GroupInstructionsWhat they do
LoadLDI · LOAD · INfill the accumulator from a literal, memory, or a peripheral
StoreSTORE · OUTwrite the accumulator to RAM or to a port
MoveMOVcopy one register into another
ArithmeticADD · SUB · CMP8-bit wrap, with carry, overflow, zero and negative set
LogicAND · OR · XOR · NOTbitwise, no surprises
ShiftSHL · SHRthe bit that falls off lands in carry
FlowJMP · JZ · JNZ · JG · JL · CALL · RETsigned branches and a 16-deep call stack
StackPUSH · POPyour own values, guarded against overflow and underflow
HousekeepingRAND · NOP · HLTa random byte from an injectable source, and stop

What it refuses to do

An 8-bit machine is only useful if it is honest about its edges. Every item here is asserted by the test suite, not promised by the prose.

  • A program that does not assemble is never run. The error names the line and the reason: an undefined label, R16, an immediate of 300, a program past the 128-byte ROM.
  • A runaway loop stops. At the step limit, and the page says it stopped there.
  • A stack underflow is an error, not a crash. RET on an empty stack says so.
  • A write into ROM is refused — and reported, rather than silently doing nothing.
  • Nothing leaves the device. No network, no account, no telemetry: the peripherals are simulated in the page.
  • The count is honest. The spec asked for 28 opcodes and listed 27; the machine has 27 and the README says so instead of inventing a twenty-eighth.

Take it with you

The whole app is one page plus two files it carries with it, so it runs from a USB stick, a school laptop, or a phone with no signal.

Open the loom Source on GitHub

the weft-8 family — one machine, seven faces

the Loomyou are here
Weft Puzzlesfive puzzles solved in assembly, a robot on a grid Clip Loomclipboard programs you can read: strip, squeeze, wrap Weft-8 on hardwarethe same machine in C, three-way parity with the JS one weft8-kitrules small enough to sign off Weft-8 Classroomeight exercises that teach how a computer works Weft-8 beside x86 and ARMthe same four jobs in three machines

Every one of these runs the same engine — weft8.js from the Loom, byte for byte. Learn it once and you have learned all seven.