Advertisement
bf17

Grawlix description

Oct 16th, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. GPL - Grawlix Programming Language
  2.  
  3. This is the horrible Grawlix Programming Language - as if brainfuck had evolved on a hostile planet.
  4.  
  5. Description:
  6. 8 bit memory cells (and perhaps other bit amounts)
  7. Everything initialized to zero
  8. Cell values rollover
  9. Program memory infinite
  10. Data memory infinite
  11. Stack memory infinite
  12. Function definitions 256
  13. T - top of stack, where the next value will get pushed
  14. P - data pointer
  15. (P) - byte value at P
  16. P < 0 is an error and should halt the program
  17. Pop when T = 0 is an error and should halt the program
  18. A program with only > < + - , . [ ] is brainfuck, not Grawlix
  19. Turing complete: yes, because Brainfuck is Turing complete
  20.  
  21. Enhancements to Brainfuck
  22. Stack operations
  23. Decimal I/O
  24. Another loop structure
  25. Functions
  26.  
  27. Functions
  28. Function properties are processed before program is run
  29. Function definition '{ code }' can be anywhere in the program listing
  30. Function definition in program listing '{' is skipped to command after matching '}'
  31. Only function call '@' runs function code
  32. To call a function: push function number, function call '@'
  33. Function calls can be inside of function definitions
  34. 256 functions allowed
  35.  
  36. - Brainfuck
  37. , Brainfuck
  38. ; Pop (P)
  39. : Push (P)
  40. ? (P) = input decimal number modulo 256
  41. . Brainfuck
  42. ( Proceed to next command after ‘(‘ if (P) == 0 (Opposite of brainfuck)
  43. ) Return to matching ‘(‘
  44. [ Brainfuck
  45. ] Brainfuck
  46. { Begin function definition
  47. } Terminate function definition
  48. @ Function call, with function number previously pushed onto the stack
  49. / Shift right: zero > 7 > 6 > 5 > 4 > 3 > 2 > 1 > 0 > null
  50. | Shift left: null < 7 < 6 < 5 < 4 < 3 < 2 < 1 < 0 < zero
  51. + Brainfuck
  52. < Brainfuck
  53. = Print out (P) as a zero-filled three digit decimal number
  54. > Brainfuck
  55. ^ Halt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement