onward_aspush((value_t)val);
}
-defcode("ccall", ccall, &load_sym, 0u) {
+defcode("ccall0", ccall0, &load_sym, 0u) {
+ void* func = (void*)onward_aspop();
+ ((void (*)(void))func)();
+}
+
+defcode("ccall1", ccall1, &ccall0, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg1 = onward_aspop();
+ ((void (*)(value_t))func)(arg1);
+}
+
+defcode("ccall2", ccall2, &ccall1, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ ((void (*)(value_t,value_t))func)(arg1, arg2);
+}
+
+defcode("ccall3", ccall3, &ccall2, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ ((void (*)(value_t,value_t,value_t))func)( arg1, arg2, arg3 );
+}
+
+defcode("ccall4", ccall4, &ccall3, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg4 = onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ ((void (*)(value_t,value_t,value_t,value_t))func)( arg1, arg2, arg3, arg4 );
+}
+
+defcode("ccall5", ccall5, &ccall4, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg5 = onward_aspop();
+ value_t arg4 = onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ ((void (*)(value_t,value_t,value_t,value_t,value_t))func)( arg1, arg2, arg3, arg4, arg5 );
+}
+defcode("ccall6", ccall6, &ccall5, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg6 = onward_aspop();
+ value_t arg5 = onward_aspop();
+ value_t arg4 = onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ ((void (*)(value_t,value_t,value_t,value_t,value_t,value_t))func)( arg1, arg2, arg3, arg4, arg5, arg6 );
}
-defcode("ccall-ret", ccall_ret, &ccall, 0u) {
+defcode("ccall0-ret", ccall0_ret, &ccall6, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t result = ((value_t (*)(void))func)();
+ onward_aspush(result);
+}
+
+defcode("ccall1-ret", ccall1_ret, &ccall0_ret, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg1 = onward_aspop();
+ value_t result = ((value_t (*)(value_t))func)(arg1);
+ onward_aspush(result);
+}
+
+defcode("ccall2-ret", ccall2_ret, &ccall1_ret, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ value_t result = ((value_t (*)(value_t,value_t))func)(arg1, arg2);
+ onward_aspush(result);
+}
+
+defcode("ccall3-ret", ccall3_ret, &ccall2_ret, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ value_t result = ((value_t (*)(value_t,value_t,value_t))func)( arg1, arg2, arg3 );
+ onward_aspush(result);
+}
+
+defcode("ccall4-ret", ccall4_ret, &ccall3_ret, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg4 = onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ value_t result = ((value_t (*)(value_t,value_t,value_t,value_t))func)( arg1, arg2, arg3, arg4 );
+ onward_aspush(result);
+}
+
+defcode("ccall5-ret", ccall5_ret, &ccall4_ret, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg5 = onward_aspop();
+ value_t arg4 = onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ value_t result = ((value_t (*)(value_t,value_t,value_t,value_t,value_t))func)( arg1, arg2, arg3, arg4, arg5 );
+ onward_aspush(result);
+}
+defcode("ccall6-ret", ccall6_ret, &ccall5_ret, 0u) {
+ void* func = (void*)onward_aspop();
+ value_t arg6 = onward_aspop();
+ value_t arg5 = onward_aspop();
+ value_t arg4 = onward_aspop();
+ value_t arg3 = onward_aspop();
+ value_t arg2 = onward_aspop();
+ value_t arg1 = onward_aspop();
+ value_t result = ((value_t (*)(value_t,value_t,value_t,value_t,value_t,value_t))func)( arg1, arg2, arg3, arg4, arg5, arg6 );
+ onward_aspush(result);
}
-defcode("dumpw", dumpw, &load_sym, 0u) {
+defcode("dumpw", dumpw, &ccall6_ret, 0u) {
word_t* word = (word_t*)onward_aspop();
printf("name:\t'%s'\n", word->name);
printf("flags:\t%#zx\n", word->flags);