2004-09-06 02:32:04 -04:00
|
|
|
#include "factor.h"
|
|
|
|
|
2004-09-06 22:39:12 -04:00
|
|
|
void primitive_compiled_offset(void)
|
2004-09-06 02:32:04 -04:00
|
|
|
{
|
2004-09-19 17:39:28 -04:00
|
|
|
box_integer(compiling.here);
|
2004-09-06 02:32:04 -04:00
|
|
|
}
|
2004-09-06 22:39:12 -04:00
|
|
|
|
|
|
|
void primitive_set_compiled_offset(void)
|
|
|
|
{
|
2004-09-19 17:39:28 -04:00
|
|
|
CELL offset = unbox_integer();
|
2004-09-06 22:39:12 -04:00
|
|
|
compiling.here = offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
void primitive_literal_top(void)
|
|
|
|
{
|
2004-09-19 17:39:28 -04:00
|
|
|
box_integer(literal_top);
|
2004-09-06 22:39:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void primitive_set_literal_top(void)
|
|
|
|
{
|
2004-09-19 17:39:28 -04:00
|
|
|
CELL offset = unbox_integer();
|
2004-12-25 02:55:03 -05:00
|
|
|
if(offset >= literal_max)
|
|
|
|
critical_error("Too many compiled literals",offset);
|
2004-09-06 22:39:12 -04:00
|
|
|
literal_top = offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
void collect_literals(void)
|
|
|
|
{
|
2004-12-24 02:52:02 -05:00
|
|
|
CELL i;
|
|
|
|
for(i = compiling.base; i < literal_top; i += CELLS)
|
2004-09-06 22:39:12 -04:00
|
|
|
copy_object((CELL*)i);
|
|
|
|
}
|