Chomp

From Esolang
Jump to navigation Jump to search

Chomp is a program language in the which the programmer must use bitwise operations, which can be performed with an instruction pointer. There is a stack to store and get bytes, as well as subroutines for use. Commands are separated with a newline. Note that the program starts by running the subroutine "main".

Commands

prev    - jump to previous bit
next    - jump to next bit
move V  - move V bits
flip    - set a bit to opposite value
zero    - zero a bit
def ID  - define subroutine ID
run ID  - run the subroutine with the ID
ret     - return from subroutine 
hop     - skip the next command if bit is 0
push    - push byte onto stack
pop     - pop byte off stack, write to byte register
out     - print byte as char
in      - get input as char
halt    - halt
cmt     - a comment