|
ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
|
#include "../../ugbc.h"Go to the source code of this file.
Functions | |
| void | if_then (Environment *_environment, char *_expression) |
| Emit ASM code for IF ... THEN .... | |
| void if_then | ( | Environment * | _environment, |
| char * | _expression ) |
Emit ASM code for IF ... THEN ....
This function outputs the code to implement the conditional jump. This implementation assumes that an expression passed as a parameter is 0 (for false) and not zero (for true). In this case, if the expression is zero, it jumps directly to the statement following the corresponding ENDIF (or ELSE, if present). Otherwise, the following code will be executed (up to ENDIF). Since the compiler acts with a single pass, it is necessary to keep the information on the last used label. For this purpose, the label where it will jump will be inserted in the stack, so that it is defined at the moment when the ENDIF instruction will be examined.
| _environment | Current calling environment |
| _expression | Expression with the true / false condition |