User:Aadenboy/draft2

From Esolang
Jump to navigation Jump to search

Magical crystal ball is an esolang chanted forth by wizards which, like a magical crystal ball, lets you perform any operation just based on your thoughts.

Syntax

Its syntax is that of Assembly, with each digit inscribed onto your crystal ball following these patterns:

The symbols for digits 0 to F.

How exactly you inscribe the glyphs is not important. Each bytecode is one byte long, with the arguments being dependent on the command itself.

Commands

Most wizards will use these three commands:

Bytecode Command Name Description
F0 GNC ... Generic A generic command—able to execute anything based on nearby thought or divine intervention, commonly used for input. Arguments are varied.
F1 DGM ... Debug memory Debugs the inscribed memory. Arguments are varied as to be implied.
00 CTX ... Context A generic command which executes based on the context around it, rather than GNC which uses intervention. Arguments are varied.

These commands are not set in stone and can be set to do anything based on what the wizard needs. Such code is a valid truth machine:

F0 00       | GNC R00
A5 00       | DHG R00
F0 00 01 FF | GNC R00 #01 #FF

However, more "mainstream" commands can be used.

02 STR reg val Store register Stores val into reg. val can be an immediate value or another register.
03 STA adr val Store address Stores val into adr in crystalline RAM.
adr can be an immediate address or offset from that of register 0. val can be an immediate value or another register.
04 STS adr val Store spectral Stores val into adr in spectral RAM, to be shared between other magical crystal balls.
adr can be an immediate address or offset from that of register 0. val can be an immediate value or another register.
05 RDA adr Read address Reads address from crystalline RAM.
adr can be an immediate address or offset from that of register 0.
06 RDS adr Read address Reads address from spectral RAM.
adr can be an immediate address or offset from that of register 0.