From 564c90479c6a76afd1b9c693074cb7e1a631e300 Mon Sep 17 00:00:00 2001 From: StarCells Date: Wed, 29 Jul 2026 13:55:54 +0800 Subject: [PATCH] 202607291355 --- README.md | 2 +- asm/add.r8asm | 6 +++--- asm/and.r8asm | 18 +++++++++--------- asm/lib.r8asm | 14 +++++++------- asm/or.r8asm | 18 +++++++++--------- asm/xor.r8asm | 18 +++++++++--------- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 255ed72..d400430 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ macro和rep内同理,并且这样宏就不会破坏调用前的上下文. | 前缀 | 含义 | | --- | --- | | bit | 对指定的Unit中,前一个Cell的LSB进行单bit运算,但不会破坏其LSB | -| distructive | 对指定的区域进行运算,具有破坏性(一般会清除该区域) | +| clb | 对指定的区域进行运算,具有破坏性(一般会清除该区域) | | 无前缀 | 安全的宏,对指定区域进行运算,不会破坏该区域 | >正如规范中提到的,当安全宏作用于Unit时,即使不会破坏前一个Cell,有时也会使后一个Cell被清空以作为寄存器. diff --git a/asm/add.r8asm b/asm/add.r8asm index e2bdd9c..e2424b1 100644 --- a/asm/add.r8asm +++ b/asm/add.r8asm @@ -173,7 +173,7 @@ ror %rep _CELL_SIZE bit_raw_add %1 %2 %3 %4 %5 %6 .tp %5 - bit_distructive_mov %3 + clb_bit_mov %3 .tp %1 ror .tp %2 @@ -183,10 +183,10 @@ ror %endrep .tp %3 -bit_distructive_mov %5 +clb_bit_mov %5 .tp %6 rol -bit_distructive_mov %3 +clb_bit_mov %3 .tp before_add %endmacro \ No newline at end of file diff --git a/asm/and.r8asm b/asm/and.r8asm index cf79e42..60869e3 100644 --- a/asm/and.r8asm +++ b/asm/and.r8asm @@ -1,11 +1,11 @@ %include asm/lib.r8asm -; Macro bit_distructive_and +; Macro clb_bit_and ; %1: CellBit arg1 ; %2: CellBit arg2 ; %3: CellBit ans -%macro bit_distructive_and 3 -.anchor before_bit_distructive_and +%macro clb_bit_and 3 +.anchor before_clb_bit_and .tp %3 set_0 .tp %1 @@ -21,20 +21,20 @@ biz set_0 rnz -.tp before_bit_distructive_and +.tp before_clb_bit_and %endmacro -; Macro distructive_and +; Macro clb_and ; %1: Cell arg1 ; %2: Cell arg2 ; %3: Cell ans -%macro distructive_and 3 -.anchor before_distructive_and +%macro clb_and 3 +.anchor before_clb_and %rep _CELL_SIZE - bit_distructive_and %1 %2 %3 + clb_bit_and %1 %2 %3 .tp %1 ror .tp %2 @@ -42,7 +42,7 @@ rnz .tp %3 ror %endrep -.tp before_distructive_and +.tp before_clb_and %endmacro diff --git a/asm/lib.r8asm b/asm/lib.r8asm index 232f6cf..4ddcb0b 100644 --- a/asm/lib.r8asm +++ b/asm/lib.r8asm @@ -46,22 +46,22 @@ flb -; Macro bit_distructive_mov +; Macro clb_bit_mov ; %this: CellBit data ; %1: CellBit destination -%macro bit_distructive_mov 1 -.anchor before_bit_distructive_mov +%macro clb_bit_mov 1 +.anchor before_clb_bit_mov .tp %1 set_0 -.tp before_bit_distructive_mov +.tp before_clb_bit_mov biz .tp %1 flb - .tp before_bit_distructive_mov + .tp before_clb_bit_mov flb rnz -.tp before_bit_distructive_mov +.tp before_clb_bit_mov %endmacro @@ -87,7 +87,7 @@ biz flb rnz .tp %2 -bit_distructive_mov before_bit_copy +clb_bit_mov before_bit_copy .tp before_bit_copy %endmacro diff --git a/asm/or.r8asm b/asm/or.r8asm index b807662..dce12a3 100644 --- a/asm/or.r8asm +++ b/asm/or.r8asm @@ -1,10 +1,10 @@ %include asm/lib.r8asm -; Macro bit_distructive_or +; Macro clb_bit_or ; %1: CellBit arg1 ; %2: CellBit arg2 ; %3: CellBit ans -%macro bit_distructive_or 3 -.anchor before_bit_distructive_or +%macro clb_bit_or 3 +.anchor before_clb_bit_or .tp %3 set_0 .tp %1 @@ -22,20 +22,20 @@ biz flb rnz -.tp before_bit_distructive_or +.tp before_clb_bit_or %endmacro -; Macro distructive_or +; Macro clb_or ; %1: Cell arg1 ; %2: Cell arg2 ; %3: Cell ans -%macro distructive_or 3 -.anchor before_distructive_or +%macro clb_or 3 +.anchor before_clb_or %rep _CELL_SIZE - bit_distructive_or %1 %2 %3 + clb_bit_or %1 %2 %3 .tp %1 ror .tp %2 @@ -43,7 +43,7 @@ rnz .tp %3 ror %endrep -.tp before_distructive_or +.tp before_clb_or %endmacro diff --git a/asm/xor.r8asm b/asm/xor.r8asm index 264fc72..0c35606 100644 --- a/asm/xor.r8asm +++ b/asm/xor.r8asm @@ -1,11 +1,11 @@ %include asm/lib.r8asm -; Macro bit_distructive_xor +; Macro clb_bit_xor ; %1: CellBit arg1 ; %2: CellBit arg2 ; %3: CellBit ans -%macro bit_distructive_xor 3 -.anchor before_bit_distructive_xor +%macro clb_bit_xor 3 +.anchor before_clb_bit_xor .tp %3 set_0 .tp %1 @@ -23,20 +23,20 @@ biz set_0 rnz -.tp before_bit_distructive_xor +.tp before_clb_bit_xor %endmacro -; Macro distructive_xor +; Macro clb_xor ; %1: Cell arg1 ; %2: Cell arg2 ; %3: Cell ans -%macro distructive_xor 3 -.anchor before_distructive_xor +%macro clb_xor 3 +.anchor before_clb_xor %rep _CELL_SIZE - bit_distructive_xor %1 %2 %3 + clb_bit_xor %1 %2 %3 .tp %1 ror .tp %2 @@ -44,7 +44,7 @@ rnz .tp %3 ror %endrep -.tp before_distructive_xor +.tp before_clb_xor %endmacro