107 lines
1.0 KiB
Plaintext
107 lines
1.0 KiB
Plaintext
%include "asm/lib.r8asm"
|
|
; Macro bit_raw_inc
|
|
; %1: CellBit A
|
|
; %2: CellBit Ci
|
|
; %3: CellBit S
|
|
; %4: CellBit Co
|
|
; %5: CellBit tmp
|
|
|
|
%macro bit_raw_inc 5
|
|
|
|
.anchor before_bit_raw_inc
|
|
.tp %3
|
|
biz
|
|
flb
|
|
rnz
|
|
|
|
.tp %4
|
|
biz
|
|
flb
|
|
rnz
|
|
|
|
.tp %5
|
|
biz
|
|
flb
|
|
rnz
|
|
|
|
.tp %2
|
|
biz
|
|
.tp %1
|
|
flb
|
|
.tp %3
|
|
flb
|
|
.tp %2
|
|
flb
|
|
rnz
|
|
|
|
.tp %1
|
|
biz
|
|
.tp %4
|
|
set_1
|
|
.tp %5
|
|
set_1
|
|
.tp %1
|
|
flb
|
|
rnz
|
|
|
|
.tp %3
|
|
biz
|
|
.tp %1
|
|
set_1
|
|
.tp %2
|
|
set_1
|
|
.tp %4
|
|
set_1
|
|
.tp %3
|
|
flb
|
|
rnz
|
|
|
|
.tp %5
|
|
biz
|
|
.tp %1
|
|
flb
|
|
.tp %3
|
|
flb
|
|
.tp %4
|
|
flb
|
|
.tp %5
|
|
flb
|
|
rnz
|
|
|
|
.tp before_bit_raw_inc
|
|
|
|
%endmacro
|
|
|
|
; Macro raw_inc
|
|
; %1: Cell A
|
|
; %2: CellBit Ci
|
|
; %3: Cell S
|
|
; %4: CellBit Co
|
|
; %5: Cell tmp
|
|
|
|
%macro raw_inc 5
|
|
.anchor before_raw_inc
|
|
|
|
.tp %2
|
|
bit_copy %5 %4
|
|
.tp %5
|
|
ror
|
|
|
|
%rep _CELL_SIZE
|
|
bit_raw_inc %1 %2 %3 %4 %5
|
|
.tp %4
|
|
clb_bit_mov %2
|
|
.tp %1
|
|
ror
|
|
.tp %3
|
|
ror
|
|
%endrep
|
|
|
|
.tp %2
|
|
clb_bit_mov %4
|
|
.tp %5
|
|
rol
|
|
clb_bit_mov %2
|
|
|
|
.tp before_raw_inc
|
|
%endmacro |