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-05-31 05:34:42 +00:00

115 lines
1.1 KiB
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 copy_to_buffer.
; %1: tmp
;move(0,{0',1'})
;move(1',0)
;TODO
%macro copy_to_buffer 1
.anchor before_copy_to_buffer
%repeat _UNIT_SIZE
biz
stp
set_1
.tp %1
set_1
.tp before_copy_to_buffer
flb
rnz
%endrepeat
.tp %1
%repeat _UNIT_SIZE
biz
.tp before_copy_to_buffer
set_1
.tp %1
flb
rnz
%endrepeat
.tp before_copy_to_buffer
%endmacro
; Macro and
; %1: arg1
; %2: arg2
; %3: ans
;TODO
%macro and 3
.anchor before_and
%repeat _UNIT_SIZE
.tp %1
biz
.tp %2
biz
.tp %3
set_1
.tp %2
set_0
rnz
.tp %1
set_0
rnz
.tp %1
ror
.tp %2
ror
.tp %3
ror
%endrepeat
.tp before_and
%endmacro
; Macro or
; %1: arg1
; %2: arg2
; %3: ans
;TODO
%macro or 3
.anchor before_or
%repeat _UNIT_SIZE
.tp %1
biz
rnz
%endrepeat
.tp before_or
%endmacro