From a36e5e001a4f17505c40b7f7a8f9c1f514f40de1 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 13 Apr 2024 22:27:54 +0300 Subject: Fix bugs, add tests --- atk16_asm/builtin_asm/std_mem.atk16 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'atk16_asm/builtin_asm') diff --git a/atk16_asm/builtin_asm/std_mem.atk16 b/atk16_asm/builtin_asm/std_mem.atk16 index 4c6a455..7a7efab 100644 --- a/atk16_asm/builtin_asm/std_mem.atk16 +++ b/atk16_asm/builtin_asm/std_mem.atk16 @@ -7,13 +7,14 @@ stack_stash RD RE ldi 0 RD ; RD := i (counter), initially 0 @label memset_loop - subi RB RD RE ; RE := n – i (unused value) + sub RB RD RE ; RE := n – i (unused value) bri zero memset_done ; exit the loop add RA RD RE ; RE := RA + i (address of the word to set) str RC RE ; set the word at address RE to value in RC inc RD ; i := i + 1 + jpi memset_loop ; repeat the loop @label memset_done stack_restore RD RE return -- cgit v1.3