hence/lib/std.asm

63 lines
1.2 KiB
NASM

; hence standard lib
.requires "$lib/core.asm"
std:
.macro std_tclr
ts NULL
.endmacro
.macro std_rclr, std_rclr_arg_0_reg
ts NULL
tlr std_rclr_arg_0_reg
.endmacro
.macro std_alu, std_alu_arg_0_op
ts std_alu_arg_0_op
alu
.endmacro
.macro std_get, std_get_arg_0_addr
ts std_get_arg_0_addr
get
.endmacro
.macro std_set, std_set_arg_0_addr
ts std_set_arg_0_addr
set
.endmacro
.macro std_cp, std_cp_arg_0_from, std_cp_arg_1_to
tsr std_cp_arg_0_from
tlr std_cp_arg_1_to
.endmacro
.macro std_mv, std_mv_arg_0_from, std_cp_arg_1_to
tsr std_cp_arg_0_from
tlr std_cp_arg_1_to
.std_rclr std_cp_arg_1_to
.endmacro
.macro std_rset, std_init_arg_0_reg, std_init_arg_1_val
ts std_init_arg_1_val
tlr std_init_arg_0_reg
.endmacro
.macro std_jump, std_jump_arg_0_label
.std_rset CORE_REG_PC, std_jump_arg_0_label
.endmacro
.macro std_cond_jump, std_cond_jump_arg_0_label
ts std_cond_jump_arg_0_label
tlrc CORE_REG_PC
.endmacro
.macro std_stop
.std_rset CORE_REG_PC, 0xffff
.endmacro
.macro std_inc, std_inc_arg_0_reg
.std_rset std_inc_arg_0_reg, 1
.std_alu CORE_ALU_ADD
.endmacro