Control Flow
Control flow commands are used to control the flow of the program. All control flow commands use the
prefix.
Label
Labels are used to mark locations which can be jumped to from elsewhere in the program. In Nospace, labels are defined by an identifier which consists of a sequence of
and
terminated by a
.
Syntax
Command | Unobsfucated | |
---|---|---|
Nospace | | ZWJ , ZWSP , ZWSP |
Whitespace |
| Newline, Space, Space |
Nossembly | Label | - |
Parameters
The Label
command requires a unique identifier consisting of a sequence of
and
terminated by a
.
Stack parameters
The Label
command takes no stack parameters.
Example
Call
The Call
command calls a subroutine. Control is given to the provided label and is returned when the Return
command is executed from within the invoked subroutine.
Syntax
Command | Unobsfucated | |
---|---|---|
Nospace | | ZWJ , ZWSP , ZWNJ |
Whitespace |
| Newline, Space, Tab |
Nossembly | Call | - |
Parameters
The Call
command must be passed the label to invoke.
Stack parameters
The Call
command takes no stack parameters.
Example
Jump
The Jump
command unconditionally jumps to a label.
Syntax
Command | Unobsfucated | |
---|---|---|
Nospace | | ZWJ , ZWSP , ZWJ |
Whitespace |
| Newline, Space, Newline |
Nossembly | Jump | - |
Parameters
The Jump
command must be passed the label to jump to.
Stack parameters
The Jump
command takes no stack parameters.
Example
JumpZero
The JumpZero
conditionally jumps to the specified label if the top item of the stack is 0
. The top item of the stack is discarded as part of the command.
Syntax
Command | Unobsfucated | |
---|---|---|
Nospace | | ZWJ , ZWNJ , ZWSP |
Whitespace |
| Newline, Tab, Space |
Nossembly | JumpZero | - |
Parameters
The JumpZero
command must be passed the label to conditionally jump to.
Stack parameters
Int
- the value to evaluate
Example
JumpNegative
The JumpNegative
conditionally jumps to the specified label if the top item of the stack is less than 0
. The top item of the stack is discarded as part of the command.
Syntax
Command | Unobsfucated | |
---|---|---|
Nospace | | ZWJ , ZWNJ , ZWNJ |
Whitespace |
| Newline, Tab, Tab |
Nossembly | JumpNegative | - |
Parameters
The JumpNegative
command must be passed the label to conditionally jump to.
Stack parameters
Int
- the value to evaluate
Example
Return
The Return
command transfers control from a subroutine back to the caller. If the Return
command is invoked outside of a subroutine, it ends the execution of the program.
Syntax
Command | Unobsfucated | |
---|---|---|
Nospace | | ZWJ , ZWNJ , ZWJ |
Whitespace |
| Newline, Tab, Newline |
Nossembly | Return | - |
Parameters
The Return
command takes no parameters.
Stack parameters
The Return
command takes no stack parameters.
Example
End
The End
command ends the execution of the program.
Syntax
Command | Unobsfucated | |
---|---|---|
Nospace | | ZWJ , ZWJ , ZWJ |
Whitespace |
| Newline, Newline, Newline |
Nossembly | End | - |
Parameters
The End
command takes no parameters.
Stack parameters
The End
command takes no stack parameters.
Example