Ahhlang

From Esolang
Jump to navigation Jump to search

ahh is a language (created by User:Elemental) that uses a as an instruction and h as a terminator.
Note I will represent the amount of a's before an h as number like 0 is h and 1 is ah and 2 is aah and so on.
There are two stacks in ahh stack a (the working stank) and stack b (the storage stack) if you pop while nothing is on the stack it returns 0.
cbreak mode is enabled and echoing is disabled.

basic instructions
instruction argument information
0 (NUL) Not Used. pushes 0 on to stack a.
1 (LDI) What to load in the accumulator. Load a value in the accumulator.
2 (STA) Not Used. Store the accumulator onto stack a .
3 (TAB) Not Used. Pop the top value off of stack a and push it on to stack b.
4 (TBA) Not Used. Pop the top value off of stack b and push it on to stack a.
5 (DRP) Not Used. Pop stack a and do nothing with it.
6 (LDA) Not Used. Pop stack a and put it in to the accumulator.
7 (PRN) Not Used. Pop stack a and print the ascii character until 0.
8 (BCP) What to push. push to stack a from the arguments until there is a 0 or an h without an a before it
9 (BNE) Where to jump. If the accumulator is not 0 than set the code that is running to after the index of the argument relative to h's.
10 (INP) Not Used. Reads a character from the terminal and push it to stack a as a number.
13 (ORD) Not Used. Pops everything off of stack a until 0 and (pushes a 0 and) pushes them so that the stack is flipped.