Skip to content

HF-Foundation/HF-SPEC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 

Repository files navigation

HF-SPEC

Official HolyFuck(tm) specification.

Operators

Command Description
+ Increment value at the memory pointer [wrapping]
- Decrement value at the memory pointer [wrapping]
> Move memory pointer 1 byte to the right [wrapping]
< Move memory pointer 1 byte to the left [wrapping]
[ Jump past the matching ] if the byte at the memory pointer is 0
] Jump back to the matching [ if the byte at the memory pointer is nonzero
. Push the byte at the memory pointer to the stack
, Pop a byte from the stack and write it to the current memory pointer
; Ends an assembly instruction, function call, memory allocation
: Defines a function (see (Functions)[#functions])
@ Calls a function
$ Calls an external function
& Starts a memory allocation (e.x. &1024;)

Functions

Functions are defined as follows:

:showme{
    +++[-]
}

Functions can be called as such:

:main{
    @showme
}

Because the stack is shared throughout the entire program, there is no need for function arguments. Just make sure to pop the right values to the stack, and the function can read these and act upon them. Isn't that simple?

Functions can also have ANY characters in the name, except { (in function declarations) and ; (in function calls)! Example:

:sorry
    for_πŸ‘++this{
  +++[-]
}

:main{
  @sorry
    for_πŸ‘++this;
}

Example

:test{
  $real asm instruction
}

:main{
  @test
}

About

Technical Specification and User Guides

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published