ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
on_gosub.c File Reference
#include "../../ugbc.h"

Go to the source code of this file.

Functions

void on_gosub (Environment *_environment, char *_expression)
 Emit ASM code for ON ... GOSUB ....
void on_gosub_index (Environment *_environment, char *_label)
 Emit ASM code for ... (of ON ... GOSUB ...).
void on_gosub_number (Environment *_environment, int _number)
 Emit ASM code for ... (of ON ... GOSUB ...).
void on_gosub_end (Environment *_environment)
 Emit ASM code for ... (of ON ... GOSUB ...).

Function Documentation

◆ on_gosub()

void on_gosub ( Environment * _environment,
char * _expression )

Emit ASM code for ON ... GOSUB ....

This function outputs the code to implement the unconditional jump with returning, calculated by expression.

Parameters
_environmentCurrent calling environment
_expressionExpression with the true / false condition

Definition at line 79 of file on_gosub.c.

◆ on_gosub_end()

void on_gosub_end ( Environment * _environment)

Emit ASM code for ... (of ON ... GOSUB ...).

This function outputs the code to implement the end of unconditional jump (with returning) by expression.

Parameters
_environmentCurrent calling environment

Definition at line 177 of file on_gosub.c.

◆ on_gosub_index()

void on_gosub_index ( Environment * _environment,
char * _label )

Emit ASM code for ... (of ON ... GOSUB ...).

This function outputs the code to implement any specific indexed jump with returning on forced jumps by expression.

Parameters
_environmentCurrent calling environment
_labelLabel to jump to

Definition at line 107 of file on_gosub.c.

◆ on_gosub_number()

void on_gosub_number ( Environment * _environment,
int _number )

Emit ASM code for ... (of ON ... GOSUB ...).

This function outputs the code to implement any specific indexed jump with returning on forced jumps by expression.

Parameters
_environmentCurrent calling environment
_labelLine number to jump to

Definition at line 158 of file on_gosub.c.