aboutsummaryrefslogtreecommitdiffstats
path: root/foci.h
diff options
context:
space:
mode:
Diffstat (limited to 'foci.h')
-rw-r--r--foci.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/foci.h b/foci.h
index 48c5871..6a96f32 100644
--- a/foci.h
+++ b/foci.h
@@ -49,8 +49,6 @@
#define N(name, tname, prev) NATIVE(name, tname, prev, 0)
#define C(name, tname, prev) NATIVE(name, tname, prev, ATTR_IMMEDIATE)
-#define STASH asm("push %r12; push %r13; push %r14; push %r15")
-#define RESTORE asm("pop %r15; pop %r14; pop %r13; pop %r12")
#define NEXT { goto *(*++pp); }
struct word_t
@@ -61,10 +59,21 @@ struct word_t
char name[];
} __attribute__ ((packed));
-register intptr_t tmp asm("r12");
-register intptr_t * sp asm("r13"); // pointer to stack cells
-register intptr_t *** rp asm("r14"); // stack of pp
-register intptr_t ** pp asm("r15"); // pointer to ip
+// ARM Cortex-M:
+//register intptr_t * sp asm("r0"); // pointer to stack cells
+//register intptr_t *** rp asm("r1"); // stack of pp
+//register intptr_t ** pp asm("r2"); // pointer to ip
+//register intptr_t tmp asm("r8");
+//#define STASH asm("push {r0-r2,r8}")
+//#define RESTORE asm("pop {r0-r2,r8}")
+
+// x86_64
+register intptr_t * sp asm("r12"); // pointer to stack cells
+register intptr_t *** rp asm("r13"); // stack of pp
+register intptr_t ** pp asm("r14"); // pointer to ip
+register intptr_t tmp asm("r15");
+#define STASH asm("push %r12; push %r13; push %r14")
+#define RESTORE asm("pop %r14; pop %r13; pop %r12")
void init(void);
int depth(void);