%synth used to always run both searches, so every assembly of the full adder sat there for twenty minutes. A block can now say 'mode layers' to stop after the layer search (7.7 seconds) or 'mode tape' (the default) to pay for the shortest tape. examples/full_add_layers.r8asm is the fast one, 95 characters and still checked on the machine. The lexer also no longer chokes on a UTF-8 BOM. Every Windows editor writes one, and the first token came out as a garbage prefix, which crashed the assembler with an access violation rather than saying anything useful. README grew a getting-started walkthrough: build, a complete adder.r8asm, what the two stderr lines mean, how to drop a synth block into a library, and the three things that bite (inputs first, don't call them in/out, map length).
21 lines
241 B
Plaintext
21 lines
241 B
Plaintext
%include "asm/lib.r8asm"
|
|
|
|
%synth fulladd_fast
|
|
params 6
|
|
inputs %1 %2 %3
|
|
outputs %4 %5
|
|
map 0 1 1 2 1 2 2 3
|
|
mode layers
|
|
%endsynth
|
|
|
|
.var A 0
|
|
.var B 1
|
|
.var Ci 2
|
|
.var S 3
|
|
.var Co 4
|
|
.var T 5
|
|
|
|
fulladd_fast A B Ci S Co T
|
|
output S
|
|
output Co
|