%synth could optimise the real tape characters, but that price depends on where the cells sit, so the answer was only good for one layout and the cache could only be shared between call sites with the same addresses. metric chars tape characters including the .tp walk layout dependent metric flat characters without the walk layout independent metric blocks block count layout independent 'flat' is the step-free mode: it counts biz/flb/rnz and the ops, ignores how far apart the cells are, so one search result and one cache entry serve every layout. The price is a slightly longer tape when the layout happens to suit a different program: 90 characters for chars, 95 for flat on the full adder. Checked: examples/full_add_flat.r8asm hits the cache on the second run, and the same block with 'layout 0 2 4 6 8 10' added hits the *same* entry and emits a byte-identical tape (the key drops the layout for the layout-free metrics). Both pass the eight combination check.
21 lines
289 B
Plaintext
21 lines
289 B
Plaintext
%include "asm/lib.r8asm"
|
|
|
|
; ????:metric flat ?? .tp ?????,??? cell ????,
|
|
; ??????????????(?????????????????)?
|
|
%synth fulladd_flat
|
|
params 6
|
|
map 0 1 1 2 1 2 2 3
|
|
metric flat
|
|
%endsynth
|
|
|
|
.var A 0
|
|
.var B 1
|
|
.var Ci 2
|
|
.var S 3
|
|
.var Co 4
|
|
.var T 5
|
|
|
|
fulladd_flat A B Ci S Co T
|
|
output S
|
|
output Co
|