Weft-8 · an 8-bit machine you can hold
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.
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.
Opcode, then operand, little-endian. Register pairs pack into one byte as
a<<4 | b, so ADD R12, R5 is literally 04 C5.
Program ROM at 0x00, scratch RAM at 0x80, peripherals from
0xC0. Writing into ROM is refused, and the machine says so.
Z, C, N and V are all set, and JG/JL use N against V — so
-1 < 1 even though 255 > 1.
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.
; 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
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.
No omissions and no "coming soon": these are all 27 instructions the Weft-8 has.
| Group | Instructions | What they do |
|---|---|---|
| Load | LDI · LOAD · IN | fill the accumulator from a literal, memory, or a peripheral |
| Store | STORE · OUT | write the accumulator to RAM or to a port |
| Move | MOV | copy one register into another |
| Arithmetic | ADD · SUB · CMP | 8-bit wrap, with carry, overflow, zero and negative set |
| Logic | AND · OR · XOR · NOT | bitwise, no surprises |
| Shift | SHL · SHR | the bit that falls off lands in carry |
| Flow | JMP · JZ · JNZ · JG · JL · CALL · RET | signed branches and a 16-deep call stack |
| Stack | PUSH · POP | your own values, guarded against overflow and underflow |
| Housekeeping | RAND · NOP · HLT | a random byte from an injectable source, and stop |
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.
R16, an immediate of 300, a program past the 128-byte ROM.RET on an empty stack says so.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.
the weft-8 family — one machine, seven faces
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.