diff --git a/README.md b/README.md index 94ed15b..bf8cb76 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ### Unit与Cell 在R8ASM中,从[0]开始,每2个Cells将被划为一个Unit.每个Unit中前一个Cell用于存储主要数据,而后一个Cell则作为缓冲区存在.这在一定程度上解决了ROT-8缺乏寄存器的问题.\ -macro参数的注释中出现Unit前缀时,即表示其指向的数据作为Unit的前一个参数地址被传递,这意味着该Unit的缓冲区可能(几乎一定)会被清空. +macro参数的注释中出现Unit或UnitBit前缀时,即表示其指向的数据作为Unit的前一个参数地址被传递,这意味着该Unit的缓冲区可能(几乎一定)会被清空. >当然往奇数Cell中存数据本来就是不推荐的行为.如果要进行不太在意性能的计算,用封装好的,更安全的宏直接计算会更合适.\ >除非你知道自己在做什么. diff --git a/asm/add.r8asm b/asm/add.r8asm index fe919c2..be5ecad 100644 --- a/asm/add.r8asm +++ b/asm/add.r8asm @@ -1,9 +1,9 @@ ; Macro bit_add -; %1: Unit A -; %2: Unit B -; %3: Unit Ci -; %4: S -; %5: Co +; %1: UnitBit A +; %2: UnitBit B +; %3: UnitBit Ci +; %4: CellBit S +; %5: CellBit Co %macro bit_add 5 .anchor before_bit_add @@ -54,7 +54,7 @@ bit_move_to %4 ; %1: Unit A ; %2: Unit B ; %3: Unit Ci -; %4: S +; %4: Cell S ; %5: Unit Co %macro add 5 .anchor before_add diff --git a/asm/and.r8asm b/asm/and.r8asm index f57b0fe..08036c6 100644 --- a/asm/and.r8asm +++ b/asm/and.r8asm @@ -1,7 +1,7 @@ ; Macro bit_unsafe_and -; %1: arg1 -; %2: arg2 -; %3: ans +; %1: CellBit arg1 +; %2: CellBit arg2 +; %3: CellBit ans %macro bit_unsafe_and 3 .anchor before_bit_unsafe_and .tp %3 @@ -25,9 +25,9 @@ rnz ; Macro unsafe_and -; %1: arg1 -; %2: arg2 -; %3: ans +; %1: Cell arg1 +; %2: Cell arg2 +; %3: Cell ans %macro unsafe_and 3 .anchor before_unsafe_and @@ -47,9 +47,9 @@ rnz ; Macro bit_and -; %1: Unit arg1 -; %2: Unit arg2 -; %3: ans +; %1: UnitBit arg1 +; %2: UnitBit arg2 +; %3: CellBit ans %macro bit_and 3 .anchor before_and .tp %1 @@ -69,7 +69,7 @@ bit_unsafe_and bit_and_buf_1 bit_and_buf_2 %3 ; Macro and ; %1: Unit arg1 ; %2: Unit arg2 -; %3: Unit ans +; %3: Cell ans %macro and 3 .anchor before_and diff --git a/asm/or.r8asm b/asm/or.r8asm index 62eb0cd..d743fe9 100644 --- a/asm/or.r8asm +++ b/asm/or.r8asm @@ -1,7 +1,7 @@ ; Macro bit_unsafe_or -; %1: arg1 -; %2: arg2 -; %3: ans +; %1: CellBit arg1 +; %2: CellBit arg2 +; %3: CellBit ans %macro bit_unsafe_or 3 .anchor before_bit_unsafe_or .tp %3 @@ -27,9 +27,9 @@ rnz ; Macro unsafe_or -; %1: arg1 -; %2: arg2 -; %3: ans +; %1: Cell arg1 +; %2: Cell arg2 +; %3: Cell ans %macro unsafe_or 3 .anchor before_unsafe_or @@ -49,9 +49,9 @@ rnz ; Macro bit_or -; %1: Unit arg1 -; %2: Unit arg2 -; %3: ans +; %1: UnitBit arg1 +; %2: UnitBit arg2 +; %3: CellBit ans %macro bit_or 3 .anchor before_or .tp %1 @@ -71,7 +71,7 @@ bit_unsafe_or bit_or_buf_1 bit_or_buf_2 %3 ; Macro or ; %1: Unit arg1 ; %2: Unit arg2 -; %3: Unit ans +; %3: Cell ans %macro or 3 .anchor before_or diff --git a/asm/xor.r8asm b/asm/xor.r8asm index 1beec97..1d4e156 100644 --- a/asm/xor.r8asm +++ b/asm/xor.r8asm @@ -1,7 +1,7 @@ ; Macro bit_unsafe_xor -; %1: arg1 -; %2: arg2 -; %3: ans +; %1: CellBit arg1 +; %2: CellBit arg2 +; %3: CellBit ans %macro bit_unsafe_xor 3 .anchor before_bit_unsafe_xor .tp %3 @@ -27,9 +27,9 @@ rnz ; Macro unsafe_xor -; %1: arg1 -; %2: arg2 -; %3: ans_unit +; %1: Cell arg1 +; %2: Cell arg2 +; %3: Cell ans %macro unsafe_xor 3 .anchor before_unsafe_xor @@ -49,9 +49,9 @@ rnz ; Macro bit_xor -; %1: Unit arg1 -; %2: Unit arg2 -; %3: ans +; %1: UnitBit arg1 +; %2: UnitBit arg2 +; %3: CellBit ans %macro bit_xor 3 .anchor before_xor .tp %1 @@ -71,7 +71,7 @@ bit_unsafe_xor bit_xor_buf_1 bit_xor_buf_2 %3 ; Macro xor ; %1: Unit arg1 ; %2: Unit arg2 -; %3: ans +; %3: Cell ans %macro xor 3 .anchor before_xor diff --git a/src/r8asm_parse.cc b/src/r8asm_parse.cc index 0baf9ee..62c0682 100644 --- a/src/r8asm_parse.cc +++ b/src/r8asm_parse.cc @@ -30,7 +30,7 @@ void r8asm_trim(std::string &str) { // Clean empty chars in the string. str = ""; } -std::string r8asm_peel(std::string &str) { // Peel a word from string. +std::string r8asm_peel(std::string &str) { // Peel the first word from string. r8asm_trim(str); auto end = str.find_first_of(EMPTY_CHARS);