149 loop->label = strdup( label );
154 unsigned char beginForPrepareAfter[
MAX_TEMPORARY_STORAGE]; sprintf(beginForPrepareAfter,
"%sprepa", label );
156 cpu_jump( _environment, beginForPrepareAfter );
178 cpu_label( _environment, beginForFromPrepare );
198 loop->from->locked = 1;
199 loop->fromResident = fromResident;
200 loop->fromResident->locked = 1;
212 cpu_label( _environment, beginForToPrepare );
231 loop->to->locked = 1;
232 loop->toResident = toResident;
233 loop->toResident->locked = 1;
243 cpu_label( _environment, beginForStepPrepare );
272 loop->step->locked = 1;
282 loop->stepResident = stepResident;
283 loop->stepResident->locked = 1;
298 cpu_label( _environment, beginForPrepareAfter );
300 cpu_call( _environment, beginForFromPrepare );
301 cpu_call( _environment, beginForToPrepare );
302 cpu_call( _environment, beginForStepPrepare );
330 if ( !
loop->step ||
loop->step->initializedByConstant ) {
332 if ( !
loop->step ||
loop->step->value > 0 ) {
334 if (
loop->from->initializedByConstant ) {
349 if (
loop->to->initializedByConstant ) {
364 }
else if (
loop->step->value < 0 ) {
367 if (
loop->from->initializedByConstant ) {
381 if (
loop->to->initializedByConstant ) {
404 cpu_jump( _environment, backwardFor );
416 cpu_jump( _environment, continueFor );
469 loop->label = strdup( label );
474 loop->from->locked = 1;
475 loop->fromResident = from;
476 loop->fromResident->locked = 1;
478 loop->to->locked = 1;
479 loop->toResident = to;
480 loop->toResident->locked = 1;
483 loop->step->locked = 1;
485 loop->stepResident = step;
486 loop->stepResident->locked = 1;
void cpu_label(Environment *_environment, char *_label)
void cpu_call(Environment *_environment, char *_label)
void cpu_jump(Environment *_environment, char *_label)
void cpu_bvneq(Environment *_environment, char *_value, char *_label)
void cpu_return(Environment *_environment)
Variable * variable_retrieve(Environment *_environment, char *_name)
Variable * variable_less_than_const(Environment *_environment, char *_source, int _destination, int _equal)
Variable * variable_retrieve_or_define(Environment *_environment, char *_name, VariableType _type, int _value)
int variable_exists(Environment *_environment, char *_name)
Variable * variable_less_than(Environment *_environment, char *_source, char *_destination, int _equal)
Compare two variable and return the result of comparation.
Variable * variable_greater_than(Environment *_environment, char *_source, char *_destination, int _equal)
Compare two variable and return the result of comparation.
Variable * variable_move(Environment *_environment, char *_source, char *_destination)
Store the value of a variable inside another variable by converting it.
Variable * variable_resident(Environment *_environment, VariableType _type, char *_meaning)
Variable * variable_store(Environment *_environment, char *_destination, unsigned int _value)
Store a direct value to a variable.
Variable * variable_greater_than_const(Environment *_environment, char *_source, int _destination, int _equal)
int check_datatype_limits(VariableType _type, int _value)
void begin_for_identifier(Environment *_environment, char *_index)
void begin_for_from_prepare(Environment *_environment)
void begin_for_prepare(Environment *_environment, char *_index)
Emit ASM code for FOR ....
void begin_for(Environment *_environment, char *_index, char *_from, char *_to)
void begin_for_from_assign(Environment *_environment, char *_from)
void begin_for_step_assign(Environment *_environment, char *_step)
void begin_for_to_prepare(Environment *_environment)
void begin_for_step_prepare(Environment *_environment)
void begin_for_to_assign(Environment *_environment, char *_to)
VariableType defaultVariableType
int initializedByConstant
#define CRITICAL_FOR_OUTSIDE_LIMITS(v, a)
#define MAX_TEMPORARY_STORAGE
void loop(Environment *_environment, char *_label)
#define CRITICAL_VARIABLE_UNDEFINED(f)
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
#define VT_MAX_BITWIDTH_TYPE(a, b)
struct _Loop Loop
Structure of a single loop.