Summary Files Commits Branches @commit @diff @stats
path: root / catalan / math.a65
diff options
context:
space:
mode:
1 files changed, 13 insertions, 0 deletions
-rw-r--r--catalan/math.a6513
diff --git a/catalan/math.a65 b/catalan/math.a65
index 667d651..3a93854 100644
--- a/catalan/math.a65
+++ b/catalan/math.a65
@@ -1,6 +1,19 @@
#ifndef CATALAN_MATH
#define CATALAN_MATH
+#define starg(name, value) .( :\
+ pha ; push a :\
+ lda value ; a = value :\
+ sta name ; name = a :\
+ pla ; pop a :\
+.)
+
+#define applya(subroutine, valuea, arg, value) .( :\
+ lda valuea :\
+ starg(arg, value) :\
+ jsr subroutine :\
+.)
+
; a *= multa_arg
multa .(
ora #0 ; Update flags, so they're accurate with the accumulator value