In Yotta there are only three primitives:
$XX emits the byte XX (in hex)
^XX emits machine code that emits XX
: A defines the word A
From there, the first thing we need to do is define semicolon (;) which emits the RET instruction. Semicolon is used to end word definitions. We use semicolon to end its own definition.
This is the preamble, the first bit of Yotta code that the Yotta interpreter/compiler runs. Besides semicolon, we're also defining line and block comments with \ and ( ).
After the preamble, there is an x86-64 assembler, written in Yotta. The assembler makes it much easier to work with machine code, as you might expect.
However the assembler is a bit quirky, because it uses a syntax that reflects the structure of the machine code. It's neither intel syntax nor at&t syntax, but a secret third thing.
I won't get into the assembler details, but let me show you how it's used to build a forth: