202607291355
This commit is contained in:
1 parent
ccbee746a2
commit
564c90479c
6 files changed
+38
-38
No files matched your search
@@ -61,7 +61,7 @@ macro和rep内同理,并且这样宏就不会破坏调用前的上下文.
|
||||
| 前缀 | 含义 |
|
||||
| --- | --- |
|
||||
| bit | 对指定的Unit中,前一个Cell的LSB进行单bit运算,但不会破坏其LSB |
|
||||
| distructive | 对指定的区域进行运算,具有破坏性(一般会清除该区域) |
|
||||
| clb | 对指定的区域进行运算,具有破坏性(一般会清除该区域) |
|
||||
| 无前缀 | 安全的宏,对指定区域进行运算,不会破坏该区域 |
|
||||
|
||||
>正如规范中提到的,当安全宏作用于Unit时,即使不会破坏前一个Cell,有时也会使后一个Cell被清空以作为寄存器.
|
||||
|
||||
+3
-3
@@ -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
|
||||
+9
-9
@@ -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
|
||||
|
||||
|
||||
|
||||
+7
-7
@@ -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
|
||||
|
||||
+9
-9
@@ -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
|
||||
|
||||
|
||||
|
||||
+9
-9
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user