This repository has been archived on 2026-09-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
R8ASM/asm/lib.r8asm
T
2026-06-12 08:29:05 +08:00

77 lines
747 B
Plaintext

;lib.r8asm
%macro step 1
stp %1
stp %1
%endmacro
%macro back 1
btp %1
btp %1
%endmacro
%macro set_0 0
biz
flb
rnz
%endmacro
%macro set_1 0
set_0
flb
%endmacro
%macro erase 0
%repeat _UNIT_SIZE
set_0
ror
%endrepeat
%endmacro
; Macro copy_to_buffer.
; %1: tmp
%macro copy_to_buffer 1
.anchor before_copy_to_buffer
stp
erase
.tp %1
erase
.tp before_copy_to_buffer
%repeat _UNIT_SIZE
biz
stp
set_1
.tp %1
set_1
.tp before_copy_to_buffer
flb
rnz
.tp before_copy_to_buffer
ror
stp
ror
.tp %1
ror
.tp before_copy_to_buffer
%endrepeat
.tp %1
%repeat _UNIT_SIZE
biz
.tp before_copy_to_buffer
set_1
.tp %1
flb
rnz
.tp before_copy_to_buffer
ror
.tp %1
ror
%endrepeat
.tp before_copy_to_buffer
%endmacro