diff lwbasic/emit.c @ 32:49d608aecc4d

Framework for handling local stack frame and/or variables
author lost@l-w.ca
date Thu, 03 Feb 2011 22:00:47 -0700
parents 77626fc37af2
children
line wrap: on
line diff
--- a/lwbasic/emit.c	Thu Feb 03 21:28:24 2011 -0700
+++ b/lwbasic/emit.c	Thu Feb 03 22:00:47 2011 -0700
@@ -28,24 +28,24 @@
 #define __emit_c_seen__
 #include "lwbasic.h"
 
-void emit_prolog(cstate *state, int vis, int framesize)
+void emit_prolog(cstate *state, int vis)
 {
 	if (vis)
 	{
 		printf("\texport _%s\n", state -> currentsub);
 	}
 	printf("_%s\n", state -> currentsub);
-	if (framesize > 0)
+	if (state -> framesize > 0)
 	{
-		printf("\tleas %d,s\n", -framesize);
+		printf("\tleas %d,s\n", -(state -> framesize));
 	}
 }
 
-void emit_epilog(cstate *state, int framesize)
+void emit_epilog(cstate *state)
 {
-	if (framesize > 0)
+	if (state -> framesize > 0)
 	{
-		printf("\tleas %d,s\n", framesize);
+		printf("\tleas %d,s\n", state -> framesize);
 	}
 	printf("\trts\n");
 }