ExtendedFuck

Z ZděchovNET
Verze z 27. 2. 2020, 07:07, kterou vytvořil Chronos (diskuse | příspěvky)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)
Skočit na navigaci Skočit na vyhledávání

Is Brainfuck extension with new commands. All commands are single symbol without parameters.

Base commands
Character Name Meaning
Base
> RIGHT Increment the pointer (to point to the next cell to the right).
< LEFT Decrement the pointer (to point to the next cell to the left).
+ INC Increment (increase by one) the byte at the pointer.
- DEC Decrement (decrease by one) the byte at the pointer.
. OUT Output the value of the byte at the pointer.
, IN Accept one byte of input, storing its value in the byte at the pointer.
[ JUMPZ Jump forward to the command after the corresponding ] if the byte at the pointer is zero.
] JUMPNZ Jump back to the command after the corresponding [ if the byte at the pointer is nonzero.
General
= SET Set the byte at the pointer to zero
@ HALT Ends program execution
Ω LOAD Load the byte at the pointer to storage
© STORE Save storage to the byte at the pointer
Subroutines
: LABEL Define procedure using current cell value as label
° JUMP Jump to label
! CALL Call subroutine given by label matching current cell value
? RET Return from subroutine
Arithmetic operations
§ ADD Adds the byte at the pointer with the byte in storage, storing its result in the byte at the pointer.
ø SUB Subtracts the byte at the pointer with the byte in storage, storing its result in the byte at the pointer.
* MUL Multiplies the byte at the pointer with the byte in storage, storing its result in the byte at the pointer.
/ DIV Divides the byte at the pointer with the byte in storage, storing its result in the byte at the pointer.
% MOD Preforms a Modulo operation on the byte at the pointer and the byte in storage, storing its result in the byte at the pointer.
Bitwise operations
} SHR Performs a single right logical shift of the byte at the pointer.
{ SHL Performs a single left logical shift of the byte at the pointer.
~ NOT Performs a bitwise NOT operation on the byte at the pointer (all 1's and 0's are swapped).
^ XOR Performs a bitwise XOR operation on the byte at the pointer and the byte in storage, storing its result in the byte at the pointer.
& AND Performs a bitwise AND operation on the byte at the pointer and the byte in storage, storing its result in the byte at the pointer.
| OR Performs a bitwise OR operation on the byte at the pointer and the byte in storage, storing its result in the byte at the pointer.