From 4be8aa15ad40259e7bb9147930f82f675f70a4a9 Mon Sep 17 00:00:00 2001 From: dsh Date: Sat, 7 Nov 2026 09:03:08 +0800 Subject: [PATCH] Byte level add and increment with 4 and 3 cells: clb_*_nc The nc slices do drive a rotation, so two more library macros fall out of them: clb_add_nc A + B -> S, carry in/out in one cell 4 cells 693 chars clb_inc_nc A + 1 -> S, carry in/out in one cell 3 cells 433 chars against raw_add (6 cells, 1647) and raw_inc (5, 1214). Both are in r8forge_byte_op_test now, exhaustive: 65536 and 256 combinations, all pass. clb_inc_nc has to start its carry cell at 1 -- that bit is the "+1"; the add version starts at 0. A rotation driver reads the low bit, throws it away and rotates, so eating the operands is exactly what it wants. This retracts a sentence that has been in the tree for a while: "rotation needs A and B preserved". It does not. Preserving them is a separate wish (raw_* grants it, with two more cells). AGENTS.md said the wrong thing in the do not retry list; that bullet now says what was really measured, which is only that a 4 cell slice asked to *preserve* A and B has no solution up to 8 layers. Renamed for the same reason: bit_add_nc -> clb_bit_add_nc, bit_inc_nc -> clb_bit_inc_nc, verify_add_nc.r8asm -> verify_clb_bit_add_nc.r8asm, verify_inc_nc.r8asm -> verify_clb_bit_inc_nc.r8asm. Measured what the prefixes actually separate here: bit_raw_and A=1 B=1 -> cells 0=1 1=1 2=1 operands preserved, has tmp bit_raw_add A=1 B=1 -> cells 0=1 1=1 4=1 operands preserved, has buf clb_bit_and A=1 B=1 -> cells 2=1 operands eaten, no tmp clb_bit_add_nc A=1 B=1 -> cells 2=1 3=1 operands eaten, no tmp so raw means "the caller passes the scratch cell" and those variants happen to keep their inputs, while clb means the inputs are gone. These slices eat A and B, so they are clb. One self inflicted mess to own up to: I rewrote AGENTS.md with a PowerShell Get-Content / Set-Content round trip, which on this machine decodes UTF-8 as GBK and wrote the file back as mojibake. Restored it with git checkout -- AGENTS.md and redid every edit through the editor. The work rule in AGENTS.md now names that exact trap instead of only warning about -Encoding ascii. Green: test.r8asm 1666, full_add 8/8, both verify_*.r8asm, byte_op_test (65536x4 + 512 + 65536 + 256), macro_docs_test 32 macros in 10 files, fibonacci. --- AGENTS.md | 47 ++++++++++----- asm/raw_add_nc.r8asm | 44 +++++++++++--- asm/raw_inc_nc.r8asm | 40 ++++++++++--- drv/raw_add_nc_byte.r8asm | 18 ++++++ drv/raw_inc_nc_byte.r8asm | 16 +++++ tests/byte_op_test.cc | 58 ++++++++++++++++++- ...dd_nc.r8asm => verify_clb_bit_add_nc.r8asm | 4 +- ...nc_nc.r8asm => verify_clb_bit_inc_nc.r8asm | 4 +- 8 files changed, 197 insertions(+), 34 deletions(-) create mode 100644 drv/raw_add_nc_byte.r8asm create mode 100644 drv/raw_inc_nc_byte.r8asm rename verify_add_nc.r8asm => verify_clb_bit_add_nc.r8asm (60%) rename verify_inc_nc.r8asm => verify_clb_bit_inc_nc.r8asm (55%) diff --git a/AGENTS.md b/AGENTS.md index 5ba5896..dc73cf9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,8 +9,11 @@ 一次搜索可以跑 680 秒、缓存预热 885 秒,前台干等会撞上客户端和 API 的传输超时。 * **别让大段 stderr 进上下文**。PowerShell 遇到原生命令出错会吐一整套 `NativeCommandError` 堆栈;用 `2>$null` 收干净,判断结果靠 `$LASTEXITCODE` 和 stdout。 -* 写含中文的文件用编辑工具(UTF-8),**不要用 `Set-Content -Encoding ascii`** —— - 汉字会变成 `?`(`examples/full_add_flat*.r8asm` 就这么坏过一次)。 +* 写含中文的文件用编辑工具(UTF-8)。**不要用 PowerShell 做"读-改-写"**:这台机器上 + `Get-Content` 默认按 GBK 读 UTF-8 文件,再 `Set-Content -Encoding utf8` 写回去就是 + 二次转码、整篇变乱码(`AGENTS.md` 就这么被我毁过一次,靠 `git checkout -- AGENTS.md` + 救回来)。`Set-Content -Encoding ascii` 更糟,汉字直接变 `?` + (`examples/full_add_flat*.r8asm` 就这么坏过一次)。 * **构建要用 VS 自带的 cmake**:`build/` 是 `Visual Studio 18 2026` 生成器配的, 直接敲 PATH 上的 scoop cmake(4.4)会因为版本不一致重新配置,然后死在 `No preprocessor test for "PellesC"`。用这个: @@ -54,8 +57,8 @@ clang-cl /nologo /std:c++20 /EHsc /O2 /I include src/r8asm.cc src/synth.cc tests ```sh r8forge asm/test.r8asm # 应 exit 0,1666 字符,7/7 命中缓存 r8forge_synth_test examples/full_add.r8asm # all eight combinations ok -r8forge verify_add_nc.r8asm # 4 cell 加法切片(进位进->出) -r8forge verify_inc_nc.r8asm # 3 cell 自增切片,进位同样进->出 +r8forge verify_clb_bit_add_nc.r8asm # 4 cell 加法切片(进位进->出) +r8forge verify_clb_bit_inc_nc.r8asm # 3 cell 自增切片,进位同样进->出 r8forge_byte_op_test # 字节级库:65536×4 + 512 全过,0.5 秒 r8forge_macro_docs_test # asm/ 里每个宏的注释格式 ``` @@ -115,8 +118,15 @@ void rot8_rnz(rot8_iter *iter) { if ((*(iter->mem_now) & 1) == 1) { ... } } | `raw_or` | `drv/raw_or_byte.r8asm` | 575 字符 | **65536/65536** | | `raw_xor` | `drv/raw_xor_byte.r8asm` | 463 字符 | **65536/65536** | | `raw_inc`(a+进位) | `drv/raw_inc_byte.r8asm` | 1214 字符 | **512/512** | +| **`clb_add_nc`(a+b,4 cell)** | `drv/raw_add_nc_byte.r8asm` | **693 字符** | **65536/65536** | +| **`clb_inc_nc`(a+1,3 cell)** | `drv/raw_inc_nc_byte.r8asm` | **433 字符** | **256/256** | | `asm/fibonacci.r8asm` | — | 8761 字符 | 跑出 `1 1 2 3 5 8 13 21 34 55`,和文件注释一致 | +`raw_*` 保留操作数(A、B 原样还回来),`clb_*_nc` 把 A、B 吃干净 —— 所以后者能省掉 +`Co` 和 `tmp`:**4 cell 加法、3 cell 自增**。两者都用轮转驱动,差别只在 +"操作数要不要还回去"。`clb_inc_nc` 的关键是把进位 cell 先置 **1**(那个 1 就是"加 1"), +加法那版才是置 0。 + 顺带纠正一个流传下来的说法:`raw_add` **不**吃掉操作数。实测 `5+3 → A=5 B=3 S=8`, `255+255 → A=255 B=255 S=254 Co=1`。`asm/fibonacci.r8asm` 里"每圈都要重新复印"的注释 是过度保守(它确实复印了,但不复印也对)。 @@ -138,10 +148,11 @@ void rot8_rnz(rot8_iter *iter) { if ((*(iter->mem_now) & 1) == 1) { ... } } ### 另一位一 cell 的实现在这里被删过一次(别再加回来) -"每个 bit 一个 cell、用 `bit_add_nc` 串成 8 位加法器"这条路能跑通(32 cell, +"每个 bit 一个 cell、用 `clb_bit_add_nc` 串成 8 位加法器"这条路能跑通(32 cell, 1308 字符,65536 组合全对),但它是上面那个错误诊断的产物:既然一个 cell 能放一个字节、 位读得出来,就没必要为每个 bit 花一个 cell。R8Forge 之前也删过一次同样的东西 -(交接文档原话:"8 位加法 25 个 cell,没有实用价值")。**要拼字节级运算就用 `raw_*`。** +(交接文档原话:"8 位加法 25 个 cell,没有实用价值")。 +**要拼字节级运算就用 `raw_*` 或 `clb_*_nc`。** ## %synth 相关 @@ -161,18 +172,23 @@ void rot8_rnz(rot8_iter *iter) { if ((*(iter->mem_now) & 1) == 1) { ... } } | 东西 | 结论 | |---|---| | 库里的 7 个位运算块(and/or/xor/inc/add) | 合成版比手写短:`asm/test.r8asm` 1714 → 1666 字符 | -| `bit_add_nc`(4 cell 忽略进位切片) | flat 代价 **27**,完整全加器切片是 38;8/8 组合正确 | -| `bit_inc_nc`(3 cell 自增切片) | 表 `0 4 4 2 0 4 4 2`(3 参数)缓存里就有,4 blocks;纸带 54 字符,4/4 组合正确 | +| `clb_bit_add_nc`(4 cell 忽略进位切片) | flat 代价 **27**,完整全加器切片是 38;8/8 组合正确 | +| `clb_bit_inc_nc`(3 cell 自增切片) | 表 `0 4 4 2 0 4 4 2`(3 参数)缓存里就有,4 blocks;纸带 54 字符,4/4 组合正确 | +| `clb_add_nc`(4 cell 字节加法) | 693 字符,65536 组合全对;比 6 cell 的 `raw_add` 少 2 个 cell、短 954 字符 | +| `clb_inc_nc`(3 cell 字节自增) | 433 字符,256 组合全对;比 5 cell 的 `raw_inc` 少 2 个 cell | | `bit_raw_add`(6 cell 全加器切片) | 保留 A、B;字节级 `raw_add` 1647 字符,65536 组合全对 | | `raw_and` / `raw_or` / `raw_xor` / `raw_inc` | 639 / 575 / 463 / 1214 字符,各 65536(inc 512)全对 | | `asm/fibonacci.r8asm` | 8761 字符,跑出 10 项斐波那契,和注释一致 | ## 已经确认走不通的(别重试) -* **3 个 cell 做加法切片**:层数上限 5 和 8 都报 `no program up to N layers`。 -* **让 `%synth` 合成的块自己保留操作数(没有草稿 cell)**:轮转要求 A、B 保留, - 而合成的程序只会吃掉操作数;把表改成"保留 A、B"后同样报 `no program up to 8 layers`。 - 只有 6 cell 的 `bit_raw_add`(有草稿 cell)能做到。 +* **3 个 cell 做加法切片**:层数上限 5 和 8 都报 `no program up to N layers` + (3 cell 的**自增**切片是有解的,两个操作数塞不进 3 个 cell)。 +* **4 cell 的加法切片要做到"保留 A、B"**:表改成保留 A、B 后报 `no program up to 8 layers`。 + 想拿回操作数只能用 6 cell 的 `bit_raw_add`。 + **但这不等于"轮转需要保留操作数"** —— 这句以前写错过。轮转只是 + "读走最低位 → 丢掉 → `ror`",吃掉操作数完全没问题:`clb_add_nc`(4 cell)就是这么跑的, + 65536 组合全过。 * 字节级(2^16 项真值表)交给 `%synth`:搜索空间不可行。 ## 命名与注释格式(照 `SPEC.md`,别自己发明) @@ -203,8 +219,9 @@ SPEC 第 136-150 行的标准宏前缀: |---|---| | `raw_add` / `raw_and` / `raw_or` / `raw_xor` / `raw_inc` | 字节级,且草稿 cell 由调用者传 | | `bit_raw_add`(6 cell) | 位级,且 `%6: buf` 是真正的草稿:内容无关,结束是垃圾 | -| `bit_add_nc`(4 cell) | **四个 cell 都有意义**,没有草稿 cell:第 3 个是"进→出"的进位(`A=0 B=0 进位入=1` 时 `S=1`,实测过)。所以名字里没有 `raw` | -| `bit_inc_nc`(3 cell) | 同样:A 被吃掉,进位进→出,没有草稿 cell | +| `clb_bit_add_nc`(4 cell) | 四个 cell 都有意义,没有草稿 cell(所以没 `raw`),而 A、B 被吃掉(所以有 `clb`):第 3 个是"进→出"的进位,`A=0 B=0 进位入=1` 时 `S=1` | +| `clb_bit_inc_nc`(3 cell) | 同样:A 被吃掉,进位进→出,没有草稿 cell | +| `clb_add_nc`(4 cell)/ `clb_inc_nc`(3 cell) | 字节级版本,同样吃 A、B | | `clb_bit_mov` | 位级搬运,并且把源吃掉 | | `bit_copy` / `copy` | 位级/字节级拷贝,缓冲由调用者传(历史命名,少了 `raw`) | | `set_0` / `set_1` / `erase` / `rol` / `step` / `back` / `output` | 基础操作,不带前缀 | @@ -214,7 +231,7 @@ SPEC 第 136-150 行的标准宏前缀: 宏里的注释: ```asm -; Macro bit_add_nc +; Macro clb_bit_add_nc ; %1: CellBit A ; %2: CellBit B ``` diff --git a/asm/raw_add_nc.r8asm b/asm/raw_add_nc.r8asm index 58a68f3..a4dac62 100644 --- a/asm/raw_add_nc.r8asm +++ b/asm/raw_add_nc.r8asm @@ -11,27 +11,57 @@ ; 喂进来的 A、B、进位都必须是 0/1; ; 2. set_0 清的是最低位(`biz`/`rnz` 判 `cell & 1`,见 AGENTS),不会碰 S 的其余位。 ; -; 因为 A、B 被吃掉,它配不了轮转式的字节级驱动(那种驱动每轮还要读回操作数); -; 字节级的 `raw_add` 用的是保留 A、B 的 `bit_raw_add`(6 cell)。 +; 它**能**配轮转式字节级驱动:每轮读走最低位、丢掉,再 ror —— 正好对上 A、B +; 被吃掉这件事。`clb_add_nc` 就是这么拼的(4 cell、693 字符、65536 组合全过)。 +; `raw_add` 那版保留 A、B(6 cell),是留给"想把操作数要回去"的调用者的。 -; Macro bit_add_nc +; Macro clb_bit_add_nc ; %1: CellBit A ; %2: CellBit B ; %3: CellBit Ci ; %4: CellBit S ; ; 四个 cell 都有意义(A、B 是输入,进位进->出,S 是输出),没有草稿 cell —— -; 名字里不带 raw 就是为这个(SPEC:`raw` 指"草稿 cell 要调用者传")。 +; 所以不带 `raw`(SPEC:`raw` 指"草稿 cell 要调用者传");又因为 A、B 被吃掉, +; 所以带 `clb`(clobber)。`bit_raw_and`/`bit_raw_add` 那种保留输入的变体才需要草稿 cell。 ; 表:S = A^B^Ci,进位 = AB|ACi|BCi;A、B 结束为 0,S 和进位只落在 0/1 上。 -%synth bit_add_nc_synth +%synth clb_bit_add_nc_synth params 4 stat 0 8 8 4 8 4 4 12 0 8 8 4 8 4 4 12 metric flat mode tape %endsynth -%macro bit_add_nc 4 +%macro clb_bit_add_nc 4 .tp %4 set_0 - bit_add_nc_synth %1 %2 %3 %4 + clb_bit_add_nc_synth %1 %2 %3 %4 +%endmacro + +; Macro clb_add_nc +; %1: Cell A +; %2: Cell B +; %3: Cell S +; %4: CellBit Ci +; +; 字节级加法:A + B -> S,进位进->出。每轮把 A、B 的当前最低位喂进 clb_bit_add_nc, +; 和写进 S 的最低位,然后 A、B、S 各 ror 一格。A、B 结束为 0, +; Ci 在最后一轮之后就是整个加法的进位输出。 +%macro clb_add_nc 4 +.anchor before_clb_add_nc + +.tp %4 +set_0 + +%rep _CELL_SIZE + clb_bit_add_nc %1 %2 %4 %3 + .tp %1 + ror + .tp %2 + ror + .tp %3 + ror +%endrep + +.tp before_clb_add_nc %endmacro diff --git a/asm/raw_inc_nc.r8asm b/asm/raw_inc_nc.r8asm index ebcb1e7..098e9dd 100644 --- a/asm/raw_inc_nc.r8asm +++ b/asm/raw_inc_nc.r8asm @@ -2,7 +2,7 @@ ; 忽略独立进位的自增切片:一个操作数 + 一个"进->出"的进位 cell + 和。 ; -; 和 bit_add_nc 的关系:自增就是"加一个 1",但 1 不用 cell 装,所以少一个参数。 +; 和 clb_bit_add_nc 的关系:自增就是"加一个 1",但 1 不用 cell 装,所以少一个参数。 ; 切片占 3 个 cell:A、进位、S。A 被吃掉(结束为 0),进位就地在自己的 cell 里更新。 ; ; 两条要知道的: @@ -10,24 +10,50 @@ ; 喂进来的 A、进位都必须是 0/1; ; 2. set_0 清的是最低位(`biz`/`rnz` 判 `cell & 1`,见 AGENTS),不会碰 S 的其余位。 ; -; 同样因为 A 被吃掉,它配不了轮转式的字节级驱动;要字节级自增用 raw_inc -; (那是保留 A 的 bit_raw_inc,5 cell)。 +; 它也**能**配轮转式字节级驱动(读走最低位、丢掉、再 ror),`clb_inc_nc` 就是 +; 这么拼的:A 被吃干净、结果在 S、进位进->出。想在自增之后还留着 A 的用 `raw_inc` +; (保留 A 的 bit_raw_inc,5 cell)。 -; Macro bit_inc_nc +; Macro clb_bit_inc_nc ; %1: CellBit A ; %2: CellBit Ci ; %3: CellBit S ; +; 三个 cell 都有意义、没有草稿 cell(所以不带 `raw`),A 被吃掉(所以带 `clb`)。 ; 表:S = A^Ci,进位 = A&Ci;A 结束为 0。 -%synth bit_inc_nc_synth +%synth clb_bit_inc_nc_synth params 3 stat 0 4 4 2 0 4 4 2 metric flat mode tape %endsynth -%macro bit_inc_nc 3 +%macro clb_bit_inc_nc 3 .tp %3 set_0 - bit_inc_nc_synth %1 %2 %3 + clb_bit_inc_nc_synth %1 %2 %3 +%endmacro + +; Macro clb_inc_nc +; %1: Cell A +; %2: Cell S +; %3: CellBit Ci +; +; 字节级自增:A + 1 -> S,A 被吃干净。进位 cell 先置 **1** —— 那个 1 就是"加 1", +; 所以这里不能像加法那样清零。最后一轮之后 Ci 是进位输出。 +%macro clb_inc_nc 3 +.anchor before_clb_inc_nc + +.tp %3 +set_1 + +%rep _CELL_SIZE + clb_bit_inc_nc %1 %3 %2 + .tp %1 + ror + .tp %2 + ror +%endrep + +.tp before_clb_inc_nc %endmacro diff --git a/drv/raw_add_nc_byte.r8asm b/drv/raw_add_nc_byte.r8asm new file mode 100644 index 0000000..6b6b764 --- /dev/null +++ b/drv/raw_add_nc_byte.r8asm @@ -0,0 +1,18 @@ +%include "asm/raw_add_nc.r8asm" + +; clb_add_nc 的字节级驱动:操作数直接放在 A、B 里,不预置任何常量。 +; +; r8forge_derive drv/raw_add_nc_byte.r8asm -2 0=5 2=3 +; +; out 依次是 A、B、S、Ci。和 raw_add 的驱动不同,A、B 是被吃掉的(结束为 0)。 +.var A 0 +.var Ci 1 +.var B 2 +.var S 4 + +clb_add_nc A B S Ci + +output A +output B +output S +output Ci diff --git a/drv/raw_inc_nc_byte.r8asm b/drv/raw_inc_nc_byte.r8asm new file mode 100644 index 0000000..5f8788e --- /dev/null +++ b/drv/raw_inc_nc_byte.r8asm @@ -0,0 +1,16 @@ +%include "asm/raw_inc_nc.r8asm" + +; clb_inc_nc 的字节级驱动。A 被吃掉,S = A + 1,Ci 是进位输出。 +; +; r8forge_derive drv/raw_inc_nc_byte.r8asm -2 0=255 +; +; out 依次是 A、S、Ci。 +.var A 0 +.var Ci 1 +.var S 2 + +clb_inc_nc A S Ci + +output A +output S +output Ci diff --git a/tests/byte_op_test.cc b/tests/byte_op_test.cc index ba4a8e8..047466f 100644 --- a/tests/byte_op_test.cc +++ b/tests/byte_op_test.cc @@ -186,6 +186,60 @@ int test_inc(const std::string &file) { return bad; } +// clb_add_nc: out is A, B, S, Ci. This one eats both operands, so A and B have +// to come back zero -- that is what lets it use the 4 cell slice. +int test_add_nc(const std::string &file) { + const std::string tape = assemble(file); + std::cout << "clb_add_nc: " << tape.size() << " characters\n"; + int bad = 0; + for (int a = 0; a < 256; a++) + for (int b = 0; b < 256; b++) { + machine m; + m.cells[0] = uint8_t(a); // A + m.cells[2] = uint8_t(b); // B + m.run(tape, 100'000); + const int sum = a + b; + const bool ok = m.finished && m.out.size() == 4 && m.out[0] == 0 && + m.out[1] == 0 && m.out[2] == (sum & 0xff) && + m.out[3] == (sum >> 8); + if (!ok) { + bad++; + if (bad <= 3) + report("clb_add_nc", a, b, m, + "0 0 " + std::to_string(sum & 0xff) + " " + + std::to_string(sum >> 8)); + } + } + std::cout << " " << (bad ? "FAILED" : "all 65536 combinations ok") + << (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n"; + return bad; +} + +// clb_inc_nc: out is A, S, Ci. +int test_inc_nc(const std::string &file) { + const std::string tape = assemble(file); + std::cout << "clb_inc_nc: " << tape.size() << " characters\n"; + int bad = 0; + for (int a = 0; a < 256; a++) { + machine m; + m.cells[0] = uint8_t(a); // A + m.run(tape, 100'000); + const int sum = a + 1; + const bool ok = m.finished && m.out.size() == 3 && m.out[0] == 0 && + m.out[1] == (sum & 0xff) && m.out[2] == (sum >> 8); + if (!ok) { + bad++; + if (bad <= 3) + report("clb_inc_nc", a, 1, m, + "0 " + std::to_string(sum & 0xff) + " " + + std::to_string(sum >> 8)); + } + } + std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok") + << (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n"; + return bad; +} + } // namespace int main(int argc, char **argv) { @@ -195,7 +249,9 @@ int main(int argc, char **argv) { test_bitop(drv + "raw_and_byte.r8asm", "raw_and", 0) + test_bitop(drv + "raw_or_byte.r8asm", "raw_or", 1) + test_bitop(drv + "raw_xor_byte.r8asm", "raw_xor", 2) + - test_inc(drv + "raw_inc_byte.r8asm"); + test_inc(drv + "raw_inc_byte.r8asm") + + test_add_nc(drv + "raw_add_nc_byte.r8asm") + + test_inc_nc(drv + "raw_inc_nc_byte.r8asm"); std::cout << (bad ? "FAILED\n" : "byte level library ok\n"); return bad ? 1 : 0; } diff --git a/verify_add_nc.r8asm b/verify_clb_bit_add_nc.r8asm similarity index 60% rename from verify_add_nc.r8asm rename to verify_clb_bit_add_nc.r8asm index 361898c..f136b1f 100644 --- a/verify_add_nc.r8asm +++ b/verify_clb_bit_add_nc.r8asm @@ -1,12 +1,12 @@ %include "asm/raw_add_nc.r8asm" -; bit_add_nc 的单点验证:A、B、进位各喂一位,打出和与进位。 +; clb_bit_add_nc 的单点验证:A、B、进位各喂一位,打出和与进位。 ; 进位是"进->出"同一个 cell,所以 0=0 1=0 2=1 就是 0+0+1。 .var A 0 .var B 1 .var Ci 2 .var S 3 -bit_add_nc A B Ci S +clb_bit_add_nc A B Ci S output S output Ci diff --git a/verify_inc_nc.r8asm b/verify_clb_bit_inc_nc.r8asm similarity index 55% rename from verify_inc_nc.r8asm rename to verify_clb_bit_inc_nc.r8asm index e02c895..4ac5d63 100644 --- a/verify_inc_nc.r8asm +++ b/verify_clb_bit_inc_nc.r8asm @@ -1,11 +1,11 @@ %include "asm/raw_inc_nc.r8asm" -; bit_inc_nc 的单点验证:A、进位各喂一位,打出和与进位输出。 +; clb_bit_inc_nc 的单点验证:A、进位各喂一位,打出和与进位输出。 ; out 依次是 S、进位(进->出同一个 cell)。 .var A 0 .var Ci 1 .var S 2 -bit_inc_nc A Ci S +clb_bit_inc_nc A Ci S output S output Ci