Files
2026-09-13 12:17:41 +08:00

133 lines
1.3 KiB
Plaintext

%include "asm/lib.r8asm"
; Macro clb_bit_or
; %1: CellBit arg1
; %2: CellBit arg2
; %3: CellBit ans
%macro clb_bit_or 3
.anchor before_clb_bit_or
.tp %3
set_0
.tp %1
biz
.tp %3
flb
.tp %1
flb
rnz
.tp %2
biz
.tp %3
set_1
.tp %2
flb
rnz
.tp before_clb_bit_or
%endmacro
; Macro clb_or
; %1: Cell arg1
; %2: Cell arg2
; %3: Cell ans
%macro clb_or 3
.anchor before_clb_or
%rep _CELL_SIZE
clb_bit_or %1 %2 %3
.tp %1
ror
.tp %2
ror
.tp %3
ror
%endrep
.tp before_clb_or
%endmacro
; Macro bit_raw_or
; %1: CellBit arg1
; %2: CellBit arg2
; %3: CellBit ans
; %4: CellBit tmp
%macro bit_raw_or 3
.anchor before_bit_raw_or
.tp %3
biz
flb
rnz
.tp %4
biz
flb
rnz
.tp %1
biz
.tp %3
set_1
.tp %1
flb
rnz
.tp %3
biz
.tp %1
flb
.tp %2
flb
.tp %4
flb
.tp %3
flb
rnz
.tp %2
biz
.tp %3
flb
.tp %4
flb
.tp %2
flb
rnz
.tp %4
biz
.tp %2
set_1
.tp %3
set_1
.tp %4
flb
rnz
.tp before_bit_raw_or
%endmacro
; Macro raw_or
; %1: Cell arg1
; %2: Cell arg2
; %3: Cell ans
; %4: CellBit tmp
%macro raw_or 4
.anchor before_raw_or
%rep _CELL_SIZE
bit_raw_or %1 %2 %3 %4
.tp %1
ror
.tp %2
ror
.tp %3
ror
%endrep
.tp before_raw_or
%endmacro