commit 5752ef1179d4f8ecebbb6cbb4c377c9dfbebc556
parent 5b6fad2a7a40d32e516421af85a29ff03c7b2e09
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Mon, 29 May 2023 17:18:40 -0400
bootlo: optimize tuck and 2dup
I can't, for the life of me, remember why I wrote them thus during the HAL
rewrite. Minimize stack operations while leveraging the speed of W and A
interactions? or maybe in early HAL designs it made more sense.
In any case, tuck goes from 6 HAL operations to 4 and 2dup goes from 6 HAL
operations to 5.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/xcomp/bootlo.fs b/fs/xcomp/bootlo.fs
@@ -8,8 +8,8 @@ code dup dup, exit,
: rot, PSP) @!, PSP) 4 +) @!, ; code rot rot, exit,
code rot> PSP) 4 +) @!, PSP) @!, exit,
: over, dup, PSP) 4 +) @, ; code over over, exit,
-code tuck W>A, PSP) @, dup, W<>A, PSP) 4 +) !, exit,
-code 2dup W>A, PSP) @, -8 ps+, PSP) !, W<>A, PSP) 4 +) !, exit,
+code tuck swap, over, exit,
+code 2dup -8 ps+, PSP) 4 +) !, PSP) 8 +) @, PSP) !, PSP) 4 +) @, exit,
code @ W) @, exit,
code16b HERE @ W) 16b) @, exit,