Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GPL - Grawlix Programming Language
- This is the horrible Grawlix Programming Language - as if brainfuck had evolved on a hostile planet.
- Description:
- 8 bit memory cells (and perhaps other bit amounts)
- Everything initialized to zero
- Cell values rollover
- Program memory infinite
- Data memory infinite
- Stack memory infinite
- Function definitions 256
- T - top of stack, where the next value will get pushed
- P - data pointer
- (P) - byte value at P
- P < 0 is an error and should halt the program
- Pop when T = 0 is an error and should halt the program
- A program with only > < + - , . [ ] is brainfuck, not Grawlix
- Turing complete: yes, because Brainfuck is Turing complete
- Enhancements to Brainfuck
- Stack operations
- Decimal I/O
- Another loop structure
- Functions
- Functions
- Function properties are processed before program is run
- Function definition '{ code }' can be anywhere in the program listing
- Function definition in program listing '{' is skipped to command after matching '}'
- Only function call '@' runs function code
- To call a function: push function number, function call '@'
- Function calls can be inside of function definitions
- 256 functions allowed
- - Brainfuck
- , Brainfuck
- ; Pop (P)
- : Push (P)
- ? (P) = input decimal number modulo 256
- . Brainfuck
- ( Proceed to next command after ‘(‘ if (P) == 0 (Opposite of brainfuck)
- ) Return to matching ‘(‘
- [ Brainfuck
- ] Brainfuck
- { Begin function definition
- } Terminate function definition
- @ Function call, with function number previously pushed onto the stack
- / Shift right: zero > 7 > 6 > 5 > 4 > 3 > 2 > 1 > 0 > null
- | Shift left: null < 7 < 6 < 5 < 4 < 3 < 2 < 1 < 0 < zero
- + Brainfuck
- < Brainfuck
- = Print out (P) as a zero-filled three digit decimal number
- > Brainfuck
- ^ Halt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement