Difference between revisions of "Badaboom!"

From Who's Angel?
Jump to: navigation, search
(Created page with "Badaboom! is an esoteric programming language. I have no idea why I came up with this. Badaboom! has a number of phonemes, which can be joined together into instructions. A...")
 
(No difference)

Latest revision as of 09:44, 22 September 2020

Badaboom! is an esoteric programming language. I have no idea why I came up with this.

Badaboom! has a number of phonemes, which can be joined together into instructions.

A valid instruction consists of any number of phonemes. Phonemes may be placed next to each other with no space between. If this would put two consonants next to each other, one or two of the letters a, o, or u may be placed in between. If the joining would put two vowels together, they should be separated by the letters b or n.

Multiple instructions may be placed on a *line*, separated by punctuation characters or spaces.

There are 3 main places to store data in Badaboom: Registers, the heap, and the core.

Registers

Each register can contain a single integer value. Integers have a maximum value of plus or minus 5318008. Any operation which would cause a register to exceed this value stores its operand in the register instead.

Specifically, the instructions below:

  • ADD A
    • Normally, adds the value in register A to the assumulator
    • If this would cause the accumulator to overflow, store A in the assumulator instead
  • ADD A B
    • Normally, adds A and B and stores the result in the assumulator
    • If this would cause the assumulator to overflow, store the larger (highest absolute) of A and B in the assumulator
      • If A is equal to -B, one should be picked randomly. Obviously this is not possible for addition but may be for other operators
  • ADD A B C
    • Normally, adds A and B together and stores the result in C
    • If this would cause an overflow, find the largest (highest absolute) non-overflowing value which can be created by summing any combination of A, B, and C, and store that in C.

There are a number of special registers. In most cases, it should not be necessary to refer to these. Use of these registers is limited to one per line, and generates a warning:

  • The program counter stores the number of the current instruction in the core. The program counter has the phoneme CORE, which must always be in capitals, and starts with value zero. The instruction executed is found by taking the value of the program counter, modulo the number of instructions in core.
  • The assumulator stores the value of current operations. Most opcodes will set the assumulator to something, and will operate on the assumulator if not given an explicit operand. The assumulator starts with a random nonzero value, and is decremented at the end of each line which doesn't change its value. Its phoneme is ASS.
  • The but what if register is used for error handling. Its value starts at zero, and is increased by the modulo value of the instruction counter any time an error or warning occurs. If the but what if register overflows, in addition to the normal overflow behaviour all basic registers are reset to their default values. Its phoneme is either BUT or BUTT.

There are also several basic registers (bad, boom, bing, bop, and so on), whose initial values are all different. This means that they can be used as 'mnemonics' for the basic opcodes.

The Core

The Heap

Operations